[Xiao_esp32_C3]
extends = esp32_base
board = seeed_xiao_esp32c3
build_flags =
  ${esp32_base.build_flags}
  -I variants/xiao_c3
  -D ESP32_CPU_FREQ=80
  -D PIN_VBAT_READ=D0
  -D P_LORA_DIO_1=D1
  -D P_LORA_NSS=D4
  -D P_LORA_RESET=D2
  -D P_LORA_BUSY=D3
  -D PIN_BOARD_SDA=D6
  -D PIN_BOARD_SCL=D7
  -D USE_SX1262
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D SX126X_RX_BOOSTED_GAIN=1
  -D LORA_TX_POWER=22
  -D SX126X_RXEN=D5
  -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/xiao_c3>
  +<helpers/sensors>
lib_deps =
  ${esp32_base.lib_deps}

[env:Xiao_C3_repeater]
extends = Xiao_esp32_C3
build_src_filter = ${Xiao_esp32_C3.build_src_filter}
  +<../examples/simple_repeater/*.cpp>
build_flags =
  ${Xiao_esp32_C3.build_flags}
  ${sensor_base.build_flags}
  -UENV_INCLUDE_GPS
  -UENV_INCLUDE_VL53L0X
  -D ADVERT_NAME='"Xiao C3 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 =
  ${Xiao_esp32_C3.lib_deps}
  ${sensor_base.lib_deps}
  ${esp32_ota.lib_deps}
  bakercp/CRC32 @ ^2.0.0

[env:Xiao_C3_room_server]
extends = Xiao_esp32_C3
build_src_filter = ${Xiao_esp32_C3.build_src_filter}
  +<../examples/simple_room_server/*.cpp>
build_flags =
  ${Xiao_esp32_C3.build_flags}
  ${sensor_base.build_flags}
  -UENV_INCLUDE_GPS
  -UENV_INCLUDE_VL53L0X
  -D ADVERT_NAME='"Xiao C3 Room"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
  -D ROOM_PASSWORD='"hello"'
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
lib_deps =
  ${Xiao_esp32_C3.lib_deps}
  ${sensor_base.lib_deps}
  ${esp32_ota.lib_deps}
  bakercp/CRC32 @ ^2.0.0

[env:Xiao_C3_companion_radio_ble]
extends = Xiao_esp32_C3
build_src_filter = ${Xiao_esp32_C3.build_src_filter}
  +<../examples/companion_radio/*.cpp>
  +<helpers/esp32/*.cpp>
build_flags =
  ${Xiao_esp32_C3.build_flags}
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D BLE_PIN_CODE=123456
  -D OFFLINE_QUEUE_SIZE=256
  ; -D BLE_DEBUG_LOGGING=1
  ; -D MESH_PACKET_LOGGING=1
  ; -D MESH_DEBUG=1
lib_deps =
  ${Xiao_esp32_C3.lib_deps}
  ${esp32_ota.lib_deps}
  densaugeo/base64 @ ~1.4.0

[env:Xiao_C3_companion_radio_usb]
extends = Xiao_esp32_C3
build_src_filter = ${Xiao_esp32_C3.build_src_filter}
  +<../examples/companion_radio/*.cpp>
  +<helpers/esp32/*.cpp>
build_flags =
  ${Xiao_esp32_C3.build_flags}
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D OFFLINE_QUEUE_SIZE=256
  ; -D BLE_DEBUG_LOGGING=1
  ; -D MESH_PACKET_LOGGING=1
  ; -D MESH_DEBUG=1
lib_deps =
  ${Xiao_esp32_C3.lib_deps}
  ${esp32_ota.lib_deps}
  densaugeo/base64 @ ~1.4.0

[env:Xiao_C3_companion_radio_wifi]
extends = Xiao_esp32_C3
build_src_filter = ${Xiao_esp32_C3.build_src_filter}
  +<../examples/companion_radio/*.cpp>
  +<helpers/esp32/*.cpp>
build_flags =
  ${Xiao_esp32_C3.build_flags}
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D OFFLINE_QUEUE_SIZE=256
  -D WIFI_DEBUG_LOGGING=1
  -D WIFI_SSID='"myssid"'
  -D WIFI_PWD='"mypwd"'
  ; -D BLE_DEBUG_LOGGING=1
  ; -D MESH_PACKET_LOGGING=1
  ; -D MESH_DEBUG=1
lib_deps =
  ${Xiao_esp32_C3.lib_deps}
  ${esp32_ota.lib_deps}
  densaugeo/base64 @ ~1.4.0
