Skip to content

Commit 99efb06

Browse files
fix: Correct TFT pins and add I2C power for Reverse TFT board
Fixed pin definitions and display initialization for both Adafruit ESP32-S3 Feather TFT variants based on official Adafruit board definitions. Pin Corrections (from official Arduino board definitions): - Normal TFT (adafruit_feather_esp32s3_tft): * TFT_CS: 7 * TFT_DC: 39 * TFT_RST: 40 * TFT_BACKLIGHT: 45 * TFT_I2C_POWER: 21 (NEW - required for display power) - Reverse TFT (adafruit_feather_esp32s3_reversetft): * TFT_CS: 42 * TFT_DC: 40 * TFT_RST: 41 * TFT_BACKLIGHT: 45 * TFT_I2C_POWER: 7 (NEW - required for display power) Critical Fix: - Added TFT_I2C_POWER pin initialization in initializeTFT() - This pin MUST be set HIGH before initializing the display - Without this, the display may not work or show garbled output - Added 10ms delay after power-on for stabilization Display Configuration: - Rotation: 1 for normal TFT, 3 for Reverse TFT - Dimensions: 135x240 pixels (both boards) - Driver: Adafruit ST7789 Testing: - Both board variants build successfully - Normal TFT: Flash 80.5%, RAM 16.2% - Reverse TFT: Flash 79.1%, RAM 16.2% References: - ~/.platformio/packages/framework-arduinoespressif32/variants/adafruit_feather_esp32s3_tft/pins_arduino.h - ~/.platformio/packages/framework-arduinoespressif32/variants/adafruit_feather_esp32s3_reversetft/pins_arduino.h
1 parent 3e75883 commit 99efb06

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

lib/TFTDisplay/tft_display.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ static void tftDisplayTask(void* parameter);
3333
// TFT DISPLAY INITIALIZATION
3434
// ==========================================
3535
void initializeTFT() {
36+
// Enable TFT I2C power (required for both TFT and Reverse TFT boards)
37+
pinMode(TFT_I2C_POWER, OUTPUT);
38+
digitalWrite(TFT_I2C_POWER, HIGH);
39+
delay(10); // Wait for power to stabilize
40+
3641
// Initialize TFT display
3742
tft = new Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);
3843
tft->init(TFT_WIDTH, TFT_HEIGHT);

lib/TFTDisplay/tft_display.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,18 @@
1313

1414
// TFT Display pins - board specific
1515
#if defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_REVERSETFT)
16-
// Reverse TFT board pins
16+
// Reverse TFT board pins (official Adafruit pinout)
17+
#define TFT_I2C_POWER 7
1718
#define TFT_CS 42
18-
#define TFT_DC 40
1919
#define TFT_RST 41
20+
#define TFT_DC 40
2021
#define TFT_BACKLIGHT 45
2122
#else
2223
// Normal TFT board pins (ARDUINO_ADAFRUIT_FEATHER_ESP32S3_TFT)
23-
#define TFT_CS 7
24-
#define TFT_DC 39
24+
#define TFT_I2C_POWER 21
25+
#define TFT_CS 7
2526
#define TFT_RST 40
27+
#define TFT_DC 39
2628
#define TFT_BACKLIGHT 45
2729
#endif
2830

0 commit comments

Comments
 (0)