Select one of the symbols to view example projects that use it.
 
Outline
#define __ILI9341_H
#include "../Common/lcd.h"
#define ILI9341_ID
#define ILI9341_LCD_PIXEL_WIDTH
#define ILI9341_LCD_PIXEL_HEIGHT
#define ILI9341_HSYNC
#define ILI9341_HBP
#define ILI9341_HFP
#define ILI9341_VSYNC
#define ILI9341_VBP
#define ILI9341_VFP
#define LCD_SWRESET
#define LCD_READ_DISPLAY_ID
#define LCD_RDDST
#define LCD_RDDPM
#define LCD_RDDMADCTL
#define LCD_RDDCOLMOD
#define LCD_RDDIM
#define LCD_RDDSM
#define LCD_RDDSDR
#define LCD_SPLIN
#define LCD_SLEEP_OUT
#define LCD_PTLON
#define LCD_NORMAL_MODE_ON
#define LCD_DINVOFF
#define LCD_DINVON
#define LCD_GAMMA
#define LCD_DISPLAY_OFF
#define LCD_DISPLAY_ON
#define LCD_COLUMN_ADDR
#define LCD_PAGE_ADDR
#define LCD_GRAM
#define LCD_RGBSET
#define LCD_RAMRD
#define LCD_PLTAR
#define LCD_VSCRDEF
#define LCD_TEOFF
#define LCD_TEON
#define LCD_MAC
#define LCD_VSCRSADD
#define LCD_IDMOFF
#define LCD_IDMON
#define LCD_PIXEL_FORMAT
#define LCD_WRITE_MEM_CONTINUE
#define LCD_READ_MEM_CONTINUE
#define LCD_SET_TEAR_SCANLINE
#define LCD_GET_SCANLINE
#define LCD_WDB
#define LCD_RDDISBV
#define LCD_WCD
#define LCD_RDCTRLD
#define LCD_WRCABC
#define LCD_RDCABC
#define LCD_WRITE_CABC
#define LCD_READ_CABC
#define LCD_READ_ID1
#define LCD_READ_ID2
#define LCD_READ_ID3
#define LCD_RGB_INTERFACE
#define LCD_FRMCTR1
#define LCD_FRMCTR2
#define LCD_FRMCTR3
#define LCD_INVTR
#define LCD_BPC
#define LCD_DFC
#define LCD_ETMOD
#define LCD_BACKLIGHT1
#define LCD_BACKLIGHT2
#define LCD_BACKLIGHT3
#define LCD_BACKLIGHT4
#define LCD_BACKLIGHT5
#define LCD_BACKLIGHT7
#define LCD_BACKLIGHT8
#define LCD_POWER1
#define LCD_POWER2
#define LCD_VCOM1
#define LCD_VCOM2
#define LCD_NVMWR
#define LCD_NVMPKEY
#define LCD_RDNVM
#define LCD_READ_ID4
#define LCD_PGAMMA
#define LCD_NGAMMA
#define LCD_DGAMCTRL1
#define LCD_DGAMCTRL2
#define LCD_INTERFACE
#define LCD_POWERA
#define LCD_POWERB
#define LCD_DTCA
#define LCD_DTCB
#define LCD_POWER_SEQ
#define LCD_3GAMMA_EN
#define LCD_PRC
#define LCD_READ_ID4_SIZE
ili9341_Init();
ili9341_ReadID();
ili9341_WriteReg(uint8_t);
ili9341_WriteData(uint16_t);
ili9341_ReadData(uint16_t, uint8_t);
ili9341_DisplayOn();
ili9341_DisplayOff();
ili9341_GetLcdPixelWidth();
ili9341_GetLcdPixelHeight();
ili9341_drv;
LCD_IO_Init();
LCD_IO_WriteData(uint16_t);
LCD_IO_WriteReg(uint8_t);
LCD_IO_ReadData(uint16_t, uint8_t);
LCD_Delay(uint32_t);
Files
loading...
CodeScopeSTM32 Libraries and Samplesili9341ili9341.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/** ****************************************************************************** * @file ili9341.h * @author MCD Application Team * @version V1.0.2 * @date 02-December-2014 * @brief This file contains all the functions prototypes for the ili9341.c * driver. ****************************************************************************** * @attention * * Copyright (c) 2014 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __ILI9341_H #define __ILI9341_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "../Common/lcd.h" /** @addtogroup BSP * @{ *//* ... */ /** @addtogroup Components * @{ *//* ... */ /** @addtogroup ILI9341 * @{ *//* ... */ /** @defgroup ILI9341_Exported_Types * @{ *//* ... */ /** * @} *//* ... */ /** @defgroup ILI9341_Exported_Constants * @{ *//* ... */ /** * @brief ILI9341 chip IDs *//* ... */ #define ILI9341_ID 0x9341 /** * @brief ILI9341 Size *//* ... */ #define ILI9341_LCD_PIXEL_WIDTH ((uint16_t)240) #define ILI9341_LCD_PIXEL_HEIGHT ((uint16_t)320) /** * @brief ILI9341 Timing *//* ... */ /* Timing configuration (Typical configuration from ILI9341 datasheet) HSYNC=10 (9+1) HBP=20 (29-10+1) ActiveW=240 (269-20-10+1) HFP=10 (279-240-20-10+1) VSYNC=2 (1+1) VBP=2 (3-2+1) ActiveH=320 (323-2-2+1) VFP=4 (327-320-2-2+1) *//* ... */ #define ILI9341_HSYNC ((uint32_t)9) /* Horizontal synchronization */ #define ILI9341_HBP ((uint32_t)29) /* Horizontal back porch */ #define ILI9341_HFP ((uint32_t)2) /* Horizontal front porch */ #define ILI9341_VSYNC ((uint32_t)1) /* Vertical synchronization */ #define ILI9341_VBP ((uint32_t)3) /* Vertical back porch */ #define ILI9341_VFP ((uint32_t)2) /* Vertical front porch */ /** * @brief ILI9341 Registers *//* ... */ /* Level 1 Commands */ #define LCD_SWRESET 0x01 /* Software Reset */ #define LCD_READ_DISPLAY_ID 0x04 /* Read display identification information */ #define LCD_RDDST 0x09 /* Read Display Status */ #define LCD_RDDPM 0x0A /* Read Display Power Mode */ #define LCD_RDDMADCTL 0x0B /* Read Display MADCTL */ #define LCD_RDDCOLMOD 0x0C /* Read Display Pixel Format */ #define LCD_RDDIM 0x0D /* Read Display Image Format */ #define LCD_RDDSM 0x0E /* Read Display Signal Mode */ #define LCD_RDDSDR 0x0F /* Read Display Self-Diagnostic Result */ #define LCD_SPLIN 0x10 /* Enter Sleep Mode */ #define LCD_SLEEP_OUT 0x11 /* Sleep out register */ #define LCD_PTLON 0x12 /* Partial Mode ON */ #define LCD_NORMAL_MODE_ON 0x13 /* Normal Display Mode ON */ #define LCD_DINVOFF 0x20 /* Display Inversion OFF */ #define LCD_DINVON 0x21 /* Display Inversion ON */ #define LCD_GAMMA 0x26 /* Gamma register */ #define LCD_DISPLAY_OFF 0x28 /* Display off register */ #define LCD_DISPLAY_ON 0x29 /* Display on register */ #define LCD_COLUMN_ADDR 0x2A /* Colomn address register */ #define LCD_PAGE_ADDR 0x2B /* Page address register */ #define LCD_GRAM 0x2C /* GRAM register */ #define LCD_RGBSET 0x2D /* Color SET */ #define LCD_RAMRD 0x2E /* Memory Read */ #define LCD_PLTAR 0x30 /* Partial Area */ #define LCD_VSCRDEF 0x33 /* Vertical Scrolling Definition */ #define LCD_TEOFF 0x34 /* Tearing Effect Line OFF */ #define LCD_TEON 0x35 /* Tearing Effect Line ON */ #define LCD_MAC 0x36 /* Memory Access Control register*/ #define LCD_VSCRSADD 0x37 /* Vertical Scrolling Start Address */ #define LCD_IDMOFF 0x38 /* Idle Mode OFF */ #define LCD_IDMON 0x39 /* Idle Mode ON */ #define LCD_PIXEL_FORMAT 0x3A /* Pixel Format register */ #define LCD_WRITE_MEM_CONTINUE 0x3C /* Write Memory Continue */ #define LCD_READ_MEM_CONTINUE 0x3E /* Read Memory Continue */ #define LCD_SET_TEAR_SCANLINE 0x44 /* Set Tear Scanline */ #define LCD_GET_SCANLINE 0x45 /* Get Scanline */ #define LCD_WDB 0x51 /* Write Brightness Display register */ #define LCD_RDDISBV 0x52 /* Read Display Brightness */ #define LCD_WCD 0x53 /* Write Control Display register*/ #define LCD_RDCTRLD 0x54 /* Read CTRL Display */ #define LCD_WRCABC 0x55 /* Write Content Adaptive Brightness Control */ #define LCD_RDCABC 0x56 /* Read Content Adaptive Brightness Control */ #define LCD_WRITE_CABC 0x5E /* Write CABC Minimum Brightness */ #define LCD_READ_CABC 0x5F /* Read CABC Minimum Brightness */ #define LCD_READ_ID1 0xDA /* Read ID1 */ #define LCD_READ_ID2 0xDB /* Read ID2 */ #define LCD_READ_ID3 0xDC /* Read ID3 */ /* Level 2 Commands */ #define LCD_RGB_INTERFACE 0xB0 /* RGB Interface Signal Control */ #define LCD_FRMCTR1 0xB1 /* Frame Rate Control (In Normal Mode) */ #define LCD_FRMCTR2 0xB2 /* Frame Rate Control (In Idle Mode) */ #define LCD_FRMCTR3 0xB3 /* Frame Rate Control (In Partial Mode) */ #define LCD_INVTR 0xB4 /* Display Inversion Control */ #define LCD_BPC 0xB5 /* Blanking Porch Control register */ #define LCD_DFC 0xB6 /* Display Function Control register */ #define LCD_ETMOD 0xB7 /* Entry Mode Set */ #define LCD_BACKLIGHT1 0xB8 /* Backlight Control 1 */ #define LCD_BACKLIGHT2 0xB9 /* Backlight Control 2 */ #define LCD_BACKLIGHT3 0xBA /* Backlight Control 3 */ #define LCD_BACKLIGHT4 0xBB /* Backlight Control 4 */ #define LCD_BACKLIGHT5 0xBC /* Backlight Control 5 */ #define LCD_BACKLIGHT7 0xBE /* Backlight Control 7 */ #define LCD_BACKLIGHT8 0xBF /* Backlight Control 8 */ #define LCD_POWER1 0xC0 /* Power Control 1 register */ #define LCD_POWER2 0xC1 /* Power Control 2 register */ #define LCD_VCOM1 0xC5 /* VCOM Control 1 register */ #define LCD_VCOM2 0xC7 /* VCOM Control 2 register */ #define LCD_NVMWR 0xD0 /* NV Memory Write */ #define LCD_NVMPKEY 0xD1 /* NV Memory Protection Key */ #define LCD_RDNVM 0xD2 /* NV Memory Status Read */ #define LCD_READ_ID4 0xD3 /* Read ID4 */ #define LCD_PGAMMA 0xE0 /* Positive Gamma Correction register */ #define LCD_NGAMMA 0xE1 /* Negative Gamma Correction register */ #define LCD_DGAMCTRL1 0xE2 /* Digital Gamma Control 1 */ #define LCD_DGAMCTRL2 0xE3 /* Digital Gamma Control 2 */ #define LCD_INTERFACE 0xF6 /* Interface control register */ /* Extend register commands */ #define LCD_POWERA 0xCB /* Power control A register */ #define LCD_POWERB 0xCF /* Power control B register */ #define LCD_DTCA 0xE8 /* Driver timing control A */ #define LCD_DTCB 0xEA /* Driver timing control B */ #define LCD_POWER_SEQ 0xED /* Power on sequence register */ #define LCD_3GAMMA_EN 0xF2 /* 3 Gamma enable register */ #define LCD_PRC 0xF7 /* Pump ratio control register */ /* Size of read registers */ #define LCD_READ_ID4_SIZE 3 /* Size of Read ID4 */ 92 defines /** * @} *//* ... */ /** @defgroup ILI9341_Exported_Functions * @{ *//* ... */ void ili9341_Init(void); uint16_t ili9341_ReadID(void); void ili9341_WriteReg(uint8_t LCD_Reg); void ili9341_WriteData(uint16_t RegValue); uint32_t ili9341_ReadData(uint16_t RegValue, uint8_t ReadSize); void ili9341_DisplayOn(void); void ili9341_DisplayOff(void); uint16_t ili9341_GetLcdPixelWidth(void); uint16_t ili9341_GetLcdPixelHeight(void); /* LCD driver structure */ extern LCD_DrvTypeDef ili9341_drv; /* LCD IO functions */ void LCD_IO_Init(void); void LCD_IO_WriteData(uint16_t RegValue); void LCD_IO_WriteReg(uint8_t Reg); uint32_t LCD_IO_ReadData(uint16_t RegValue, uint8_t ReadSize); void LCD_Delay (uint32_t delay); #ifdef __cplusplus }extern "C" { ... } #endif /* ... */ #endif /* __ILI9341_H */ /** * @} *//* ... */ /** * @} *//* ... */ /** * @} *//* ... */ /** * @} *//* ... */