From 616d66c5fbfa11ee963ba5a19845062abba49273 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Mon, 17 Dec 2018 10:30:56 +0100 Subject: [PATCH] ttgobeam HAL files added --- platformio.ini | 28 +++++++++++++--- src/hal/ttgobeam_new.h | 45 ++++++++++++++++++++++++++ src/hal/{ttgobeam.h => ttgobeam_old.h} | 11 ++++--- 3 files changed, 75 insertions(+), 9 deletions(-) create mode 100644 src/hal/ttgobeam_new.h rename src/hal/{ttgobeam.h => ttgobeam_old.h} (84%) diff --git a/platformio.ini b/platformio.ini index 34823ec9..04daa59d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -15,7 +15,8 @@ env_default = generic ;env_default = ttgov2 ;env_default = ttgov21old ;env_default = ttgov21new -;env_default = ttgobeam +;env_default = ttgobeam_old +;env_default = ttgobeam_new ;env_default = lopy ;env_default = lopy4 ;env_default = fipy @@ -202,11 +203,11 @@ upload_protocol = ${common.upload_protocol} extra_scripts = ${common.extra_scripts} monitor_speed = ${common.monitor_speed} -[env:ttgobeam] +[env:ttgobeam_old] platform = ${common.platform_espressif32} framework = arduino -;board = esp32dev -board = t-beam +board = esp32dev +;board = t-beam board_build.partitions = ${common.board_build.partitions} upload_speed = 921600 lib_deps = @@ -220,6 +221,25 @@ upload_protocol = ${common.upload_protocol} extra_scripts = ${common.extra_scripts} monitor_speed = ${common.monitor_speed} +[env:ttgobeam_new] +platform = ${common.platform_espressif32} +framework = arduino +board = esp32dev +;board = t-beam +board_build.partitions = ${common.board_build.partitions} +upload_speed = 921600 +lib_deps = + ${common.lib_deps_basic} + ${common.lib_deps_lora} + ${common.lib_deps_gps} +build_flags = + ${common.build_flags_all} + -mfix-esp32-psram-cache-issue +upload_protocol = ${common.upload_protocol} +extra_scripts = ${common.extra_scripts} +monitor_speed = ${common.monitor_speed} + + [env:fipy] platform = ${common.platform_espressif32} framework = arduino diff --git a/src/hal/ttgobeam_new.h b/src/hal/ttgobeam_new.h new file mode 100644 index 00000000..5bbdd620 --- /dev/null +++ b/src/hal/ttgobeam_new.h @@ -0,0 +1,45 @@ +// clang-format off + +#ifndef _TTGOBEAM_H +#define _TTGOBEAM_H + +#include + +// Hardware related definitions for TTGO T-Beam board + +// enable only if device has these sensors, otherwise comment these lines +// BME680 sensor on I2C bus +// attention: Pin21 is also LED! set HAS_LED to NOT_A_PIN if using BME280 +// don't forget to connect SDIO of BME680 to GND for selecting i2c addr 0x76 +//#define HAS_BME GPIO_NUM_21, GPIO_NUM_22 // SDA, SCL +//#define HAS_LED NOT_A_PIN // on board green LED + +#define HAS_LED GPIO_NUM_14 // on board green LED + +// user defined sensors +//#define HAS_SENSORS 1 // comment out if device has user defined sensors + +#define HAS_LORA 1 // comment out if device shall not send data via LoRa +#define CFG_sx1276_radio 1 // HPD13A LoRa SoC +#define BOARD_HAS_PSRAM // use extra 4MB external RAM + +//#define DISABLE_BROWNOUT 1 // comment out if you want to keep brownout feature + +#define HAS_BUTTON GPIO_NUM_39 // on board button "BOOT" (next to reset button) + +#define HAS_BATTERY_PROBE ADC1_GPIO35_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 +#define BATT_FACTOR 2 // voltage divider 100k/100k on board +#define HAS_GPS 1 // use on board GPS +#define GPS_SERIAL 9600, SERIAL_8N1, GPIO_NUM_12, GPIO_NUM_15 // UBlox NEO 6M or 7M with default configuration + +// Pins for LORA chip SPI interface, reset line and interrupt lines +#define LORA_SCK (5) +#define LORA_CS (18) +#define LORA_MISO (19) +#define LORA_MOSI (27) +#define LORA_RST LMIC_UNUSED_PIN +#define LORA_IRQ (26) +#define LORA_IO1 (33) // for T-Beam T22_V05 and T22_V07, for other versions use ttgobeam_old.h +#define LORA_IO2 (32) + +#endif \ No newline at end of file diff --git a/src/hal/ttgobeam.h b/src/hal/ttgobeam_old.h similarity index 84% rename from src/hal/ttgobeam.h rename to src/hal/ttgobeam_old.h index 8691c79f..e7d39287 100644 --- a/src/hal/ttgobeam.h +++ b/src/hal/ttgobeam_old.h @@ -11,17 +11,19 @@ // BME680 sensor on I2C bus // attention: Pin21 is also LED! set HAS_LED to NOT_A_PIN if using BME280 // don't forget to connect SDIO of BME680 to GND for selecting i2c addr 0x76 -#define HAS_BME GPIO_NUM_21, GPIO_NUM_22 // SDA, SCL -#define HAS_LED NOT_A_PIN // on board green LED +//#define HAS_BME GPIO_NUM_21, GPIO_NUM_22 // SDA, SCL +//#define HAS_LED NOT_A_PIN // on board green LED + +#define HAS_LED GPIO_NUM_21 // on board green LED // user defined sensors //#define HAS_SENSORS 1 // comment out if device has user defined sensors #define HAS_LORA 1 // comment out if device shall not send data via LoRa #define CFG_sx1276_radio 1 // HPD13A LoRa SoC - #define BOARD_HAS_PSRAM // use extra 4MB external RAM -//#define HAS_LED GPIO_NUM_21 // on board green LED + +//#define DISABLE_BROWNOUT 1 // comment out if you want to keep brownout feature #define HAS_BUTTON GPIO_NUM_39 // on board button "BOOT" (next to reset button) @@ -38,7 +40,6 @@ #define LORA_RST LMIC_UNUSED_PIN #define LORA_IRQ (26) #define LORA_IO1 (32) // !! NEEDS EXTERNAL WIRING !! -//#define LORA_IO1 (33) // for T-Beam T22_V05 and T22_V07, other versions may need external wiring #define LORA_IO2 LMIC_UNUSED_PIN #endif