From 84654a09cb379553108ad16a49234f86d1b7d2cd Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Sat, 18 Oct 2025 20:51:49 +0200 Subject: [PATCH] update variant definitions --- .../t5_s3_epaper_pro/variant.cpp | 33 +++++++++++ variants/esp32s3/t5s3_epaper/pins_arduino.h | 5 +- variants/esp32s3/t5s3_epaper/platformio.ini | 16 +++-- variants/esp32s3/t5s3_epaper/variant.h | 58 ++++++++++++++----- 4 files changed, 83 insertions(+), 29 deletions(-) create mode 100644 src/platform/extra_variants/t5_s3_epaper_pro/variant.cpp diff --git a/src/platform/extra_variants/t5_s3_epaper_pro/variant.cpp b/src/platform/extra_variants/t5_s3_epaper_pro/variant.cpp new file mode 100644 index 000000000..943b8510d --- /dev/null +++ b/src/platform/extra_variants/t5_s3_epaper_pro/variant.cpp @@ -0,0 +1,33 @@ +#include "configuration.h" + +#ifdef T5_S3_EPAPER_PRO + +#include "input/TouchScreenImpl1.h" +#include +#include + +BBCapTouch bbct; + +bool readTouch(int16_t *x, int16_t *y) +{ + TOUCHINFO ti; + if (!digitalRead(GT911_PIN_INT)) { + if (bbct.getSamples(&ti)) { + *x = ti.x[0]; + *y = ti.y[0]; + return true; + } + } + return false; +} + +// T5-S3-ePaper Pro specific (late-) init +void lateInitVariant() +{ + bbct.init(GT911_PIN_SDA, GT911_PIN_SCL, GT911_PIN_RST, GT911_PIN_INT); + bbct.setOrientation(90, EPD_WIDTH, EPD_HEIGHT); + // FIXME: crashes! + // touchScreenImpl1 = new TouchScreenImpl1(EPD_WIDTH, EPD_HEIGHT, readTouch); + // touchScreenImpl1->init(); +} +#endif \ No newline at end of file diff --git a/variants/esp32s3/t5s3_epaper/pins_arduino.h b/variants/esp32s3/t5s3_epaper/pins_arduino.h index ccde8a5f9..1949124a6 100644 --- a/variants/esp32s3/t5s3_epaper/pins_arduino.h +++ b/variants/esp32s3/t5s3_epaper/pins_arduino.h @@ -16,12 +16,9 @@ static const uint8_t MOSI = 17; static const uint8_t MISO = 8; static const uint8_t SCK = 18; -// Default SPI1 will be mapped to SD Card #define SPI_MOSI (13) #define SPI_SCK (14) #define SPI_MISO (21) -#define SPI_CS (16) - -#define SDCARD_CS SPI_CS +#define SPI_CS (12) #endif /* Pins_Arduino_h */ diff --git a/variants/esp32s3/t5s3_epaper/platformio.ini b/variants/esp32s3/t5s3_epaper/platformio.ini index 93ae5f685..1eeb7f27d 100644 --- a/variants/esp32s3/t5s3_epaper/platformio.ini +++ b/variants/esp32s3/t5s3_epaper/platformio.ini @@ -9,13 +9,9 @@ build_flags = ${esp32_base.build_flags} ${inkhud.build_flags} -I variants/esp32s3/t5s3_epaper + -D T5_S3_EPAPER_PRO -D PRIVATE_HW - -D MESHTASTIC_EXCLUDE_I2C=1 - -D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1 -; -D GPS_POWER_TOGGLE - -D HAS_SDCARD - -D SDCARD_USE_SPI1 - -D PCF8563_RTC=0x51 + -D GPS_POWER_TOGGLE build_src_filter = ${esp32s3_base.build_src_filter} @@ -24,6 +20,8 @@ build_src_filter = lib_deps = ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX ${esp32s3_base.lib_deps} - lewisxhe/PCF8563_Library@^1.0.1 - lewisxhe/XPowersLib@^0.2.3 - lewisxhe/SensorLib@^0.2.2 \ No newline at end of file + https://github.com/Xinyuan-LilyGO/LilyGo-EPD47 + https://github.com/mverch67/BQ27220/archive/07d92be846abd8a0258a50c23198dac0858b22ed.zip + https://github.com/bitbank2/bb_captouch/archive/refs/tags/1.3.1.zip + lewisxhe/XPowersLib@0.3.1 + lewisxhe/SensorLib@0.3.1 \ No newline at end of file diff --git a/variants/esp32s3/t5s3_epaper/variant.h b/variants/esp32s3/t5s3_epaper/variant.h index dcf438973..e5f3fa127 100644 --- a/variants/esp32s3/t5s3_epaper/variant.h +++ b/variants/esp32s3/t5s3_epaper/variant.h @@ -11,39 +11,65 @@ #define EPD_WIDTH 960 #define EPD_HEIGHT 540 -// TODO: battery voltage measurement (I2C) -// BQ25896 -// BQ27220 +#define I2C_SDA SDA +#define I2C_SCL SCL -// #define I2C_SDA SDA -// #define I2C_SCL SCL +#define HAS_TOUCHSCREEN 1 +#define GT911_PIN_SDA 39 +#define GT911_PIN_SCL 40 +#define GT911_PIN_INT 15 +#define GT911_PIN_RST 41 + +#define PCF85063_RTC 0x51 +#define HAS_RTC 1 + +#define USE_POWERSAVE +#define SLEEP_TIME 120 // optional GPS #define GPS_DEFAULT_NOT_PRESENT 1 -// #define GPS_RX_PIN 43 -// #define GPS_TX_PIN 44 +#define GPS_RX_PIN 44 +#define GPS_TX_PIN 43 #define BUTTON_PIN 48 #define BUTTON_PIN_SECONDARY 0 +// SD card +#define HAS_SDCARD +#define SDCARD_USE_SPI1 +#define SDCARD_CS SPI_CS +#define SD_SPI_FREQUENCY 75000000U + +// 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 1500 + +// TPS651851 + +// LoRa #define USE_SX1262 +#define USE_SX1268 + #define LORA_SCK 18 #define LORA_MISO 8 #define LORA_MOSI 17 #define LORA_CS 46 + +#define LORA_DIO0 -1 #define LORA_RESET 1 +#define LORA_DIO1 10 // SX1262 IRQ +#define LORA_DIO2 47 // SX1262 BUSY +#define LORA_DIO3 -#define LORA_DIO0 -#define LORA_DIO1 10 -#define LORA_DIO2 -#define LORA_RXEN NC -#define LORA_TXEN NC - -#ifdef USE_SX1262 #define SX126X_CS LORA_CS #define SX126X_DIO1 LORA_DIO1 -#define SX126X_BUSY 47 +#define SX126X_BUSY LORA_DIO2 #define SX126X_RESET LORA_RESET #define SX126X_DIO2_AS_RF_SWITCH #define SX126X_DIO3_TCXO_VOLTAGE 2.4 -#endif