2023-02-13 22:59:42 +01:00
|
|
|
|
2022-04-14 22:48:11 +02:00
|
|
|
#ifndef _COMMON_H_
|
|
|
|
#define _COMMON_H_
|
|
|
|
|
2023-02-13 22:59:42 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2022-04-14 22:48:11 +02:00
|
|
|
#define Q(x) #x
|
|
|
|
#define QUOTE(x) Q(x)
|
|
|
|
|
2023-02-13 22:59:42 +01:00
|
|
|
#define TRUE 1
|
|
|
|
#define FALSE 0
|
|
|
|
|
|
|
|
#define HOST_NAME "AirsoftTimer_%08X"
|
|
|
|
|
|
|
|
#define GPIO_LORA_TX D3
|
|
|
|
#define GPIO_LORA_RX D4
|
|
|
|
#define GPIO_LORA_AUX D0
|
|
|
|
|
|
|
|
#define GPIO_7SEG_EN_FAC1 D5
|
|
|
|
#define GPIO_7SEG_EN_FAC2 D6
|
|
|
|
#define GPIO_7SEG_EN_FAC3 D7
|
|
|
|
#define GPIO_7SEG_CLK D8
|
2022-04-14 22:48:11 +02:00
|
|
|
|
2023-02-13 22:59:42 +01:00
|
|
|
#define I2C_IO_BTN_FAC1 0
|
2022-05-15 22:52:24 +02:00
|
|
|
#define FAC_1_TRG_PRESSED LOW
|
2023-02-13 22:59:42 +01:00
|
|
|
#define I2C_IO_BTN_FAC2 1
|
2022-05-15 22:52:24 +02:00
|
|
|
#define FAC_2_TRG_PRESSED LOW
|
2023-02-13 22:59:42 +01:00
|
|
|
#define I2C_IO_BTN_FAC3 2
|
2022-07-15 19:19:28 +02:00
|
|
|
#define FAC_3_TRG_PRESSED LOW
|
2022-04-14 22:48:11 +02:00
|
|
|
|
2023-02-13 22:59:42 +01:00
|
|
|
#define I2C_IO_LORA_M0 4
|
|
|
|
#define I2C_IO_LORA_M1 3
|
|
|
|
|
|
|
|
#define EEPROM_TYPE 24LC64
|
|
|
|
|
|
|
|
#define I2C_IO_ADDRESS 0x38
|
|
|
|
#define I2C_POWER_ADDRESS 0x40
|
|
|
|
#define I2C_EEPROM_ADDRESS 0x50
|
2022-04-14 22:48:11 +02:00
|
|
|
|
|
|
|
#ifndef OTA_DELAY
|
|
|
|
#define OTA_DELAY 50 // ticks -> 10ms / tick
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ADMIN_PASSWORD
|
|
|
|
#error "You need to define ADMIN_PASSWORD for OTA-Update"
|
|
|
|
#endif
|
|
|
|
#ifndef WIFI_PASSWORD
|
|
|
|
#error "You must define an WIFI_PASSWORD for OTA-Update"
|
|
|
|
#endif
|
|
|
|
#ifndef WIFI_SSID
|
|
|
|
#error "You must define an WIFI_SSID for OTA-Update"
|
|
|
|
#endif
|
|
|
|
#ifndef WIFI_AP_PASSWORD
|
|
|
|
#error "You must define an WIFI_AP_PASSWORD for Standalone AP-Mode"
|
|
|
|
#endif
|
|
|
|
|
2023-02-13 22:59:42 +01:00
|
|
|
#endif
|