acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

ILI9341_Defines.h (4180B)

      1 // Change the width and height if required (defined in portrait mode)
      2 // or use the constructor to over-ride defaults
      3 
      4 #if defined (ILI9341_DRIVER) || defined (ILI9341_2_DRIVER)
      5   #define TFT_WIDTH  240
      6   #define TFT_HEIGHT 320
      7 #elif defined (ILI9342_DRIVER)
      8   #define TFT_WIDTH  320
      9   #define TFT_HEIGHT 240
     10 #endif
     11 
     12 // Color definitions for backwards compatibility with old sketches
     13 // use colour definitions like TFT_BLACK to make sketches more portable
     14 #define ILI9341_BLACK       0x0000      /*   0,   0,   0 */
     15 #define ILI9341_NAVY        0x000F      /*   0,   0, 128 */
     16 #define ILI9341_DARKGREEN   0x03E0      /*   0, 128,   0 */
     17 #define ILI9341_DARKCYAN    0x03EF      /*   0, 128, 128 */
     18 #define ILI9341_MAROON      0x7800      /* 128,   0,   0 */
     19 #define ILI9341_PURPLE      0x780F      /* 128,   0, 128 */
     20 #define ILI9341_OLIVE       0x7BE0      /* 128, 128,   0 */
     21 #define ILI9341_LIGHTGREY   0xC618      /* 192, 192, 192 */
     22 #define ILI9341_DARKGREY    0x7BEF      /* 128, 128, 128 */
     23 #define ILI9341_BLUE        0x001F      /*   0,   0, 255 */
     24 #define ILI9341_GREEN       0x07E0      /*   0, 255,   0 */
     25 #define ILI9341_CYAN        0x07FF      /*   0, 255, 255 */
     26 #define ILI9341_RED         0xF800      /* 255,   0,   0 */
     27 #define ILI9341_MAGENTA     0xF81F      /* 255,   0, 255 */
     28 #define ILI9341_YELLOW      0xFFE0      /* 255, 255,   0 */
     29 #define ILI9341_WHITE       0xFFFF      /* 255, 255, 255 */
     30 #define ILI9341_ORANGE      0xFD20      /* 255, 165,   0 */
     31 #define ILI9341_GREENYELLOW 0xAFE5      /* 173, 255,  47 */
     32 #define ILI9341_PINK        0xF81F
     33 
     34 
     35 // Delay between some initialisation commands
     36 #define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked
     37 
     38 
     39 // Generic commands used by TFT_eSPI.cpp
     40 #define TFT_NOP     0x00
     41 #define TFT_SWRST   0x01
     42 
     43 #define TFT_CASET   0x2A
     44 #define TFT_PASET   0x2B
     45 #define TFT_RAMWR   0x2C
     46 
     47 #define TFT_RAMRD   0x2E
     48 #define TFT_IDXRD   0xDD // ILI9341 only, indexed control register read
     49 
     50 #define TFT_MADCTL  0x36
     51 #define TFT_MAD_MY  0x80
     52 #define TFT_MAD_MX  0x40
     53 #define TFT_MAD_MV  0x20
     54 #define TFT_MAD_ML  0x10
     55 #define TFT_MAD_BGR 0x08
     56 #define TFT_MAD_MH  0x04
     57 #define TFT_MAD_RGB 0x00
     58 
     59 #ifdef TFT_RGB_ORDER
     60   #if (TFT_RGB_ORDER == 1)
     61     #define TFT_MAD_COLOR_ORDER TFT_MAD_RGB
     62   #else
     63     #define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
     64   #endif
     65 #else
     66   #define TFT_MAD_COLOR_ORDER TFT_MAD_BGR
     67 #endif
     68 
     69 #define TFT_INVOFF  0x20
     70 #define TFT_INVON   0x21
     71 
     72 
     73 // All ILI9341 specific commands some are used by init()
     74 #define ILI9341_NOP     0x00
     75 #define ILI9341_SWRESET 0x01
     76 #define ILI9341_RDDID   0x04
     77 #define ILI9341_RDDST   0x09
     78 
     79 #define ILI9341_SLPIN   0x10
     80 #define ILI9341_SLPOUT  0x11
     81 #define ILI9341_PTLON   0x12
     82 #define ILI9341_NORON   0x13
     83 
     84 #define ILI9341_RDMODE  0x0A
     85 #define ILI9341_RDMADCTL  0x0B
     86 #define ILI9341_RDPIXFMT  0x0C
     87 #define ILI9341_RDIMGFMT  0x0A
     88 #define ILI9341_RDSELFDIAG  0x0F
     89 
     90 #define ILI9341_INVOFF  0x20
     91 #define ILI9341_INVON   0x21
     92 #define ILI9341_GAMMASET 0x26
     93 #define ILI9341_DISPOFF 0x28
     94 #define ILI9341_DISPON  0x29
     95 
     96 #define ILI9341_CASET   0x2A
     97 #define ILI9341_PASET   0x2B
     98 #define ILI9341_RAMWR   0x2C
     99 #define ILI9341_RAMRD   0x2E
    100 
    101 #define ILI9341_PTLAR   0x30
    102 #define ILI9341_VSCRDEF 0x33
    103 #define ILI9341_MADCTL  0x36
    104 #define ILI9341_VSCRSADD 0x37
    105 #define ILI9341_PIXFMT  0x3A
    106 
    107 #define ILI9341_WRDISBV  0x51
    108 #define ILI9341_RDDISBV  0x52
    109 #define ILI9341_WRCTRLD  0x53
    110 
    111 #define ILI9341_FRMCTR1 0xB1
    112 #define ILI9341_FRMCTR2 0xB2
    113 #define ILI9341_FRMCTR3 0xB3
    114 #define ILI9341_INVCTR  0xB4
    115 #define ILI9341_DFUNCTR 0xB6
    116 
    117 #define ILI9341_PWCTR1  0xC0
    118 #define ILI9341_PWCTR2  0xC1
    119 #define ILI9341_PWCTR3  0xC2
    120 #define ILI9341_PWCTR4  0xC3
    121 #define ILI9341_PWCTR5  0xC4
    122 #define ILI9341_VMCTR1  0xC5
    123 #define ILI9341_VMCTR2  0xC7
    124 
    125 #define ILI9341_RDID4   0xD3
    126 #define ILI9341_RDINDEX 0xD9
    127 #define ILI9341_RDID1   0xDA
    128 #define ILI9341_RDID2   0xDB
    129 #define ILI9341_RDID3   0xDC
    130 #define ILI9341_RDIDX   0xDD // TBC
    131 
    132 #define ILI9341_GMCTRP1 0xE0
    133 #define ILI9341_GMCTRN1 0xE1
    134 
    135 #define ILI9341_MADCTL_MY  0x80
    136 #define ILI9341_MADCTL_MX  0x40
    137 #define ILI9341_MADCTL_MV  0x20
    138 #define ILI9341_MADCTL_ML  0x10
    139 #define ILI9341_MADCTL_RGB 0x00
    140 #define ILI9341_MADCTL_BGR 0x08
    141 #define ILI9341_MADCTL_MH  0x04