38 #define ST7789_SWRST 0x01 39 #define ST7789_RDDCOLMOD 0x0C 40 #define ST7789_SLPOUT 0x11 41 #define ST7789_PTLON 0x12 42 #define ST7789_NORON 0x13 43 #define ST7789_INVOFF 0x20 44 #define ST7789_INVON 0x21 45 #define ST7789_DISPON 0x29 46 #define ST7789_PTLAR 0x30 47 #define ST7789_COLMOD 0x3A 48 #define ST7789_WRDISBV 0x51 49 #define ST7789_WRCTRLD 0x53 50 #define ST7789_WRCACE 0x55 51 #define ST7789_WRCABCMB 0x5E 52 #define ST7789_RAMCTRL 0xB0 53 #define ST7789_PORCTRL 0xB2 54 #define ST7789_GCTRL 0xB7 55 #define ST7789_VCOMS 0xBB 56 #define ST7789_LCMCTRL 0xC0 57 #define ST7789_VDVVRHEN 0xC2 58 #define ST7789_VRHS 0xC3 59 #define ST7789_VDVS 0xC4 60 #define ST7789_FRCTRL2 0xC6 61 #define ST7789_PWCTRL1 0xD0 62 #define ST7789_PVGAMCTRL 0xE0 63 #define ST7789_NVGAMCTRL 0xE1 66 void ST7789Controller::softReset()
70 writeCommand(ST7789_SWRST);
72 vTaskDelay(150 / portTICK_PERIOD_MS);
77 writeCommand(ST7789_SLPOUT);
78 vTaskDelay(120 / portTICK_PERIOD_MS);
81 writeCommand(ST7789_NORON);
86 writeCommand(ST7789_COLMOD);
88 vTaskDelay(10 / portTICK_PERIOD_MS);
91 writeCommand(ST7789_PORCTRL);
101 writeCommand(ST7789_GCTRL);
106 writeCommand(ST7789_VCOMS);
111 writeCommand(ST7789_LCMCTRL);
116 writeCommand(ST7789_VDVVRHEN);
123 writeCommand(ST7789_VRHS);
128 writeCommand(ST7789_VDVS);
134 writeCommand(ST7789_FRCTRL2);
141 writeCommand(ST7789_PWCTRL1);
146 writeCommand(ST7789_PVGAMCTRL);
163 writeCommand(ST7789_NVGAMCTRL);
180 writeCommand(ST7789_INVON);
183 writeCommand(ST7789_DISPON);
195 #define ILI9341_SWRESET 0x01 196 #define ILI9341_SLEEPOUT 0x11 197 #define ILI9341_NORON 0x13 198 #define ILI9341_GAMMASET 0x26 199 #define ILI9341_DISPON 0x29 200 #define ILI9341_PIXELFORMATSET 0x3A 201 #define ILI9341_FRAMERATECTRL1 0xB1 202 #define ILI9341_DISPLAYFUNCCTRL 0xB6 203 #define ILI9341_POWERCTR1 0xC0 204 #define ILI9341_POWERCTR2 0xC1 205 #define ILI9341_VCOMCTR1 0xC5 206 #define ILI9341_VCOMCTR2 0xC7 207 #define ILI9341_POWERCTRLA 0xCB 208 #define ILI9341_POWERCTRLB 0xCF 209 #define ILI9341_POSGAMMACORR 0xE0 210 #define ILI9341_NEGGAMMACORR 0xE1 211 #define ILI9341_DRIVERTIMINGCTRLA 0xE8 212 #define ILI9341_DRIVERTIMINGCTRLB 0xEA 213 #define ILI9341_POWERONSEQCTRL 0xED 214 #define ILI9341_DEVICECODE 0xEF 215 #define ILI9341_ENABLE3G 0xF2 216 #define ILI9341_PUMPRATIOCTRL 0xF7 220 void ILI9341Controller::softReset()
222 m_reverseHorizontal =
true;
226 writeCommand(ILI9341_SWRESET);
228 vTaskDelay(150 / portTICK_PERIOD_MS);
233 writeCommand(ILI9341_DEVICECODE);
239 writeCommand(ILI9341_POWERCTRLB);
245 writeCommand(ILI9341_POWERONSEQCTRL);
252 writeCommand(ILI9341_DRIVERTIMINGCTRLA);
258 writeCommand(ILI9341_POWERCTRLA);
266 writeCommand(ILI9341_PUMPRATIOCTRL);
270 writeCommand(ILI9341_DRIVERTIMINGCTRLB);
275 writeCommand(ILI9341_POWERCTR1);
279 writeCommand(ILI9341_POWERCTR2);
283 writeCommand(ILI9341_VCOMCTR1);
288 writeCommand(ILI9341_VCOMCTR2);
294 writeCommand(ILI9341_PIXELFORMATSET);
298 writeCommand(ILI9341_FRAMERATECTRL1);
303 writeCommand(ILI9341_DISPLAYFUNCCTRL);
309 writeCommand(ILI9341_ENABLE3G);
313 writeCommand(ILI9341_GAMMASET);
317 writeCommand(ILI9341_POSGAMMACORR);
335 writeCommand(ILI9341_NEGGAMMACORR);
353 writeCommand(ILI9341_SLEEPOUT);
356 writeCommand(ILI9341_NORON);
360 vTaskDelay(120 / portTICK_PERIOD_MS);
365 writeCommand(ILI9341_DISPON);
This file contains TFT controllers definitions.
This file contains some utility classes and functions.