From e4e6b992f4e25ea9b7136cc19bfc961dcd371397 Mon Sep 17 00:00:00 2001 From: Miner203 <84179454+TheMiner203@users.noreply.github.com> Date: Thu, 4 Jun 2026 22:47:29 +0800 Subject: [PATCH] Add LilyGo T-Embed CC1101 board support --- lib/TFT_eSPI/User_Setup_Select.h | 3 ++ .../Setup214_LilyGo_T_Embed_CC1101.h | 32 +++++++++++++++++++ platformio.ini | 29 ++++++++++++++++- src/drivers/devices/device.h | 2 ++ src/drivers/devices/lilygoS3TEmbedCC1101.h | 10 ++++++ src/drivers/displays/tDisplayDriver.cpp | 2 +- 6 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 lib/TFT_eSPI/User_Setups/Setup214_LilyGo_T_Embed_CC1101.h create mode 100644 src/drivers/devices/lilygoS3TEmbedCC1101.h diff --git a/lib/TFT_eSPI/User_Setup_Select.h b/lib/TFT_eSPI/User_Setup_Select.h index f61df74d..7a16af10 100644 --- a/lib/TFT_eSPI/User_Setup_Select.h +++ b/lib/TFT_eSPI/User_Setup_Select.h @@ -149,6 +149,9 @@ #ifdef LILYGO_S3_T_EMBED #include // For the LilyGo T-Embed S3 based ESP32S3 with ST7789 170 x 320 TFT #endif +#ifdef LILYGO_S3_T_EMBED_CC1101 +#include // For the LilyGo T-Embed CC1101 S3 with ST7789 170 x 320 TFT +#endif #ifdef NERDMINER_T_QT #include // For the LilyGo T-QT Pro S3 based ESP32S3 with GC9A01 128 x 128 TFT #endif diff --git a/lib/TFT_eSPI/User_Setups/Setup214_LilyGo_T_Embed_CC1101.h b/lib/TFT_eSPI/User_Setups/Setup214_LilyGo_T_Embed_CC1101.h new file mode 100644 index 00000000..844775ef --- /dev/null +++ b/lib/TFT_eSPI/User_Setups/Setup214_LilyGo_T_Embed_CC1101.h @@ -0,0 +1,32 @@ +// ST7789 170 x 320 display - LilyGo T-Embed CC1101 +#define USER_SETUP_ID 214 + +#define ST7789_DRIVER + +#define TFT_WIDTH 170 +#define TFT_HEIGHT 320 + +#define TFT_INVERSION_ON +#define TFT_BACKLIGHT_ON 1 + +#define TFT_BL 21 +#define TFT_MISO 10 +#define TFT_MOSI 9 +#define TFT_SCLK 11 +#define TFT_CS 41 +#define TFT_DC 16 +#define TFT_RST -1 + +#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 +#define SPI_READ_FREQUENCY 20000000 +#define SPI_TOUCH_FREQUENCY 2500000 diff --git a/platformio.ini b/platformio.ini index 8f8b9f24..8ac093a9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,7 +11,7 @@ [platformio] globallib_dir = lib -default_envs = NerdminerV2, NerdminerV2-T-HMI, wt32-sc01, wt32-sc01-plus, han_m5stack, M5Stick-C, M5Stick-C-Plus2, M5Stick-CPlus, esp32cam, ESP32-2432S028R, ESP32_2432S028_2USB, ESP32-2432S024, Lilygo-T-Embed, ESP32-devKitv1, NerdminerV2-S3-DONGLE, NerdminerV2-S3-GEEK, NerdminerV2-S3-AMOLED, NerdminerV2-S3-AMOLED-TOUCH, NerdminerV2-T-QT, NerdminerV2-T-Display_V1, TTGO-T-Display, M5-StampS3, ESP32-S3-devKitv1, ESP32-S3-mini-wemos, ESP32-S2-mini-wemos, ESP32-S3-mini-weact, ESP32-D0WD-V3-weact, ESP32-C3-super-mini, ESP32-C3-devKitmv1, ESP32-C3-042-OLED, ESP32-S3-042-OLED, ESP32-C3-spotpear, esp32-s3-devkitc1-n32r8 +default_envs = NerdminerV2, NerdminerV2-T-HMI, wt32-sc01, wt32-sc01-plus, han_m5stack, M5Stick-C, M5Stick-C-Plus2, M5Stick-CPlus, esp32cam, ESP32-2432S028R, ESP32_2432S028_2USB, ESP32-2432S024, Lilygo-T-Embed, Lilygo-T-Embed-CC1101, ESP32-devKitv1, NerdminerV2-S3-DONGLE, NerdminerV2-S3-GEEK, NerdminerV2-S3-AMOLED, NerdminerV2-S3-AMOLED-TOUCH, NerdminerV2-T-QT, NerdminerV2-T-Display_V1, TTGO-T-Display, M5-StampS3, ESP32-S3-devKitv1, ESP32-S3-mini-wemos, ESP32-S2-mini-wemos, ESP32-S3-mini-weact, ESP32-D0WD-V3-weact, ESP32-C3-super-mini, ESP32-C3-devKitmv1, ESP32-C3-042-OLED, ESP32-S3-042-OLED, ESP32-C3-spotpear, esp32-s3-devkitc1-n32r8 ; Global configuration for all environments [env] @@ -675,6 +675,33 @@ lib_ignore = ;-------------------------------------------------------------------- +[env:Lilygo-T-Embed-CC1101] +platform = espressif32@6.6.0 +board = esp32-s3-devkitc-1 +framework = arduino +extra_scripts = + pre:auto_firmware_version.py + post:post_build_merge.py +board_build.arduino.memory_type = qio_opi +monitor_speed = 115200 +upload_speed = 115200 +board_build.partitions = huge_app.csv +build_flags = + -D LV_LVGL_H_INCLUDE_SIMPLE + -D BOARD_HAS_PSRAM + -D ARDUINO_USB_MODE=1 + -D ARDUINO_USB_CDC_ON_BOOT=1 + -D LILYGO_S3_T_EMBED_CC1101=1 +lib_deps = + https://github.com/takkaO/OpenFontRender#v1.2 + bblanchon/ArduinoJson@^6.21.5 + https://github.com/tzapu/WiFiManager.git#v2.0.17 + mathertel/oneButton@^2.6.1 + arduino-libraries/NTPClient@^3.2.1 +lib_ignore = + HANSOLOminerv2 + +;-------------------------------------------------------------------- [env:ESP32-devKitv1] platform = espressif32@6.6.0 board = esp32dev diff --git a/src/drivers/devices/device.h b/src/drivers/devices/device.h index 49ec045f..e20c45b6 100644 --- a/src/drivers/devices/device.h +++ b/src/drivers/devices/device.h @@ -23,6 +23,8 @@ #include "lilygoS3Dongle.h" #elif defined(LILYGO_S3_T_EMBED) #include "lilygoS3TEmbed.h" +#elif defined(LILYGO_S3_T_EMBED_CC1101) +#include "lilygoS3TEmbedCC1101.h" #elif defined(ESP32_2432S028R) #include "esp322432s028r.h" #elif defined(ESP32_2432S028_2USB) // For another type of ESP32_2432S028 version with 2 USB connectors diff --git a/src/drivers/devices/lilygoS3TEmbedCC1101.h b/src/drivers/devices/lilygoS3TEmbedCC1101.h new file mode 100644 index 00000000..0ec2ccaa --- /dev/null +++ b/src/drivers/devices/lilygoS3TEmbedCC1101.h @@ -0,0 +1,10 @@ +#ifndef _LILYGO_S3_T_EMBED_CC1101_H +#define _LILYGO_S3_T_EMBED_CC1101_H + +#define PIN_BUTTON_1 0 +#define PIN_BUTTON_2 6 +#define PIN_ENABLE5V 15 + +#define T_DISPLAY + +#endif diff --git a/src/drivers/displays/tDisplayDriver.cpp b/src/drivers/displays/tDisplayDriver.cpp index 3bab4a28..c31115a0 100644 --- a/src/drivers/displays/tDisplayDriver.cpp +++ b/src/drivers/displays/tDisplayDriver.cpp @@ -27,7 +27,7 @@ void tDisplay_Init(void) #endif tft.init(); - #ifdef LILYGO_S3_T_EMBED + #if defined(LILYGO_S3_T_EMBED) || defined(LILYGO_S3_T_EMBED_CC1101) tft.setRotation(ROTATION_270); #else tft.setRotation(ROTATION_90);