59 #define d4dlcd_ili9341_ID 1
65 #if (D4D_MK_STR(D4D_LLD_LCD) == d4dlcd_ili9341_ID)
79 static unsigned char D4DLCD_Init_ILI9341(
void);
80 static unsigned char D4DLCD_SetWindow_ILI9341(
unsigned short x1,
unsigned short y1,
unsigned short x2,
unsigned short y2);
81 static unsigned char D4DLCD_SetOrientation_ILI9341(
D4DLCD_ORIENTATION new_orientation);
82 static void D4DLCD_Send_PixelColor_ILI9341(
D4D_COLOR color) ;
83 static D4D_COLOR D4DLCD_Get_PixelColor_ILI9341(
void);
85 static void D4DLCD_Delay_ms_ILI9341(
unsigned short period);
86 static unsigned char D4DLCD_DeInit_ILI9341(
void);
107 D4DLCD_SetWindow_ILI9341,
108 D4DLCD_SetOrientation_ILI9341,
109 D4DLCD_Send_PixelColor_ILI9341,
110 D4DLCD_Get_PixelColor_ILI9341,
111 D4DLCD_Flush_ILI9341,
112 D4DLCD_Delay_ms_ILI9341,
113 D4DLCD_DeInit_ILI9341,
128 static void D4DLCD_Command_Data(
const unsigned short data[],
unsigned short count)
132 for (i=0; i<count; i+=2)
149 static unsigned char D4DLCD_Init_ILI9341(
void)
150 {
unsigned short data[10] = {0};
151 const unsigned short init_data[] =
155 0x00CF, 0x0000, 0x00C1, 0x0030,
157 0x00ED, 0x0067, 0x0003, 0x0012, 0x0081,
159 0x00E8, 0x0085, 0x0000, 0x0078,
161 0x00CB, 0x0039, 0x002C, 0x0000, 0x0034, 0x0002,
165 0x00EA, 0x0000, 0x0000,
172 0x00C5, 0x002B, 0x002B,
180 0x00B1, 0x0000, 0x001B,
182 0x00B6, 0x000A, 0x0002,
184 0x00F6, 0x0001, 0x0030,
190 0x00E0, 0x000F, 0x0026, 0x0022, 0x000A, 0x0010, 0x000A, 0x004C, 0x00CA, 0x0036,
191 0x0000, 0x0015, 0x0000, 0x0010, 0x0010, 0x0000,
193 0x00E1, 0x0000, 0x0019, 0x001B, 0x0005, 0x000F, 0x0005, 0x0033, 0x0035, 0x0049,
194 0x000F, 0x001F, 0x000F, 0x003F, 0x003F, 0x000F,
301 static unsigned char D4DLCD_DeInit_ILI9341(
void)
315 static unsigned char D4DLCD_SetWindow_ILI9341(
unsigned short x1,
unsigned short y1,
unsigned short x2,
unsigned short y2)
317 unsigned short x1_x2;
318 unsigned short Addr1, Addr2;
375 (void)
D4D_LLD_LCD_HW.D4DLCDHW_SendDataWord((
unsigned short)((x1 >> 8) & 0x00ff));
376 (void)
D4D_LLD_LCD_HW.D4DLCDHW_SendDataWord((
unsigned short)(x1 & 0x00ff));
377 (void)
D4D_LLD_LCD_HW.D4DLCDHW_SendDataWord((
unsigned short)((x2 >> 8) & 0x00ff));
378 (void)
D4D_LLD_LCD_HW.D4DLCDHW_SendDataWord((
unsigned short)(x2 & 0x00ff));
382 (void)
D4D_LLD_LCD_HW.D4DLCDHW_SendDataWord((
unsigned short)((y1 >> 8) & 0x00ff));
383 (void)
D4D_LLD_LCD_HW.D4DLCDHW_SendDataWord((
unsigned short)(y1 & 0x00ff));
384 (void)
D4D_LLD_LCD_HW.D4DLCDHW_SendDataWord((
unsigned short)((y2 >> 8) & 0x00ff));
385 (void)
D4D_LLD_LCD_HW.D4DLCDHW_SendDataWord((
unsigned short)(y2 & 0x00ff));
400 static unsigned char D4DLCD_SetOrientation_ILI9341(
D4DLCD_ORIENTATION new_orientation)
402 unsigned short LCD_EntryMode = 0;
404 d4dlcd_orientation = new_orientation;
406 switch (d4dlcd_orientation)
410 LCD_EntryMode = 0x60b0;
break;
412 LCD_EntryMode = 0x6080;
break;
414 LCD_EntryMode = 0x60a8;
break;
416 LCD_EntryMode = 0x6098;
break;
421 (void)D4DLCD_SetWindow_ILI9341(0, 0, 1, 1);
433 static void D4DLCD_Send_PixelColor_ILI9341(
D4D_COLOR value)
436 #ifdef D4D_COLOR_TRANSPARENT
437 if(value == D4D_COLOR_TRANSPARENT)
442 #if D4D_COLOR_SYSTEM != D4D_COLOR_SYSTEM_RGB565
464 static D4D_COLOR D4DLCD_Get_PixelColor_ILI9341(
void)
466 #if D4D_COLOR_SYSTEM != D4D_COLOR_SYSTEM_RGB565
501 static void D4DLCD_Delay_ms_ILI9341(
unsigned short period)
508 #endif //(D4D_MK_STR(D4D_LLD_LCD) == d4dlcd_ili9341_ID)
#define D4D_COLOR_RGB565(R, G, B)
The macro create the color from the color component Red/Green/Blue to 16-bit RGB565 format (the input...
D4D driver - ILI9341 lcd driver function header file.
#define D4D_COLOR_GET_B(color)
D4D low level standard LCD interface API structure.
#define D4D_COLOR_RGB(R, G, B)
Orientation LandScape up side down.
#define D4D_COLOR565_GET_B(color)
The macro gets the Blue component from 16-bit standard format to 8-bit component format.
D4D Driver main header file.
D4DLCD_FLUSH_MODE
D4D low level eGUI flush screen types enumeration.
D4D Driver private header file.
Orientation Portrait up side down.
D4DLCD_ORIENTATION
D4D low level screen orientation enumeration type.
Switch pin to output mode.
#define NULL
Type definition of null pointer.
Set pin output register to logic 1.
LCD device backlight enable signal.
#define D4D_COLOR565_GET_R(color)
The macro gets the Red component from 16-bit standard format to 8-bit component format.
#define D4D_COLOR_GET_G(color)
Set pin output register to logic 0.
#define D4D_COLOR565_GET_G(color)
The macro gets the Green component from 16-bit standard format to 8-bit component format...
D4D driver - common low level driver header file.
void D4DLCD_Delay_ms_Common(unsigned short period)
D4D driver - resistive touch screen driver function header file.
LWord D4D_COLOR
Type definition of eGUI color variables.
unsigned short Word
Type definition of Word (unsigned 16-bit).
#define D4D_COLOR_GET_R(color)