diff --git a/src/main.cpp b/src/main.cpp index 0a3bcd3a0..c009b5096 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -400,11 +400,13 @@ void setup() pinMode(SDCARD_CS, OUTPUT); digitalWrite(SDCARD_CS, HIGH); pinMode(BOARD_BL_EN, OUTPUT); +#if !defined(T5_S3_EPAPER_PRO_V1) io.begin(Wire, PCA9535_ADDR, SDA, SCL); io.configPort(ExtensionIOXL9555::PORT0, 0x00); io.configPort(ExtensionIOXL9555::PORT1, 0xFF); io.digitalWrite(PCA9535_IO00_LORA_EN, HIGH); delay(100); +#endif #endif concurrency::hasBeenSetup = true; #if ARCH_PORTDUINO diff --git a/variants/esp32s3/t5s3_epaper/pins_arduino.h b/variants/esp32s3/t5s3_epaper/pins_arduino.h index a786213e8..4978cff2a 100644 --- a/variants/esp32s3/t5s3_epaper/pins_arduino.h +++ b/variants/esp32s3/t5s3_epaper/pins_arduino.h @@ -6,7 +6,24 @@ #define USB_VID 0x303a #define USB_PID 0x1001 -// The default Wire will be mapped to RTC and Touch +#if defined(T5_S3_EPAPER_PRO_V1) +// The default Wire will be mapped to RTC, Touch, BQ25896, and BQ27220 +static const uint8_t SDA = 6; +static const uint8_t SCL = 5; + +// Default SPI will be mapped to Radio +static const uint8_t SS = 46; +static const uint8_t MOSI = 17; +static const uint8_t MISO = 8; +static const uint8_t SCK = 18; + +#define SPI_MOSI (17) +#define SPI_SCK (18) +#define SPI_MISO (8) +#define SPI_CS (16) + +#else // T5_S3_EPAPER_PRO_V2 +// The default Wire will be mapped to RTC, Touch, PCA9535, BQ25896, and BQ27220 static const uint8_t SDA = 39; static const uint8_t SCL = 40; @@ -21,4 +38,6 @@ static const uint8_t SCK = 14; #define SPI_MISO (21) #define SPI_CS (12) +#endif + #endif /* Pins_Arduino_h */ diff --git a/variants/esp32s3/t5s3_epaper/platformio.ini b/variants/esp32s3/t5s3_epaper/platformio.ini index b65952be9..1a09099da 100644 --- a/variants/esp32s3/t5s3_epaper/platformio.ini +++ b/variants/esp32s3/t5s3_epaper/platformio.ini @@ -29,6 +29,7 @@ build_flags = build_src_filter = ${t5s3_epaper_base.build_src_filter} ${inkhud.build_src_filter} + -D SDCARD_USE_SPI1 lib_deps = ${inkhud.lib_deps} ; InkHUD libs first, so we get GFXRoot instead of AdafruitGFX ${t5s3_epaper_base.lib_deps} @@ -46,3 +47,4 @@ extends = t5s3_epaper_base build_flags = ${t5s3_epaper_base.build_flags} -D T5_S3_EPAPER_PRO_V2 + -D SDCARD_USE_SPI1 diff --git a/variants/esp32s3/t5s3_epaper/variant.h b/variants/esp32s3/t5s3_epaper/variant.h index 2f988dc5b..c96318338 100644 --- a/variants/esp32s3/t5s3_epaper/variant.h +++ b/variants/esp32s3/t5s3_epaper/variant.h @@ -1,7 +1,6 @@ // Display (E-Ink) ED047TC1 #define USE_EPD -#define BOARD_BL_EN 11 #define EP_I2C_PORT I2C_NUM_0 #define EP_SCL (40) #define EP_SDA (39) @@ -23,14 +22,25 @@ #define EPD_WIDTH 960 #define EPD_HEIGHT 540 +#if defined(T5_S3_EPAPER_PRO_V1) +#define BOARD_BL_EN 40 +#else +#define BOARD_BL_EN 11 +#endif + #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_SDA SDA +#define GT911_PIN_SCL SCL +#if defined(T5_S3_EPAPER_PRO_V1) +#define GT911_PIN_INT 15 +#define GT911_PIN_RST 41 +#else #define GT911_PIN_INT 3 #define GT911_PIN_RST 9 +#endif #define PCF85063_RTC 0x51 #define HAS_RTC 1 @@ -40,15 +50,16 @@ #define SLEEP_TIME 120 // GPS +#if !defined(T5_S3_EPAPER_PRO_V1) #define GPS_RX_PIN 44 #define GPS_TX_PIN 43 +#endif #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 @@ -62,6 +73,7 @@ #define BQ27220_I2C_SCL SCL #define BQ27220_DESIGN_CAPACITY 1500 +#if !defined(T5_S3_EPAPER_PRO_V1) // TPS651851 // PCA9535 IO extender @@ -77,21 +89,29 @@ #define PCA9535_IO15_TPS_WAKEUP 15 #define PCA9535_IO16_TPS_PWR_GOOD 16 #define PCA9535_IO17_TPS_INT 17 +#endif // LoRa #define USE_SX1262 #define USE_SX1268 -#define LORA_SCK 14 // 18 -#define LORA_MISO 21 // 8 -#define LORA_MOSI 13 // 17 +#define LORA_SCK SCK +#define LORA_MISO MISO +#define LORA_MOSI MOSI #define LORA_CS 46 #define LORA_DIO0 -1 +#if defined(T5_S3_EPAPER_PRO_V1) +#define LORA_RESET 43 +#define LORA_DIO1 3 // SX1262 IRQ +#define LORA_DIO2 44 // SX1262 BUSY +#define LORA_DIO3 +#else #define LORA_RESET 1 #define LORA_DIO1 10 // SX1262 IRQ #define LORA_DIO2 47 // SX1262 BUSY #define LORA_DIO3 +#endif #define SX126X_CS LORA_CS #define SX126X_DIO1 LORA_DIO1 @@ -99,41 +119,3 @@ #define SX126X_RESET LORA_RESET #define SX126X_DIO2_AS_RF_SWITCH #define SX126X_DIO3_TCXO_VOLTAGE 2.4 - -/* V1 - -#define BOARD_SCL (5) -#define BOARD_SDA (6) - -#define BOARD_SPI_MISO (8) -#define BOARD_SPI_MOSI (17) -#define BOARD_SPI_SCLK (18) - -#define BOARD_SD_MISO (BOARD_SPI_MISO) -#define BOARD_SD_MOSI (BOARD_SPI_MOSI) -#define BOARD_SD_SCLK (BOARD_SPI_SCLK) -#define BOARD_SD_CS (16) - -#define BOARD_LORA_MISO (BOARD_SPI_MISO) -#define BOARD_LORA_MOSI (BOARD_SPI_MOSI) -#define BOARD_LORA_SCLK (BOARD_SPI_SCLK) -#define BOARD_LORA_CS (46) -#define BOARD_LORA_IRQ (3) -#define BOARD_LORA_RST (43) -#define BOARD_LORA_BUSY (44) - -#define BOARD_TOUCH_SCL (BOARD_SCL) -#define BOARD_TOUCH_SDA (BOARD_SDA) -#define BOARD_TOUCH_INT (15) -#define BOARD_TOUCH_RST (41) - -#define BOARD_RTC_INT 7 -#define BOARD_RT_SCL (BOARD_SCL) -#define BOARD_RT_SDA (BOARD_SDA) - -#define BOARD_BL_EN (40) -#define BOARD_BATT_PIN (4) -#define BOARD_BOOT_BTN (0) -#define BOARD_KEY_BTN (48) - -*/ \ No newline at end of file