[LilyGo_TDeck]
extends = esp32_base
board = t-deck
build_flags =
  ${esp32_base.build_flags}
  ${sensor_base.build_flags}
  -I variants/lilygo_tdeck
  -D LILYGO_TDECK
  -D BOARD_HAS_PSRAM=1
  -D CORE_DEBUG_LEVEL=1
  -D ARDUINO_USB_CDC_ON_BOOT=1
  -D PIN_USER_BTN=0  ; Trackball button
  -D PIN_PERF_POWERON=10 ; Peripheral power pin
  -D USE_SX1262
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D LORA_TX_POWER=22
  -D SX126X_DIO2_AS_RF_SWITCH=false
  -D SX126X_CURRENT_LIMIT=140
  -D SX126X_RX_BOOSTED_GAIN=1
  -D SX126X_DIO3_TCXO_VOLTAGE=1.8f
  -D P_LORA_DIO_1=45 ; LORA IRQ pin
  -D ENV_INCLUDE_GPS=1
  -D ENV_INCLUDE_AHTX0=0
  -D ENV_INCLUDE_BME280=0
  -D ENV_INCLUDE_BMP280=0
  -D ENV_INCLUDE_SHTC3=0
  -D ENV_INCLUDE_SHT4X=0
  -D ENV_INCLUDE_LPS22HB=0
  -D ENV_INCLUDE_INA3221=0
  -D ENV_INCLUDE_INA219=0
  -D ENV_INCLUDE_INA226=0
  -D ENV_INCLUDE_INA260=0
  -D ENV_INCLUDE_MLX90614=0
  -D ENV_INCLUDE_VL53L0X=0
  -D ENV_INCLUDE_BME680=0
  -D ENV_INCLUDE_BMP085=0
  -D P_LORA_NSS=9    ; LORA SS pin
  -D P_LORA_RESET=17 ; LORA RST pin
  -D P_LORA_BUSY=13  ; LORA Busy pin
  -D P_LORA_SCLK=40  ; LORA SCLK pin
  -D P_LORA_MISO=38  ; LORA MISO pin
  -D P_LORA_MOSI=41  ; LORA MOSI pin
  -D DISPLAY_CLASS=ST7789LCDDisplay
  -D DISPLAY_SCALE_X=2.5
  -D DISPLAY_SCALE_Y=3.75
  -D PIN_TFT_RST=-1
  -D PIN_TFT_VDD_CTL=-1
  -D PIN_TFT_LEDA_CTL=42
  -D PIN_TFT_CS=12
  -D PIN_TFT_DC=11
  -D PIN_TFT_SCL=40
  -D PIN_TFT_SDA=41
  -D PIN_GPS_RX=43
  -D PIN_GPS_TX=44
  -D GPS_BAUD_RATE=38400
build_src_filter = ${esp32_base.build_src_filter}
  +<../variants/lilygo_tdeck>
  +<helpers/sensors/*.cpp>
  +<helpers/ui/ST7789LCDDisplay.cpp>
lib_deps =
  ${esp32_base.lib_deps}
  ${sensor_base.lib_deps}
  adafruit/Adafruit ST7735 and ST7789 Library @ ^1.11.0

[env:LilyGo_TDeck_companion_radio_usb]
extends = LilyGo_TDeck
build_flags =
  ${LilyGo_TDeck.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D OFFLINE_QUEUE_SIZE=256
  -D ENABLE_USB_INTERFACE
build_src_filter = ${LilyGo_TDeck.build_src_filter}
  +<helpers/esp32/*.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${LilyGo_TDeck.lib_deps}
  densaugeo/base64 @ ~1.4.0

[env:LilyGo_TDeck_companion_radio_ble]
extends = LilyGo_TDeck
build_flags =
  ${LilyGo_TDeck.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D BLE_PIN_CODE=123456
  -D OFFLINE_QUEUE_SIZE=256
build_src_filter = ${LilyGo_TDeck.build_src_filter}
  +<helpers/esp32/*.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${LilyGo_TDeck.lib_deps}
  densaugeo/base64 @ ~1.4.0

[env:LilyGo_TDeck_repeater]
extends = LilyGo_TDeck
build_flags =
  ${LilyGo_TDeck.build_flags}
  -D ADVERT_NAME='"TDeck Repeater"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=50
build_src_filter = ${LilyGo_TDeck.build_src_filter}
  +<../examples/simple_repeater>
  +<helpers/ui/ST7789LCDDisplay.cpp>
lib_deps =
  ${LilyGo_TDeck.lib_deps}
  ${esp32_ota.lib_deps}

[env:LilyGo_TDeck_kiss_modem]
extends = LilyGo_TDeck
build_src_filter = ${LilyGo_TDeck.build_src_filter}
  +<../examples/kiss_modem/>
