From 66ef9927824d12c77e19a36c9675b020c64d0920 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Fri, 18 Jan 2019 22:19:40 +0100 Subject: [PATCH] board ttgo t-fox added --- platformio.ini | 20 ++++++++++++++++++-- src/hal/ttgofox.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 src/hal/ttgofox.h diff --git a/platformio.ini b/platformio.ini index 21943a92..01b8b602 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,6 +16,7 @@ env_default = generic ;env_default = ttgov21old ;env_default = ttgov21new ;env_default = ttgobeam +;env_default = ttgofox ;env_default = lopy ;env_default = lopy4 ;env_default = fipy @@ -32,14 +33,13 @@ description = Paxcounter is a proof-of-concept ESP32 device for metering passeng release_version = 1.7.11 ; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running! ; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose -debug_level = 0 +debug_level = 3 ; UPLOAD MODE: select esptool to flash via USB/UART, select custom to upload to cloud for OTA upload_protocol = esptool ;upload_protocol = custom extra_scripts = pre:build.py keyfile = ota.conf platform_espressif32 = espressif32@1.6.0 -;platform_espressif32 = https://github.com/platformio/platform-espressif32.git#feature/stage board_build.partitions = min_spiffs.csv monitor_speed = 115200 lib_deps_lora = @@ -202,6 +202,22 @@ upload_protocol = ${common.upload_protocol} extra_scripts = ${common.extra_scripts} monitor_speed = ${common.monitor_speed} +[env:ttgofox] +platform = ${common.platform_espressif32} +framework = arduino +board = esp32dev +board_build.partitions = ${common.board_build.partitions} +upload_speed = 921600 +lib_deps = + ${common.lib_deps_basic} + ${common.lib_deps_lora} + ${common.lib_deps_display} +build_flags = + ${common.build_flags_basic} +upload_protocol = ${common.upload_protocol} +extra_scripts = ${common.extra_scripts} +monitor_speed = ${common.monitor_speed} + [env:ttgobeam] platform = ${common.platform_espressif32} framework = arduino diff --git a/src/hal/ttgofox.h b/src/hal/ttgofox.h new file mode 100644 index 00000000..8f0a6d2d --- /dev/null +++ b/src/hal/ttgofox.h @@ -0,0 +1,33 @@ +// clang-format off + +#ifndef _TTGOFOX_H +#define _TTGOFOX_H + +#include + +#define HAS_LORA 1 // comment out if device shall not send data via LoRa +#define CFG_sx1276_radio 1 // HPD13A LoRa SoC + +#define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C +#define HAS_LED NOT_A_PIN // green on board LED +//#define LED_ACTIVE_LOW 1 // Onboard LED is active when pin is LOW +#define HAS_BATTERY_PROBE ADC1_GPIO35_CHANNEL // uses GPIO7 +#define BATT_FACTOR 2 // voltage divider 100k/100k on board +#define HAS_BUTTON GPIO_NUM_36 // on board button (next to reset) + +// Pins for I2C interface of OLED Display +#define MY_OLED_SDA (21) +#define MY_OLED_SCL (22) +#define MY_OLED_RST U8X8_PIN_NONE + +// 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 (23) +#define LORA_IRQ (26) +#define LORA_IO1 (33) +#define LORA_IO2 (32) + +#endif \ No newline at end of file