[Xiao_S3]
extends = esp32_base
board = seeed_xiao_esp32s3
board_check = true
board_build.mcu = esp32s3
build_flags = ${esp32_base.build_flags}
  ${sensor_base.build_flags}
  -I variants/xiao_s3
  -UENV_INCLUDE_GPS
  -D SEEED_XIAO_S3
  -D PIN_VBAT_READ=1   ; D0
  -D P_LORA_DIO_1=2    ; D1
  -D P_LORA_NSS=5      ; D4
  -D P_LORA_RESET=3    ; D2
  -D P_LORA_BUSY=4     ; D3
  -D P_LORA_SCLK=7     ; D8
  -D P_LORA_MISO=8     ; D0
  -D P_LORA_MOSI=9     ; D10
  -D PIN_USER_BTN=-1   ; NC
  -D PIN_STATUS_LED=21 ; Orange user led, LOW=On
  -D PIN_BOARD_SDA=D6  ; D6=43
  -D PIN_BOARD_SCL=D7  ; D7=44
  -D SX126X_RXEN=6     ; D5
  -D SX126X_TXEN=RADIOLIB_NC
  -D SX126X_DIO2_AS_RF_SWITCH=true
  -D SX126X_DIO3_TCXO_VOLTAGE=1.8
  -D SX126X_CURRENT_LIMIT=140
  -D RADIO_CLASS=CustomSX1262
  -D WRAPPER_CLASS=CustomSX1262Wrapper
  -D LORA_TX_POWER=22
  -D SX126X_RX_BOOSTED_GAIN=1
build_src_filter = ${esp32_base.build_src_filter}
  +<../variants/xiao_s3>
  +<helpers/sensors>
lib_deps =
  ${esp32_base.lib_deps}
  ${sensor_base.lib_deps}

[env:Xiao_S3_repeater]
extends = Xiao_S3
build_src_filter = ${Xiao_S3.build_src_filter}
  +<../examples/simple_repeater/*.cpp>
build_flags =
  ${Xiao_S3.build_flags}
  -D ADVERT_NAME='"Xiao S3 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_S3.lib_deps}
  ${esp32_ota.lib_deps}

[env:Xiao_S3_repeater_bridge_espnow]
extends = Xiao_S3
build_src_filter = ${Xiao_S3.build_src_filter}
  +<helpers/bridges/ESPNowBridge.cpp>
  +<../examples/simple_repeater/*.cpp>
build_flags =
  ${Xiao_S3.build_flags}
  -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 =
  ${Xiao_S3.lib_deps}
  ${esp32_ota.lib_deps}

[env:Xiao_S3_room_server]
extends = Xiao_S3
build_src_filter = ${Xiao_S3.build_src_filter}
  +<../examples/simple_room_server>
build_flags =
  ${Xiao_S3.build_flags}
  -D ADVERT_NAME='"Xiao S3 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_S3.lib_deps}
  ${esp32_ota.lib_deps}

[env:Xiao_S3_companion_radio_ble]
extends = Xiao_S3
build_flags =
  ${Xiao_S3.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D BLE_PIN_CODE=123456
  -D DISPLAY_CLASS=SSD1306Display
  -D OFFLINE_QUEUE_SIZE=256
;  -D BLE_DEBUG_LOGGING=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Xiao_S3.build_src_filter}
  +<helpers/ui/SSD1306Display.cpp>
  +<helpers/esp32/*.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${Xiao_S3.lib_deps}
  densaugeo/base64 @ ~1.4.0
  adafruit/Adafruit SSD1306 @ ^2.5.13

[env:Xiao_S3_companion_radio_ble_ps]
extends = env:Xiao_S3_companion_radio_ble

[env:Xiao_S3_companion_radio_usb]
extends = Xiao_S3
build_flags =
  ${Xiao_S3.build_flags}
  -I examples/companion_radio/ui-new
  -D MAX_CONTACTS=350
  -D MAX_GROUP_CHANNELS=40
  -D DISPLAY_CLASS=SSD1306Display
  -D OFFLINE_QUEUE_SIZE=256
;  -D BLE_DEBUG_LOGGING=1
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
build_src_filter = ${Xiao_S3.build_src_filter}
  +<helpers/ui/SSD1306Display.cpp>
  +<helpers/esp32/*.cpp>
  +<helpers/ui/MomentaryButton.cpp>
  +<../examples/companion_radio/*.cpp>
  +<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
  ${Xiao_S3.lib_deps}
  densaugeo/base64 @ ~1.4.0
  adafruit/Adafruit SSD1306 @ ^2.5.13

[env:Xiao_S3_sensor]
extends = Xiao_S3
build_src_filter = ${Xiao_S3.build_src_filter}
  +<../examples/simple_sensor>
build_flags =
  ${Xiao_S3.build_flags}
  -D ADVERT_NAME='"Xiao S3 Sensor"'
  -D ADVERT_LAT=0.0
  -D ADVERT_LON=0.0
  -D ADMIN_PASSWORD='"password"'
;  -D MESH_PACKET_LOGGING=1
;  -D MESH_DEBUG=1
lib_deps =
  ${Xiao_S3.lib_deps}
  ${esp32_ota.lib_deps}

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