From c4217a92e893ee7f9d57438220647998639b5bde Mon Sep 17 00:00:00 2001 From: adampr1 Date: Thu, 30 May 2024 17:12:30 +0200 Subject: [PATCH 1/5] Add support for Waveshare ESP32-S3-Touch-LCD-4.3 Add suppor for ws_esp32_s3_touch_lcd_4p3 from post https://github.com/HASwitchPlate/openHASP/discussions/602 --- platformio_override-template.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/platformio_override-template.ini b/platformio_override-template.ini index 69a865c2..c3791ae8 100644 --- a/platformio_override-template.ini +++ b/platformio_override-template.ini @@ -78,6 +78,7 @@ extra_default_envs = ; wt-86-32-3zw1 ; yeacreate-nscreen32 ; wz2432r028 + ; ws_esp32_s3_touch_lcd_4p3 ;endregion ;region -- Define your local COM ports for each environment --- From 91074746039acdb7e90b5ac58988ffd3c0ea090e Mon Sep 17 00:00:00 2001 From: adampr1 Date: Thu, 30 May 2024 17:14:42 +0200 Subject: [PATCH 2/5] Add support for Waveshare ESP32-S3-Touch-LCD-4.3 Add support for Waveshare ESP32-S3-Touch-LCD-4.3 from https://github.com/HASwitchPlate/openHASP/discussions/602 --- .../esp32s3/ws_esp32_s3_touch_lcd_4p3.ini | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 user_setups/esp32s3/ws_esp32_s3_touch_lcd_4p3.ini diff --git a/user_setups/esp32s3/ws_esp32_s3_touch_lcd_4p3.ini b/user_setups/esp32s3/ws_esp32_s3_touch_lcd_4p3.ini new file mode 100644 index 00000000..fd766e4a --- /dev/null +++ b/user_setups/esp32s3/ws_esp32_s3_touch_lcd_4p3.ini @@ -0,0 +1,86 @@ +;***************************************************; +; Waveshare ESP32-S3-Touch-LCD-4.3 ; +; - 16-bit RGB TFT ; +; - GT911 touch controller ; +;***************************************************; + + +[ws_esp32_s3_touch] +extends = arduino_esp32s3_v2, flash_8mb +board = esp32-s3-devkitc-1 +board_build.arduino.memory_type = qio_opi + +build_flags = + ${arduino_esp32s3_v2.build_flags} + ${esp32s3.ps_ram} + ;-DARDUINO_USB_CDC_ON_BOOT + ;-DUSE_USB_CDC_CONSOLE + +;region -- ArduinoGFX build options ------------------------ + -D HASP_USE_ARDUINOGFX=1 + -D HASP_LV_USE_SW_ROTATE=1 +;endregion + +lib_deps = + ${arduino_esp32s3_v2.lib_deps} + ${arduinogfx.lib_deps} + Arduino_RPi_DPI_RGBPanel_mod + ${goodix.lib_deps} + +[env:ws_esp32_s3_touch_lcd_4p3] +extends = ws_esp32_s3_touch + +build_flags = + -D HASP_MODEL="Waveshare ESP32-S3-Touch-LCD-4.3" + ${ws_esp32_s3_touch.build_flags} + ; Bus Settings + -D LV_VDB_SIZE=76800 ; 10% of full framebuffer + -D TFT_WIDTH=800 + -D TFT_HEIGHT=480 + -D TFT_DE=5 + -D TFT_VSYNC=3 + -D TFT_HSYNC=46 + -D TFT_PCLK=7 + -D TFT_B0=14 + -D TFT_B1=38 + -D TFT_B2=18 + -D TFT_B3=17 + -D TFT_B4=10 + -D TFT_G0=39 + -D TFT_G1=0 + -D TFT_G2=45 + -D TFT_G3=48 + -D TFT_G4=47 + -D TFT_G5=21 + -D TFT_R0=1 + -D TFT_R1=2 + -D TFT_R2=42 + -D TFT_R3=41 + -D TFT_R4=40 + -D TFT_BCKL=6 ; use GPIO06 as backlight PIN + ; Panel Settings + -D TFT_HSYNC_POLARITY=0 + -D TFT_HSYNC_FRONT_PORCH=20 ; Maximum HSYNC Front Porch + -D TFT_HSYNC_PULSE_WIDTH=10 ; Typical HSYNC Pulse Width + -D TFT_HSYNC_BACK_PORCH=10 ; Typical HSYNC Back Porch + -D TFT_VSYNC_POLARITY=0 + -D TFT_VSYNC_FRONT_PORCH=10 ; Maximum VSYNC Front Porch + -D TFT_VSYNC_PULSE_WIDTH=10 ; Typical VSYNC Pulse Width + -D TFT_VSYNC_BACK_PORCH=10 ; Typical VSYNC Back Porch + -D TFT_PCLK_ACTIVE_NEG=0 + -D TFT_PREFER_SPEED=14000000 ; 1/2 of Typical DCLK Frequency + -D TFT_AUTO_FLUSH=1 + ; Touch Settings + -D TOUCH_WIDTH=800 + -D TOUCH_HEIGHT=480 + -D TOUCH_DRIVER=0x911 + -D TOUCH_SCL=9 + -D TOUCH_SDA=8 + -D TOUCH_IRQ=-1 + -D TOUCH_RST=-1 + -D I2C_TOUCH_ADDRESS=0x5d ; or 0x5D + -D I2C_TOUCH_FREQUENCY=400000 + -D BACKLIGHT_FREQUENCY=1000 ;adopted frerquency for MP3302DJ-LF-Z (200 to 1000Hz) ->higher is better for sound! +lib_deps = + ${sunton-esp32-s3-tft.lib_deps} + ${goodix.lib_deps} From 94ceaf2cf132d1e1bef4b231ecac40f99779a9a6 Mon Sep 17 00:00:00 2001 From: FreeBear Date: Fri, 14 Jun 2024 00:03:26 +0100 Subject: [PATCH 3/5] Was a mistake to hide TFT_BCKL gpio pin from the user. On some boards, it can be reassigned by the user (on others, it is baked in to the hardware). --- src/drv/tft/tft_driver_arduinogfx.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/drv/tft/tft_driver_arduinogfx.cpp b/src/drv/tft/tft_driver_arduinogfx.cpp index f9fc214f..4bc12004 100644 --- a/src/drv/tft/tft_driver_arduinogfx.cpp +++ b/src/drv/tft/tft_driver_arduinogfx.cpp @@ -296,9 +296,6 @@ bool ArduinoGfx::is_driver_pin(uint8_t pin) #ifdef TFT_HSYNC || (pin == TFT_HSYNC) #endif -#ifdef TFT_BCKL - || (pin == TFT_BCKL) -#endif #ifdef TFT_RST || (pin == TFT_RST) #endif From 89ef57346a8f8aa51df4b243f8cba9f224cda2a4 Mon Sep 17 00:00:00 2001 From: FreeBear Date: Fri, 19 Jul 2024 15:20:11 +0100 Subject: [PATCH 4/5] TFT_G5 was missing from the list of used GPIO pins. Add the USB TX/RX pins to the list for the Guition ESP32-S3 4848S040 board. --- src/drv/tft/tft_driver_arduinogfx.cpp | 9 +++++++++ user_setups/esp32s3/esp32-s3-4848S040.ini | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/src/drv/tft/tft_driver_arduinogfx.cpp b/src/drv/tft/tft_driver_arduinogfx.cpp index 4bc12004..a1cc3c89 100644 --- a/src/drv/tft/tft_driver_arduinogfx.cpp +++ b/src/drv/tft/tft_driver_arduinogfx.cpp @@ -335,6 +335,9 @@ bool ArduinoGfx::is_driver_pin(uint8_t pin) #ifdef TFT_G4 || (pin == TFT_G4) #endif +#ifdef TFT_G5 + || (pin == TFT_G5) +#endif #ifdef TFT_B0 || (pin == TFT_B0) #endif @@ -361,6 +364,12 @@ bool ArduinoGfx::is_driver_pin(uint8_t pin) #endif #ifdef TOUCH_IRQ || (pin == TOUCH_IRQ) +#endif +#ifdef USB_TXD + || (pin == USB_TXD) +#endif +#ifdef USB_RXD + || (pin == USB_RXD) #endif ) { return true; diff --git a/user_setups/esp32s3/esp32-s3-4848S040.ini b/user_setups/esp32s3/esp32-s3-4848S040.ini index 95c800ac..27d89050 100644 --- a/user_setups/esp32s3/esp32-s3-4848S040.ini +++ b/user_setups/esp32s3/esp32-s3-4848S040.ini @@ -76,6 +76,10 @@ build_flags = -D I2C_TOUCH_FREQUENCY=400000 -D I2C_TOUCH_ADDRESS=0x5D ; or 0x14 -D I2C_TOUCH_PORT=1 + ; USB GPIO - Only need to define these so that the pins do not + ; show up in the list of available GPIO + -D USB_TXD=43 + -D USB_RXD=44 ;endregion lib_deps = From 0b30b075fa806b13ceeff7058654d41745e7685c Mon Sep 17 00:00:00 2001 From: FreeBear Date: Fri, 19 Jul 2024 16:15:45 +0100 Subject: [PATCH 5/5] Move USB_TXD/RXD to is_system_pin() --- src/drv/tft/tft_driver_arduinogfx.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/drv/tft/tft_driver_arduinogfx.cpp b/src/drv/tft/tft_driver_arduinogfx.cpp index a1cc3c89..ae73d504 100644 --- a/src/drv/tft/tft_driver_arduinogfx.cpp +++ b/src/drv/tft/tft_driver_arduinogfx.cpp @@ -364,12 +364,6 @@ bool ArduinoGfx::is_driver_pin(uint8_t pin) #endif #ifdef TOUCH_IRQ || (pin == TOUCH_IRQ) -#endif -#ifdef USB_TXD - || (pin == USB_TXD) -#endif -#ifdef USB_RXD - || (pin == USB_RXD) #endif ) { return true;