ESPHome  2022.11.3
ili9341_defines.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace esphome {
4 namespace ili9341 {
5 
6 // Color definitions
7 // clang-format off
8 static const uint8_t MADCTL_MY = 0x80;
9 static const uint8_t MADCTL_MX = 0x40;
10 static const uint8_t MADCTL_MV = 0x20;
11 static const uint8_t MADCTL_ML = 0x10;
12 static const uint8_t MADCTL_RGB = 0x00;
13 static const uint8_t MADCTL_BGR = 0x08;
14 static const uint8_t MADCTL_MH = 0x04;
15 // clang-format on
16 
17 static const uint16_t ILI9341_TFTWIDTH = 320;
18 static const uint16_t ILI9341_TFTHEIGHT = 240;
19 
20 // All ILI9341 specific commands some are used by init()
21 static const uint8_t ILI9341_NOP = 0x00;
22 static const uint8_t ILI9341_SWRESET = 0x01;
23 static const uint8_t ILI9341_RDDID = 0x04;
24 static const uint8_t ILI9341_RDDST = 0x09;
25 
26 static const uint8_t ILI9341_SLPIN = 0x10;
27 static const uint8_t ILI9341_SLPOUT = 0x11;
28 static const uint8_t ILI9341_PTLON = 0x12;
29 static const uint8_t ILI9341_NORON = 0x13;
30 
31 static const uint8_t ILI9341_RDMODE = 0x0A;
32 static const uint8_t ILI9341_RDMADCTL = 0x0B;
33 static const uint8_t ILI9341_RDPIXFMT = 0x0C;
34 static const uint8_t ILI9341_RDIMGFMT = 0x0A;
35 static const uint8_t ILI9341_RDSELFDIAG = 0x0F;
36 
37 static const uint8_t ILI9341_INVOFF = 0x20;
38 static const uint8_t ILI9341_INVON = 0x21;
39 static const uint8_t ILI9341_GAMMASET = 0x26;
40 static const uint8_t ILI9341_DISPOFF = 0x28;
41 static const uint8_t ILI9341_DISPON = 0x29;
42 
43 static const uint8_t ILI9341_CASET = 0x2A;
44 static const uint8_t ILI9341_PASET = 0x2B;
45 static const uint8_t ILI9341_RAMWR = 0x2C;
46 static const uint8_t ILI9341_RAMRD = 0x2E;
47 
48 static const uint8_t ILI9341_PTLAR = 0x30;
49 static const uint8_t ILI9341_VSCRDEF = 0x33;
50 static const uint8_t ILI9341_MADCTL = 0x36;
51 static const uint8_t ILI9341_VSCRSADD = 0x37;
52 static const uint8_t ILI9341_PIXFMT = 0x3A;
53 
54 static const uint8_t ILI9341_WRDISBV = 0x51;
55 static const uint8_t ILI9341_RDDISBV = 0x52;
56 static const uint8_t ILI9341_WRCTRLD = 0x53;
57 
58 static const uint8_t ILI9341_FRMCTR1 = 0xB1;
59 static const uint8_t ILI9341_FRMCTR2 = 0xB2;
60 static const uint8_t ILI9341_FRMCTR3 = 0xB3;
61 static const uint8_t ILI9341_INVCTR = 0xB4;
62 static const uint8_t ILI9341_DFUNCTR = 0xB6;
63 
64 static const uint8_t ILI9341_PWCTR1 = 0xC0;
65 static const uint8_t ILI9341_PWCTR2 = 0xC1;
66 static const uint8_t ILI9341_PWCTR3 = 0xC2;
67 static const uint8_t ILI9341_PWCTR4 = 0xC3;
68 static const uint8_t ILI9341_PWCTR5 = 0xC4;
69 static const uint8_t ILI9341_VMCTR1 = 0xC5;
70 static const uint8_t ILI9341_VMCTR2 = 0xC7;
71 
72 static const uint8_t ILI9341_RDID4 = 0xD3;
73 static const uint8_t ILI9341_RDINDEX = 0xD9;
74 static const uint8_t ILI9341_RDID1 = 0xDA;
75 static const uint8_t ILI9341_RDID2 = 0xDB;
76 static const uint8_t ILI9341_RDID3 = 0xDC;
77 static const uint8_t ILI9341_RDIDX = 0xDD; // TBC
78 
79 static const uint8_t ILI9341_GMCTRP1 = 0xE0;
80 static const uint8_t ILI9341_GMCTRN1 = 0xE1;
81 
82 } // namespace ili9341
83 } // namespace esphome
Definition: a4988.cpp:4