[Generic_E22]
extends = esp32_base
board = esp32doit-devkit-v1
build_flags =
  ${esp32_base.build_flags}
  -I variants/generic-e22
  -D GENERIC_E22
  -D P_LORA_TX_LED=2
  -D PIN_VBAT_READ=35
  -D P_LORA_DIO_1=33
  -D P_LORA_NSS=18
  -D P_LORA_RESET=RADIOLIB_NC
  -D P_LORA_BUSY=32
  -D P_LORA_SCLK=5
  -D P_LORA_MOSI=27
  -D P_LORA_MISO=19
  -D SX126X_TXEN=13
  -D SX126X_RXEN=14
  -D PIN_BOARD_SDA=21
  -D PIN_BOARD_SCL=22
  -D SX126X_DIO2_AS_RF_SWITCH=true
  -D SX126X_DIO3_TCXO_VOLTAGE=1.8
  -D SX126X_CURRENT_LIMIT=140
build_src_filter = ${esp32_base.build_src_filter}
  +<../variants/generic-e22>
lib_deps =
  ${esp32_base.lib_deps}
  adafruit/Adafruit SSD1306 @ ^2.5.13

[env:Generic_E22_sx1262_repeater]
extends = Generic_E22
build_src_filter = ${Generic_E22.build_src_filter}
  +<../examples/simple_repeater/*.cpp>
build_flags =
  ${Generic_E22.build_flags}
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D LORA_TX_POWER=22
  -D ADVERT_NAME='"E22 Repeater"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=50
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
lib_deps =
  ${Generic_E22.lib_deps}
  ${esp32_ota.lib_deps}

; [env:Generic_E22_sx1262_repeater_bridge_rs232]
; extends = Generic_E22
; build_src_filter = ${Generic_E22.build_src_filter}
;   +<helpers/bridges/RS232Bridge.cpp>
;   +<../examples/simple_repeater/*.cpp>
; build_flags =
;   ${Generic_E22.build_flags}
;   -D RADIO_CLASS=CustomSX1262
;   -D WRAPPER_CLASS=CustomSX1262Wrapper
;   -D LORA_TX_POWER=22
;   -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
; lib_deps =
;   ${Generic_E22.lib_deps}
;   ${esp32_ota.lib_deps}

[env:Generic_E22_sx1262_repeater_bridge_espnow]
extends = Generic_E22
build_src_filter = ${Generic_E22.build_src_filter}
  +<helpers/bridges/ESPNowBridge.cpp>
  +<../examples/simple_repeater/*.cpp>
build_flags =
  ${Generic_E22.build_flags}
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D LORA_TX_POWER=22
  -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
lib_deps =
  ${Generic_E22.lib_deps}
  ${esp32_ota.lib_deps}

[env:Generic_E22_sx1268_repeater]
extends = Generic_E22
build_src_filter = ${Generic_E22.build_src_filter}
  +<../examples/simple_repeater/*.cpp>
build_flags =
  ${Generic_E22.build_flags}
  -D RADIO_CLASS=CustomSX1268
  -D WRAPPER_CLASS=CustomSX1268Wrapper
  -D LORA_TX_POWER=22
  -D ADVERT_NAME='"E22 Repeater"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D MAX_NEIGHBOURS=50
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
lib_deps =
  ${Generic_E22.lib_deps}
  ${esp32_ota.lib_deps}

; [env:Generic_E22_sx1268_repeater_bridge_rs232]
; extends = Generic_E22
; build_src_filter = ${Generic_E22.build_src_filter}
;   +<helpers/bridges/RS232Bridge.cpp>
;   +<../examples/simple_repeater/*.cpp>
; build_flags =
;   ${Generic_E22.build_flags}
;   -D RADIO_CLASS=CustomSX1268
;   -D WRAPPER_CLASS=CustomSX1268Wrapper
;   -D LORA_TX_POWER=22
;   -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
; lib_deps =
;   ${Generic_E22.lib_deps}
;   ${esp32_ota.lib_deps}

[env:Generic_E22_sx1268_repeater_bridge_espnow]
extends = Generic_E22
build_src_filter = ${Generic_E22.build_src_filter}
  +<helpers/bridges/ESPNowBridge.cpp>
  +<../examples/simple_repeater/*.cpp>
build_flags =
  ${Generic_E22.build_flags}
  -D RADIO_CLASS=CustomSX1268
  -D WRAPPER_CLASS=CustomSX1268Wrapper
  -D LORA_TX_POWER=22
  -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
lib_deps =
  ${Generic_E22.lib_deps}
  ${esp32_ota.lib_deps}
