4 * \brief registers definition for ili9341 TFT display component.
\r
6 * Copyright (c) 2013 Atmel Corporation. All rights reserved.
\r
12 * Redistribution and use in source and binary forms, with or without
\r
13 * modification, are permitted provided that the following conditions are met:
\r
15 * 1. Redistributions of source code must retain the above copyright notice,
\r
16 * this list of conditions and the following disclaimer.
\r
18 * 2. Redistributions in binary form must reproduce the above copyright notice,
\r
19 * this list of conditions and the following disclaimer in the documentation
\r
20 * and/or other materials provided with the distribution.
\r
22 * 3. The name of Atmel may not be used to endorse or promote products derived
\r
23 * from this software without specific prior written permission.
\r
25 * 4. This software may only be redistributed and used in connection with an
\r
26 * Atmel microcontroller product.
\r
28 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
\r
29 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
\r
30 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
\r
31 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
\r
32 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
\r
33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
\r
34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
\r
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
\r
36 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
\r
37 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
\r
38 * POSSIBILITY OF SUCH DAMAGE.
\r
44 #ifndef ILI9341_REGS_H_INCLUDED
\r
45 #define ILI9341_REGS_H_INCLUDED
\r
55 /** ili9341 LCD Registers */
\r
57 /** Level 1 Commands (from the display Datasheet) */
\r
59 #define ILI9341_CMD_NOP 0x00
\r
60 /** Software reset*/
\r
61 #define ILI9341_CMD_SOFTWARE_RESET 0x01
\r
62 /** Read Display Identification information*/
\r
63 #define ILI9341_CMD_READ_DISP_ID 0x04
\r
64 /** Read display status*/
\r
65 #define ILI9341_CMD_READ_DISP_STATUS 0x09
\r
66 /** Read display power mode*/
\r
67 #define ILI9341_CMD_READ_DISP_POWER_MODE 0x0A
\r
68 /** Read display MADCTL*/
\r
69 #define ILI9341_CMD_READ_DISP_MADCTRL 0x0B
\r
70 /** Read display pixel format*/
\r
71 #define ILI9341_CMD_READ_DISP_PIXEL_FORMAT 0x0C
\r
72 /** Read display image format*/
\r
73 #define ILI9341_CMD_READ_DISP_IMAGE_FORMAT 0x0D
\r
74 /** Read display signal mode*/
\r
75 #define ILI9341_CMD_READ_DISP_SIGNAL_MODE 0x0E
\r
76 /** read display self-diagnostic resutl*/
\r
77 #define ILI9341_CMD_READ_DISP_SELF_DIAGNOSTIC 0x0F
\r
78 /** Enter sleep mode*/
\r
79 #define ILI9341_CMD_ENTER_SLEEP_MODE 0x10
\r
81 #define ILI9341_CMD_SLEEP_OUT 0x11
\r
82 /** Partial mode on*/
\r
83 #define ILI9341_CMD_PARTIAL_MODE_ON 0x12
\r
84 /** Normal display mode on*/
\r
85 #define ILI9341_CMD_NORMAL_DISP_MODE_ON 0x13
\r
86 /** Display inversion off*/
\r
87 #define ILI9341_CMD_DISP_INVERSION_OFF 0x20
\r
88 /** Display inversion on*/
\r
89 #define ILI9341_CMD_DISP_INVERSION_ON 0x21
\r
91 #define ILI9341_CMD_GAMMA_SET 0x26
\r
93 #define ILI9341_CMD_DISPLAY_OFF 0x28
\r
95 #define ILI9341_CMD_DISPLAY_ON 0x29
\r
96 /** Column address set*/
\r
97 #define ILI9341_CMD_COLUMN_ADDRESS_SET 0x2A
\r
98 /** Page address set*/
\r
99 #define ILI9341_CMD_PAGE_ADDRESS_SET 0x2B
\r
101 #define ILI9341_CMD_MEMORY_WRITE 0x2C
\r
103 #define ILI9341_CMD_COLOR_SET 0x2D
\r
105 #define ILI9341_CMD_MEMORY_READ 0x2E
\r
107 #define ILI9341_CMD_PARTIAL_AREA 0x30
\r
108 /** Vertical scrolling definition*/
\r
109 #define ILI9341_CMD_VERT_SCROLL_DEFINITION 0x33
\r
110 /** Tearing effect line off*/
\r
111 #define ILI9341_CMD_TEARING_EFFECT_LINE_OFF 0x34
\r
112 /** Tearing effect line on*/
\r
113 #define ILI9341_CMD_TEARING_EFFECT_LINE_ON 0x35
\r
115 /** Memory Access control*/
\r
116 #define ILI9341_CMD_MEMORY_ACCESS_CONTROL 0x36
\r
117 #define ILI9341_CMD_MEMORY_ACCESS_CONTROL_MY (0x1u << 7)
\r
118 #define ILI9341_CMD_MEMORY_ACCESS_CONTROL_MX (0x1u << 6)
\r
119 #define ILI9341_CMD_MEMORY_ACCESS_CONTROL_MV (0x1u << 5)
\r
120 #define ILI9341_CMD_MEMORY_ACCESS_CONTROL_ML (0x1u << 4)
\r
121 #define ILI9341_CMD_MEMORY_ACCESS_CONTROL_BGR (0x1u << 3)
\r
122 #define ILI9341_CMD_MEMORY_ACCESS_CONTROL_MH (0x1u << 2)
\r
124 /** Vetical scrolling start address*/
\r
125 #define ILI9341_CMD_VERT_SCROLL_START_ADDRESS 0x37
\r
126 /** Idle mode off*/
\r
127 #define ILI9341_CMD_IDLE_MODE_OFF 0x38
\r
129 #define ILI9341_CMD_IDLE_MODE_ON 0x39
\r
130 /** Pixel Format set*/
\r
131 #define ILI9341_CMD_PIXEL_FORMAT_SET 0x3A
\r
132 /** write memory continue*/
\r
133 #define ILI9341_CMD_WRITE_MEMORY_CONTINUE 0x3C
\r
134 /** Read memory continue*/
\r
135 #define ILI9341_CMD_READ_MEMORY_CONTINUE 0x3E
\r
136 /** set tear scanline*/
\r
137 #define ILI9341_CMD_SET_TEAR_SCANLINE 0x44
\r
139 #define ILI9341_CMD_GET_SCANLINE 0x45
\r
140 /** write display brightness*/
\r
141 #define ILI9341_CMD_WRITE_DISPLAY_BRIGHTNESS 0x51
\r
142 /** read display brightness*/
\r
143 #define ILI9341_CMD_READ_DISPLAY_BRIGHTNESS 0x52
\r
144 /** write control display*/
\r
145 #define ILI9341_CMD_WRITE_CTRL_DISPLAY 0x53
\r
146 /** read control display*/
\r
147 #define ILI9341_CMD_READ_CTRL_DISPLAY 0x54
\r
148 /** write content adaptive brightness control*/
\r
149 #define ILI9341_CMD_WRITE_CONTENT_ADAPT_BRIGHTNESS 0x55
\r
150 /** read content adaptive brightness control*/
\r
151 #define ILI9341_CMD_READ_CONTENT_ADAPT_BRIGHTNESS 0x56
\r
152 /** write CABC minimum brightness*/
\r
153 #define ILI9341_CMD_WRITE_MIN_CAB_LEVEL 0x5E
\r
154 /** read CABC minimum brightness*/
\r
155 #define ILI9341_CMD_READ_MIN_CAB_LEVEL 0x5F
\r
157 #define ILI9341_CMD_READ_ID1 0xDA
\r
159 #define ILI9341_CMD_READ_ID2 0xDB
\r
161 #define ILI9341_CMD_READ_ID3 0xDC
\r
163 /** Level 2 Commands (from the display Datasheet) */
\r
164 /** RGB interface signal control*/
\r
165 #define ILI9341_CMD_RGB_SIGNAL_CONTROL 0xB0
\r
166 /** frame control*/
\r
167 #define ILI9341_CMD_FRAME_RATE_CONTROL_NORMAL 0xB1
\r
168 /** frame control in idle mode*/
\r
169 #define ILI9341_CMD_FRAME_RATE_CONTROL_IDLE_8COLOR 0xB2
\r
170 /** frame control in partial mode*/
\r
171 #define ILI9341_CMD_FRAME_RATE_CONTROL_PARTIAL 0xB3
\r
172 /** display inversion control*/
\r
173 #define ILI9341_CMD_DISPLAY_INVERSION_CONTROL 0xB4
\r
174 /** blanking porch control*/
\r
175 #define ILI9341_CMD_BLANKING_PORCH_CONTROL 0xB5
\r
176 /** display function control*/
\r
177 #define ILI9341_CMD_DISPLAY_FUNCTION_CTL 0xB6
\r
178 #define ILI9341_DISP_FUNC_CTL_REV (0x1u << 7)
\r
179 #define ILI9341_DISP_FUNC_CTL_GS (0x1u << 6)
\r
180 #define ILI9341_DISP_FUNC_CTL_SS (0x1u << 5)
\r
181 #define ILI9341_DISP_FUNC_CTL_SM (0x1u << 4)
\r
182 #define ILI9341_DISP_FUNC_CTL_ISC_POS 0
\r
183 #define ILI9341_DISP_FUNC_CTL_ISC_MSK (0x0F << 0)
\r
184 #define ILI9341_DISP_FUNC_CTL_ISC(value) \
\r
185 (ILI9341_DISP_FUNC_CTL_ISC_MSK & \
\r
186 (value << ILI9341_DISP_FUNC_CTL_ISC_POS))
\r
188 /** entry mode set*/
\r
189 #define ILI9341_CMD_ENTRY_MODE_SET 0xB7
\r
190 /** backlight control1*/
\r
191 #define ILI9341_CMD_BACKLIGHT_CONTROL_1 0xB8
\r
192 /** backlight control2*/
\r
193 #define ILI9341_CMD_BACKLIGHT_CONTROL_2 0xB9
\r
194 /** backlight control3*/
\r
195 #define ILI9341_CMD_BACKLIGHT_CONTROL_3 0xBA
\r
196 /** backlight control 4*/
\r
197 #define ILI9341_CMD_BACKLIGHT_CONTROL_4 0xBB
\r
198 /** backlight control 5*/
\r
199 #define ILI9341_CMD_BACKLIGHT_CONTROL_5 0xBC
\r
200 /** backlight control 7*/
\r
201 #define ILI9341_CMD_BACKLIGHT_CONTROL_7 0xBE
\r
202 /** backlight control 8*/
\r
203 #define ILI9341_CMD_BACKLIGHT_CONTROL_8 0xBF
\r
204 /** power control 1*/
\r
205 #define ILI9341_CMD_POWER_CONTROL_1 0xC0
\r
206 /** power control 2*/
\r
207 #define ILI9341_CMD_POWER_CONTROL_2 0xC1
\r
208 /** VCOM control 1*/
\r
209 #define ILI9341_CMD_VCOM_CONTROL_1 0xC5
\r
210 /** VCOM control 2*/
\r
211 #define ILI9341_CMD_VCOM_CONTROL_2 0xC7
\r
212 /** Power control A*/
\r
213 #define ILI9341_CMD_POWER_CONTROL_A 0xCB
\r
214 /** Power control B*/
\r
215 #define ILI9341_CMD_POWER_CONTROL_B 0xCF
\r
216 /** NV memory write*/
\r
217 #define ILI9341_CMD_NVMEM_WRITE 0xD0
\r
218 /** NV memory protection key*/
\r
219 #define ILI9341_CMD_NVMEM_PROTECTION_KEY 0xD1
\r
220 /** NV memory status read*/
\r
221 #define ILI9341_CMD_NVMEM_STATUS_READ 0xD2
\r
223 #define ILI9341_CMD_READ_ID4 0xD3
\r
224 /** positive gamma correction*/
\r
225 #define ILI9341_CMD_POSITIVE_GAMMA_CORRECTION 0xE0
\r
226 /** negative gamma correction*/
\r
227 #define ILI9341_CMD_NEGATIVE_GAMMA_CORRECTION 0xE1
\r
228 /** digital gamma control 1*/
\r
229 #define ILI9341_CMD_DIGITAL_GAMMA_CONTROL_1 0xE2
\r
230 /** digital gamma control 2*/
\r
231 #define ILI9341_CMD_DIGITAL_GAMMA_CONTROL_2 0xE3
\r
232 /** driver timing control A*/
\r
233 #define ILI9341_CMD_DRIVER_TIMING_CTL_A 0xE8
\r
234 /** driver timing control B*/
\r
235 #define ILI9341_CMD_DRIVER_TIMING_CTL_B 0xEA
\r
236 /** power-on sequence control*/
\r
237 #define ILI9341_CMD_POWER_ON_SEQUENCE_CONTROL 0xED
\r
238 /** enable 3g gamma control*/
\r
239 #define ILI9341_CMD_ENABLE_3_GAMMA_CONTROL 0xF2
\r
240 /** Interface control*/
\r
241 #define ILI9341_CMD_INTERFACE_CONTROL 0xF6
\r
242 /** pump ration control*/
\r
243 #define ILI9341_CMD_PUMP_RATIO_CONTROL 0xF7
\r
245 #endif /* ILI9341_REGS_H_INCLUDED */
\r