|
6 | 6 | // |
7 | 7 | // If this file is edited correctly then all the library example sketches should |
8 | 8 | // run without the need to make any more changes for a particular hardware setup! |
| 9 | +// Note that some sketches are designed for a particular TFT pixel width/height |
9 | 10 |
|
10 | 11 | // ################################################################################## |
11 | 12 | // |
|
19 | 20 | //#define ILI9163_DRIVER |
20 | 21 | //#define S6D02A1_DRIVER |
21 | 22 | //#define RPI_ILI9486_DRIVER // 20MHz maximum SPI |
| 23 | +//#define HX8357D_DRIVER |
| 24 | +//#define ILI9481_DRIVER |
| 25 | +//#define ILI9486_DRIVER |
| 26 | +//#define ILI9488_DRIVER |
| 27 | +//#define ST7789_DRIVER // Define the screen size below for this display |
22 | 28 |
|
23 | 29 | // For M5Stack ESP32 module with integrated display ONLY, remove // in line below |
24 | 30 | //#define M5STACK |
25 | 31 |
|
26 | | -// For ST7735 and ILI9163 ONLY, define the pixel width and height in portrait orientation |
27 | | -//#define TFT_WIDTH 80 |
28 | | -//#define TFT_WIDTH 128 |
29 | | -//#define TFT_HEIGHT 160 |
30 | | -//#define TFT_HEIGHT 128 |
| 32 | +// For ST7789, ST7735 and ILI9163 ONLY, define the pixel width and height in portrait orientation |
| 33 | +// #define TFT_WIDTH 80 |
| 34 | +// #define TFT_WIDTH 128 |
| 35 | +// #define TFT_WIDTH 240 // ST7789 240 x 240 and 240 x 320 |
| 36 | +// #define TFT_HEIGHT 160 |
| 37 | +// #define TFT_HEIGHT 128 |
| 38 | +// #define TFT_HEIGHT 240 // ST7789 240 x 240 |
| 39 | +// #define TFT_HEIGHT 320 // ST7789 240 x 320 |
31 | 40 |
|
32 | 41 | // For ST7735 ONLY, define the type of display, originally this was based on the |
33 | 42 | // colour of the tab on the screen protector film but this is not always true, so try |
|
36 | 45 | // Comment out ALL BUT ONE of these options for a ST7735 display driver, save this |
37 | 46 | // this User_Setup file, then rebuild and upload the sketch to the board again: |
38 | 47 |
|
39 | | -//#define ST7735_INITB |
40 | | -//#define ST7735_GREENTAB |
41 | | -//#define ST7735_GREENTAB2 |
42 | | -//#define ST7735_GREENTAB3 |
43 | | -//#define ST7735_GREENTAB128 // For 128 x 128 display |
44 | | -//#define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset) |
45 | | -//#define ST7735_REDTAB |
46 | | -//#define ST7735_BLACKTAB |
| 48 | +// #define ST7735_INITB |
| 49 | +// #define ST7735_GREENTAB |
| 50 | +// #define ST7735_GREENTAB2 |
| 51 | +// #define ST7735_GREENTAB3 |
| 52 | +// #define ST7735_GREENTAB128 // For 128 x 128 display |
| 53 | +// #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset) |
| 54 | +// #define ST7735_REDTAB |
| 55 | +// #define ST7735_BLACKTAB |
47 | 56 |
|
48 | 57 | // ################################################################################## |
49 | 58 | // |
|
88 | 97 | #define TFT_CS PIN_D8 // Chip select control pin D8 |
89 | 98 | #define TFT_DC PIN_D3 // Data Command control pin |
90 | 99 | #define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line) |
91 | | -//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V |
| 100 | +//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V |
| 101 | + |
| 102 | +//#define TFT_BL PIN_D1 // LED back-light (only for ST7789 with backlight control pin) |
92 | 103 |
|
93 | | -//#define TOUCH_CS PIN_D1 // Chip select pin (T_CS) of touch screen |
| 104 | +//#define TOUCH_CS PIN_D2 // Chip select pin (T_CS) of touch screen |
94 | 105 |
|
95 | 106 | //#define TFT_WR PIN_D2 // Write strobe for modified Raspberry Pi TFT only |
96 | 107 |
|
|
118 | 129 | //#define TFT_MISO 19 |
119 | 130 | //#define TFT_MOSI 23 |
120 | 131 | //#define TFT_SCLK 18 |
121 | | -//#define TFT_CS 15 // Chip select control pin |
| 132 | +//#define TFT_CS 15 // Chip select control pin |
122 | 133 | //#define TFT_DC 2 // Data Command control pin |
123 | 134 | //#define TFT_RST 4 // Reset pin (could connect to RST pin) |
124 | 135 | //#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST |
| 136 | +//#define TFT_BL 32 // LED back-light (only for ST7789 with backlight control pin) |
125 | 137 |
|
126 | | -//#define TOUCH_CS 22 // Chip select pin (T_CS) of touch screen |
127 | | - |
128 | | -//#define TFT_WR 21 // Write strobe for modified Raspberry Pi TFT only |
129 | 138 |
|
130 | 139 | // For the M5Stack module use these #define lines |
131 | 140 | //#define TFT_MISO 19 |
|
134 | 143 | //#define TFT_CS 14 // Chip select control pin |
135 | 144 | //#define TFT_DC 27 // Data Command control pin |
136 | 145 | //#define TFT_RST 33 // Reset pin (could connect to Arduino RESET pin) |
137 | | -//#define TFT_BL 32 // LED back-light |
| 146 | +//#define TFT_BL 32 // LED back-light (required for M5Stack) |
| 147 | + |
| 148 | +//#define TOUCH_CS 21 // Chip select pin (T_CS) of touch screen |
| 149 | + |
| 150 | +//#define TFT_WR 22 // Write strobe for modified Raspberry Pi TFT only |
| 151 | + |
| 152 | +// ###### EDIT THE PINs BELOW TO SUIT YOUR ESP32 PARALLEL TFT SETUP ###### |
| 153 | + |
| 154 | +// The library supports 8 bit parallel TFTs with the ESP32, the pin |
| 155 | +// selection below is compatible with ESP32 boards in UNO format. |
| 156 | +// Wemos D32 boards need to be modified, see diagram in Tools folder. |
| 157 | +// Only ILI9481 and ILI9341 based displays have been tested! |
138 | 158 |
|
| 159 | +// Parallel bus is only supported on ESP32 |
| 160 | +// Uncomment line below to use ESP32 Parallel interface instead of SPI |
| 161 | + |
| 162 | +//#define ESP32_PARALLEL |
| 163 | + |
| 164 | +// The ESP32 and TFT the pins used for testing are: |
| 165 | +//#define TFT_CS 33 // Chip select control pin (library pulls permanently low |
| 166 | +//#define TFT_DC 15 // Data Command control pin - use a pin in the range 0-31 |
| 167 | +//#define TFT_RST 32 // Reset pin, toggles on startup |
| 168 | + |
| 169 | +//#define TFT_WR 4 // Write strobe control pin - use a pin in the range 0-31 |
| 170 | +//#define TFT_RD 2 // Read strobe control pin - use a pin in the range 0-31 |
| 171 | + |
| 172 | +//#define TFT_D0 12 // Must use pins in the range 0-31 for the data bus |
| 173 | +//#define TFT_D1 13 // so a single register write sets/clears all bits. |
| 174 | +//#define TFT_D2 26 // Pins can be randomly assigned, this does not affect |
| 175 | +//#define TFT_D3 25 // TFT screen update performance. |
| 176 | +//#define TFT_D4 17 |
| 177 | +//#define TFT_D5 16 |
| 178 | +//#define TFT_D6 27 |
| 179 | +//#define TFT_D7 14 |
139 | 180 |
|
140 | 181 | // ################################################################################## |
141 | 182 | // |
|
167 | 208 | #define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters |
168 | 209 | #define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters |
169 | 210 | #define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm |
170 | | -#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:. |
171 | | -//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT |
| 211 | +#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. |
172 | 212 | #define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. |
| 213 | +//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT |
173 | 214 | #define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts |
174 | 215 |
|
175 | 216 | // Comment out the #define below to stop the SPIFFS filing system and smooth font code being loaded |
|
202 | 243 | // #define SPI_FREQUENCY 20000000 |
203 | 244 | #define SPI_FREQUENCY 27000000 // Actually sets it to 26.67MHz = 80/3 |
204 | 245 | // #define SPI_FREQUENCY 40000000 // Maximum to use SPIFFS |
205 | | -// #define SPI_FREQUENCY 53400000 |
206 | 246 | // #define SPI_FREQUENCY 80000000 |
207 | 247 |
|
| 248 | +// Optional reduced SPI frequency for reading TFT |
| 249 | +#define SPI_READ_FREQUENCY 20000000 |
| 250 | + |
208 | 251 | // The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here: |
209 | 252 | #define SPI_TOUCH_FREQUENCY 2500000 |
210 | 253 |
|
|
219 | 262 | // Transactions are automatically enabled by the library for an ESP32 (to use HAL mutex) |
220 | 263 | // so changing it here has no effect |
221 | 264 |
|
222 | | -// #define SUPPORT_TRANSACTIONS |
| 265 | +//#define SUPPORT_TRANSACTIONS |
0 commit comments