From 79f14b020ddafa358b75baf6dff603a83f3dad96 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Tue, 15 May 2018 10:36:11 +0200 Subject: [PATCH] TTGOv2.1 support added --- README.md | 2 +- platformio.ini | 14 ++++++++++++++ src/hal/ttgov21.h | 28 ++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/hal/ttgov21.h diff --git a/README.md b/README.md index 7bdb8e6a..ebb259b5 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Currently supported IoT boards: - Heltec LoRa-32 {1} - TTGOv1 {1} - TTGOv2 {1}{4} -- TTGOv2.1 not yet, coming soon +- TTGOv2.1 (not yet tested) {1} - Pycom LoPy {2} - Pycom LoPy4 {2} - Pycom FiPy {2} diff --git a/platformio.ini b/platformio.ini index 59b9fbc3..518e995c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -14,6 +14,7 @@ env_default = heltec_wifi_lora_32 ;env_default = ttgov1 ;env_default = ttgov2 +;env_default = ttgov21 ;env_default = lopy ;env_default = lopy4 ;env_default = fipy @@ -80,6 +81,19 @@ build_flags = -Dttgov2 -include "src/hal/ttgov2.h" +[env:ttgov21] +platform = espressif32 +framework = arduino +board = esp32dev +monitor_baud = 115200 +upload_speed = 921600 +lib_deps = + ${common_env_data.lib_deps_display} +build_flags = + ${common_env_data.build_flags} + -Dttgov2 + -include "src/hal/ttgov21.h" + [env:fipy] platform = espressif32 framework = arduino diff --git a/src/hal/ttgov21.h b/src/hal/ttgov21.h new file mode 100644 index 00000000..b5e38c94 --- /dev/null +++ b/src/hal/ttgov21.h @@ -0,0 +1,28 @@ +// Hardware related definitions for TTGO V2.1 Board +// NOT YET TESTED + +#define CFG_sx1276_radio 1 // HPD13A LoRa SoC + +#define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C +#define DISPLAY_FLIP 1 // rotated display +#define HAS_LED 23 + +// disable brownout detection (needed on TTGOv2 for battery powered operation) +#define DISABLE_BROWNOUT 1 // comment out if you want to keep brownout feature + +// re-define pin definitions of pins_arduino.h +#define PIN_SPI_SS 18 // ESP32 GPIO18 (Pin18) -- HPD13A NSS/SEL (Pin4) SPI Chip Select Input +#define PIN_SPI_MOSI 27 // ESP32 GPIO27 (Pin27) -- HPD13A MOSI/DSI (Pin6) SPI Data Input +#define PIN_SPI_MISO 19 // ESP32 GPIO19 (Pin19) -- HPD13A MISO/DSO (Pin7) SPI Data Output +#define PIN_SPI_SCK 5 // ESP32 GPIO5 (Pin5) -- HPD13A SCK (Pin5) SPI Clock Input + +// non arduino pin definitions +#define RST LMIC_UNUSED_PIN // connected to ESP32 RST/EN +#define DIO0 26 // ESP32 GPIO26 wired on PCB to HPD13A +#define DIO1 32 +#define DIO2 33 + +// Hardware pin definitions for TTGO V2 Board with OLED SSD1306 0,96" I2C Display +#define OLED_RST U8X8_PIN_NONE // connected to CPU RST/EN +#define OLED_SDA 21 // ESP32 GPIO4 (Pin4) -- SD1306 D1+D2 +#define OLED_SCL 22 // ESP32 GPIO15 (Pin15) -- SD1306 D0 \ No newline at end of file