2019-03-23 11:03:04 +01:00
|
|
|
// clang-format off
|
2019-06-30 17:48:24 +02:00
|
|
|
// upload_speed 921600
|
|
|
|
// board esp32dev
|
2019-03-23 11:03:04 +01:00
|
|
|
|
|
|
|
#ifndef _GENERIC_H
|
|
|
|
#define _GENERIC_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#define HAS_LORA 1 // comment out if device shall not send data via LoRa or has no LoRa
|
|
|
|
#define CFG_sx1276_radio 1 // select LoRa chip
|
|
|
|
|
|
|
|
//#define DISABLE_BROWNOUT 1 // comment out if you want to keep brownout feature
|
|
|
|
|
2019-09-27 12:47:00 +02:00
|
|
|
#define HAS_DISPLAY 1
|
2020-03-29 12:10:42 +02:00
|
|
|
//#define MY_DISPLAY_FLIP 1 // use if display is rotated
|
2019-03-23 11:03:04 +01:00
|
|
|
#define BAT_MEASURE_ADC ADC1_GPIO35_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7
|
|
|
|
#define BAT_VOLTAGE_DIVIDER ((82.0+220.0)/82.0) // 82k + 220k 1%
|
2019-05-19 17:18:49 +02:00
|
|
|
//#define BAT_MEASURE_EN EXT_POWER_SW // Turn power on for measurement
|
2019-03-23 11:03:04 +01:00
|
|
|
|
2019-05-19 17:18:49 +02:00
|
|
|
#define EXT_POWER_SW 15 // Switch VDD on pin JP10, needed for RTC DS3231
|
2019-03-23 11:03:04 +01:00
|
|
|
#define EXT_POWER_ON 0
|
|
|
|
|
2019-03-24 01:05:13 +01:00
|
|
|
#define HAS_LED (2) // on board green LED
|
2019-03-24 16:22:12 +01:00
|
|
|
#define HAS_TWO_LED (12) // on board red LED
|
2019-03-23 15:06:05 +01:00
|
|
|
//#define HAS_BUTTON (0) // on board button -> don't use, is same as RTC_INT!
|
2019-03-23 11:03:04 +01:00
|
|
|
|
|
|
|
// Pins for I2C interface of OLED Display
|
2020-03-29 12:10:42 +02:00
|
|
|
#define MY_DISPLAY_SDA SDA
|
|
|
|
#define MY_DISPLAY_SCL SCL
|
|
|
|
#define MY_DISPLAY_RST NOT_A_PIN
|
2019-03-23 11:03:04 +01:00
|
|
|
|
|
|
|
// Settings for on board DS3231 RTC chip
|
2019-03-23 15:06:05 +01:00
|
|
|
// note: to use RTC_INT, capacitor 100nF next to red LED must be removed to sharpen interrupt signal slope
|
|
|
|
// and setting EXT_POWER_ON is needed (this is done in main.cpp)
|
2020-03-29 12:10:42 +02:00
|
|
|
#define HAS_RTC MY_DISPLAY_SDA, MY_DISPLAY_SCL // SDA, SCL
|
2019-03-23 15:06:05 +01:00
|
|
|
#define RTC_INT GPIO_NUM_0 //
|
2019-03-23 11:03:04 +01:00
|
|
|
|
|
|
|
// Settings for IF482 interface
|
2020-10-31 21:42:47 +01:00
|
|
|
//#define HAS_IF482 9600, SERIAL_7E1, GPIO_NUM_3, GPIO_NUM_1 // RX, TX
|
2019-03-23 11:03:04 +01:00
|
|
|
|
|
|
|
// Settings for DCF77 interface
|
|
|
|
//#define HAS_DCF77 GPIO_NUM_14 // JP8 #13
|
|
|
|
//#define DCF77_ACTIVE_LOW 1
|
|
|
|
|
|
|
|
// Pins for LORA chip SPI interface, reset line and interrupt lines
|
2019-04-20 12:42:33 +02:00
|
|
|
#define LORA_SCK SCK
|
|
|
|
#define LORA_CS SS
|
|
|
|
#define LORA_MISO MISO
|
|
|
|
#define LORA_MOSI MOSI
|
2019-03-23 11:03:04 +01:00
|
|
|
#define LORA_RST (17)
|
|
|
|
#define LORA_IRQ (16)
|
2019-03-23 15:06:05 +01:00
|
|
|
#define LORA_IO1 (14) // JP8 #13 to be external wired
|
2019-03-23 11:03:04 +01:00
|
|
|
#define LORA_IO2 LMIC_UNUSED_PIN
|
|
|
|
|
|
|
|
#endif
|