Added support for WROOM
This commit is contained in:
DanKoloff 2022-10-21 15:30:14 +03:00
parent ec35ee37fe
commit fca38ce033
2 changed files with 38 additions and 8 deletions

@ -7,12 +7,33 @@
#define TFT_CS 5
#define TFT_MOSI 2
#define TFT_CLK 14
#define TFT_MISO -1
#define TFT_RST -1
#elif defined ARDUINO_ESP32_EVB
// This is pinouts for ESP32-EVB
#define TFT_DC 15
#define TFT_CS 17
#define TFT_MOSI 2
#define TFT_CLK 14
#define TFT_MISO -1
#define TFT_RST -1
#elif defined ARDUINO_ESP32_DEV
//This is if you select ESP32 Wrover Module
#define TFT_DC 12
#define TFT_CS 15
#define TFT_MOSI 13
#define TFT_CLK 14
#define TFT_MISO -1
#define TFT_RST -1
#elif defined ARDUINO_ESP32_WROVER_KIT
//This is if you select ESP32 Wrover Kit (All versions)
#define TFT_DC 12
#define TFT_CS 15
#define TFT_MOSI 13
#define TFT_CLK 14
#define TFT_MISO -1
#define TFT_RST -1
#elif defined ARDUINO_AVR_OLIMEXINO_2560
// This is pinouts for Olimexino 2560
// Important!!! If using UEXT connector you need
@ -23,7 +44,8 @@
#define TFT_CS 53
#define TFT_MOSI 51
#define TFT_CLK 52
#define TFT_BKL 0
#define TFT_MISO -1
#define TFT_RST -1
#elif defined ARDUINO_AVR_MEGA2560
#warning You need to connect the respective SPI and I2C pins to the AVR_MEGA256
@ -31,7 +53,8 @@
#define TFT_CS 53
#define TFT_MOSI 51
#define TFT_CLK 52
#define TFT_BKL 0
#define TFT_MISO -1
#define TFT_RST -1
#elif defined ARDUINO_OLIMEXINO_STM32F3
#define TFT_DC 12
#define TFT_CS 4
@ -39,6 +62,7 @@
#define TFT_CLK 13
#define TFT_MISO -1
#define TFT_RST -1
#else
#error This demo does not support selected board.
@ -46,7 +70,8 @@
#define TFT_CS 0
#define TFT_MOSI 0
#define TFT_CLK 0
#define TFT_BKL 0
#define TFT_MISO 0
#define TFT_RST 0
#endif
#endif // #ifndef _BOARD_PINOUT_H

@ -47,11 +47,11 @@ Adafruit_STMPE610 ts = Adafruit_STMPE610();
// Size of the color selection boxes and the paintbrush size
#define BOXSIZE 40
#ifdef ARDUINO_OLIMEXINO_STM32F3
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
#else
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
#endif
//if there is problem with this consturctor for some boards try
//#ifdef ARDUINO_OLIMEXINO_STM32F3
//Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
uint8_t tp[5];
@ -65,7 +65,12 @@ void setup() {
tft.begin();
Wire.begin();
#if (defined ARDUINO_ESP32_WROVER_KIT) || (defined ARDUINO_ESP32_DEV)
Wire.begin(18,23);
#else
Wire.begin();
#endif
pinMode(TFT_DC, OUTPUT);
// read diagnostics (optional but can help debug problems)
//uint8_t x = tft.readcommand8(ILI9341_RDMODE);