#ifndef DEFINITION_H
#define DEFINITION_H

#include <Adafruit_SSD1306.h>
#include <Arduino.h>

typedef enum {  GPIO_0 = 0,
                GPIO_1_TX = 1,
                GPIO_2 = 2,
                GPIO_3_RX = 3,
                GPIO_4_SDA = 4,
                GPIO_5_SCL = 5,
                GPIO_10 = 10,
                GPIO_12_MISO = 12,
                GPIO_13_MOSI = 13,
                GPIO_14_CLK = 14,
                GPIO_15 = 15,
                GPIO_16 = 16,
                ADC = A0,
                DEFAULT_PIN = -1 } Pin;

#define NO_ERROR 0

#define NO_CURRENT_VIEW NULL
#define LAST_VIEW -1
#define RESERVED_VIEW_UID -2

#define BATT_FULL 870 //8.4v
#define BATT_EMPTY 775 //7.4v
#define BATT_DIFF 95
#define USB_THRESHOLD 600

//SD card file structure :
#define AP_CFG_FILE "/CONFIG/AP.CFG"
#define STA_CFG_FILE "/CONFIG/STA.CFG"
#define SCREEN_CFG_FILE "/CONFIG/SCREEN.CFG"
#define SERVER_CFG_FILE "/CONFIG/SERVER.CFG"
#define OTA_CFG_FILE "/CONFIG/OTA.CFG"
#define WWW_DIR "/WWW"
#define LOG_DIR "/LOGS"
#define FTP_DIR "/FTP"

//OTA public key for binary verification
const char otaVerificationPubKey[] PROGMEM = R"DEL(
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh6eFU0pdfir5CsQqs0v
vi7ip7MtRuNgcMtjl7lpXwQuMG5yoso1iR+Fzbz+Cso4lcqarG5uHV8nKYWQ+C39
+3OfKx9LSfabCnRAeFFhXuGWEfRcZ9aeW3Jv0Mg2+3sTOfXQGjdgNwOAqZNrL4kr
574F+c3o/PAwlr4VLMy7KygorNnaYzC5JF1H5DhqaKNniKVEqGXiVQKW10C04SsM
mGV/rKRSPpBVzyBrIf8GNPyVf7W4D0s9gSiCrRWMU2aU3tX35tezwlicsb86MKKM
o9ySHAMsIihx3zdwAGOELxE47Ylodq9cwc53fz7pfcdyL+N6FKKWM0bYJAkwNhdJ
NQIDAQAB
-----END PUBLIC KEY-----
)DEL";

typedef enum { OR_0 = 2, OR_90 = 3, OR_180 = 0, OR_270 = 1 } Orientation;

typedef enum { BIT = 0, BYTE, KBIT, KBYTE, MBIT, MBYTE, GBIT, GBYTE } SizeUnit;
#endif //DEFINITION_H
