[Heltec_E213_base]
extends = esp32_base
board = heltec_e213
build_flags =
  ${esp32_base.build_flags}
  -I variants/heltec_e213
  -D Vision_Master_E213
  -D ARDUINO_USB_CDC_ON_BOOT=1
  -D USE_SX1262
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D P_LORA_DIO_1=14
  -D P_LORA_NSS=8
  -D P_LORA_RESET=12
  -D P_LORA_BUSY=13
  -D P_LORA_SCLK=9
  -D P_LORA_MISO=11
  -D P_LORA_MOSI=10
  -D P_LORA_TX_LED=45
  -D LORA_TX_POWER=22
  -D PIN_USER_BTN=0
  -D PIN_VEXT_EN=18
  -D PIN_VEXT_EN_ACTIVE=HIGH
  -D PIN_VBAT_READ=7
  -D PIN_ADC_CTRL=46
  -D SX126X_DIO2_AS_RF_SWITCH=true
  -D SX126X_DIO3_TCXO_VOLTAGE=1.8
  -D SX126X_CURRENT_LIMIT=140
  -D SX126X_RX_BOOSTED_GAIN=1
  -D PIN_BOARD_SDA=39
  -D PIN_BOARD_SCL=38
  -D DISP_CS=5
  -D DISP_BUSY=1
  -D DISP_DC=2
  -D DISP_RST=3
  -D DISP_SCLK=4
  -D DISP_MOSI=6
build_src_filter = ${esp32_base.build_src_filter}
  +<../variants/heltec_e213>
lib_deps =
  ${esp32_base.lib_deps}
  https://github.com/Quency-D/heltec-eink-modules/archive/563dd41fd850a1bc3039b8723da4f3a20fe1c800.zip

[env:Heltec_E213_companion_radio_ble]
extends = Heltec_E213_base
build_flags =
  ${Heltec_E213_base.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D DISPLAY_CLASS=E213Display
  -D AUTO_OFF_MILLIS=0
  -D BLE_PIN_CODE=123456   ; dynamic, random PIN
  -D BLE_DEBUG_LOGGING=1
  -D OFFLINE_QUEUE_SIZE=256
build_src_filter = ${Heltec_E213_base.build_src_filter}
  +<helpers/ui/E213Display.cpp>
  +<helpers/esp32/*.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${Heltec_E213_base.lib_deps}
  densaugeo/base64 @ ~1.4.0
  bakercp/CRC32 @ ^2.0.0

[env:Heltec_E213_companion_radio_usb]
extends = Heltec_E213_base
build_flags =
  ${Heltec_E213_base.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D DISPLAY_CLASS=E213Display
  -D AUTO_OFF_MILLIS=0
  -D OFFLINE_QUEUE_SIZE=256
build_src_filter = ${Heltec_E213_base.build_src_filter}
  +<helpers/ui/E213Display.cpp>
  +<helpers/esp32/*.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${Heltec_E213_base.lib_deps}
  densaugeo/base64 @ ~1.4.0
  bakercp/CRC32 @ ^2.0.0

[env:Heltec_E213_repeater]
extends = Heltec_E213_base
build_flags =
  ${Heltec_E213_base.build_flags}
  -D DISPLAY_CLASS=E213Display
  -D ADVERT_NAME='"Heltec E213 Repeater"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=50
build_src_filter = ${Heltec_E213_base.build_src_filter}
  +<helpers/ui/E213Display.cpp>
  +<../examples/simple_repeater>
lib_deps =
  ${Heltec_E213_base.lib_deps}
  ${esp32_ota.lib_deps}
  bakercp/CRC32 @ ^2.0.0

; [env:Heltec_E213_repeater_bridge_rs232]
; extends = Heltec_E213_base
; build_flags =
;   ${Heltec_E213_base.build_flags}
;   -D DISPLAY_CLASS=E213Display
;   -D ADVERT_NAME='"RS232 Bridge"'
;   -D ADVERT_LAT=0.0
;   -D ADVERT_LON=0.0
;   -D ADMIN_PASSWORD='"password"'
;   -D MAX_NEIGHBOURS=50
;   -D WITH_RS232_BRIDGE=Serial2
;   -D WITH_RS232_BRIDGE_RX=5
;   -D WITH_RS232_BRIDGE_TX=6
;  -D BRIDGE_DEBUG=1
; ;  -D MESH_PACKET_LOGGING=1
; ;  -D MESH_DEBUG=1
; build_src_filter = ${Heltec_E213_base.build_src_filter}
;   +<helpers/bridges/RS232Bridge.cpp>
;   +<helpers/ui/E213Display.cpp>
;   +<../examples/simple_repeater>
; lib_deps =
;   ${Heltec_E213_base.lib_deps}
;   ${esp32_ota.lib_deps}
;   bakercp/CRC32 @ ^2.0.0

[env:Heltec_E213_repeater_bridge_espnow]
extends = Heltec_E213_base
build_flags =
  ${Heltec_E213_base.build_flags}
  -D DISPLAY_CLASS=E213Display
  -D ADVERT_NAME='"ESPNow Bridge"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=50
  -D WITH_ESPNOW_BRIDGE=1
;  -D BRIDGE_DEBUG=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Heltec_E213_base.build_src_filter}
  +<helpers/bridges/ESPNowBridge.cpp>
  +<helpers/ui/E213Display.cpp>
  +<../examples/simple_repeater>
lib_deps =
  ${Heltec_E213_base.lib_deps}
  ${esp32_ota.lib_deps}
  bakercp/CRC32 @ ^2.0.0

[env:Heltec_E213_room_server]
extends = Heltec_E213_base
build_flags =
  ${Heltec_E213_base.build_flags}
  -D DISPLAY_CLASS=E213Display
  -D ADVERT_NAME='"Heltec E213 Room"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D ROOM_PASSWORD='"hello"'
build_src_filter = ${Heltec_E213_base.build_src_filter}
  +<helpers/ui/E213Display.cpp>
  +<../examples/simple_room_server>
lib_deps =
  ${Heltec_E213_base.lib_deps}
  ${esp32_ota.lib_deps}
  bakercp/CRC32 @ ^2.0.0

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