generic board hal file added

This commit is contained in:
Klaus K Wilting 2018-07-15 14:55:30 +02:00
parent f90c093436
commit e5bbd0fbf8
2 changed files with 51 additions and 1 deletions

View File

@ -11,7 +11,8 @@
; ---> SELECT TARGET PLATFORM HERE! <--- ; ---> SELECT TARGET PLATFORM HERE! <---
[platformio] [platformio]
env_default = heltec env_default = generic
;env_default = heltec
;env_default = ttgov1 ;env_default = ttgov1
;env_default = ttgov2 ;env_default = ttgov2
;env_default = ttgov21 ;env_default = ttgov21
@ -186,3 +187,18 @@ lib_deps =
${common_env_data.lib_deps_rgbled} ${common_env_data.lib_deps_rgbled}
build_flags = build_flags =
${common_env_data.build_flags} ${common_env_data.build_flags}
[env:generic]
platform = ${common_env_data.platform_espressif32}
framework = arduino
board = esp32dev
board_build.partitions = ${common_env_data.board_build.partitions}
upload_speed = 921600
monitor_speed = 115200
lib_deps =
${common_env_data.lib_deps_all}
${common_env_data.lib_deps_rgbled}
${common_env_data.lib_deps_gps}
${common_env_data.lib_deps_display}
build_flags =
${common_env_data.build_flags}

34
src/hal/generic.h Normal file
View File

@ -0,0 +1,34 @@
// Hardware related definitions for generic ESP32 boards
#define HAS_LORA 1 // comment out if device shall not send data via LoRa or has no LoRa
#define HAS_SPI 1 // comment out if device shall not send data via SPI
#define CFG_sx1276_radio 1 // select LoRa chip
//#define CFG_sx1272_radio 1 // select LoRa chip
#define BOARD_HAS_PSRAM // use if board has external PSRAM
#define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C
//#define DISPLAY_FLIP 1 // use if display is rotated
#define HAS_BATTERY_PROBE ADC1_GPIO35_CHANNEL // uses GPIO7
#define BATT_FACTOR 2 // voltage divider 100k/100k on board
#define HAS_LED GPIO_NUM_21 // on board green LED_G1
#define HAS_BUTTON GPIO_NUM_39 // use if board has button
#define HAS_GPS 1 // use if board has GPS
#define GPS_SERIAL 9600, SERIAL_8N1, GPIO_NUM_12, GPIO_NUM_15 // UBlox NEO 6M or 7M with default configuration
// pin definitions for SPI interface of LoRa chip
#define PIN_SPI_SS GPIO_NUM_18 // SPI Chip Select
#define PIN_SPI_MOSI GPIO_NUM_27 // SPI Data Input
#define PIN_SPI_MISO GPIO_NUM_19 // SPI Data Output
#define PIN_SPI_SCK GPIO_NUM_5 // SPI Clock
#define RST LMIC_UNUSED_PIN // LoRa Reset (if wired)
#define DIO0 GPIO_NUM_26 // LoRa IO0
#define DIO1 GPIO_NUM_32 // LoRa IO1
#define DIO2 LMIC_UNUSED_PIN // LoRa IO2 (not needed)
// pin definitions for I2C interface of OLED Display
#define OLED_RST GPIO_NUM_16 // SSD1306 RST
#define OLED_SDA GPIO_NUM_4 // SD1306 D1+D2
#define OLED_SCL GPIO_NUM_15 // SD1306 D0