Merge pull request #72 from cyberman54/development

TTGO T-Beam board support added
This commit is contained in:
Verkehrsrot 2018-06-06 23:52:02 +02:00 committed by GitHub
commit 7dfb6bf199
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 3 deletions

View File

@ -24,13 +24,14 @@ Supported ESP32 based LoRa IoT boards:
- TTGOv1 {1}
- TTGOv2 {1}{4}
- TTGOv2.1 {1}{5}
- TTGO T-Beam {4}{5}
- Pycom LoPy {2}
- Pycom LoPy4 {2}
- Pycom FiPy {2}
- LoLin32 with [LoraNode32 shield](https://github.com/hallard/LoLin32-Lora) {2}{3}
- LoLin32 Lite with [LoraNode32-Lite shield](https://github.com/hallard/LoLin32-Lite-Lora) {2}{3}
{1} on board OLED Display supported; {2} on board RGB LED supported; {3} on board Hardware unique DEVEUI supported; {4} special wiring needed, see instructions in /hal/ttgov2.h; {5} battery voltage monitoring supported
{1} on board OLED Display supported; {2} on board RGB LED supported; {3} on board Hardware unique DEVEUI supported; {4} special wiring needed, see instructions in file /hal/<board>.h; {5} battery voltage monitoring supported
Target platform must be selected in [platformio.ini](https://github.com/cyberman54/ESP32-Paxcounter/blob/master/platformio.ini).<br>
Hardware dependent settings (pinout etc.) are stored in board files in /hal directory.<br>

View File

@ -11,10 +11,11 @@
; ---> SELECT TARGET PLATFORM HERE! <---
[platformio]
env_default = heltec
;env_default = heltec
;env_default = ttgov1
;env_default = ttgov2
;env_default = ttgov21
env_default = ttgobeam
;env_default = lopy
;env_default = lopy4
;env_default = fipy
@ -24,7 +25,7 @@ env_default = heltec
description = Paxcounter is a proof-of-concept ESP32 device for metering passenger flows in realtime. It counts how many mobile devices are around.
[common_env_data]
platform_espressif32 = espressif32@>=1.0.1
platform_espressif32 = espressif32@>=1.0.2
board_build.partitions = no_ota.csv
board_upload.maximum_size = 2097152
lib_deps_display =
@ -101,6 +102,20 @@ build_flags =
${common_env_data.build_flags}
-include "src/hal/ttgov21.h"
[env:ttgobeam]
platform = ${common_env_data.platform_espressif32}
framework = arduino
board = esp32dev
board_build.partitions = ${common_env_data.board_build.partitions}
board_upload.maximum_size = ${common_env_data.board_upload.maximum_size}
monitor_speed = 115200
upload_speed = 921600
lib_deps =
${common_env_data.lib_deps_display}
build_flags =
${common_env_data.build_flags}
-include "src/hal/ttgobeam.h"
[env:fipy]
platform = espressif32@1.0.1
framework = arduino

21
src/hal/ttgobeam.h Normal file
View File

@ -0,0 +1,21 @@
// Hardware related definitions for TTGO T-Beam board
#define CFG_sx1276_radio 1 // HPD13A LoRa SoC
#define HAS_LED 21 // on board green LED_G1
#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 // to be done
// GSP serial (9600, SERIAL_8N1, 12, 15); //17-TX 18-RX
// 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 <-> HPD13A IO0
#define DIO1 33 // Lora1 <-> HPD13A IO1 // !! NEEDS EXTERNAL WIRING !!
#define DIO2 32 // Lora2 <-> HPD13A IO2 // needs external wiring, but not necessary for LoRa, only FSK