#pragma once

#define GPS_DEFAULT_NOT_PRESENT 1

// SD card (TF)
#define HAS_SDCARD
#define SDCARD_USE_SPI1
#define SDCARD_CS 40
#define SD_SPI_FREQUENCY 25000000U

// Built-in RTC (I2C)
#define PCF8563_RTC 0x51
#define HAS_RTC 1
#define I2C_SDA SDA
#define I2C_SCL SCL

// Battery voltage monitoring
#define BATTERY_PIN 2 // A battery voltage measurement pin, voltage divider connected here to
// measure battery voltage ratio of voltage divider = 2.0 (assumption)
#define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage.
#define ADC_CHANNEL ADC_CHANNEL_1

// Display (E-Ink)
#define PIN_EINK_EN 42
#define PIN_EINK_CS 13
#define PIN_EINK_BUSY 10
#define PIN_EINK_DC 12
#define PIN_EINK_RES 11
#define PIN_EINK_SCLK 14
#define PIN_EINK_MOSI 15
#define DISPLAY_FORCE_SMALL_FONTS

// Two-Way Rocker input (left/right + boot as press)
#define INPUTDRIVER_TWO_WAY_ROCKER
#define INPUTDRIVER_ENCODER_TYPE 2
#define INPUTDRIVER_TWO_WAY_ROCKER_RIGHT 3
#define INPUTDRIVER_TWO_WAY_ROCKER_LEFT 4
#define INPUTDRIVER_TWO_WAY_ROCKER_BTN 0
#define UPDOWN_LONG_PRESS_REPEAT_INTERVAL 150

// LoRa (SX1262)
#define USE_SX1262

#define LORA_DIO1 5
#define LORA_SCK 8
#define LORA_MISO 6
#define LORA_MOSI 17
#define LORA_CS 7 // CS not connected; IO7 is free
#define LORA_RESET 21

#ifdef USE_SX1262
#define SX126X_CS LORA_CS
#define SX126X_DIO1 LORA_DIO1
#define SX126X_BUSY 16
#define SX126X_RESET LORA_RESET
#define SX126X_DIO3_TCXO_VOLTAGE 1.8
#endif
