From 2c8dec2fbdaea2860851841a0fbd38eb129da13c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 19:48:07 -0500 Subject: [PATCH 1/8] Update meshtastic/device-ui digest to 56e1da4 (#10195) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 3cd0cc9d0..4d66cf538 100644 --- a/platformio.ini +++ b/platformio.ini @@ -126,7 +126,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/5305670b68eb5b92d14e62b5b536969ca4bb441f.zip + https://github.com/meshtastic/device-ui/archive/56e1da4e7d30abcd746a2092a30e422f8cf5fc2b.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From d31d0f85fe789649e292478ea426ea29e2744b19 Mon Sep 17 00:00:00 2001 From: lewisxhe Date: Wed, 21 Jan 2026 17:33:50 +0800 Subject: [PATCH 2/8] Added compatibility with LilyGo T-Deck-Pro V1.1 --- src/detect/ScanI2C.h | 3 +- src/detect/ScanI2CTwoWire.cpp | 26 +++- src/graphics/EInkDisplay2.cpp | 3 + src/main.cpp | 60 +++++++++ .../extra_variants/t_deck_pro/variant.cpp | 116 +++++++++++++++++- .../esp32s3/t-deck-pro-v1_1/pins_arduino.h | 19 +++ .../esp32s3/t-deck-pro-v1_1/platformio.ini | 41 +++++++ variants/esp32s3/t-deck-pro-v1_1/variant.h | 106 ++++++++++++++++ 8 files changed, 367 insertions(+), 7 deletions(-) create mode 100644 variants/esp32s3/t-deck-pro-v1_1/pins_arduino.h create mode 100644 variants/esp32s3/t-deck-pro-v1_1/platformio.ini create mode 100644 variants/esp32s3/t-deck-pro-v1_1/variant.h diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index cc83a8d7b..5eb9217cc 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -94,7 +94,8 @@ class ScanI2C SFA30, CW2015, SCD30, - ADS1115 + ADS1115, + CST3530, } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 2e00c11ce..e992fb276 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -585,7 +585,31 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) SCAN_SIMPLE_CASE(PCT2075_ADDR, PCT2075, "PCT2075", (uint8_t)addr.address); SCAN_SIMPLE_CASE(SCD30_ADDR, SCD30, "SCD30", (uint8_t)addr.address); case CST328_ADDR: - // Do we have the CST328 or the CST226SE + // Do we have the CST328 or the CST226SE,CST3530 + { + // T-Deck pro V1.1 new touch panel use CST3530 + int retry = 5; + while (retry--) { + uint8_t buffer[7]; + uint8_t r_cmd[] = {0x0d0, 0x03, 0x00, 0x00}; + i2cBus->beginTransmission(addr.address); + i2cBus->write(r_cmd, sizeof(r_cmd)); + if (i2cBus->endTransmission() == 0) { + i2cBus->requestFrom((int)addr.address, 7); + i2cBus->readBytes(buffer, 7); + if (buffer[2] == 0xCA && buffer[3] == 0xCA) { + logFoundDevice("CST3530", (uint8_t)addr.address); + type = CST3530; + break; + } + } + uint8_t cmd1[] = {0xD0, 0x00, 0x04, 0x00}; + i2cBus->beginTransmission(addr.address); + i2cBus->write(cmd1, sizeof(cmd1)); + i2cBus->endTransmission(); + delay(50); + } + } registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xAB), 1); if (registerValue == 0xA9) { type = CST226SE; diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index 704487bc8..96321f9c4 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -104,8 +104,11 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit) // End the update process - virtual method, overridden in derived class void EInkDisplay::endUpdate() { +#ifndef EINK_NOT_HIBERNATE // Power off display hardware, then deep-sleep (Except Wireless Paper V1.1, no deep-sleep) adafruitDisplay->hibernate(); +#endif + } // Write the buffer to the display memory diff --git a/src/main.cpp b/src/main.cpp index 6f78c0b96..cc7d25ed9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -343,6 +343,66 @@ void setup() digitalWrite(BLE_LED, LED_STATE_OFF); #endif +#if defined(T_DECK) + // GPIO10 manages all peripheral power supplies + // Turn on peripheral power immediately after MUC starts. + // If some boards are turned on late, ESP32 will reset due to low voltage. + // ESP32-C3(Keyboard) , MAX98357A(Audio Power Amplifier) , + // TF Card , Display backlight(AW9364DNR) , AN48841B(Trackball) , ES7210(Decoder) + pinMode(KB_POWERON, OUTPUT); + digitalWrite(KB_POWERON, HIGH); + // T-Deck has all three SPI peripherals (TFT, SD, LoRa) attached to the same SPI bus + // We need to initialize all CS pins in advance otherwise there will be SPI communication issues + // e.g. when detecting the SD card + pinMode(LORA_CS, OUTPUT); + digitalWrite(LORA_CS, HIGH); + pinMode(SDCARD_CS, OUTPUT); + digitalWrite(SDCARD_CS, HIGH); + pinMode(TFT_CS, OUTPUT); + digitalWrite(TFT_CS, HIGH); + delay(100); +#elif defined(T_DECK_PRO) + pinMode(LORA_EN, OUTPUT); + digitalWrite(LORA_EN, HIGH); + pinMode(LORA_CS, OUTPUT); + digitalWrite(LORA_CS, HIGH); + pinMode(SDCARD_CS, OUTPUT); + digitalWrite(SDCARD_CS, HIGH); + pinMode(PIN_EINK_CS, OUTPUT); + digitalWrite(PIN_EINK_CS, HIGH); + pinMode(PIN_EINK_RES, OUTPUT); + digitalWrite(PIN_EINK_RES, HIGH); + pinMode(CST328_PIN_RST, OUTPUT); + digitalWrite(CST328_PIN_RST, HIGH); +#elif defined(T_LORA_PAGER) + pinMode(LORA_CS, OUTPUT); + digitalWrite(LORA_CS, HIGH); + pinMode(SDCARD_CS, OUTPUT); + digitalWrite(SDCARD_CS, HIGH); + pinMode(TFT_CS, OUTPUT); + digitalWrite(TFT_CS, HIGH); + pinMode(KB_INT, INPUT_PULLUP); + // io expander + io.begin(Wire, XL9555_SLAVE_ADDRESS0, SDA, SCL); + io.pinMode(EXPANDS_DRV_EN, OUTPUT); + io.digitalWrite(EXPANDS_DRV_EN, HIGH); + io.pinMode(EXPANDS_AMP_EN, OUTPUT); + io.digitalWrite(EXPANDS_AMP_EN, LOW); + io.pinMode(EXPANDS_LORA_EN, OUTPUT); + io.digitalWrite(EXPANDS_LORA_EN, HIGH); + io.pinMode(EXPANDS_GPS_EN, OUTPUT); + io.digitalWrite(EXPANDS_GPS_EN, HIGH); + io.pinMode(EXPANDS_KB_EN, OUTPUT); + io.digitalWrite(EXPANDS_KB_EN, HIGH); + io.pinMode(EXPANDS_SD_EN, OUTPUT); + io.digitalWrite(EXPANDS_SD_EN, HIGH); + io.pinMode(EXPANDS_GPIO_EN, OUTPUT); + io.digitalWrite(EXPANDS_GPIO_EN, HIGH); + io.pinMode(EXPANDS_SD_PULLEN, INPUT); +#elif defined(HACKADAY_COMMUNICATOR) + pinMode(KB_INT, INPUT); +#endif + concurrency::hasBeenSetup = true; #if HAS_SCREEN meshtastic_Config_DisplayConfig_OledType screen_model = diff --git a/src/platform/extra_variants/t_deck_pro/variant.cpp b/src/platform/extra_variants/t_deck_pro/variant.cpp index eae9335ce..77fba53b9 100644 --- a/src/platform/extra_variants/t_deck_pro/variant.cpp +++ b/src/platform/extra_variants/t_deck_pro/variant.cpp @@ -8,20 +8,126 @@ CSE_CST328 tsPanel = CSE_CST328(EINK_WIDTH, EINK_HEIGHT, &Wire, CST328_PIN_RST, CST328_PIN_INT); +static bool is_cst3530 = false; +volatile bool touch_isr = false; +#define CST3530_ADDR 0x1A + +bool read_cst3530_touch(int16_t *x, int16_t *y) { + uint8_t buffer[9] = {0}; + uint8_t r_cmd[] = {0xD0, 0x07, 0x00, 0x00}; + uint8_t clear_cmd[] = {0xD0, 0x00, 0x02, 0xAB}; + + Wire.beginTransmission(CST3530_ADDR); + Wire.write(r_cmd, sizeof(r_cmd)); + if (Wire.endTransmission() != 0) { + LOG_DEBUG("CST3530 I2C send addr failed"); + return false; + } + + int read_len = Wire.requestFrom((int)CST3530_ADDR, sizeof(buffer)); + if (read_len != sizeof(buffer)) { + LOG_DEBUG("CST3530 read len error: %d (expect 9)", read_len); + return false; + } + int actual_read = Wire.readBytes(buffer, sizeof(buffer)); + if (actual_read != sizeof(buffer)) { + LOG_DEBUG("CST3530 read bytes error: %d (expect 9)", actual_read); + return false; + } + + uint8_t report_typ = buffer[2]; + if (report_typ != 0xFF) { + return false; + } + + uint8_t touch_points = buffer[3] & 0x0F; + if (touch_points == 0 || touch_points > 1) { + LOG_DEBUG("CST3530 touch points invalid: %d", touch_points); + return false; + } + + *x = buffer[4] + ((uint16_t)(buffer[7] & 0x0F) << 8); + *y = buffer[5] + ((uint16_t)(buffer[7] & 0xF0) << 4); + + // LOG_DEBUG("CST3530 touch: num:%d x=%d,y=%d", touch_points, *x, *y); + + Wire.beginTransmission(CST3530_ADDR); + Wire.write(clear_cmd, sizeof(clear_cmd)); + if (Wire.endTransmission() != 0) { + LOG_DEBUG("CST3530 clear cmd failed"); + } + + return true; +} + bool readTouch(int16_t *x, int16_t *y) { - if (tsPanel.getTouches()) { - *x = tsPanel.getPoint(0).x; - *y = tsPanel.getPoint(0).y; - return true; + + if(is_cst3530){ + if(touch_isr){ + touch_isr = false; + return read_cst3530_touch(x, y); + } + return false; + }else{ + if (tsPanel.getTouches()) { + *x = tsPanel.getPoint(0).x; + *y = tsPanel.getPoint(0).y; + return true; + } } return false; } + +static void touchInterruptHandler(){ + touch_isr = true; +} + // T-Deck Pro specific init void lateInitVariant() { - tsPanel.begin(); + // Reset touch + pinMode(CST328_PIN_RST, OUTPUT); + digitalWrite(CST328_PIN_RST, HIGH); + delay(20); + digitalWrite(CST328_PIN_RST, LOW); + delay(80); + digitalWrite(CST328_PIN_RST, HIGH); + delay(20); + + int retry = 5; + uint8_t buffer[7]; + uint8_t r_cmd[] = {0x0d0,0x03,0x00,0x00}; + + // Probe touch chip + while(retry--) { + Wire.beginTransmission(CST3530_ADDR); + Wire.write(r_cmd, sizeof(r_cmd)); + if(Wire.endTransmission() == 0){ + Wire.requestFrom((int)CST3530_ADDR,7); + Wire.readBytes(buffer,7); + if(buffer[2] == 0xCA && buffer[3] == 0xCA){ + LOG_DEBUG("CST3530 detected"); + is_cst3530 = true; + + // The CST3530 will automatically enter sleep mode; + // polling should not be used, but rather an interrupt method should be employed. + pinMode(CST328_PIN_INT, INPUT); + attachInterrupt(digitalPinToInterrupt(CST328_PIN_INT), touchInterruptHandler, FALLING); + + break; + }else{ + LOG_DEBUG("CST3530 not response ~!"); + } + } + uint8_t cmd1[] = {0xD0,0x00,0x04,0x00}; + Wire.beginTransmission(CST3530_ADDR); + Wire.write(cmd1, sizeof(cmd1)); + Wire.endTransmission(); + delay(50); + } + touchScreenImpl1 = new TouchScreenImpl1(EINK_WIDTH, EINK_HEIGHT, readTouch); touchScreenImpl1->init(); } diff --git a/variants/esp32s3/t-deck-pro-v1_1/pins_arduino.h b/variants/esp32s3/t-deck-pro-v1_1/pins_arduino.h new file mode 100644 index 000000000..af0ba80b3 --- /dev/null +++ b/variants/esp32s3/t-deck-pro-v1_1/pins_arduino.h @@ -0,0 +1,19 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +// used for keyboard, touch controller, beam sensor, and gyroscope +static const uint8_t SDA = 13; +static const uint8_t SCL = 14; + +// Default SPI will be mapped to Radio +static const uint8_t SS = 3; +static const uint8_t MOSI = 33; +static const uint8_t MISO = 47; +static const uint8_t SCK = 36; + +#endif /* Pins_Arduino_h */ diff --git a/variants/esp32s3/t-deck-pro-v1_1/platformio.ini b/variants/esp32s3/t-deck-pro-v1_1/platformio.ini new file mode 100644 index 000000000..b76522934 --- /dev/null +++ b/variants/esp32s3/t-deck-pro-v1_1/platformio.ini @@ -0,0 +1,41 @@ +[env:t-deck-pro-v1_1] +custom_meshtastic_hw_model = 102 +custom_meshtastic_hw_model_slug = T_DECK_PRO +custom_meshtastic_architecture = esp32-s3 +custom_meshtastic_actively_supported = true +custom_meshtastic_support_level = 1 +custom_meshtastic_display_name = LILYGO T-Deck Pro +custom_meshtastic_images = tdeck_pro.svg +custom_meshtastic_tags = LilyGo +custom_meshtastic_requires_dfu = true +custom_meshtastic_partition_scheme = 16MB + +extends = esp32s3_base +board = t-deck-pro +board_check = true +upload_protocol = esptool + +build_flags = + ${esp32s3_base.build_flags} -I variants/esp32s3/t-deck-pro-v1_1 + -D T_DECK_PRO + -D USE_EINK + -D EINK_DISPLAY_MODEL=GxEPD2_310_GDEQ031T10 + -D EINK_WIDTH=240 + -D EINK_HEIGHT=320 + ;-D USE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk + -D EINK_LIMIT_FASTREFRESH=10 ; How many consecutive fast-refreshes are permitted + -D EINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated + -D EINK_NOT_HIBERNATE ; Disable hibernate to avoid issues with elink + +lib_deps = + ${esp32s3_base.lib_deps} + # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 + zinggjm/GxEPD2@1.6.5 + # renovate: datasource=git-refs depName=CSE_Touch packageName=https://github.com/CIRCUITSTATE/CSE_Touch gitBranch=main + https://github.com/CIRCUITSTATE/CSE_Touch/archive/b44f23b6f870b848f1fbe453c190879bc6cfaafa.zip + # renovate: datasource=github-tags depName=CSE_CST328 packageName=CIRCUITSTATE/CSE_CST328 + https://github.com/CIRCUITSTATE/CSE_CST328/archive/refs/tags/v0.0.4.zip + # renovate: datasource=git-refs depName=BQ27220 packageName=https://github.com/mverch67/BQ27220 gitBranch=main + https://github.com/mverch67/BQ27220/archive/07d92be846abd8a0258a50c23198dac0858b22ed.zip + # renovate: datasource=custom.pio depName=Adafruit DRV2605 packageName=adafruit/library/Adafruit DRV2605 Library + adafruit/Adafruit DRV2605 Library@1.2.4 diff --git a/variants/esp32s3/t-deck-pro-v1_1/variant.h b/variants/esp32s3/t-deck-pro-v1_1/variant.h new file mode 100644 index 000000000..8584fd8a1 --- /dev/null +++ b/variants/esp32s3/t-deck-pro-v1_1/variant.h @@ -0,0 +1,106 @@ +// Display (E-Ink) +#define PIN_EINK_CS 34 +#define PIN_EINK_BUSY 37 +#define PIN_EINK_DC 35 +#define PIN_EINK_RES 16 +#define PIN_EINK_SCLK 36 +#define PIN_EINK_MOSI 47 +#define TFT_BL 45 // option , default not backlight + +#define I2C_SDA SDA +#define I2C_SCL SCL + +// CST328 touch screen (implementation in src/platform/extra_variants/t_deck_pro/variant.cpp) +#define HAS_TOUCHSCREEN 1 +#define CST328_PIN_INT 12 +#define CST328_PIN_RST 38 + +#define USE_POWERSAVE +#define SLEEP_TIME 120 + +// GNNS +#define HAS_GPS 1 +#define GPS_BAUDRATE 38400 +#define PIN_GPS_EN 39 +#define GPS_EN_ACTIVE 1 +#define GPS_RX_PIN 44 +#define GPS_TX_PIN 43 +#define PIN_GPS_PPS 1 + +#define BUTTON_PIN 0 + +// vibration motor +#define HAS_DRV2605 +#define PIN_DRV_EN 2 + +// Have SPI interface SD card slot +#define HAS_SDCARD +#define SDCARD_USE_SPI1 +#define SPI_MOSI (33) +#define SPI_SCK (36) +#define SPI_MISO (47) +#define SPI_CS (48) +#define SDCARD_CS SPI_CS +#define SD_SPI_FREQUENCY 75000000U + +// TCA8418 keyboard +#define KB_BL_PIN 42 +#define CANNED_MESSAGE_MODULE_ENABLE 1 + +// microphone PCM5102A +#define PCM5102A_SCK 47 +#define PCM5102A_DIN 17 +#define PCM5102A_LRCK 18 + +// LTR_553ALS light sensor +#define HAS_LTR553ALS + +// gyroscope BHI260AP +// #define BOARD_1V8_EN 38 //Deck-Pro remove 1.8v en pin +#define HAS_BHI260AP + +// battery charger BQ25896 +#define HAS_PPM 1 +#define XPOWERS_CHIP_BQ25896 + +// battery quality management BQ27220 +#define HAS_BQ27220 1 +#define BQ27220_I2C_SDA SDA +#define BQ27220_I2C_SCL SCL +#define BQ27220_DESIGN_CAPACITY 1400 + +// LoRa +#define USE_SX1262 +#define USE_SX1268 + +#define LORA_EN 46 // LoRa enable pin +#define LORA_SCK 36 +#define LORA_MISO 47 +#define LORA_MOSI 33 +#define LORA_CS 3 + +#define LORA_DIO0 -1 // a No connect on the SX1262 module +#define LORA_RESET 4 +#define LORA_DIO1 5 // SX1262 IRQ +#define LORA_DIO2 6 // SX1262 BUSY +#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled + +#define SX126X_CS LORA_CS // FIXME - we really should define LORA_CS instead +#define SX126X_DIO1 LORA_DIO1 +#define SX126X_BUSY LORA_DIO2 +#define SX126X_RESET LORA_RESET +// Not really an E22 but TTGO seems to be trying to clone that +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 2.4 +// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface +// code) + +#define MODEM_POWER_EN 41 +#define MODEM_PWRKEY 40 +#define MODEM_RST 9 +#define MODEM_RI 7 +#define MODEM_DTR 8 +#define MODEM_RX 10 +#define MODEM_TX 11 + +#define HAS_PHYSICAL_KEYBOARD 1 \ No newline at end of file From d0cd8ec366402e260df6761220eeb71bacea5d91 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 07:48:19 -0500 Subject: [PATCH 3/8] Update variants/esp32s3/t-deck-pro-v1_1/variant.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- variants/esp32s3/t-deck-pro-v1_1/variant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/esp32s3/t-deck-pro-v1_1/variant.h b/variants/esp32s3/t-deck-pro-v1_1/variant.h index 8584fd8a1..af761d64d 100644 --- a/variants/esp32s3/t-deck-pro-v1_1/variant.h +++ b/variants/esp32s3/t-deck-pro-v1_1/variant.h @@ -18,7 +18,7 @@ #define USE_POWERSAVE #define SLEEP_TIME 120 -// GNNS +// GNSS #define HAS_GPS 1 #define GPS_BAUDRATE 38400 #define PIN_GPS_EN 39 From 2beebea453a0e6e7cc82cad6769eb528ff0792fa Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 07:48:35 -0500 Subject: [PATCH 4/8] Update src/platform/extra_variants/t_deck_pro/variant.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/platform/extra_variants/t_deck_pro/variant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/extra_variants/t_deck_pro/variant.cpp b/src/platform/extra_variants/t_deck_pro/variant.cpp index 77fba53b9..ff8e34ebd 100644 --- a/src/platform/extra_variants/t_deck_pro/variant.cpp +++ b/src/platform/extra_variants/t_deck_pro/variant.cpp @@ -80,7 +80,7 @@ bool readTouch(int16_t *x, int16_t *y) } -static void touchInterruptHandler(){ +static void IRAM_ATTR touchInterruptHandler(){ touch_isr = true; } From 84bb90943721bb399ee41e798aaa5f277e8fb5f8 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 07:48:50 -0500 Subject: [PATCH 5/8] Update variants/esp32s3/t-deck-pro-v1_1/platformio.ini Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- variants/esp32s3/t-deck-pro-v1_1/platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/esp32s3/t-deck-pro-v1_1/platformio.ini b/variants/esp32s3/t-deck-pro-v1_1/platformio.ini index b76522934..1a9b20f76 100644 --- a/variants/esp32s3/t-deck-pro-v1_1/platformio.ini +++ b/variants/esp32s3/t-deck-pro-v1_1/platformio.ini @@ -30,7 +30,7 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 - zinggjm/GxEPD2@1.6.5 + zinggjm/GxEPD2@1.6.8 # renovate: datasource=git-refs depName=CSE_Touch packageName=https://github.com/CIRCUITSTATE/CSE_Touch gitBranch=main https://github.com/CIRCUITSTATE/CSE_Touch/archive/b44f23b6f870b848f1fbe453c190879bc6cfaafa.zip # renovate: datasource=github-tags depName=CSE_CST328 packageName=CIRCUITSTATE/CSE_CST328 From 9e26cc3795365251b2d4dbc32c46a1a9cbe964fb Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 07:49:08 -0500 Subject: [PATCH 6/8] Update src/main.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index cc7d25ed9..76b9bb13a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -370,8 +370,10 @@ void setup() digitalWrite(SDCARD_CS, HIGH); pinMode(PIN_EINK_CS, OUTPUT); digitalWrite(PIN_EINK_CS, HIGH); +#if PIN_EINK_RES >= 0 pinMode(PIN_EINK_RES, OUTPUT); digitalWrite(PIN_EINK_RES, HIGH); +#endif pinMode(CST328_PIN_RST, OUTPUT); digitalWrite(CST328_PIN_RST, HIGH); #elif defined(T_LORA_PAGER) From a277108c842fe4f97a1ed09938d295f6c777934c Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 07:49:34 -0500 Subject: [PATCH 7/8] Update src/graphics/EInkDisplay2.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/graphics/EInkDisplay2.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index 96321f9c4..28b956bb1 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -105,10 +105,12 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit) void EInkDisplay::endUpdate() { #ifndef EINK_NOT_HIBERNATE - // Power off display hardware, then deep-sleep (Except Wireless Paper V1.1, no deep-sleep) + // By default, power off the E-Ink display hardware and enter hibernate(). + // Boards/panels that define EINK_NOT_HIBERNATE intentionally skip this step. + // Skipping hibernate() can help avoid panel-specific wake/refresh or ghosting issues, + // but it typically trades lower power savings for that compatibility. adafruitDisplay->hibernate(); #endif - } // Write the buffer to the display memory From e589de2d6e86cede7890acc468d9e1693190695f Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 18 Apr 2026 11:12:05 -0500 Subject: [PATCH 8/8] Tronk --- .../extra_variants/t_deck_pro/variant.cpp | 45 ++++++++++--------- variants/esp32s3/t-deck-pro-v1_1/variant.h | 2 +- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/platform/extra_variants/t_deck_pro/variant.cpp b/src/platform/extra_variants/t_deck_pro/variant.cpp index ff8e34ebd..2915ff363 100644 --- a/src/platform/extra_variants/t_deck_pro/variant.cpp +++ b/src/platform/extra_variants/t_deck_pro/variant.cpp @@ -10,13 +10,14 @@ CSE_CST328 tsPanel = CSE_CST328(EINK_WIDTH, EINK_HEIGHT, &Wire, CST328_PIN_RST, static bool is_cst3530 = false; volatile bool touch_isr = false; -#define CST3530_ADDR 0x1A +#define CST3530_ADDR 0x1A -bool read_cst3530_touch(int16_t *x, int16_t *y) { +bool read_cst3530_touch(int16_t *x, int16_t *y) +{ uint8_t buffer[9] = {0}; uint8_t r_cmd[] = {0xD0, 0x07, 0x00, 0x00}; - uint8_t clear_cmd[] = {0xD0, 0x00, 0x02, 0xAB}; - + uint8_t clear_cmd[] = {0xD0, 0x00, 0x02, 0xAB}; + Wire.beginTransmission(CST3530_ADDR); Wire.write(r_cmd, sizeof(r_cmd)); if (Wire.endTransmission() != 0) { @@ -41,13 +42,13 @@ bool read_cst3530_touch(int16_t *x, int16_t *y) { } uint8_t touch_points = buffer[3] & 0x0F; - if (touch_points == 0 || touch_points > 1) { + if (touch_points == 0 || touch_points > 1) { LOG_DEBUG("CST3530 touch points invalid: %d", touch_points); return false; } - *x = buffer[4] + ((uint16_t)(buffer[7] & 0x0F) << 8); - *y = buffer[5] + ((uint16_t)(buffer[7] & 0xF0) << 4); + *x = buffer[4] + ((uint16_t)(buffer[7] & 0x0F) << 8); + *y = buffer[5] + ((uint16_t)(buffer[7] & 0xF0) << 4); // LOG_DEBUG("CST3530 touch: num:%d x=%d,y=%d", touch_points, *x, *y); @@ -63,13 +64,13 @@ bool read_cst3530_touch(int16_t *x, int16_t *y) { bool readTouch(int16_t *x, int16_t *y) { - if(is_cst3530){ - if(touch_isr){ + if (is_cst3530) { + if (touch_isr) { touch_isr = false; return read_cst3530_touch(x, y); } return false; - }else{ + } else { if (tsPanel.getTouches()) { *x = tsPanel.getPoint(0).x; *y = tsPanel.getPoint(0).y; @@ -79,8 +80,8 @@ bool readTouch(int16_t *x, int16_t *y) return false; } - -static void IRAM_ATTR touchInterruptHandler(){ +static void IRAM_ATTR touchInterruptHandler() +{ touch_isr = true; } @@ -98,30 +99,30 @@ void lateInitVariant() int retry = 5; uint8_t buffer[7]; - uint8_t r_cmd[] = {0x0d0,0x03,0x00,0x00}; + uint8_t r_cmd[] = {0x0d0, 0x03, 0x00, 0x00}; // Probe touch chip - while(retry--) { + while (retry--) { Wire.beginTransmission(CST3530_ADDR); Wire.write(r_cmd, sizeof(r_cmd)); - if(Wire.endTransmission() == 0){ - Wire.requestFrom((int)CST3530_ADDR,7); - Wire.readBytes(buffer,7); - if(buffer[2] == 0xCA && buffer[3] == 0xCA){ + if (Wire.endTransmission() == 0) { + Wire.requestFrom((int)CST3530_ADDR, 7); + Wire.readBytes(buffer, 7); + if (buffer[2] == 0xCA && buffer[3] == 0xCA) { LOG_DEBUG("CST3530 detected"); is_cst3530 = true; - // The CST3530 will automatically enter sleep mode; - // polling should not be used, but rather an interrupt method should be employed. + // The CST3530 will automatically enter sleep mode; + // polling should not be used, but rather an interrupt method should be employed. pinMode(CST328_PIN_INT, INPUT); attachInterrupt(digitalPinToInterrupt(CST328_PIN_INT), touchInterruptHandler, FALLING); break; - }else{ + } else { LOG_DEBUG("CST3530 not response ~!"); } } - uint8_t cmd1[] = {0xD0,0x00,0x04,0x00}; + uint8_t cmd1[] = {0xD0, 0x00, 0x04, 0x00}; Wire.beginTransmission(CST3530_ADDR); Wire.write(cmd1, sizeof(cmd1)); Wire.endTransmission(); diff --git a/variants/esp32s3/t-deck-pro-v1_1/variant.h b/variants/esp32s3/t-deck-pro-v1_1/variant.h index af761d64d..d7accfe82 100644 --- a/variants/esp32s3/t-deck-pro-v1_1/variant.h +++ b/variants/esp32s3/t-deck-pro-v1_1/variant.h @@ -5,7 +5,7 @@ #define PIN_EINK_RES 16 #define PIN_EINK_SCLK 36 #define PIN_EINK_MOSI 47 -#define TFT_BL 45 // option , default not backlight +#define TFT_BL 45 // option , default not backlight #define I2C_SDA SDA #define I2C_SCL SCL