From c89d10dd902907b4d2ee2965dd41728696d22792 Mon Sep 17 00:00:00 2001 From: Lincoln Lavoie Date: Thu, 5 Dec 2024 23:08:22 -0500 Subject: [PATCH 1/2] Updated settings for the Lanbon L9 * Fixed the TFT driver, bad reference to gfx object. * Added setting for GFX parallel driver speed. * Corrected touch drive to FT6336. --- src/drv/tft/tft_driver_arduinogfx.cpp | 6 +++--- user_setups/esp32s3/lanbon_l9.ini | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/drv/tft/tft_driver_arduinogfx.cpp b/src/drv/tft/tft_driver_arduinogfx.cpp index 8826cef8..71a52a96 100644 --- a/src/drv/tft/tft_driver_arduinogfx.cpp +++ b/src/drv/tft/tft_driver_arduinogfx.cpp @@ -26,10 +26,10 @@ void ArduinoGfx::init(int w, int h) LOG_TRACE(TAG_TFT, F(D_SERVICE_STARTING)); #if(TFT_WIDTH == 170) && (TFT_HEIGHT == 320) - Arduino_DataBus *bus = new Arduino_ESP32PAR8Q( + Arduino_DataBus *bus = new Arduino_ESP32LCD8( TFT_DC, TFT_CS, TFT_WR, TFT_RD, TFT_D0, TFT_D1, TFT_D2, TFT_D3, TFT_D4, TFT_D5, TFT_D6, TFT_D7); - Arduino_GFX *gfx = new Arduino_ST7789(bus, + tft = new Arduino_ST7789(bus, TFT_RST /* RST */, TFT_ROTATION /* rotation */, true /* IPS */, TFT_WIDTH /* width */, TFT_HEIGHT /* height */, 35 /* col offset 1 */, 0 /* row offset 1 */, @@ -142,7 +142,7 @@ void ArduinoGfx::init(int w, int h) /* TFT init */ LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__); - tft->begin(GFX_NOT_DEFINED); + tft->begin(SPI_FREQUENCY); LOG_DEBUG(TAG_TFT, F("%s - %d"), __FILE__, __LINE__); // tft.setSwapBytes(true); /* set endianness */ LOG_INFO(TAG_TFT, F(D_SERVICE_STARTED)); diff --git a/user_setups/esp32s3/lanbon_l9.ini b/user_setups/esp32s3/lanbon_l9.ini index 9dfb0616..216dfcf8 100644 --- a/user_setups/esp32s3/lanbon_l9.ini +++ b/user_setups/esp32s3/lanbon_l9.ini @@ -26,6 +26,7 @@ build_flags = ;-D TFT_INVERSION_ON ;-D TFT_RGB_ORDER=0 ; Colour order Blue-Green-Red ;-D INVERT_COLORS=1 ; for inverted colors + -D SPI_FREQUENCY=16000000 -D TFT_RST=-1 -D TFT_CS=21 @@ -44,13 +45,13 @@ build_flags = ; Touch Setttings -D TOUCH_WIDTH=170 -D TOUCH_HEIGHT=320 - -D TOUCH_DRIVER=0x911 + -D TOUCH_DRIVER=0x6336 -D TOUCH_SCL=0 -D TOUCH_SDA=35 -D TOUCH_IRQ=-1 -D TOUCH_RST=-1 - -D I2C_TOUCH_ADDRESS=0x5d ; or 0x14 - -D I2C_TOUCH_FREQUENCY=400000 + -D I2C_TOUCH_ADDRESS=0x38 + -D I2C_TOUCH_FREQUENCY=100000 ;endregion ;region -- Library options ------------------------------- From 113b6838f2c3c6fa49babf03a3536ec1e5c698cb Mon Sep 17 00:00:00 2001 From: Lincoln Lavoie Date: Fri, 6 Dec 2024 16:01:00 -0500 Subject: [PATCH 2/2] Working setup for Lanbon L9 * Changed to Arduino_ESP32PAR8 bus driver. * Fixed touch driver options, added missing port settings. * Increased frequency of i2c to 400kHz. --- src/drv/tft/tft_driver_arduinogfx.cpp | 2 +- user_setups/esp32s3/lanbon_l9.ini | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/drv/tft/tft_driver_arduinogfx.cpp b/src/drv/tft/tft_driver_arduinogfx.cpp index 71a52a96..2e377c39 100644 --- a/src/drv/tft/tft_driver_arduinogfx.cpp +++ b/src/drv/tft/tft_driver_arduinogfx.cpp @@ -26,7 +26,7 @@ void ArduinoGfx::init(int w, int h) LOG_TRACE(TAG_TFT, F(D_SERVICE_STARTING)); #if(TFT_WIDTH == 170) && (TFT_HEIGHT == 320) - Arduino_DataBus *bus = new Arduino_ESP32LCD8( + Arduino_DataBus *bus = new Arduino_ESP32PAR8( TFT_DC, TFT_CS, TFT_WR, TFT_RD, TFT_D0, TFT_D1, TFT_D2, TFT_D3, TFT_D4, TFT_D5, TFT_D6, TFT_D7); tft = new Arduino_ST7789(bus, diff --git a/user_setups/esp32s3/lanbon_l9.ini b/user_setups/esp32s3/lanbon_l9.ini index 216dfcf8..b4ead53a 100644 --- a/user_setups/esp32s3/lanbon_l9.ini +++ b/user_setups/esp32s3/lanbon_l9.ini @@ -51,7 +51,8 @@ build_flags = -D TOUCH_IRQ=-1 -D TOUCH_RST=-1 -D I2C_TOUCH_ADDRESS=0x38 - -D I2C_TOUCH_FREQUENCY=100000 + -D I2C_TOUCH_PORT=1 + -D I2C_TOUCH_FREQUENCY=400000 ;endregion ;region -- Library options ------------------------------- @@ -61,6 +62,7 @@ lib_deps = ${arduino_esp32s3_v2.lib_deps} ${arduinogfx.lib_deps} ${goodix.lib_deps} + ${ft6336.lib_deps} lib_ignore = ${env.lib_ignore}