From 993d671af4917ef68a059dd8161f47812244f0fd Mon Sep 17 00:00:00 2001 From: p43lz3r <16374477+paelzer@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:13:30 +0100 Subject: [PATCH 1/6] Update platformio.ini to support another variant of ESP32_2432S028 --- platformio.ini | 54 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index dace0bb..afa54b7 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,7 +10,7 @@ [platformio] globallib_dir = lib -default_envs = M5Stick-C, esp32cam, ESP32-2432S028R, NerminerV2, ESP32-devKitv1, NerminerV2-S3-DONGLE, NerminerV2-S3-AMOLED, NerminerV2-T-QT, NerdminerV2-T-Display_V1, ESP32-2432S028R, M5-StampS3, ESP32-S3-devKitv1, ESP32-S3-mini-wemos, ESP32-S3-mini-weact, ESP32-C3-devKitmv1, ESP32-C3-super-mini +default_envs = M5Stick-C, esp32cam, ESP32-2432S028R, ESP32_2432S028_2USB, NerminerV2, ESP32-devKitv1, NerminerV2-S3-DONGLE, NerminerV2-S3-AMOLED, NerminerV2-T-QT, NerdminerV2-T-Display_V1, ESP32-2432S028R, M5-StampS3, ESP32-S3-devKitv1, ESP32-S3-mini-wemos, ESP32-S3-mini-weact, ESP32-C3-devKitmv1, ESP32-C3-super-mini [env:M5Stick-C] platform = espressif32 @@ -370,6 +370,56 @@ lib_deps = mathertel/OneButton @ ^2.0.3 arduino-libraries/NTPClient + ;-------------------------------------------------------------------- + +; This env is just for another type of the popular ESP32_2432S028 which need different settings than others +; like TFT inversion +; and different gamma settings + +[env:ESP32_2432S028_2USB] +platform = espressif32 +board = esp32dev +framework = arduino +monitor_speed = 115200 +upload_speed = 921600 +;build_type = debug +board_build.partitions = huge_app.csv +build_flags = + ;-DDEBUG_MEMORY=1 + -D ESP32_2432S028_2USB=1 + -DTFT_INVERSION_ON + -DUSER_SETUP_LOADED=1 + -DILI9341_2_DRIVER=1 + -DTFT_WIDTH=240 + -DTFT_HEIGHT=320 + -DTFT_BACKLIGHT_ON=HIGH + -DTFT_MOSI=13 + -DTFT_SCLK=14 + -DTFT_CS=15 + -DTFT_DC=2 + -DTFT_RST=12 + -DTFT_BL=21 + -DETOUCH_CS=33 + -DTOUCH_CLK=25 + -DTOUCH_MISO=39 + -DTOUCH_MOSI=32 + -DTOUCH_IRQ=36 + -DLOAD_GLCD=1 + -DLOAD_FONT2=1 + -DLOAD_GFXFF=1 + -DSMOOTH_FONT=1 + -DSPI_FREQUENCY=55000000 + -DSPI_READ_FREQUENCY=20000000 + -DSPI_TOUCH_FREQUENCY=2500000 +lib_deps = + https://github.com/takkaO/OpenFontRender + bblanchon/ArduinoJson@^6.21.2 + https://github.com/tzapu/WiFiManager.git#v2.0.16-rc.2 + mathertel/OneButton @ ^2.0.3 + arduino-libraries/NTPClient + bodmer/TFT_eSPI @ ^2.5.31 + https://github.com/achillhasler/TFT_eTouch + ;-------------------------------------------------------------------- [env:ESP32-2432S028R] @@ -465,4 +515,4 @@ lib_ignore = TFT_eSPI SD rm67162 - SPI \ No newline at end of file + SPI From b737f8d0615b989dfdc15d0ce8c79dcd7172dcd0 Mon Sep 17 00:00:00 2001 From: p43lz3r <16374477+paelzer@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:21:21 +0100 Subject: [PATCH 2/6] Update esp23_2432s028r.cpp support for another ESP32_2432S028 variant --- src/drivers/displays/esp23_2432s028r.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/drivers/displays/esp23_2432s028r.cpp b/src/drivers/displays/esp23_2432s028r.cpp index f86a91c..ec9431f 100644 --- a/src/drivers/displays/esp23_2432s028r.cpp +++ b/src/drivers/displays/esp23_2432s028r.cpp @@ -1,6 +1,6 @@ #include "displayDriver.h" -#ifdef ESP32_2432S028R +#if defined ESP32_2432S028R || ESP32_2432S028_2USB #include #include @@ -32,6 +32,17 @@ void esp32_2432S028R_Init(void) { tft.init(); tft.setRotation(1); + #ifdef ESP32_2432S028_2USB + /* + In addition to TFT_INVERSION this adjusts the gamma curve to have better + picture quality for this type of ESP32_2432S028 TFT with for example two USB connectors + */ + tft.writecommand(ILI9341_GAMMASET); // Gamma curve selected + tft.writedata(2); + delay(120); + tft.writecommand(ILI9341_GAMMASET); // Gamma curve selected + tft.writedata(1); + #endif tft.setSwapBytes(true); // Swap the colour byte order when rendering hSPI.begin(TOUCH_CLK, TOUCH_MISO, TOUCH_MOSI, ETOUCH_CS); touch.init(); From 8131479cd102d3d5e1a786064849139ce6fc50ef Mon Sep 17 00:00:00 2001 From: p43lz3r <16374477+paelzer@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:22:28 +0100 Subject: [PATCH 3/6] Update device.h --- src/drivers/devices/device.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/drivers/devices/device.h b/src/drivers/devices/device.h index ddc45c6..205f68a 100644 --- a/src/drivers/devices/device.h +++ b/src/drivers/devices/device.h @@ -15,6 +15,8 @@ #include "lilygoS3Dongle.h" #elif defined(ESP32_2432S028R) #include "esp322432s028r.h" +#elif defined(ESP32_2432S028_2USB) // For another type of ESP32_2432S028 version with 2 USB connectors +#include "esp322432s028r.h" #elif defined(NERMINER_T_QT) #include "lilygoT_QT.h" #elif defined(NERDMINER_T_DISPLAY_V1) @@ -30,4 +32,4 @@ #error "No device defined" #endif -#endif // __DEVICE_H__ \ No newline at end of file +#endif // __DEVICE_H__ From 4eaeef30f23347a1c8ee24e13072328fa8124e66 Mon Sep 17 00:00:00 2001 From: p43lz3r <16374477+paelzer@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:23:37 +0100 Subject: [PATCH 4/6] Update display.cpp to support another ESP32_2432S028 variant --- src/drivers/displays/display.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/drivers/displays/display.cpp b/src/drivers/displays/display.cpp index 7d718be..3838aa3 100644 --- a/src/drivers/displays/display.cpp +++ b/src/drivers/displays/display.cpp @@ -24,6 +24,10 @@ DisplayDriver *currentDisplayDriver = &dongleDisplayDriver; DisplayDriver *currentDisplayDriver = &esp32_2432S028RDriver; #endif +#ifdef ESP32_2432S028_2USB +DisplayDriver *currentDisplayDriver = &esp32_2432S028RDriver; +#endif + #ifdef T_QT_DISPLAY DisplayDriver *currentDisplayDriver = &t_qtDisplayDriver; #endif From 6e516c44014c5f0da182046879866cb06d7ce7a5 Mon Sep 17 00:00:00 2001 From: p43lz3r <16374477+paelzer@users.noreply.github.com> Date: Thu, 18 Jan 2024 15:54:51 +0100 Subject: [PATCH 5/6] Update esp322432s028r.h added SD card pin defines --- src/drivers/devices/esp322432s028r.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/drivers/devices/esp322432s028r.h b/src/drivers/devices/esp322432s028r.h index 5f20e7e..6ea20ad 100644 --- a/src/drivers/devices/esp322432s028r.h +++ b/src/drivers/devices/esp322432s028r.h @@ -1,10 +1,16 @@ #ifndef _ESP32_2432S028R #define _ESP32_2432S028R +// Defines for the SD card slot ESP32_2432S028R +#define SDSPI_CS 5 +#define SDSPI_CLK 18 +#define SDSPI_MOSI 23 +#define SDSPI_MISO 19 + #define PIN_BUTTON_1 0 //#define PIN_BUTTON_2 22 // Not used #define PIN_ENABLE5V 21 // Not used #define LED_PIN 4 // Red pin #define LED_PIN_G 17 // Green pin -#endif \ No newline at end of file +#endif From d4e3a31aaa6d4ee064777cf443b77bf84f103c07 Mon Sep 17 00:00:00 2001 From: p43lz3r <16374477+paelzer@users.noreply.github.com> Date: Sun, 21 Jan 2024 18:35:13 +0100 Subject: [PATCH 6/6] Update esp322432s028r.h --- src/drivers/devices/esp322432s028r.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/drivers/devices/esp322432s028r.h b/src/drivers/devices/esp322432s028r.h index 6ea20ad..73d6911 100644 --- a/src/drivers/devices/esp322432s028r.h +++ b/src/drivers/devices/esp322432s028r.h @@ -1,12 +1,6 @@ #ifndef _ESP32_2432S028R #define _ESP32_2432S028R -// Defines for the SD card slot ESP32_2432S028R -#define SDSPI_CS 5 -#define SDSPI_CLK 18 -#define SDSPI_MOSI 23 -#define SDSPI_MISO 19 - #define PIN_BUTTON_1 0 //#define PIN_BUTTON_2 22 // Not used #define PIN_ENABLE5V 21 // Not used