From 6e5db9236e3fc3b187007f9eb4a96a3accc8c5ff Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Sat, 12 Jan 2019 12:17:29 +0100 Subject: [PATCH] update hal files --- src/hal/heltec.h | 10 ++++----- src/hal/heltecv2.h | 10 ++++----- src/hal/lolin32lite.h | 7 +++--- src/hal/ttgobeam_old.h | 50 ------------------------------------------ src/hal/ttgov1.h | 19 ++++++---------- src/hal/ttgov2.h | 12 ++++------ 6 files changed, 24 insertions(+), 84 deletions(-) delete mode 100644 src/hal/ttgobeam_old.h diff --git a/src/hal/heltec.h b/src/hal/heltec.h index 761d2b2c..5535c12d 100644 --- a/src/hal/heltec.h +++ b/src/hal/heltec.h @@ -12,13 +12,13 @@ #define HAS_LORA 1 // comment out if device shall not send data via LoRa #define CFG_sx1276_radio 1 #define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C // OLED-Display on board -#define HAS_LED (25) // white LED on board -#define HAS_BUTTON (0) // button "PROG" on board +#define HAS_LED LED_BUILTIN // white LED on board +#define HAS_BUTTON KEY_BUILTIN // button "PROG" on board // Pins for I2C interface of OLED Display -#define MY_OLED_SDA (4) -#define MY_OLED_SCL (15) -#define MY_OLED_RST (16) +#define MY_OLED_SDA OLED_SDA +#define MY_OLED_SCL OLED_SCL +#define MY_OLED_RST OLED_RST // Pins for LORA chip SPI interface come from board file, we need some // additional definitions for LMIC diff --git a/src/hal/heltecv2.h b/src/hal/heltecv2.h index a07147e2..dc3cb305 100644 --- a/src/hal/heltecv2.h +++ b/src/hal/heltecv2.h @@ -14,13 +14,13 @@ #define CFG_sx1276_radio 1 #define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C // OLED-Display on board -#define HAS_LED (25) // white LED on board -#define HAS_BUTTON (0) // button "PROG" on board +#define HAS_LED LED_BUILTIN // white LED on board +#define HAS_BUTTON KEY_BUILTIN // button "PROG" on board // Pins for I2C interface of OLED Display -#define MY_OLED_SDA (4) -#define MY_OLED_SCL (15) -#define MY_OLED_RST (16) +#define MY_OLED_SDA OLED_SDA +#define MY_OLED_SCL OLED_SCL +#define MY_OLED_RST OLED_RST // Pins for LORA chip SPI interface come from board file, we need some // additional definitions for LMIC diff --git a/src/hal/lolin32lite.h b/src/hal/lolin32lite.h index 8e19f322..3995fac7 100644 --- a/src/hal/lolin32lite.h +++ b/src/hal/lolin32lite.h @@ -7,9 +7,8 @@ // Hardware related definitions for lolin32lite (without LoRa shield) -#define CFG_sx1272_radio 1 // dummy - -#define HAS_LED (5) // on board LED on GPIO5 -#define LED_ACTIVE_LOW 1 // Onboard LED is active when pin is LOW +#define CFG_sx1272_radio 1 // dummy +#define HAS_LED LED_BUILTIN // on board LED on GPIO5 +#define LED_ACTIVE_LOW 1 // Onboard LED is active when pin is LOW #endif \ No newline at end of file diff --git a/src/hal/ttgobeam_old.h b/src/hal/ttgobeam_old.h deleted file mode 100644 index 4c5d1981..00000000 --- a/src/hal/ttgobeam_old.h +++ /dev/null @@ -1,50 +0,0 @@ -// 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 -#define HAS_BME GPIO_NUM_21, GPIO_NUM_22 // SDA, SCL -#define BME_ADDR BME680_I2C_ADDR_PRIMARY // connect SDIO of BME680 to GND -#define HAS_LED NOT_A_PIN // on board green LED uses same GPIO as SDA! - -// #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_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C -//#define MY_OLED_SDA (21) -//#define MY_OLED_SCL (22) -//#define MY_OLED_RST U8X8_PIN_NONE -//#define DISPLAY_FLIP 1 // use if display is rotated - -#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 (32) // !! NEEDS EXTERNAL WIRING !! -#define LORA_IO2 LMIC_UNUSED_PIN - -#endif diff --git a/src/hal/ttgov1.h b/src/hal/ttgov1.h index 38513579..ce926175 100644 --- a/src/hal/ttgov1.h +++ b/src/hal/ttgov1.h @@ -12,22 +12,17 @@ #define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C // OLED-Display on board //#define DISPLAY_FLIP 1 // uncomment this for rotated display -#define HAS_LED (2) // white LED on board +#define HAS_LED LED_BUILTIN #define LED_ACTIVE_LOW 1 // Onboard LED is active when pin is LOW -#define HAS_BUTTON (0) // button "PRG" on board +#define HAS_BUTTON KEY_BUILTIN // Pins for I2C interface of OLED Display -#define MY_OLED_SDA (4) -#define MY_OLED_SCL (15) -#define MY_OLED_RST (16) +#define MY_OLED_SDA OLED_SDA +#define MY_OLED_SCL OLED_SCL +#define MY_OLED_RST OLED_RST -// 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 (14) -#define LORA_IRQ (26) +// Pins for LORA chip SPI interface come from board file, we need some +// additional definitions for LMIC #define LORA_IO1 (33) #define LORA_IO2 LMIC_UNUSED_PIN diff --git a/src/hal/ttgov2.h b/src/hal/ttgov2.h index fdd021ef..9a982dda 100644 --- a/src/hal/ttgov2.h +++ b/src/hal/ttgov2.h @@ -18,17 +18,13 @@ #define DISABLE_BROWNOUT 1 // comment out if you want to keep brownout feature // Pins for I2C interface of OLED Display -#define MY_OLED_SDA (21) -#define MY_OLED_SCL (22) +#define MY_OLED_SDA OLED_SDA +#define MY_OLED_SCL OLED_SCL #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) +// Pins for LORA chip SPI interface come from board file, we need some +// additional definitions for LMIC #define LORA_RST LMIC_UNUSED_PIN -#define LORA_IRQ (26) #define LORA_IO1 (33) #define LORA_IO2 LMIC_UNUSED_PIN