[Heltec_Wireless_Paper_base]
extends = esp32_base
board = esp32-s3-devkitc-1
build_flags =
  ${esp32_base.build_flags}
  -I variants/heltec_wireless_paper
  -D HELTEC_WIRELESS_PAPER
  ;-D ARDUINO_USB_CDC_ON_BOOT=1      ; this breaks Serial
  -D P_LORA_DIO_1=14
  -D P_LORA_NSS=8
  -D P_LORA_RESET=RADIOLIB_NC
  -D P_LORA_BUSY=13
  -D P_LORA_SCLK=9
  -D P_LORA_MISO=11
  -D P_LORA_MOSI=10
  -D USE_SX1262
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D LORA_TX_POWER=22
  -D P_LORA_TX_LED=18
  ;-D PIN_BOARD_SDA=17
  ;-D PIN_BOARD_SCL=18               ; same GPIO as P_LORA_TX_LED
  -D PIN_USER_BTN=0
  -D PIN_VEXT_EN=45
  -D PIN_VBAT_READ=20
  -D PIN_ADC_CTRL=19
  -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 DISP_CS=4
  -D DISP_BUSY=7
  -D DISP_DC=5
  -D DISP_RST=6
  -D DISP_SCLK=3
  -D DISP_MOSI=2
  -D ARDUINO_heltec_wifi_lora_32_V3
  -D WIRELESS_PAPER
build_src_filter = ${esp32_base.build_src_filter}
  +<../variants/heltec_wireless_paper>
lib_deps =
  ${esp32_base.lib_deps}
  https://github.com/todd-herbert/heltec-eink-modules/archive/9207eb6ab2b96f66298e0488740218c17b006af7.zip

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

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

; [env:Heltec_Wireless_Paper_repeater_bridge_rs232]
; extends = Heltec_Wireless_Paper_base
; build_flags =
;   ${Heltec_Wireless_Paper_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_Wireless_Paper_base.build_src_filter}
;   +<helpers/bridges/RS232Bridge.cpp>
;   +<helpers/ui/E213Display.cpp>
;   +<../examples/simple_repeater>
; lib_deps =
;   ${Heltec_Wireless_Paper_base.lib_deps}
;   ${esp32_ota.lib_deps}

[env:Heltec_Wireless_Paper_repeater_bridge_espnow]
extends = Heltec_Wireless_Paper_base
build_flags =
  ${Heltec_Wireless_Paper_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_Wireless_Paper_base.build_src_filter}
  +<helpers/bridges/ESPNowBridge.cpp>
  +<helpers/ui/E213Display.cpp>
  +<../examples/simple_repeater>
lib_deps =
  ${Heltec_Wireless_Paper_base.lib_deps}
  ${esp32_ota.lib_deps}
  bakercp/CRC32 @ ^2.0.0

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