17#define PIN_EN (1 << 19)
18#define PIN_LE (1 << 20)
19#define PIN_DIR (1 << 21)
20#define PIN_CS (1 << 22)
21#define PIN_RS (1 << 23)
22#define PIN_WR (1 << 24)
23#define PIN_RD (1 << 25)
25#define LCD_EN(x) ((x) ? (LPC_GPIO0->FIOSET = PIN_EN) : (LPC_GPIO0->FIOCLR = PIN_EN))
26#define LCD_LE(x) ((x) ? (LPC_GPIO0->FIOSET = PIN_LE) : (LPC_GPIO0->FIOCLR = PIN_LE))
27#define LCD_DIR(x) ((x) ? (LPC_GPIO0->FIOSET = PIN_DIR) : (LPC_GPIO0->FIOCLR = PIN_DIR))
28#define LCD_CS(x) ((x) ? (LPC_GPIO0->FIOSET = PIN_CS) : (LPC_GPIO0->FIOCLR = PIN_CS))
29#define LCD_RS(x) ((x) ? (LPC_GPIO0->FIOSET = PIN_RS) : (LPC_GPIO0->FIOCLR = PIN_RS))
30#define LCD_WR(x) ((x) ? (LPC_GPIO0->FIOSET = PIN_WR) : (LPC_GPIO0->FIOCLR = PIN_WR))
31#define LCD_RD(x) ((x) ? (LPC_GPIO0->FIOSET = PIN_RD) : (LPC_GPIO0->FIOCLR = PIN_RD))
33#ifdef GLCD_REQUIRES_DELAY
34#define DELAY_COUNT(count) for (u16 i = count; i > 0; i--)
37 for (u16 i = 0; i < ms; i++) \
38 for (u16 j = 0; j < 1141; j++)
40#define DELAY_COUNT(count)
87 LPC_GPIO2->FIODIR |= 0xFF;
90 LPC_GPIO2->FIOPIN = halfw;
93 LPC_GPIO2->FIOPIN = halfw >> 8;
102 LPC_GPIO2->FIODIR &= ~(0xFF);
106 value = LPC_GPIO2->FIOPIN0;
109 value = (value << 8) | LPC_GPIO2->FIOPIN0;
232 LPC_PINCON->PINSEL1 &= ~(0x03FFFFC0);
236 LPC_PINCON->PINSEL4 &= ~(0x0000FFFF);
240 LPC_GPIO0->FIODIR |= 0x03f80000;
241 LPC_GPIO0->FIOSET = 0x03f80000;
257 if (code == 0x9325 || code == 0x9328)
265 write_to(0x0003, (1 << 12) | (1 << 5) | (1 << 4) | (0 << 3));
358 dummy = (
u16)((red << 11) | (green << 5) | blue);
void __LCD_LL_FillScreen(u16 color)
_PRIVATE void send(u16 halfw)
Writes an half-word (16 bits) into the LCD's DB port.
_PRIVATE u16 s_orientation
The current orientation of the screen.
_DECL_EXTERNALLY u16 LCDMaxY
_PRIVATE void set_gram_cursor(u16 x, u16 y)
Sets the GRAM cursor to the specified coordinates, for writing data into the appropriate pixel in the...
#define DELAY_COUNT(count)
void __LCD_LL_Init(u16 orientation)
u16 __LCD_LL_GetPointColor(u16 x, u16 y)
_PRIVATE void write_to(u16 reg, u16 data)
Writes a 16-bit value to the LCD controller, at the specified register.
_PRIVATE u8 s_model_code
The model code of the LCD controller.
_PRIVATE u16 read_from(u16 reg)
Reads an HW from the LCD controller, at the specified register.
_PRIVATE void init_rw_operation_at(u16 index)
Tells the LCD controller to initiate a R/W operation with the register at the index specified.
void __LCD_LL_SetPointColor(u16 rgb565, u16 x, u16 y)
_PRIVATE u16 do_read(void)
Reads an half-word (16 bits) from the LCD's DB port, from the register at the index selected with the...
_PRIVATE u16 recv(void)
Reads an half-word (16 bits) from the LCD's DB port.
_DECL_EXTERNALLY u16 LCDMaxX
The maximum X and Y coordinates of the screen.
_PRIVATE void do_write(u16 data)
Writes an half-word (16 bits) into the LCD's DB port, destined to the register at the index selected ...