acidportal- 😈 Worlds smallest Evil Portal on a LilyGo T-QT |
git clone git://git.acid.vegas/acidportal.git |
Log | Files | Refs | Archive | README | LICENSE |
ST7735_Defines.h (5356B)
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 128 5 #endif 6 #ifndef TFT_HEIGHT 7 #define TFT_HEIGHT 160 8 #endif 9 10 11 // Enumerate the different configurations 12 #define INITR_GREENTAB 0x0 13 #define INITR_REDTAB 0x1 14 #define INITR_BLACKTAB 0x2 // Display with no offsets 15 #define INITR_GREENTAB2 0x3 // Use if you get random pixels on two edges of green tab display 16 #define INITR_GREENTAB3 0x4 // Use if you get random pixels on edge(s) of 128x128 screen 17 #define INITR_GREENTAB128 0x5 // Use if you only get part of 128x128 screen in rotation 0 & 1 18 #define INITR_GREENTAB160x80 0x6 // Use if you only get part of 128x128 screen in rotation 0 & 1 19 #define INITR_REDTAB160x80 0x7 // Added for https://www.aliexpress.com/item/ShengYang-1pcs-IPS-0-96-inch-7P-SPI-HD-65K-Full-Color-OLED-Module-ST7735-Drive/32918394604.html 20 #define INITR_ROBOTLCD 0x8 21 #define INITB 0xB 22 23 24 // Setup the tab color that will be used by the library setRotation() and setup command list 25 #if defined (ST7735_INITB) 26 #define TAB_COLOUR INITB 27 28 #elif defined (ST7735_GREENTAB) 29 #define TAB_COLOUR INITR_GREENTAB 30 #define CGRAM_OFFSET 31 32 #elif defined (ST7735_GREENTAB2) 33 #define TAB_COLOUR INITR_GREENTAB2 34 #define CGRAM_OFFSET 35 36 #elif defined (ST7735_GREENTAB3) 37 #define TAB_COLOUR INITR_GREENTAB3 38 #define CGRAM_OFFSET 39 40 #elif defined (ST7735_GREENTAB128) 41 #define TAB_COLOUR INITR_GREENTAB128 42 #define CGRAM_OFFSET 43 44 #elif defined (ST7735_GREENTAB160x80) 45 #define TAB_COLOUR INITR_GREENTAB160x80 46 #define CGRAM_OFFSET 47 48 #elif defined (ST7735_ROBOTLCD) 49 #define TAB_COLOUR INITR_ROBOTLCD 50 #define CGRAM_OFFSET 51 52 #elif defined (ST7735_REDTAB160x80) 53 #define TAB_COLOUR INITR_REDTAB160x80 54 #define CGRAM_OFFSET 55 56 #elif defined (ST7735_REDTAB) 57 #define TAB_COLOUR INITR_REDTAB 58 59 #elif defined (ST7735_BLACKTAB) 60 #define TAB_COLOUR INITR_BLACKTAB 61 62 #else // Make sure it is not undefined 63 #define TAB_COLOUR INITR_BLACKTAB 64 #endif 65 66 67 // Color definitions for backwards compatibility with old sketches 68 // use colour definitions like TFT_BLACK to make sketches more portable 69 #define ST7735_BLACK 0x0000 /* 0, 0, 0 */ 70 #define ST7735_NAVY 0x000F /* 0, 0, 128 */ 71 #define ST7735_DARKGREEN 0x03E0 /* 0, 128, 0 */ 72 #define ST7735_DARKCYAN 0x03EF /* 0, 128, 128 */ 73 #define ST7735_MAROON 0x7800 /* 128, 0, 0 */ 74 #define ST7735_PURPLE 0x780F /* 128, 0, 128 */ 75 #define ST7735_OLIVE 0x7BE0 /* 128, 128, 0 */ 76 #define ST7735_LIGHTGREY 0xC618 /* 192, 192, 192 */ 77 #define ST7735_DARKGREY 0x7BEF /* 128, 128, 128 */ 78 #define ST7735_BLUE 0x001F /* 0, 0, 255 */ 79 #define ST7735_GREEN 0x07E0 /* 0, 255, 0 */ 80 #define ST7735_CYAN 0x07FF /* 0, 255, 255 */ 81 #define ST7735_RED 0xF800 /* 255, 0, 0 */ 82 #define ST7735_MAGENTA 0xF81F /* 255, 0, 255 */ 83 #define ST7735_YELLOW 0xFFE0 /* 255, 255, 0 */ 84 #define ST7735_WHITE 0xFFFF /* 255, 255, 255 */ 85 #define ST7735_ORANGE 0xFD20 /* 255, 165, 0 */ 86 #define ST7735_GREENYELLOW 0xAFE5 /* 173, 255, 47 */ 87 #define ST7735_PINK 0xF81F 88 89 90 // Delay between some initialisation commands 91 #define TFT_INIT_DELAY 0x80 92 93 94 // Generic commands used by TFT_eSPI.cpp 95 #define TFT_NOP 0x00 96 #define TFT_SWRST 0x01 97 98 #define TFT_CASET 0x2A 99 #define TFT_PASET 0x2B 100 #define TFT_RAMWR 0x2C 101 102 #define TFT_RAMRD 0x2E 103 #define TFT_IDXRD 0x00 //0xDD // ILI9341 only, indexed control register read 104 105 #define TFT_MADCTL 0x36 106 #define TFT_MAD_MY 0x80 107 #define TFT_MAD_MX 0x40 108 #define TFT_MAD_MV 0x20 109 #define TFT_MAD_ML 0x10 110 #define TFT_MAD_BGR 0x08 111 #define TFT_MAD_MH 0x04 112 #define TFT_MAD_RGB 0x00 113 114 #ifndef TFT_RGB_ORDER 115 #if defined(ST7735_BLACKTAB) || defined(ST7735_GREENTAB2) || defined(ST7735_INITB) 116 #define TFT_MAD_COLOR_ORDER TFT_MAD_RGB 117 #else 118 #define TFT_MAD_COLOR_ORDER TFT_MAD_BGR 119 #endif 120 #else 121 #if (TFT_RGB_ORDER == 1) 122 #define TFT_MAD_COLOR_ORDER TFT_MAD_RGB 123 #else 124 #define TFT_MAD_COLOR_ORDER TFT_MAD_BGR 125 #endif 126 #endif 127 128 #define TFT_INVOFF 0x20 129 #define TFT_INVON 0x21 130 131 // ST7735 specific commands used in init 132 #define ST7735_NOP 0x00 133 #define ST7735_SWRESET 0x01 134 #define ST7735_RDDID 0x04 135 #define ST7735_RDDST 0x09 136 137 #define ST7735_SLPIN 0x10 138 #define ST7735_SLPOUT 0x11 139 #define ST7735_PTLON 0x12 140 #define ST7735_NORON 0x13 141 142 #define ST7735_INVOFF 0x20 143 #define ST7735_INVON 0x21 144 #define ST7735_DISPOFF 0x28 145 #define ST7735_DISPON 0x29 146 #define ST7735_CASET 0x2A 147 #define ST7735_RASET 0x2B // PASET 148 #define ST7735_RAMWR 0x2C 149 #define ST7735_RAMRD 0x2E 150 151 #define ST7735_PTLAR 0x30 152 #define ST7735_COLMOD 0x3A 153 #define ST7735_MADCTL 0x36 154 155 #define ST7735_FRMCTR1 0xB1 156 #define ST7735_FRMCTR2 0xB2 157 #define ST7735_FRMCTR3 0xB3 158 #define ST7735_INVCTR 0xB4 159 #define ST7735_DISSET5 0xB6 160 161 #define ST7735_PWCTR1 0xC0 162 #define ST7735_PWCTR2 0xC1 163 #define ST7735_PWCTR3 0xC2 164 #define ST7735_PWCTR4 0xC3 165 #define ST7735_PWCTR5 0xC4 166 #define ST7735_VMCTR1 0xC5 167 168 #define ST7735_RDID1 0xDA 169 #define ST7735_RDID2 0xDB 170 #define ST7735_RDID3 0xDC 171 #define ST7735_RDID4 0xDD 172 173 #define ST7735_PWCTR6 0xFC 174 175 #define ST7735_GMCTRP1 0xE0 176 #define ST7735_GMCTRN1 0xE1