2018-11-25 16:35:36 +01:00
|
|
|
// clang-format off
|
|
|
|
|
2018-10-21 19:00:20 +02:00
|
|
|
#ifndef _GENERIC_H
|
|
|
|
#define _GENERIC_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2018-07-15 14:55:30 +02:00
|
|
|
// Hardware related definitions for generic ESP32 boards
|
2019-01-19 19:10:10 +01:00
|
|
|
// generic.h is kitchensink with all available options
|
2018-07-15 14:55:30 +02:00
|
|
|
|
|
|
|
#define HAS_LORA 1 // comment out if device shall not send data via LoRa or has no LoRa
|
2018-08-11 19:12:04 +02:00
|
|
|
#define HAS_SPI 1 // comment out if device shall not send data via SPI
|
2018-09-11 16:15:39 +02:00
|
|
|
// pin definitions for SPI slave interface
|
|
|
|
#define SPI_MOSI GPIO_NUM_23
|
|
|
|
#define SPI_MISO GPIO_NUM_19
|
|
|
|
#define SPI_SCLK GPIO_NUM_18
|
2018-11-04 13:58:35 +01:00
|
|
|
#define SPI_CS GPIO_NUM_5
|
2018-07-15 14:56:26 +02:00
|
|
|
|
2018-11-20 15:44:33 +01:00
|
|
|
// enable only if device has these sensors, otherwise comment these lines
|
2018-11-22 23:37:53 +01:00
|
|
|
// BME680 sensor on I2C bus
|
|
|
|
#define HAS_BME GPIO_NUM_21, GPIO_NUM_22 // SDA, SCL
|
2018-12-26 23:01:54 +01:00
|
|
|
#define BME_ADDR BME680_I2C_ADDR_PRIMARY // connect SDIO of BME680 to GND
|
2018-11-25 16:05:30 +01:00
|
|
|
|
2018-11-22 23:37:53 +01:00
|
|
|
// user defined sensors
|
|
|
|
//#define HAS_SENSORS 1 // comment out if device has user defined sensors
|
2018-11-20 15:02:37 +01:00
|
|
|
|
2018-07-15 14:55:30 +02:00
|
|
|
#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
|
2018-07-21 14:17:25 +02:00
|
|
|
#define DISABLE_BROWNOUT 1 // comment out if you want to keep brownout feature
|
2018-07-15 14:55:30 +02:00
|
|
|
|
|
|
|
#define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C
|
|
|
|
//#define DISPLAY_FLIP 1 // use if display is rotated
|
2019-01-20 13:18:23 +01:00
|
|
|
#define HAS_BATTERY_PROBE ADC1_GPIO35_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7
|
2018-07-15 14:55:30 +02:00
|
|
|
#define BATT_FACTOR 2 // voltage divider 100k/100k on board
|
|
|
|
|
2018-10-21 19:00:20 +02:00
|
|
|
#define HAS_LED (21) // on board LED
|
|
|
|
#define HAS_BUTTON (39) // on board button
|
|
|
|
#define HAS_RGB_LED (0) // WS2812B RGB LED on GPIO0
|
2018-08-01 08:53:05 +02:00
|
|
|
|
|
|
|
#define BOARD_HAS_PSRAM // use extra 4MB extern RAM
|
2018-07-15 14:55:30 +02:00
|
|
|
|
|
|
|
#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
|
|
|
|
|
2018-10-21 19:00:20 +02:00
|
|
|
// Pins for I2C interface of OLED Display
|
|
|
|
#define MY_OLED_SDA (4)
|
|
|
|
#define MY_OLED_SCL (15)
|
|
|
|
#define MY_OLED_RST (16)
|
|
|
|
|
2019-01-19 19:10:10 +01:00
|
|
|
// Pins for on board DS3231 RTC chip
|
|
|
|
#define HAS_RTC MY_OLED_SDA, MY_OLED_SCL // SDA, SCL
|
|
|
|
|
2018-10-21 22:24:45 +02:00
|
|
|
// Pins for LORA chip SPI interface, reset line and interrupt lines
|
2018-10-21 22:16:29 +02:00
|
|
|
#define LORA_SCK (5)
|
|
|
|
#define LORA_CS (18)
|
|
|
|
#define LORA_MISO (19)
|
|
|
|
#define LORA_MOSI (27)
|
|
|
|
#define LORA_RST (14)
|
2018-11-20 15:02:37 +01:00
|
|
|
#define LORA_IRQ (26)
|
2018-10-21 22:16:29 +02:00
|
|
|
#define LORA_IO1 (33)
|
|
|
|
#define LORA_IO2 LMIC_UNUSED_PIN
|
2018-09-20 13:23:22 +02:00
|
|
|
|
|
|
|
// I2C config for Microchip 24AA02E64 DEVEUI unique address
|
|
|
|
#define MCP_24AA02E64_I2C_ADDRESS 0x50 // I2C address for the 24AA02E64
|
2018-10-21 19:00:20 +02:00
|
|
|
#define MCP_24AA02E64_MAC_ADDRESS 0xF8 // Memory adress of unique deveui 64 bits
|
|
|
|
|
|
|
|
#endif
|