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 |
ST7789_Defines.h (5712B)
1 // Change the width and height if required (defined in portrait mode) 2 // or use the constructor to over-ride defaults 3 #ifndef TFT_WIDTH 4 #define TFT_WIDTH 240 5 #endif 6 #ifndef TFT_HEIGHT 7 #define TFT_HEIGHT 320 8 #endif 9 10 #if (TFT_HEIGHT == 240) && (TFT_WIDTH == 240) 11 #ifndef CGRAM_OFFSET 12 #define CGRAM_OFFSET 13 #endif 14 #endif 15 16 // Adafruit 1.44 TFT support 17 #if (TFT_HEIGHT == 240) && (TFT_WIDTH == 135) 18 #ifndef CGRAM_OFFSET 19 #define CGRAM_OFFSET 20 #endif 21 #endif 22 23 // Adafruit 1.69 round corner TFT support 24 #if (TFT_HEIGHT == 280) && (TFT_WIDTH == 240) 25 #ifndef CGRAM_OFFSET 26 #define CGRAM_OFFSET 27 #endif 28 #endif 29 30 // 1.47" 172x320 Round Rectangle Color IPS TFT Display 31 #if (TFT_HEIGHT == 320) && (TFT_WIDTH == 172) 32 #ifndef CGRAM_OFFSET 33 #define CGRAM_OFFSET 34 #endif 35 #endif 36 37 #if (TFT_HEIGHT == 320) && (TFT_WIDTH == 170) 38 #ifndef CGRAM_OFFSET 39 #define CGRAM_OFFSET 40 #endif 41 #endif 42 43 #if (TFT_HEIGHT == 300) && (TFT_WIDTH == 240) 44 #ifndef CGRAM_OFFSET 45 #define CGRAM_OFFSET 46 #endif 47 #endif 48 49 // Delay between some initialisation commands 50 #define TFT_INIT_DELAY 0x80 // Not used unless commandlist invoked 51 52 53 // Generic commands used by TFT_eSPI.cpp 54 #define TFT_NOP 0x00 55 #define TFT_SWRST 0x01 56 57 #define TFT_SLPIN 0x10 58 #define TFT_SLPOUT 0x11 59 #define TFT_NORON 0x13 60 61 #define TFT_INVOFF 0x20 62 #define TFT_INVON 0x21 63 #define TFT_DISPOFF 0x28 64 #define TFT_DISPON 0x29 65 #define TFT_CASET 0x2A 66 #define TFT_PASET 0x2B 67 #define TFT_RAMWR 0x2C 68 #define TFT_RAMRD 0x2E 69 #define TFT_MADCTL 0x36 70 #define TFT_COLMOD 0x3A 71 72 // Flags for TFT_MADCTL 73 #define TFT_MAD_MY 0x80 74 #define TFT_MAD_MX 0x40 75 #define TFT_MAD_MV 0x20 76 #define TFT_MAD_ML 0x10 77 #define TFT_MAD_RGB 0x00 78 #define TFT_MAD_BGR 0x08 79 #define TFT_MAD_MH 0x04 80 #define TFT_MAD_SS 0x02 81 #define TFT_MAD_GS 0x01 82 83 #ifdef TFT_RGB_ORDER 84 #if (TFT_RGB_ORDER == 1) 85 #define TFT_MAD_COLOR_ORDER TFT_MAD_RGB 86 #else 87 #define TFT_MAD_COLOR_ORDER TFT_MAD_BGR 88 #endif 89 #else 90 #ifdef CGRAM_OFFSET 91 #define TFT_MAD_COLOR_ORDER TFT_MAD_BGR 92 #else 93 #define TFT_MAD_COLOR_ORDER TFT_MAD_RGB 94 #endif 95 #endif 96 97 #define TFT_IDXRD 0x00 // ILI9341 only, indexed control register read 98 99 // ST7789 specific commands used in init 100 #define ST7789_NOP 0x00 101 #define ST7789_SWRESET 0x01 102 #define ST7789_RDDID 0x04 103 #define ST7789_RDDST 0x09 104 105 #define ST7789_RDDPM 0x0A // Read display power mode 106 #define ST7789_RDD_MADCTL 0x0B // Read display MADCTL 107 #define ST7789_RDD_COLMOD 0x0C // Read display pixel format 108 #define ST7789_RDDIM 0x0D // Read display image mode 109 #define ST7789_RDDSM 0x0E // Read display signal mode 110 #define ST7789_RDDSR 0x0F // Read display self-diagnostic result (ST7789V) 111 112 #define ST7789_SLPIN 0x10 113 #define ST7789_SLPOUT 0x11 114 #define ST7789_PTLON 0x12 115 #define ST7789_NORON 0x13 116 117 #define ST7789_INVOFF 0x20 118 #define ST7789_INVON 0x21 119 #define ST7789_GAMSET 0x26 // Gamma set 120 #define ST7789_DISPOFF 0x28 121 #define ST7789_DISPON 0x29 122 #define ST7789_CASET 0x2A 123 #define ST7789_RASET 0x2B 124 #define ST7789_RAMWR 0x2C 125 #define ST7789_RGBSET 0x2D // Color setting for 4096, 64K and 262K colors 126 #define ST7789_RAMRD 0x2E 127 128 #define ST7789_PTLAR 0x30 129 #define ST7789_VSCRDEF 0x33 // Vertical scrolling definition (ST7789V) 130 #define ST7789_TEOFF 0x34 // Tearing effect line off 131 #define ST7789_TEON 0x35 // Tearing effect line on 132 #define ST7789_MADCTL 0x36 // Memory data access control 133 #define ST7789_VSCRSADD 0x37 // Vertical screoll address 134 #define ST7789_IDMOFF 0x38 // Idle mode off 135 #define ST7789_IDMON 0x39 // Idle mode on 136 #define ST7789_RAMWRC 0x3C // Memory write continue (ST7789V) 137 #define ST7789_RAMRDC 0x3E // Memory read continue (ST7789V) 138 #define ST7789_COLMOD 0x3A 139 140 #define ST7789_RAMCTRL 0xB0 // RAM control 141 #define ST7789_RGBCTRL 0xB1 // RGB control 142 #define ST7789_PORCTRL 0xB2 // Porch control 143 #define ST7789_FRCTRL1 0xB3 // Frame rate control 144 #define ST7789_PARCTRL 0xB5 // Partial mode control 145 #define ST7789_GCTRL 0xB7 // Gate control 146 #define ST7789_GTADJ 0xB8 // Gate on timing adjustment 147 #define ST7789_DGMEN 0xBA // Digital gamma enable 148 #define ST7789_VCOMS 0xBB // VCOMS setting 149 #define ST7789_LCMCTRL 0xC0 // LCM control 150 #define ST7789_IDSET 0xC1 // ID setting 151 #define ST7789_VDVVRHEN 0xC2 // VDV and VRH command enable 152 #define ST7789_VRHS 0xC3 // VRH set 153 #define ST7789_VDVSET 0xC4 // VDV setting 154 #define ST7789_VCMOFSET 0xC5 // VCOMS offset set 155 #define ST7789_FRCTR2 0xC6 // FR Control 2 156 #define ST7789_CABCCTRL 0xC7 // CABC control 157 #define ST7789_REGSEL1 0xC8 // Register value section 1 158 #define ST7789_REGSEL2 0xCA // Register value section 2 159 #define ST7789_PWMFRSEL 0xCC // PWM frequency selection 160 #define ST7789_PWCTRL1 0xD0 // Power control 1 161 #define ST7789_VAPVANEN 0xD2 // Enable VAP/VAN signal output 162 #define ST7789_CMD2EN 0xDF // Command 2 enable 163 #define ST7789_PVGAMCTRL 0xE0 // Positive voltage gamma control 164 #define ST7789_NVGAMCTRL 0xE1 // Negative voltage gamma control 165 #define ST7789_DGMLUTR 0xE2 // Digital gamma look-up table for red 166 #define ST7789_DGMLUTB 0xE3 // Digital gamma look-up table for blue 167 #define ST7789_GATECTRL 0xE4 // Gate control 168 #define ST7789_SPI2EN 0xE7 // SPI2 enable 169 #define ST7789_PWCTRL2 0xE8 // Power control 2 170 #define ST7789_EQCTRL 0xE9 // Equalize time control 171 #define ST7789_PROMCTRL 0xEC // Program control 172 #define ST7789_PROMEN 0xFA // Program mode enable 173 #define ST7789_NVMSET 0xFC // NVM setting 174 #define ST7789_PROMACT 0xFE // Program action 175