From 083fd0791c648be74f13193a683eff60eccca326 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Sat, 23 Mar 2019 11:02:47 +0100 Subject: [PATCH] board file fixups --- src/hal/generic.h | 4 ++-- src/hal/heltecv2.h | 9 +++++---- src/hal/lopy.h | 6 +++--- src/hal/lopy4.h | 6 +++--- src/hal/ttgobeam.h | 4 ++-- src/hal/ttgofox.h | 10 ++++++---- src/hal/ttgov21new.h | 4 ++-- src/hal/ttgov21old.h | 4 ++-- 8 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/hal/generic.h b/src/hal/generic.h index 8cd00c11..1151b57f 100644 --- a/src/hal/generic.h +++ b/src/hal/generic.h @@ -35,8 +35,8 @@ #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 // battery probe GPIO pin -> ADC1_CHANNEL_7 -#define BATT_FACTOR 2 // voltage divider 100k/100k on board +#define BAT_MEASURE_ADC ADC1_GPIO35_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 +#define BAT_VOLTAGE_DIVIDER 2 // voltage divider 100k/100k on board #define HAS_LED (21) // on board LED #define HAS_BUTTON (39) // on board button diff --git a/src/hal/heltecv2.h b/src/hal/heltecv2.h index f85608a6..f0773d04 100644 --- a/src/hal/heltecv2.h +++ b/src/hal/heltecv2.h @@ -18,10 +18,11 @@ #define HAS_LED LED_BUILTIN // white LED on board #define HAS_BUTTON KEY_BUILTIN // button "PROG" on board -//#define HAS_BATTERY_PROBE ADC2_GPIO13_CHANNEL // battery probe GPIO pin -//#define BATT_FACTOR 4 // voltage divider 220k/100k on board -//#define HAS_LOWPOWER_SWITCH GPIO_NUM_21 // switches battery power, Vext control 0 = on / 1 = off -//#define LOW_POWER_ACTIVE_LOW 1 +//#define BAT_MEASURE_ADC ADC2_GPIO13_CHANNEL // battery probe GPIO pin +//#define BAT_VOLTAGE_DIVIDER 4 // voltage divider 220k/100k on board +//#define EXT_POWER_SW GPIO_NUM_21 // switches battery power, Vext control 0 = on / 1 = off +//#define EXT_POWER_ON 0 +//#define EXT_POWER_OFF 1 // Pins for I2C interface of OLED Display #define MY_OLED_SDA (4) diff --git a/src/hal/lopy.h b/src/hal/lopy.h index be36175b..2cb99261 100644 --- a/src/hal/lopy.h +++ b/src/hal/lopy.h @@ -28,8 +28,8 @@ //#define LED_ACTIVE_LOW 1 // use if LoPy is on Expansion Board, this has a user LED //#define HAS_BUTTON (13) // user button on expansion board //#define BUTTON_PULLUP 1 // Button need pullup instead of default pulldown -//#define HAS_BATTERY_PROBE ADC1_GPIO39_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 -//#define BATT_FACTOR 2 // voltage divider 1MOhm/1MOhm -> expansion board 3.0 -//#define BATT_FACTOR 4 // voltage divider 115kOhm/56kOhm -> expansion board 2.0 +//#define BAT_MEASURE_ADC ADC1_GPIO39_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 +//#define BAT_VOLTAGE_DIVIDER 2 // voltage divider 1MOhm/1MOhm -> expansion board 3.0 +//#define BAT_VOLTAGE_DIVIDER 4 // voltage divider 115kOhm/56kOhm -> expansion board 2.0 #endif diff --git a/src/hal/lopy4.h b/src/hal/lopy4.h index 11e26b66..a2be705c 100644 --- a/src/hal/lopy4.h +++ b/src/hal/lopy4.h @@ -38,8 +38,8 @@ #define LED_ACTIVE_LOW 1 // use if LoPy is on Expansion Board, this has a user LED #define HAS_BUTTON (13) // user button on expansion board #define BUTTON_PULLUP 1 // Button need pullup instead of default pulldown -#define HAS_BATTERY_PROBE ADC1_GPIO39_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 -#define BATT_FACTOR 2 // voltage divider 1MOhm/1MOhm -> expansion board 3.0 -//#define BATT_FACTOR 4 // voltage divider 115kOhm/56kOhm -> expansion board 2.0 +#define BAT_MEASURE_ADC ADC1_GPIO39_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 +#define BAT_VOLTAGE_DIVIDER 2 // voltage divider 1MOhm/1MOhm -> expansion board 3.0 +//#define BAT_VOLTAGE_DIVIDER 4 // voltage divider 115kOhm/56kOhm -> expansion board 2.0 #endif \ No newline at end of file diff --git a/src/hal/ttgobeam.h b/src/hal/ttgobeam.h index 91b68ebe..4fc218e1 100644 --- a/src/hal/ttgobeam.h +++ b/src/hal/ttgobeam.h @@ -17,8 +17,8 @@ #define CFG_sx1276_radio 1 // HPD13A LoRa SoC #define BOARD_HAS_PSRAM // use extra 4MB external RAM #define HAS_BUTTON GPIO_NUM_39 // on board button (next to reset) -#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 BAT_MEASURE_ADC ADC1_GPIO35_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 +#define BAT_VOLTAGE_DIVIDER 2 // voltage divider 100k/100k on board // GPS settings #define HAS_GPS 1 // use on board GPS diff --git a/src/hal/ttgofox.h b/src/hal/ttgofox.h index e29d71fb..a0d3c830 100644 --- a/src/hal/ttgofox.h +++ b/src/hal/ttgofox.h @@ -10,9 +10,11 @@ #define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C #define HAS_LED NOT_A_PIN // green on board LED is useless, is GPIO25, which switches power for Lora+Display -#define HAS_LOWPOWER_SWITCH GPIO_NUM_25 // switches power for LoRa chip + display (0 = off / 1 = on) -#define HAS_BATTERY_PROBE ADC1_GPIO35_CHANNEL -#define BATT_FACTOR 2 // voltage divider 100k/100k on board +//#define EXT_POWER_SW GPIO_NUM_25 // switches power for LoRa chip + display (0 = off / 1 = on) +//#define EXT_POWER_ON 1 +//#define EXT_POWER_OFF 0 +#define BAT_MEASURE_ADC ADC1_GPIO35_CHANNEL +#define BAT_VOLTAGE_DIVIDER 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 @@ -25,7 +27,7 @@ #define RTC_INT GPIO_NUM_34 // timepulse with accuracy +/- 2*e-6 [microseconds] = 0,1728sec / day // Settings for IF482 interface -//#define HAS_IF482 9600, SERIAL_7E1, GPIO_NUM_12, GPIO_NUM_14 // IF482 serial port parameters +#define HAS_IF482 9600, SERIAL_7E1, GPIO_NUM_12, GPIO_NUM_14 // IF482 serial port parameters // Settings for DCF77 interface //#define HAS_DCF77 GPIO_NUM_14 diff --git a/src/hal/ttgov21new.h b/src/hal/ttgov21new.h index 8852d2f2..97967187 100644 --- a/src/hal/ttgov21new.h +++ b/src/hal/ttgov21new.h @@ -20,8 +20,8 @@ #define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C #define HAS_LED (25) // green on board LED -#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 BAT_MEASURE_ADC ADC1_GPIO35_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 +#define BAT_VOLTAGE_DIVIDER 2 // voltage divider 100k/100k on board // Pins for I2C interface of OLED Display #define MY_OLED_SDA (21) diff --git a/src/hal/ttgov21old.h b/src/hal/ttgov21old.h index d3dd5572..50c6d609 100644 --- a/src/hal/ttgov21old.h +++ b/src/hal/ttgov21old.h @@ -18,8 +18,8 @@ #define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C //#define DISPLAY_FLIP 1 // rotated display -//#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 BAT_MEASURE_ADC ADC1_GPIO35_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 +//#define BAT_VOLTAGE_DIVIDER 2 // voltage divider 100k/100k on board // Pins for I2C interface of OLED Display #define MY_OLED_SDA (21)