From 6e8377f5c4257a7bc4058cdb7347f87f523f9187 Mon Sep 17 00:00:00 2001 From: Hojin You Date: Thu, 5 Mar 2026 04:38:45 -0500 Subject: [PATCH 1/2] Add Setup73 for ESP32-S3 with ST7789V 240x320 Add user setup for ESP32-S3 with ST7789V display (240x320), tested with Freenove ESP32-S3-WROOM (N8R8) and Waveshare 2" SPI LCD. Uses FSPI default pins (GPIO 10, 11, 12) with conflict-free DC/RST pins. --- User_Setup_Select.h | 1 + User_Setups/Setup73_ESP32_S3_ST7789V.h | 36 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 User_Setups/Setup73_ESP32_S3_ST7789V.h diff --git a/User_Setup_Select.h b/User_Setup_Select.h index 2e3e018f..f9c23927 100644 --- a/User_Setup_Select.h +++ b/User_Setup_Select.h @@ -120,6 +120,7 @@ //#include // Setup file for ESP32 S2 with ST7789 //#include // Setup file for ESP32 with ST7789 1.47" 172x320 +//#include // Setup file for ESP32 S3 with ST7789V 240x320 //#include // Setup file for ESP32-32E with ST7796 3.5" 320x480 diff --git a/User_Setups/Setup73_ESP32_S3_ST7789V.h b/User_Setups/Setup73_ESP32_S3_ST7789V.h new file mode 100644 index 00000000..8f1f267e --- /dev/null +++ b/User_Setups/Setup73_ESP32_S3_ST7789V.h @@ -0,0 +1,36 @@ +// Setup for the ESP32-S3 with ST7789V 240x320 display +// Tested with Freenove ESP32-S3-WROOM (N8R8) and Waveshare 2" SPI LCD +#define USER_SETUP_ID 73 + +#define ST7789_DRIVER + +#define TFT_WIDTH 240 +#define TFT_HEIGHT 320 + + // Typical board default pins (tested) +#define TFT_MOSI 11 // 11 or 35 (FSPI D) +#define TFT_SCLK 12 // 12 or 36 (FSPI CLK) +#define TFT_CS 10 // 10 or 34 (FSPI CS0) +#define TFT_MISO -1 + +// Use pins in range 0-31 +#define TFT_DC 14 +#define TFT_RST 21 + +// #define TFT_BL -1 // Backlight control pin, set to -1 if not used +// #define TFT_BACKLIGHT_ON HIGH + +// #define TFT_INVERSION_ON // Uncomment if colours are inverted +// #define TFT_RGB_ORDER TFT_BGR // Uncomment if red and blue are swapped + +#define LOAD_GLCD +#define LOAD_FONT2 +#define LOAD_FONT4 +#define LOAD_FONT6 +#define LOAD_FONT7 +#define LOAD_FONT8 +#define LOAD_GFXFF + +#define SMOOTH_FONT + +#define SPI_FREQUENCY 40000000 From f708c24c7c3f90883eaa4a26aab1eab5ca9c756c Mon Sep 17 00:00:00 2001 From: Hojin You Date: Thu, 5 Mar 2026 18:50:21 -0500 Subject: [PATCH 2/2] Add tested Core 3.x workaround notes and enable BGR colour order Enable TFT_BGR by default for correct colours on Waveshare 2" LCD. Add USE_HSPI_PORT option with Core 3.x usage notes. Move SPI_FREQUENCY next to HSPI config for clarity. --- User_Setups/Setup73_ESP32_S3_ST7789V.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/User_Setups/Setup73_ESP32_S3_ST7789V.h b/User_Setups/Setup73_ESP32_S3_ST7789V.h index 8f1f267e..1b8bc423 100644 --- a/User_Setups/Setup73_ESP32_S3_ST7789V.h +++ b/User_Setups/Setup73_ESP32_S3_ST7789V.h @@ -21,7 +21,14 @@ // #define TFT_BACKLIGHT_ON HIGH // #define TFT_INVERSION_ON // Uncomment if colours are inverted -// #define TFT_RGB_ORDER TFT_BGR // Uncomment if red and blue are swapped +#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red + +// FSPI port (SPI2) used unless following defined +// On Arduino ESP32 Core 3.x, enable USE_HSPI_PORT and reduce +// SPI_FREQUENCY to 20000000 to avoid crashes and corruption +// #define USE_HSPI_PORT + +#define SPI_FREQUENCY 40000000 #define LOAD_GLCD #define LOAD_FONT2 @@ -32,5 +39,3 @@ #define LOAD_GFXFF #define SMOOTH_FONT - -#define SPI_FREQUENCY 40000000