Skip to content

Commit

Permalink
[ESP32-S3] build infra for T3-S3-EPD
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Jun 3, 2024
1 parent dfdf24c commit aa8de4f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions software/firmware/source/SoftRF/SoftRF.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ enum
SOFTRF_MODEL_BALKAN,
SOFTRF_MODEL_HAM,
SOFTRF_MODEL_MIDI,
SOFTRF_MODEL_ECO,
SOFTRF_MODEL_INK,
SOFTRF_MODEL_NEO,
};

enum
Expand Down
32 changes: 32 additions & 0 deletions software/firmware/source/SoftRF/src/platform/ESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,9 @@ static void ESP32_setup()
esp32_board = ESP32_HELTEC_TRACKER;
hw_info.model = SOFTRF_MODEL_MIDI;
break;
case MakeFlashId(ST_ID, XMC_XM25QH32B):
esp32_board = ESP32_LILYGO_T3S3_EPD; /* ESP32-S3-MINI-1U */
break;
default:
esp32_board = ESP32_S3_DEVKIT;
break;
Expand Down Expand Up @@ -1295,6 +1298,23 @@ static void ESP32_setup()
#if defined(USE_RADIOLIB)
lmic_pins.dio[0] = SOC_GPIO_PIN_HELTRK_DIO1;
#endif /* USE_RADIOLIB */

} else if (esp32_board == ESP32_LILYGO_T3S3_EPD) {

#if ARDUINO_USB_CDC_ON_BOOT
SerialOutput.begin(SERIAL_OUT_BR, SERIAL_OUT_BITS,
SOC_GPIO_PIN_T3S3_CONS_RX,
SOC_GPIO_PIN_T3S3_CONS_TX);
#endif /* ARDUINO_USB_CDC_ON_BOOT */

lmic_pins.nss = SOC_GPIO_PIN_T3S3_SS;
lmic_pins.rst = SOC_GPIO_PIN_T3S3_RST;
lmic_pins.busy = SOC_GPIO_PIN_T3S3_BUSY;
lmic_pins.txe = SOC_GPIO_PIN_T3S3_ANT_TX;
lmic_pins.rxe = SOC_GPIO_PIN_T3S3_ANT_RX;
#if defined(USE_RADIOLIB)
lmic_pins.dio[0] = SOC_GPIO_PIN_T3S3_DIO1;
#endif /* USE_RADIOLIB */
#endif /* CONFIG_IDF_TARGET_ESP32S3 */

#if defined(CONFIG_IDF_TARGET_ESP32C2)
Expand Down Expand Up @@ -3042,6 +3062,10 @@ static void ESP32_SPI_begin()
SPI.begin(SOC_GPIO_PIN_T3C6_SCK, SOC_GPIO_PIN_T3C6_MISO,
SOC_GPIO_PIN_T3C6_MOSI, SOC_GPIO_PIN_T3C6_SS);
break;
case ESP32_LILYGO_T3S3_EPD:
SPI.begin(SOC_GPIO_PIN_T3S3_SCK, SOC_GPIO_PIN_T3S3_MISO,
SOC_GPIO_PIN_T3S3_MOSI, SOC_GPIO_PIN_T3S3_SS);
break;
default:
SPI.begin(SOC_GPIO_PIN_SCK, SOC_GPIO_PIN_MISO,
SOC_GPIO_PIN_MOSI, SOC_GPIO_PIN_SS);
Expand Down Expand Up @@ -3135,6 +3159,10 @@ static void ESP32_swSer_begin(unsigned long baud)
Serial.println(F("INFO: LilyGO T3-C6 is detected."));
Serial_GNSS_In.begin(baud, SERIAL_IN_BITS,
SOC_GPIO_PIN_T3C6_GNSS_RX, SOC_GPIO_PIN_T3C6_GNSS_TX);
} else if (esp32_board == ESP32_LILYGO_T3S3_EPD) {
Serial.println(F("INFO: LilyGO T3-S3 EPD is detected."));
Serial_GNSS_In.begin(baud, SERIAL_IN_BITS,
SOC_GPIO_PIN_T3S3_GNSS_RX, SOC_GPIO_PIN_T3S3_GNSS_TX);
} else {
/* open Standalone's GNSS port */
Serial_GNSS_In.begin(baud, SERIAL_IN_BITS,
Expand Down Expand Up @@ -4073,6 +4101,10 @@ static bool ESP32_Baro_setup()

Wire.setPins(SOC_GPIO_PIN_T3C6_SDA, SOC_GPIO_PIN_T3C6_SCL);

} else if (esp32_board == ESP32_LILYGO_T3S3_EPD) {

Wire.setPins(SOC_GPIO_PIN_T3S3_SDA, SOC_GPIO_PIN_T3S3_SCL);

} else if (hw_info.model != SOFTRF_MODEL_PRIME_MK2) {

if ((hw_info.rf != RF_IC_SX1276 && hw_info.rf != RF_IC_SX1262) ||
Expand Down
2 changes: 2 additions & 0 deletions software/firmware/source/SoftRF/src/platform/ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ extern Adafruit_NeoPixel strip;
#include "iomap/Heltec_Tracker.h"
#include "iomap/WT0132C6.h"
#include "iomap/LilyGO_T3C6.h"
#include "iomap/LilyGO_T3S3_EPD.h"

enum rst_reason {
REASON_DEFAULT_RST = 0, /* normal startup by power on */
Expand Down Expand Up @@ -275,6 +276,7 @@ enum esp32_board_id {
ESP32_LILYGO_T_TWR2,
ESP32_HELTEC_TRACKER,
ESP32_LILYGO_T3C6,
ESP32_LILYGO_T3S3_EPD,
};

/* https://github.com/espressif/usb-pids/blob/main/allocated-pids.txt#L313 */
Expand Down

0 comments on commit aa8de4f

Please sign in to comment.