From ff80287a2a3c79e5e4362ab2f097a25f2ddb1c81 Mon Sep 17 00:00:00 2001 From: pelgraine <140762863+pelgraine@users.noreply.github.com> Date: Wed, 28 Jan 2026 17:48:05 +1100 Subject: [PATCH] Deleted other extraneous variants --- variants/ebyte_eora_s3/platformio.ini | 136 ------- variants/ebyte_eora_s3/target.cpp | 85 ---- variants/ebyte_eora_s3/target.h | 29 -- variants/generic-e22/platformio.ini | 164 -------- variants/generic-e22/target.cpp | 48 --- variants/generic-e22/target.h | 21 - variants/generic-e22/variant.h | 44 --- variants/generic_espnow/platformio.ini | 81 ---- variants/generic_espnow/target.cpp | 44 --- variants/generic_espnow/target.h | 16 - variants/heltec_ct62/HT-CT62Board.h | 59 --- variants/heltec_ct62/platformio.ini | 151 ------- variants/heltec_ct62/target.cpp | 37 -- variants/heltec_ct62/target.h | 20 - variants/heltec_e213/HeltecE213Board.cpp | 67 ---- variants/heltec_e213/HeltecE213Board.h | 20 - variants/heltec_e213/pins_arduino.h | 61 --- variants/heltec_e213/platformio.ini | 159 -------- variants/heltec_e213/target.cpp | 54 --- variants/heltec_e213/target.h | 29 -- variants/heltec_e290/HeltecE290Board.cpp | 67 ---- variants/heltec_e290/HeltecE290Board.h | 21 - variants/heltec_e290/pins_arduino.h | 61 --- variants/heltec_e290/platformio.ini | 155 -------- variants/heltec_e290/target.cpp | 54 --- variants/heltec_e290/target.h | 29 -- variants/heltec_mesh_solar/MeshSolarBoard.cpp | 16 - variants/heltec_mesh_solar/MeshSolarBoard.h | 35 -- variants/heltec_mesh_solar/platformio.ini | 95 ----- variants/heltec_mesh_solar/target.cpp | 123 ------ variants/heltec_mesh_solar/target.h | 46 --- variants/heltec_mesh_solar/variant.cpp | 16 - variants/heltec_mesh_solar/variant.h | 127 ------ variants/heltec_t114/T114Board.cpp | 60 --- variants/heltec_t114/T114Board.h | 59 --- variants/heltec_t114/platformio.ini | 249 ------------ variants/heltec_t114/target.cpp | 133 ------- variants/heltec_t114/target.h | 54 --- variants/heltec_t114/variant.cpp | 15 - variants/heltec_t114/variant.h | 139 ------- variants/heltec_t190/HeltecT190Board.cpp | 67 ---- variants/heltec_t190/HeltecT190Board.h | 21 - variants/heltec_t190/pins_arduino.h | 61 --- variants/heltec_t190/platformio.ini | 154 -------- variants/heltec_t190/target.cpp | 54 --- variants/heltec_t190/target.h | 29 -- variants/heltec_tracker/platformio.ini | 157 -------- variants/heltec_tracker/target.cpp | 126 ------ variants/heltec_tracker/target.h | 47 --- .../HeltecTrackerV2Board.cpp | 88 ----- .../heltec_tracker_v2/HeltecTrackerV2Board.h | 23 -- variants/heltec_tracker_v2/pins_arduino.h | 60 --- variants/heltec_tracker_v2/platformio.ini | 219 ----------- variants/heltec_tracker_v2/target.cpp | 60 --- variants/heltec_tracker_v2/target.h | 30 -- variants/heltec_v2/HeltecV2Board.h | 67 ---- variants/heltec_v2/platformio.ini | 197 ---------- variants/heltec_v2/target.cpp | 53 --- variants/heltec_v2/target.h | 29 -- variants/heltec_v3/HeltecV3Board.h | 97 ----- variants/heltec_v3/platformio.ini | 369 ------------------ variants/heltec_v3/target.cpp | 60 --- variants/heltec_v3/target.h | 30 -- variants/heltec_v4/HeltecV4Board.cpp | 90 ----- variants/heltec_v4/HeltecV4Board.h | 23 -- variants/heltec_v4/pins_arduino.h | 67 ---- variants/heltec_v4/platformio.ini | 210 ---------- variants/heltec_v4/target.cpp | 60 --- variants/heltec_v4/target.h | 30 -- variants/heltec_wireless_paper/platformio.ini | 142 ------- variants/heltec_wireless_paper/target.cpp | 53 --- variants/heltec_wireless_paper/target.h | 29 -- .../ikoka_handheld_nrf/IkokaNrf52Board.cpp | 40 -- variants/ikoka_handheld_nrf/IkokaNrf52Board.h | 44 --- variants/ikoka_handheld_nrf/platformio.ini | 103 ----- variants/ikoka_handheld_nrf/target.cpp | 46 --- variants/ikoka_handheld_nrf/target.h | 29 -- variants/ikoka_handheld_nrf/variant.cpp | 84 ---- variants/ikoka_handheld_nrf/variant.h | 148 ------- variants/ikoka_nano_nrf/IkokaNanoNRFBoard.cpp | 35 -- variants/ikoka_nano_nrf/IkokaNanoNRFBoard.h | 52 --- variants/ikoka_nano_nrf/platformio.ini | 280 ------------- variants/ikoka_nano_nrf/target.cpp | 44 --- variants/ikoka_nano_nrf/target.h | 28 -- variants/ikoka_nano_nrf/variant.cpp | 86 ---- variants/ikoka_nano_nrf/variant.h | 149 ------- .../ikoka_stick_nrf/IkokaStickNRFBoard.cpp | 35 -- variants/ikoka_stick_nrf/IkokaStickNRFBoard.h | 52 --- variants/ikoka_stick_nrf/platformio.ini | 291 -------------- variants/ikoka_stick_nrf/target.cpp | 44 --- variants/ikoka_stick_nrf/target.h | 28 -- variants/ikoka_stick_nrf/variant.cpp | 86 ---- variants/ikoka_stick_nrf/variant.h | 149 ------- variants/keepteen_lt1/KeepteenLT1Board.cpp | 17 - variants/keepteen_lt1/KeepteenLT1Board.h | 44 --- variants/keepteen_lt1/platformio.ini | 101 ----- variants/keepteen_lt1/target.cpp | 51 --- variants/keepteen_lt1/target.h | 30 -- variants/keepteen_lt1/variant.cpp | 22 -- variants/keepteen_lt1/variant.h | 74 ---- variants/lilygo_t3s3/platformio.ini | 174 --------- variants/lilygo_t3s3/target.cpp | 48 --- variants/lilygo_t3s3/target.h | 29 -- variants/lilygo_t3s3_sx1276/platformio.ini | 171 -------- variants/lilygo_t3s3_sx1276/target.cpp | 54 --- variants/lilygo_t3s3_sx1276/target.h | 29 -- variants/lilygo_tbeam_SX1262/platformio.ini | 134 ------- variants/lilygo_tbeam_SX1262/target.cpp | 55 --- variants/lilygo_tbeam_SX1262/target.h | 29 -- variants/lilygo_tbeam_SX1276/platformio.ini | 133 ------- variants/lilygo_tbeam_SX1276/target.cpp | 60 --- variants/lilygo_tbeam_SX1276/target.h | 29 -- .../platformio.ini | 133 ------- .../lilygo_tbeam_supreme_SX1262/target.cpp | 52 --- variants/lilygo_tbeam_supreme_SX1262/target.h | 27 -- variants/lilygo_techo/TechoBoard.cpp | 31 -- variants/lilygo_techo/TechoBoard.h | 44 --- variants/lilygo_techo/platformio.ini | 128 ------ variants/lilygo_techo/target.cpp | 53 --- variants/lilygo_techo/target.h | 31 -- variants/lilygo_techo/variant.cpp | 36 -- variants/lilygo_techo/variant.h | 141 ------- variants/lilygo_tlora_c6/platformio.ini | 85 ---- variants/lilygo_tlora_c6/target.cpp | 48 --- variants/lilygo_tlora_c6/target.h | 20 - variants/lilygo_tlora_v2_1/LilyGoTLoraBoard.h | 24 -- variants/lilygo_tlora_v2_1/platformio.ini | 194 --------- variants/lilygo_tlora_v2_1/target.cpp | 49 --- variants/lilygo_tlora_v2_1/target.h | 29 -- variants/mesh_pocket/MeshPocket.cpp | 12 - variants/mesh_pocket/MeshPocket.h | 39 -- variants/mesh_pocket/platformio.ini | 112 ------ variants/mesh_pocket/target.cpp | 44 --- variants/mesh_pocket/target.h | 33 -- variants/mesh_pocket/variant.cpp | 15 - variants/mesh_pocket/variant.h | 124 ------ variants/meshadventurer/platformio.ini | 347 ---------------- variants/meshadventurer/target.cpp | 116 ------ variants/meshadventurer/target.h | 49 --- variants/meshadventurer/variant.h | 44 --- .../MinewsemiME25LS01Board.cpp | 29 -- .../MinewsemiME25LS01Board.h | 79 ---- .../minewsemi_me25ls01/NullDisplayDriver.h | 24 -- variants/minewsemi_me25ls01/platformio.ini | 172 -------- variants/minewsemi_me25ls01/target.cpp | 98 ----- variants/minewsemi_me25ls01/target.h | 29 -- variants/minewsemi_me25ls01/variant.cpp | 70 ---- variants/minewsemi_me25ls01/variant.h | 94 ----- variants/nano_g2_ultra/nano-g2.cpp | 103 ----- variants/nano_g2_ultra/nano-g2.h | 57 --- variants/nano_g2_ultra/platformio.ini | 93 ----- variants/nano_g2_ultra/target.cpp | 143 ------- variants/nano_g2_ultra/target.h | 49 --- variants/nano_g2_ultra/variant.cpp | 36 -- variants/nano_g2_ultra/variant.h | 193 --------- variants/nibble_screen_connect/platformio.ini | 160 -------- variants/nibble_screen_connect/target.cpp | 49 --- variants/nibble_screen_connect/target.h | 30 -- variants/promicro/PromicroBoard.cpp | 25 -- variants/promicro/PromicroBoard.h | 79 ---- variants/promicro/platformio.ini | 172 -------- variants/promicro/target.cpp | 51 --- variants/promicro/target.h | 30 -- variants/promicro/variant.cpp | 15 - variants/promicro/variant.h | 82 ---- .../rak_wismesh_tag/RAKWismeshTagBoard.cpp | 18 - variants/rak_wismesh_tag/RAKWismeshTagBoard.h | 74 ---- variants/rak_wismesh_tag/platformio.ini | 121 ------ variants/rak_wismesh_tag/target.cpp | 54 --- variants/rak_wismesh_tag/target.h | 27 -- variants/rak_wismesh_tag/variant.cpp | 21 - variants/rak_wismesh_tag/variant.h | 121 ------ 172 files changed, 13276 deletions(-) delete mode 100644 variants/ebyte_eora_s3/platformio.ini delete mode 100644 variants/ebyte_eora_s3/target.cpp delete mode 100644 variants/ebyte_eora_s3/target.h delete mode 100644 variants/generic-e22/platformio.ini delete mode 100644 variants/generic-e22/target.cpp delete mode 100644 variants/generic-e22/target.h delete mode 100644 variants/generic-e22/variant.h delete mode 100644 variants/generic_espnow/platformio.ini delete mode 100644 variants/generic_espnow/target.cpp delete mode 100644 variants/generic_espnow/target.h delete mode 100644 variants/heltec_ct62/HT-CT62Board.h delete mode 100644 variants/heltec_ct62/platformio.ini delete mode 100644 variants/heltec_ct62/target.cpp delete mode 100644 variants/heltec_ct62/target.h delete mode 100644 variants/heltec_e213/HeltecE213Board.cpp delete mode 100644 variants/heltec_e213/HeltecE213Board.h delete mode 100644 variants/heltec_e213/pins_arduino.h delete mode 100644 variants/heltec_e213/platformio.ini delete mode 100644 variants/heltec_e213/target.cpp delete mode 100644 variants/heltec_e213/target.h delete mode 100644 variants/heltec_e290/HeltecE290Board.cpp delete mode 100644 variants/heltec_e290/HeltecE290Board.h delete mode 100644 variants/heltec_e290/pins_arduino.h delete mode 100644 variants/heltec_e290/platformio.ini delete mode 100644 variants/heltec_e290/target.cpp delete mode 100644 variants/heltec_e290/target.h delete mode 100644 variants/heltec_mesh_solar/MeshSolarBoard.cpp delete mode 100644 variants/heltec_mesh_solar/MeshSolarBoard.h delete mode 100644 variants/heltec_mesh_solar/platformio.ini delete mode 100644 variants/heltec_mesh_solar/target.cpp delete mode 100644 variants/heltec_mesh_solar/target.h delete mode 100644 variants/heltec_mesh_solar/variant.cpp delete mode 100644 variants/heltec_mesh_solar/variant.h delete mode 100644 variants/heltec_t114/T114Board.cpp delete mode 100644 variants/heltec_t114/T114Board.h delete mode 100644 variants/heltec_t114/platformio.ini delete mode 100644 variants/heltec_t114/target.cpp delete mode 100644 variants/heltec_t114/target.h delete mode 100644 variants/heltec_t114/variant.cpp delete mode 100644 variants/heltec_t114/variant.h delete mode 100644 variants/heltec_t190/HeltecT190Board.cpp delete mode 100644 variants/heltec_t190/HeltecT190Board.h delete mode 100644 variants/heltec_t190/pins_arduino.h delete mode 100644 variants/heltec_t190/platformio.ini delete mode 100644 variants/heltec_t190/target.cpp delete mode 100644 variants/heltec_t190/target.h delete mode 100644 variants/heltec_tracker/platformio.ini delete mode 100644 variants/heltec_tracker/target.cpp delete mode 100644 variants/heltec_tracker/target.h delete mode 100644 variants/heltec_tracker_v2/HeltecTrackerV2Board.cpp delete mode 100644 variants/heltec_tracker_v2/HeltecTrackerV2Board.h delete mode 100644 variants/heltec_tracker_v2/pins_arduino.h delete mode 100644 variants/heltec_tracker_v2/platformio.ini delete mode 100644 variants/heltec_tracker_v2/target.cpp delete mode 100644 variants/heltec_tracker_v2/target.h delete mode 100644 variants/heltec_v2/HeltecV2Board.h delete mode 100644 variants/heltec_v2/platformio.ini delete mode 100644 variants/heltec_v2/target.cpp delete mode 100644 variants/heltec_v2/target.h delete mode 100644 variants/heltec_v3/HeltecV3Board.h delete mode 100644 variants/heltec_v3/platformio.ini delete mode 100644 variants/heltec_v3/target.cpp delete mode 100644 variants/heltec_v3/target.h delete mode 100644 variants/heltec_v4/HeltecV4Board.cpp delete mode 100644 variants/heltec_v4/HeltecV4Board.h delete mode 100644 variants/heltec_v4/pins_arduino.h delete mode 100644 variants/heltec_v4/platformio.ini delete mode 100644 variants/heltec_v4/target.cpp delete mode 100644 variants/heltec_v4/target.h delete mode 100644 variants/heltec_wireless_paper/platformio.ini delete mode 100644 variants/heltec_wireless_paper/target.cpp delete mode 100644 variants/heltec_wireless_paper/target.h delete mode 100644 variants/ikoka_handheld_nrf/IkokaNrf52Board.cpp delete mode 100644 variants/ikoka_handheld_nrf/IkokaNrf52Board.h delete mode 100644 variants/ikoka_handheld_nrf/platformio.ini delete mode 100644 variants/ikoka_handheld_nrf/target.cpp delete mode 100644 variants/ikoka_handheld_nrf/target.h delete mode 100644 variants/ikoka_handheld_nrf/variant.cpp delete mode 100644 variants/ikoka_handheld_nrf/variant.h delete mode 100644 variants/ikoka_nano_nrf/IkokaNanoNRFBoard.cpp delete mode 100644 variants/ikoka_nano_nrf/IkokaNanoNRFBoard.h delete mode 100644 variants/ikoka_nano_nrf/platformio.ini delete mode 100644 variants/ikoka_nano_nrf/target.cpp delete mode 100644 variants/ikoka_nano_nrf/target.h delete mode 100644 variants/ikoka_nano_nrf/variant.cpp delete mode 100644 variants/ikoka_nano_nrf/variant.h delete mode 100644 variants/ikoka_stick_nrf/IkokaStickNRFBoard.cpp delete mode 100644 variants/ikoka_stick_nrf/IkokaStickNRFBoard.h delete mode 100644 variants/ikoka_stick_nrf/platformio.ini delete mode 100644 variants/ikoka_stick_nrf/target.cpp delete mode 100644 variants/ikoka_stick_nrf/target.h delete mode 100644 variants/ikoka_stick_nrf/variant.cpp delete mode 100644 variants/ikoka_stick_nrf/variant.h delete mode 100644 variants/keepteen_lt1/KeepteenLT1Board.cpp delete mode 100644 variants/keepteen_lt1/KeepteenLT1Board.h delete mode 100644 variants/keepteen_lt1/platformio.ini delete mode 100644 variants/keepteen_lt1/target.cpp delete mode 100644 variants/keepteen_lt1/target.h delete mode 100644 variants/keepteen_lt1/variant.cpp delete mode 100644 variants/keepteen_lt1/variant.h delete mode 100644 variants/lilygo_t3s3/platformio.ini delete mode 100644 variants/lilygo_t3s3/target.cpp delete mode 100644 variants/lilygo_t3s3/target.h delete mode 100644 variants/lilygo_t3s3_sx1276/platformio.ini delete mode 100644 variants/lilygo_t3s3_sx1276/target.cpp delete mode 100644 variants/lilygo_t3s3_sx1276/target.h delete mode 100644 variants/lilygo_tbeam_SX1262/platformio.ini delete mode 100644 variants/lilygo_tbeam_SX1262/target.cpp delete mode 100644 variants/lilygo_tbeam_SX1262/target.h delete mode 100644 variants/lilygo_tbeam_SX1276/platformio.ini delete mode 100644 variants/lilygo_tbeam_SX1276/target.cpp delete mode 100644 variants/lilygo_tbeam_SX1276/target.h delete mode 100644 variants/lilygo_tbeam_supreme_SX1262/platformio.ini delete mode 100644 variants/lilygo_tbeam_supreme_SX1262/target.cpp delete mode 100644 variants/lilygo_tbeam_supreme_SX1262/target.h delete mode 100644 variants/lilygo_techo/TechoBoard.cpp delete mode 100644 variants/lilygo_techo/TechoBoard.h delete mode 100644 variants/lilygo_techo/platformio.ini delete mode 100644 variants/lilygo_techo/target.cpp delete mode 100644 variants/lilygo_techo/target.h delete mode 100644 variants/lilygo_techo/variant.cpp delete mode 100644 variants/lilygo_techo/variant.h delete mode 100644 variants/lilygo_tlora_c6/platformio.ini delete mode 100644 variants/lilygo_tlora_c6/target.cpp delete mode 100644 variants/lilygo_tlora_c6/target.h delete mode 100644 variants/lilygo_tlora_v2_1/LilyGoTLoraBoard.h delete mode 100644 variants/lilygo_tlora_v2_1/platformio.ini delete mode 100644 variants/lilygo_tlora_v2_1/target.cpp delete mode 100644 variants/lilygo_tlora_v2_1/target.h delete mode 100644 variants/mesh_pocket/MeshPocket.cpp delete mode 100644 variants/mesh_pocket/MeshPocket.h delete mode 100644 variants/mesh_pocket/platformio.ini delete mode 100644 variants/mesh_pocket/target.cpp delete mode 100644 variants/mesh_pocket/target.h delete mode 100644 variants/mesh_pocket/variant.cpp delete mode 100644 variants/mesh_pocket/variant.h delete mode 100644 variants/meshadventurer/platformio.ini delete mode 100644 variants/meshadventurer/target.cpp delete mode 100644 variants/meshadventurer/target.h delete mode 100644 variants/meshadventurer/variant.h delete mode 100644 variants/minewsemi_me25ls01/MinewsemiME25LS01Board.cpp delete mode 100644 variants/minewsemi_me25ls01/MinewsemiME25LS01Board.h delete mode 100644 variants/minewsemi_me25ls01/NullDisplayDriver.h delete mode 100644 variants/minewsemi_me25ls01/platformio.ini delete mode 100644 variants/minewsemi_me25ls01/target.cpp delete mode 100644 variants/minewsemi_me25ls01/target.h delete mode 100644 variants/minewsemi_me25ls01/variant.cpp delete mode 100644 variants/minewsemi_me25ls01/variant.h delete mode 100644 variants/nano_g2_ultra/nano-g2.cpp delete mode 100644 variants/nano_g2_ultra/nano-g2.h delete mode 100644 variants/nano_g2_ultra/platformio.ini delete mode 100644 variants/nano_g2_ultra/target.cpp delete mode 100644 variants/nano_g2_ultra/target.h delete mode 100644 variants/nano_g2_ultra/variant.cpp delete mode 100644 variants/nano_g2_ultra/variant.h delete mode 100644 variants/nibble_screen_connect/platformio.ini delete mode 100644 variants/nibble_screen_connect/target.cpp delete mode 100644 variants/nibble_screen_connect/target.h delete mode 100644 variants/promicro/PromicroBoard.cpp delete mode 100644 variants/promicro/PromicroBoard.h delete mode 100644 variants/promicro/platformio.ini delete mode 100644 variants/promicro/target.cpp delete mode 100644 variants/promicro/target.h delete mode 100644 variants/promicro/variant.cpp delete mode 100644 variants/promicro/variant.h delete mode 100644 variants/rak_wismesh_tag/RAKWismeshTagBoard.cpp delete mode 100644 variants/rak_wismesh_tag/RAKWismeshTagBoard.h delete mode 100644 variants/rak_wismesh_tag/platformio.ini delete mode 100644 variants/rak_wismesh_tag/target.cpp delete mode 100644 variants/rak_wismesh_tag/target.h delete mode 100644 variants/rak_wismesh_tag/variant.cpp delete mode 100644 variants/rak_wismesh_tag/variant.h diff --git a/variants/ebyte_eora_s3/platformio.ini b/variants/ebyte_eora_s3/platformio.ini deleted file mode 100644 index bdf6bba3..00000000 --- a/variants/ebyte_eora_s3/platformio.ini +++ /dev/null @@ -1,136 +0,0 @@ -[Ebyte_EoRa-S3] -extends = esp32_base -board = ebyte_eora-s3 -build_flags = - ${esp32_base.build_flags} - -I variants/ebyte_eora_s3 - -D EBYTE_EORA_S3 - -D P_LORA_DIO_1=33 - -D P_LORA_NSS=7 - -D P_LORA_RESET=8 ; RADIOLIB_NC - -D P_LORA_BUSY=34 - -D P_LORA_SCLK=5 - -D P_LORA_MISO=3 - -D P_LORA_MOSI=6 - -D P_LORA_TX_LED=37 - -D PIN_VBAT_READ=1 - -D PIN_USER_BTN=0 - -D PIN_BOARD_SDA=18 - -D PIN_BOARD_SCL=17 - -; SD_DAT0/MISO - GPIO2 -; SD_DAT1 - GPIO4 -; SD_CMD/MOSI - GPIO11 -; SD_DAT2 - GPIO112 -; SD_DAT3/CS - GPIO113 -; SD_CLK - GPIO114 - -D PIN_BOARD_SDA=18 - -D PIN_BOARD_SCL=17 - - -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/ebyte_eora_s3> -lib_deps = - ${esp32_base.lib_deps} - adafruit/Adafruit SSD1306 @ ^2.5.13 - -; === EByte EORA_S3 with SX1262 environments === -[env:Ebyte_EoRa-S3_Repeater] -extends = Ebyte_EoRa-S3 -build_flags = - ${Ebyte_EoRa-S3.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -D ADVERT_NAME='"EORA_S3-1262 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 -build_src_filter = ${Ebyte_EoRa-S3.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${Ebyte_EoRa-S3.lib_deps} - ${esp32_ota.lib_deps} - -[env:Ebyte_EoRa-S3_terminal_chat] -extends = Ebyte_EoRa-S3 -build_flags = - ${Ebyte_EoRa-S3.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Ebyte_EoRa-S3.build_src_filter} - +<../examples/simple_secure_chat/main.cpp> -lib_deps = - ${Ebyte_EoRa-S3.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Ebyte_EoRa-S3_room_server] -extends = Ebyte_EoRa-S3 -build_flags = - ${Ebyte_EoRa-S3.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -D ADVERT_NAME='"EORA_S3-1262 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 -build_src_filter = ${Ebyte_EoRa-S3.build_src_filter} - + - +<../examples/simple_room_server> -lib_deps = - ${Ebyte_EoRa-S3.lib_deps} - ${esp32_ota.lib_deps} - -[env:Ebyte_EoRa-S3_companion_radio_usb] -extends = Ebyte_EoRa-S3 -build_flags = - ${Ebyte_EoRa-S3.build_flags} - -I examples/companion_radio/ui-new - -D DISPLAY_CLASS=SSD1306Display - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 -; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 -; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 -build_src_filter = ${Ebyte_EoRa-S3.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Ebyte_EoRa-S3.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Ebyte_EoRa-S3_companion_radio_ble] -extends = Ebyte_EoRa-S3 -build_flags = - ${Ebyte_EoRa-S3.build_flags} - -I examples/companion_radio/ui-new - -D DISPLAY_CLASS=SSD1306Display - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Ebyte_EoRa-S3.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Ebyte_EoRa-S3.lib_deps} - densaugeo/base64 @ ~1.4.0 diff --git a/variants/ebyte_eora_s3/target.cpp b/variants/ebyte_eora_s3/target.cpp deleted file mode 100644 index 647f5997..00000000 --- a/variants/ebyte_eora_s3/target.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include -#include "target.h" - -ESP32Board board; - -#if defined(P_LORA_SCLK) - static SPIClass spi; - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -#else - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY); -#endif - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -SensorManager sensors; - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -#ifndef LORA_CR - #define LORA_CR 5 -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - -#ifdef SX126X_DIO3_TCXO_VOLTAGE - float tcxo = SX126X_DIO3_TCXO_VOLTAGE; -#else - float tcxo = 1.6f; -#endif - -#if defined(P_LORA_SCLK) - spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI); -#endif - int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_SX126X_SYNC_WORD_PRIVATE, LORA_TX_POWER, 8, tcxo); - if (status != RADIOLIB_ERR_NONE) { - Serial.print("ERROR: radio init failed: "); - Serial.println(status); - return false; // fail - } - - radio.setCRC(1); - -#if defined(SX126X_RXEN) && defined(SX126X_TXEN) - radio.setRfSwitchPins(SX126X_RXEN, SX126X_TXEN); -#endif - -#ifdef SX126X_CURRENT_LIMIT - radio.setCurrentLimit(SX126X_CURRENT_LIMIT); -#endif -#ifdef SX126X_DIO2_AS_RF_SWITCH - radio.setDio2AsRfSwitch(SX126X_DIO2_AS_RF_SWITCH); -#endif -#ifdef SX126X_RX_BOOSTED_GAIN - radio.setRxBoostedGainMode(SX126X_RX_BOOSTED_GAIN); -#endif - - return true; // success -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/ebyte_eora_s3/target.h b/variants/ebyte_eora_s3/target.h deleted file mode 100644 index f184c757..00000000 --- a/variants/ebyte_eora_s3/target.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -extern ESP32Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern SensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/generic-e22/platformio.ini b/variants/generic-e22/platformio.ini deleted file mode 100644 index 6b7bfd4e..00000000 --- a/variants/generic-e22/platformio.ini +++ /dev/null @@ -1,164 +0,0 @@ -[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} -; + -; +<../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} - + - +<../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} -; + -; +<../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} - + - +<../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} diff --git a/variants/generic-e22/target.cpp b/variants/generic-e22/target.cpp deleted file mode 100644 index e0253779..00000000 --- a/variants/generic-e22/target.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include -#include "target.h" - -ESP32Board board; - -#if defined(P_LORA_SCLK) - static SPIClass spi; - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -#else - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY); -#endif - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -SensorManager sensors; - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - - #if defined(P_LORA_SCLK) - return radio.std_init(&spi); - #else - return radio.std_init(); - #endif -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/generic-e22/target.h b/variants/generic-e22/target.h deleted file mode 100644 index 442706f3..00000000 --- a/variants/generic-e22/target.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#include - -extern ESP32Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern SensorManager sensors; - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/generic-e22/variant.h b/variants/generic-e22/variant.h deleted file mode 100644 index 6c850af2..00000000 --- a/variants/generic-e22/variant.h +++ /dev/null @@ -1,44 +0,0 @@ -// For OLED LCD -#define I2C_SDA 21 -#define I2C_SCL 22 - -// For GPS, 'undef's not needed -#define GPS_TX_PIN 15 -#define GPS_RX_PIN 12 -#define PIN_GPS_EN 4 -#define GPS_POWER_TOGGLE // Moved definition from platformio.ini to here - -#define BUTTON_PIN 39 // The middle button GPIO on the T-Beam -#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO35_CHANNEL -#define ADC_MULTIPLIER 1.85 // (R1 = 470k, R2 = 680k) -#define EXT_PWR_DETECT 4 // Pin to detect connected external power source for LILYGO® TTGO T-Energy T18 and other DIY boards -#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975). -#define LED_PIN 2 // add status LED (compatible with core-pcb and DIY targets) - -// Radio -#define USE_SX1262 // E22-900M30S uses SX1262 -#define USE_SX1268 // E22-400M30S uses SX1268 -#define SX126X_MAX_POWER 22 // Outputting 22dBm from SX1262 results in ~30dBm E22-900M30S output (module only uses last stage of the YP2233W PA) -#define SX126X_DIO3_TCXO_VOLTAGE 1.8 // E22 series TCXO reference voltage is 1.8V - -#define SX126X_CS 18 // EBYTE module's NSS pin -#define SX126X_SCK 5 // EBYTE module's SCK pin -#define SX126X_MOSI 27 // EBYTE module's MOSI pin -#define SX126X_MISO 19 // EBYTE module's MISO pin -#define SX126X_RESET 23 // EBYTE module's NRST pin -#define SX126X_BUSY 32 // EBYTE module's BUSY pin -#define SX126X_DIO1 33 // EBYTE module's DIO1 pin - -// The E22's TXEN pin is connected to MCU pin, E22's RXEN pin is connected to MCU pin (allows for ramping up PA before transmission -// Don't define DIO2_AS_RF_SWITCH because we only use DIO2 or an MCU pin mutually exclusively to connect to E22's TXEN (to prevent -// a short if they are both connected at the same time and there's a slight non-neglibible delay and/or voltage difference between -// DIO2 and TXEN). -#define SX126X_TXEN 13 // Schematic connects EBYTE module's TXEN pin to MCU -#define SX126X_RXEN 14 // Schematic connects EBYTE module's RXEN pin to MCU - -#define LORA_CS SX126X_CS // Compatibility with variant file configuration structure -#define LORA_SCK SX126X_SCK // Compatibility with variant file configuration structure -#define LORA_MOSI SX126X_MOSI // Compatibility with variant file configuration structure -#define LORA_MISO SX126X_MISO // Compatibility with variant file configuration structure -#define LORA_DIO1 SX126X_DIO1 // Compatibility with variant file configuration structure diff --git a/variants/generic_espnow/platformio.ini b/variants/generic_espnow/platformio.ini deleted file mode 100644 index cdeed076..00000000 --- a/variants/generic_espnow/platformio.ini +++ /dev/null @@ -1,81 +0,0 @@ - -; ----------- Generic ESP32-C3 ------------ - -[Generic_ESPNOW] -extends = esp32_base -board = esp32-c3-devkitm-1 -;board = esp32-s3-devkitm-1 -build_flags = - ${esp32_base.build_flags} - -I variants/generic_espnow -; -D ESP32_CPU_FREQ=80 - -D PIN_BOARD_SDA=-1 - -D PIN_BOARD_SCL=-1 -; -D P_LORA_TX_LED=8 - -D PIN_USER_BTN=0 -; -D ARDUINO_USB_MODE=1 -; -D ARDUINO_USB_CDC_ON_BOOT=1 -; -D ESPNOW_DEBUG_LOGGING=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${esp32_base.build_src_filter} - + - +<../variants/generic_espnow> - -[env:Generic_ESPNOW_terminal_chat] -extends = Generic_ESPNOW -build_flags = - ${Generic_ESPNOW.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=1 -build_src_filter = ${Generic_ESPNOW.build_src_filter} - +<../examples/simple_secure_chat/main.cpp> -lib_deps = - ${Generic_ESPNOW.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Generic_ESPNOW_repeatr] -extends = Generic_ESPNOW -build_flags = - ${Generic_ESPNOW.build_flags} - -D ADVERT_NAME='"ESPNOW Repeater"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D MAX_NEIGHBOURS=50 -build_src_filter = ${Generic_ESPNOW.build_src_filter} - +<../examples/simple_repeater/*.cpp> -lib_deps = - ${Generic_ESPNOW.lib_deps} - ${esp32_ota.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Generic_ESPNOW_comp_radio_usb] -extends = Generic_ESPNOW -build_flags = - ${Generic_ESPNOW.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=8 -; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 -; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 -; NOTE: DO NOT ENABLE --> -D ESPNOW_DEBUG_LOGGING=1 -build_src_filter = ${Generic_ESPNOW.build_src_filter} - +<../examples/companion_radio/*.cpp> -lib_deps = - ${Generic_ESPNOW.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Generic_ESPNOW_room_svr] -extends = Generic_ESPNOW -build_flags = - ${Generic_ESPNOW.build_flags} - -D ADVERT_NAME='"Heltec Room"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D ROOM_PASSWORD='"hello"' -build_src_filter = ${Generic_ESPNOW.build_src_filter} - +<../examples/simple_room_server/*.cpp> -lib_deps = - ${Generic_ESPNOW.lib_deps} - ${esp32_ota.lib_deps} diff --git a/variants/generic_espnow/target.cpp b/variants/generic_espnow/target.cpp deleted file mode 100644 index 6b5d4e44..00000000 --- a/variants/generic_espnow/target.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include -#include "target.h" -#include - -ESP32Board board; - -ESPNOWRadio radio_driver; - -ESP32RTCClock rtc_clock; -SensorManager sensors; - -bool radio_init() { - rtc_clock.begin(); - - radio_driver.init(); - - return true; // success -} - -uint32_t radio_get_rng_seed() { - return millis() + radio_driver.intID(); // TODO: where to get some entropy? -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - // no-op -} - -void radio_set_tx_power(uint8_t dbm) { - radio_driver.setTxPower(dbm); -} - -// NOTE: as we are using the WiFi radio, the ESP_IDF will have enabled hardware RNG: -// https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/random.html -class ESP_RNG : public mesh::RNG { -public: - void random(uint8_t* dest, size_t sz) override { - esp_fill_random(dest, sz); - } -}; - -mesh::LocalIdentity radio_new_identity() { - ESP_RNG rng; - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/generic_espnow/target.h b/variants/generic_espnow/target.h deleted file mode 100644 index 99b6f577..00000000 --- a/variants/generic_espnow/target.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include -#include -#include - -extern ESP32Board board; -extern ESPNOWRadio radio_driver; -extern ESP32RTCClock rtc_clock; -extern SensorManager sensors; - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/heltec_ct62/HT-CT62Board.h b/variants/heltec_ct62/HT-CT62Board.h deleted file mode 100644 index d26e7b26..00000000 --- a/variants/heltec_ct62/HT-CT62Board.h +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once - -#include -#include - -#if defined(ESP_PLATFORM) - -#include - -class Heltec_CT62_Board : public ESP32Board { - uint32_t gpio_state = 0; - -public: - void begin() { - ESP32Board::begin(); -#if defined(PIN_BOARD_RELAY_CH1) && defined(PIN_BOARD_RELAY_CH2) - pinMode(PIN_BOARD_RELAY_CH1, OUTPUT); - pinMode(PIN_BOARD_RELAY_CH2, OUTPUT); -#endif -#if defined(PIN_BOARD_DIGITAL_IN) - pinMode(PIN_BOARD_DIGITAL_IN, INPUT); -#endif - } - uint32_t getGpio() override { -#if defined(PIN_BOARD_DIGITAL_IN) - return gpio_state | (digitalRead(PIN_BOARD_DIGITAL_IN) ? 1 : 0); -#else - return 0; -#endif - } - void setGpio(uint32_t values) override { -#if defined(PIN_BOARD_RELAY_CH1) && defined(PIN_BOARD_RELAY_CH2) - gpio_state = values; - digitalWrite(PIN_BOARD_RELAY_CH1, values & 2); - digitalWrite(PIN_BOARD_RELAY_CH2, values & 4); -#endif - } - - uint16_t getBattMilliVolts() override { - #ifdef PIN_VBAT_READ - analogReadResolution(12); // ESP32-C3 ADC is 12-bit - 3.3/4096 (ref voltage/max counts) - uint32_t raw = 0; - for (int i = 0; i < 8; i++) { - raw += analogRead(PIN_VBAT_READ); - } - raw = raw / 8; - - return ((6.52 * raw) / 1024.0) * 1000; - #else - return 0; // not supported - #endif - } - - const char* getManufacturerName() const override { - return "Heltec CT62"; - } -}; - -#endif diff --git a/variants/heltec_ct62/platformio.ini b/variants/heltec_ct62/platformio.ini deleted file mode 100644 index 1f2e330a..00000000 --- a/variants/heltec_ct62/platformio.ini +++ /dev/null @@ -1,151 +0,0 @@ -[Heltec_ct62] -extends = esp32_base -board = esp32-c3-devkitm-1 -build_flags = - ${esp32_base.build_flags} - -I variants/heltec_ct62 - -D HELTEC_HT_CT62=1 - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D ESP32_CPU_FREQ=80 - -D LORA_TX_POWER=22 - -D P_LORA_TX_LED=18 - -D PIN_BOARD_SDA=0 - -D PIN_BOARD_SCL=1 - ;-D PIN_USER_BTN=9 - -D PIN_VBAT_READ=2 - -D P_LORA_DIO_1=3 - -D P_LORA_NSS=8 - -D P_LORA_RESET=5 - -D P_LORA_DIO_0=RADIOLIB_NC - -D P_LORA_DIO_2=RADIOLIB_NC - -D P_LORA_BUSY=4 - -D P_LORA_SCLK=10 - -D P_LORA_MISO=6 - -D P_LORA_MOSI=7 - -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 -build_src_filter = ${esp32_base.build_src_filter} - +<../variants/heltec_ct62> - -[env:Heltec_ct62_repeater] -extends = Heltec_ct62 -build_flags = - ${Heltec_ct62.build_flags} - ;-D ARDUINO_USB_MODE=1 - ;-D ARDUINO_USB_CDC_ON_BOOT=1 - -D ADVERT_NAME='"HT-CT62 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 -build_src_filter = ${Heltec_ct62.build_src_filter} - +<../examples/simple_repeater> -lib_deps = - ${Heltec_ct62.lib_deps} - ${esp32_ota.lib_deps} - -; [env:Heltec_ct62_repeater_bridge_rs232] -; extends = Heltec_ct62 -; build_flags = -; ${Heltec_ct62.build_flags} -; -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_ct62.build_src_filter} -; + -; +<../examples/simple_repeater> -; lib_deps = -; ${Heltec_ct62.lib_deps} -; ${esp32_ota.lib_deps} - -[env:Heltec_ct62_repeater_bridge_espnow] -extends = Heltec_ct62 -build_flags = - ${Heltec_ct62.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 -build_src_filter = ${Heltec_ct62.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_ct62.lib_deps} - ${esp32_ota.lib_deps} - -[env:Heltec_ct62_companion_radio_usb] -extends = Heltec_ct62 -build_flags = - ${Heltec_ct62.build_flags} -; -D ARDUINO_USB_MODE=1 -; -D ARDUINO_USB_CDC_ON_BOOT=1 - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_ct62.build_src_filter} - +<../examples/companion_radio/*.cpp> -lib_deps = - ${Heltec_ct62.lib_deps} - ${esp32_ota.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_ct62_companion_radio_ble] -extends = Heltec_ct62 -build_flags = - ${Heltec_ct62.build_flags} -; -D ARDUINO_USB_MODE=1 -; -D ARDUINO_USB_CDC_ON_BOOT=1 - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D OFFLINE_QUEUE_SIZE=256 - -D BLE_PIN_CODE=123456 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_ct62.build_src_filter} - +<../examples/companion_radio/*.cpp> - + -lib_deps = - ${Heltec_ct62.lib_deps} - ${esp32_ota.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_ct62_sensor] -extends = Heltec_ct62 -build_flags = - ${Heltec_ct62.build_flags} - -D ADVERT_NAME='"HT-CT62 Sensor"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D PIN_BOARD_SDA=-1 - -D PIN_BOARD_SCL=-1 - -D PIN_BOARD_RELAY_CH1=0 - -D PIN_BOARD_RELAY_CH2=1 - -D PIN_BOARD_DIGITAL_IN=19 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_ct62.build_src_filter} - +<../examples/simple_sensor> -lib_deps = - ${Heltec_ct62.lib_deps} - ${esp32_ota.lib_deps} diff --git a/variants/heltec_ct62/target.cpp b/variants/heltec_ct62/target.cpp deleted file mode 100644 index a8c15f5f..00000000 --- a/variants/heltec_ct62/target.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include "target.h" - -Heltec_CT62_Board board; - -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY); -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -SensorManager sensors; - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - return radio.std_init(&SPI); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} \ No newline at end of file diff --git a/variants/heltec_ct62/target.h b/variants/heltec_ct62/target.h deleted file mode 100644 index 9639ab2d..00000000 --- a/variants/heltec_ct62/target.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include "HT-CT62Board.h" -#include -#include -#include - -extern Heltec_CT62_Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern SensorManager sensors; - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); \ No newline at end of file diff --git a/variants/heltec_e213/HeltecE213Board.cpp b/variants/heltec_e213/HeltecE213Board.cpp deleted file mode 100644 index af115318..00000000 --- a/variants/heltec_e213/HeltecE213Board.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "HeltecE213Board.h" - -void HeltecE213Board::begin() { - ESP32Board::begin(); - - pinMode(PIN_ADC_CTRL, OUTPUT); - digitalWrite(PIN_ADC_CTRL, LOW); // Initially inactive - - periph_power.begin(); - - esp_reset_reason_t reason = esp_reset_reason(); - if (reason == ESP_RST_DEEPSLEEP) { - long wakeup_source = esp_sleep_get_ext1_wakeup_status(); - if (wakeup_source & (1 << P_LORA_DIO_1)) { // received a LoRa packet (while in deep sleep) - startup_reason = BD_STARTUP_RX_PACKET; - } - - rtc_gpio_hold_dis((gpio_num_t)P_LORA_NSS); - rtc_gpio_deinit((gpio_num_t)P_LORA_DIO_1); - } - } - - void HeltecE213Board::enterDeepSleep(uint32_t secs, int pin_wake_btn) { - esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON); - - // Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep - rtc_gpio_set_direction((gpio_num_t)P_LORA_DIO_1, RTC_GPIO_MODE_INPUT_ONLY); - rtc_gpio_pulldown_en((gpio_num_t)P_LORA_DIO_1); - - rtc_gpio_hold_en((gpio_num_t)P_LORA_NSS); - - if (pin_wake_btn < 0) { - esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet - } else { - esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1) | (1L << pin_wake_btn), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet OR wake btn - } - - if (secs > 0) { - esp_sleep_enable_timer_wakeup(secs * 1000000); - } - - // Finally set ESP32 into sleep - esp_deep_sleep_start(); // CPU halts here and never returns! - } - - void HeltecE213Board::powerOff() { - enterDeepSleep(0); - } - - uint16_t HeltecE213Board::getBattMilliVolts() { - analogReadResolution(10); - digitalWrite(PIN_ADC_CTRL, HIGH); - - uint32_t raw = 0; - for (int i = 0; i < 8; i++) { - raw += analogRead(PIN_VBAT_READ); - } - raw = raw / 8; - - digitalWrite(PIN_ADC_CTRL, LOW); - - return (5.42 * (3.3 / 1024.0) * raw) * 1000; - } - - const char* HeltecE213Board::getManufacturerName() const { - return "Heltec E213"; - } diff --git a/variants/heltec_e213/HeltecE213Board.h b/variants/heltec_e213/HeltecE213Board.h deleted file mode 100644 index 2192c141..00000000 --- a/variants/heltec_e213/HeltecE213Board.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -class HeltecE213Board : public ESP32Board { - -public: - RefCountedDigitalPin periph_power; - - HeltecE213Board() : periph_power(PIN_VEXT_EN,PIN_VEXT_EN_ACTIVE) { } - - void begin(); - void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1); - void powerOff() override; - uint16_t getBattMilliVolts() override; - const char* getManufacturerName() const override ; -}; diff --git a/variants/heltec_e213/pins_arduino.h b/variants/heltec_e213/pins_arduino.h deleted file mode 100644 index 56f5ef15..00000000 --- a/variants/heltec_e213/pins_arduino.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -static const uint8_t LED_BUILTIN = 45; // LED is not populated on earliest board variant -#define BUILTIN_LED LED_BUILTIN // Backward compatibility -#define LED_BUILTIN LED_BUILTIN - -static const uint8_t TX = 43; -static const uint8_t RX = 44; - -static const uint8_t SDA = 39; -static const uint8_t SCL = 38; - -static const uint8_t SS = 8; -static const uint8_t MOSI = 10; -static const uint8_t MISO = 11; -static const uint8_t SCK = 9; - -static const uint8_t A0 = 1; -static const uint8_t A1 = 2; -static const uint8_t A2 = 3; -static const uint8_t A3 = 4; -static const uint8_t A4 = 5; -static const uint8_t A5 = 6; -static const uint8_t A6 = 7; -static const uint8_t A7 = 8; -static const uint8_t A8 = 9; -static const uint8_t A9 = 10; -static const uint8_t A10 = 11; -static const uint8_t A11 = 12; -static const uint8_t A12 = 13; -static const uint8_t A13 = 14; -static const uint8_t A14 = 15; -static const uint8_t A15 = 16; -static const uint8_t A16 = 17; -static const uint8_t A17 = 18; -static const uint8_t A18 = 19; -static const uint8_t A19 = 20; - -static const uint8_t T1 = 1; -static const uint8_t T2 = 2; -static const uint8_t T3 = 3; -static const uint8_t T4 = 4; -static const uint8_t T5 = 5; -static const uint8_t T6 = 6; -static const uint8_t T7 = 7; -static const uint8_t T8 = 8; -static const uint8_t T9 = 9; -static const uint8_t T10 = 10; -static const uint8_t T11 = 11; -static const uint8_t T12 = 12; -static const uint8_t T13 = 13; -static const uint8_t T14 = 14; - -static const uint8_t RST_LoRa = 12; -static const uint8_t BUSY_LoRa = 13; -static const uint8_t DIO1 = 14; - -#endif /* Pins_Arduino_h */ diff --git a/variants/heltec_e213/platformio.ini b/variants/heltec_e213/platformio.ini deleted file mode 100644 index caba3a30..00000000 --- a/variants/heltec_e213/platformio.ini +++ /dev/null @@ -1,159 +0,0 @@ -[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 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 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} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_E213_base.lib_deps} - densaugeo/base64 @ ~1.4.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 OFFLINE_QUEUE_SIZE=256 -build_src_filter = ${Heltec_E213_base.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_E213_base.lib_deps} - densaugeo/base64 @ ~1.4.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} - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_E213_base.lib_deps} - ${esp32_ota.lib_deps} - -; [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} -; + -; + -; +<../examples/simple_repeater> -; lib_deps = -; ${Heltec_E213_base.lib_deps} -; ${esp32_ota.lib_deps} - -[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} - + - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_E213_base.lib_deps} - ${esp32_ota.lib_deps} - -[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} - + - +<../examples/simple_room_server> -lib_deps = - ${Heltec_E213_base.lib_deps} - ${esp32_ota.lib_deps} diff --git a/variants/heltec_e213/target.cpp b/variants/heltec_e213/target.cpp deleted file mode 100644 index 23561850..00000000 --- a/variants/heltec_e213/target.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "target.h" -#include - -HeltecE213Board board; - -#if defined(P_LORA_SCLK) - static SPIClass spi(FSPI); - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -#else - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY); -#endif - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); - -SensorManager sensors; - -#ifdef DISPLAY_CLASS -DISPLAY_CLASS display; -MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - -#if defined(P_LORA_SCLK) - return radio.std_init(&spi); -#else - return radio.std_init(); -#endif -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/heltec_e213/target.h b/variants/heltec_e213/target.h deleted file mode 100644 index 9ecdc212..00000000 --- a/variants/heltec_e213/target.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS -#include -#include -#endif - -extern HeltecE213Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern SensorManager sensors; - -#ifdef DISPLAY_CLASS -extern DISPLAY_CLASS display; -extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); \ No newline at end of file diff --git a/variants/heltec_e290/HeltecE290Board.cpp b/variants/heltec_e290/HeltecE290Board.cpp deleted file mode 100644 index 3994a206..00000000 --- a/variants/heltec_e290/HeltecE290Board.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "HeltecE290Board.h" - -void HeltecE290Board::begin() { - ESP32Board::begin(); - - pinMode(PIN_ADC_CTRL, OUTPUT); - digitalWrite(PIN_ADC_CTRL, LOW); // Initially inactive - - periph_power.begin(); - - esp_reset_reason_t reason = esp_reset_reason(); - if (reason == ESP_RST_DEEPSLEEP) { - long wakeup_source = esp_sleep_get_ext1_wakeup_status(); - if (wakeup_source & (1 << P_LORA_DIO_1)) { // received a LoRa packet (while in deep sleep) - startup_reason = BD_STARTUP_RX_PACKET; - } - - rtc_gpio_hold_dis((gpio_num_t)P_LORA_NSS); - rtc_gpio_deinit((gpio_num_t)P_LORA_DIO_1); - } - } - - void HeltecE290Board::enterDeepSleep(uint32_t secs, int pin_wake_btn) { - esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON); - - // Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep - rtc_gpio_set_direction((gpio_num_t)P_LORA_DIO_1, RTC_GPIO_MODE_INPUT_ONLY); - rtc_gpio_pulldown_en((gpio_num_t)P_LORA_DIO_1); - - rtc_gpio_hold_en((gpio_num_t)P_LORA_NSS); - - if (pin_wake_btn < 0) { - esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet - } else { - esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1) | (1L << pin_wake_btn), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet OR wake btn - } - - if (secs > 0) { - esp_sleep_enable_timer_wakeup(secs * 1000000); - } - - // Finally set ESP32 into sleep - esp_deep_sleep_start(); // CPU halts here and never returns! - } - - void HeltecE290Board::powerOff() { - enterDeepSleep(0); - } - - uint16_t HeltecE290Board::getBattMilliVolts() { - analogReadResolution(10); - digitalWrite(PIN_ADC_CTRL, HIGH); - - uint32_t raw = 0; - for (int i = 0; i < 8; i++) { - raw += analogRead(PIN_VBAT_READ); - } - raw = raw / 8; - - digitalWrite(PIN_ADC_CTRL, LOW); - - return (5.42 * (3.3 / 1024.0) * raw) * 1000; - } - - const char* HeltecE290Board::getManufacturerName() const { - return "Heltec E290"; - } diff --git a/variants/heltec_e290/HeltecE290Board.h b/variants/heltec_e290/HeltecE290Board.h deleted file mode 100644 index ff16e273..00000000 --- a/variants/heltec_e290/HeltecE290Board.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -class HeltecE290Board : public ESP32Board { - -public: - RefCountedDigitalPin periph_power; - - HeltecE290Board() : periph_power(PIN_VEXT_EN) { } - - void begin(); - void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1); - void powerOff() override; - uint16_t getBattMilliVolts() override; - const char* getManufacturerName() const override ; - -}; diff --git a/variants/heltec_e290/pins_arduino.h b/variants/heltec_e290/pins_arduino.h deleted file mode 100644 index 56f5ef15..00000000 --- a/variants/heltec_e290/pins_arduino.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -static const uint8_t LED_BUILTIN = 45; // LED is not populated on earliest board variant -#define BUILTIN_LED LED_BUILTIN // Backward compatibility -#define LED_BUILTIN LED_BUILTIN - -static const uint8_t TX = 43; -static const uint8_t RX = 44; - -static const uint8_t SDA = 39; -static const uint8_t SCL = 38; - -static const uint8_t SS = 8; -static const uint8_t MOSI = 10; -static const uint8_t MISO = 11; -static const uint8_t SCK = 9; - -static const uint8_t A0 = 1; -static const uint8_t A1 = 2; -static const uint8_t A2 = 3; -static const uint8_t A3 = 4; -static const uint8_t A4 = 5; -static const uint8_t A5 = 6; -static const uint8_t A6 = 7; -static const uint8_t A7 = 8; -static const uint8_t A8 = 9; -static const uint8_t A9 = 10; -static const uint8_t A10 = 11; -static const uint8_t A11 = 12; -static const uint8_t A12 = 13; -static const uint8_t A13 = 14; -static const uint8_t A14 = 15; -static const uint8_t A15 = 16; -static const uint8_t A16 = 17; -static const uint8_t A17 = 18; -static const uint8_t A18 = 19; -static const uint8_t A19 = 20; - -static const uint8_t T1 = 1; -static const uint8_t T2 = 2; -static const uint8_t T3 = 3; -static const uint8_t T4 = 4; -static const uint8_t T5 = 5; -static const uint8_t T6 = 6; -static const uint8_t T7 = 7; -static const uint8_t T8 = 8; -static const uint8_t T9 = 9; -static const uint8_t T10 = 10; -static const uint8_t T11 = 11; -static const uint8_t T12 = 12; -static const uint8_t T13 = 13; -static const uint8_t T14 = 14; - -static const uint8_t RST_LoRa = 12; -static const uint8_t BUSY_LoRa = 13; -static const uint8_t DIO1 = 14; - -#endif /* Pins_Arduino_h */ diff --git a/variants/heltec_e290/platformio.ini b/variants/heltec_e290/platformio.ini deleted file mode 100644 index 0c07c592..00000000 --- a/variants/heltec_e290/platformio.ini +++ /dev/null @@ -1,155 +0,0 @@ -[Heltec_E290_base] -extends = esp32_base -board = heltec_e290 -build_flags = - ${esp32_base.build_flags} - -I variants/heltec_e290 - -D Vision_Master_E290 - -D ARDUINO_USB_CDC_ON_BOOT=1 - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -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 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 -build_src_filter = ${esp32_base.build_src_filter} - +<../variants/heltec_e290> -lib_deps = - ${esp32_base.lib_deps} - https://github.com/Quency-D/heltec-eink-modules/archive/563dd41fd850a1bc3039b8723da4f3a20fe1c800.zip - -[env:Heltec_E290_companion_ble_] -extends = Heltec_E290_base -build_flags = - ${Heltec_E290_base.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D DISPLAY_CLASS=E290Display - -D BLE_PIN_CODE=123456 ; dynamic, random PIN - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -build_src_filter = ${Heltec_E290_base.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_E290_base.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_E290_companion_usb_] -extends = Heltec_E290_base -build_flags = - ${Heltec_E290_base.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D DISPLAY_CLASS=E290Display - -D BLE_PIN_CODE=123456 ; dynamic, random PIN - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -build_src_filter = ${Heltec_E290_base.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_E290_base.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_E290_repeater_] -extends = Heltec_E290_base -build_flags = - ${Heltec_E290_base.build_flags} - -D DISPLAY_CLASS=E290Display - -D ADVERT_NAME='"Heltec E290 Repeater"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D MAX_NEIGHBOURS=50 -build_src_filter = ${Heltec_E290_base.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_E290_base.lib_deps} - ${esp32_ota.lib_deps} - -; [env:Heltec_E290_repeater_bridge_rs232_] -; extends = Heltec_E290_base -; build_flags = -; ${Heltec_E290_base.build_flags} -; -D DISPLAY_CLASS=E290Display -; -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_E290_base.build_src_filter} -; + -; + -; +<../examples/simple_repeater> -; lib_deps = -; ${Heltec_E290_base.lib_deps} -; ${esp32_ota.lib_deps} - -[env:Heltec_E290_repeater_bridge_espnow_] -extends = Heltec_E290_base -build_flags = - ${Heltec_E290_base.build_flags} - -D DISPLAY_CLASS=E290Display - -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_E290_base.build_src_filter} - + - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_E290_base.lib_deps} - ${esp32_ota.lib_deps} - -[env:Heltec_E290_room_server_] -extends = Heltec_E290_base -build_flags = - ${Heltec_E290_base.build_flags} - -D DISPLAY_CLASS=E290Display - -D ADVERT_NAME='"Heltec E290 Room"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D ROOM_PASSWORD='"hello"' -build_src_filter = ${Heltec_E290_base.build_src_filter} - + - +<../examples/simple_room_server> -lib_deps = - ${Heltec_E290_base.lib_deps} - ${esp32_ota.lib_deps} diff --git a/variants/heltec_e290/target.cpp b/variants/heltec_e290/target.cpp deleted file mode 100644 index 92b02092..00000000 --- a/variants/heltec_e290/target.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "target.h" -#include - -HeltecE290Board board; - -#if defined(P_LORA_SCLK) - static SPIClass spi(FSPI); - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -#else - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY); -#endif - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); - -SensorManager sensors; - -#ifdef DISPLAY_CLASS -DISPLAY_CLASS display; -MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - -#if defined(P_LORA_SCLK) - return radio.std_init(&spi); -#else - return radio.std_init(); -#endif -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/heltec_e290/target.h b/variants/heltec_e290/target.h deleted file mode 100644 index 60770112..00000000 --- a/variants/heltec_e290/target.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS -#include -#include -#endif - -extern HeltecE290Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern SensorManager sensors; - -#ifdef DISPLAY_CLASS -extern DISPLAY_CLASS display; -extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); \ No newline at end of file diff --git a/variants/heltec_mesh_solar/MeshSolarBoard.cpp b/variants/heltec_mesh_solar/MeshSolarBoard.cpp deleted file mode 100644 index bc955fb5..00000000 --- a/variants/heltec_mesh_solar/MeshSolarBoard.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include - -#include "MeshSolarBoard.h" - -void MeshSolarBoard::begin() { - NRF52Board::begin(); - - meshSolarStart(); - -#if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL) - Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL); -#endif - - Wire.begin(); -} diff --git a/variants/heltec_mesh_solar/MeshSolarBoard.h b/variants/heltec_mesh_solar/MeshSolarBoard.h deleted file mode 100644 index 69437c87..00000000 --- a/variants/heltec_mesh_solar/MeshSolarBoard.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -#include -#include -#include - -#ifdef HELTEC_MESH_SOLAR -#include "meshSolarApp.h" -#endif - -// LoRa radio module pins for Heltec T114 -#define P_LORA_DIO_1 20 -#define P_LORA_NSS 24 -#define P_LORA_RESET 25 -#define P_LORA_BUSY 17 -#define P_LORA_SCLK 19 -#define P_LORA_MISO 23 -#define P_LORA_MOSI 22 - -#define SX126X_DIO2_AS_RF_SWITCH true -#define SX126X_DIO3_TCXO_VOLTAGE 1.8 - -class MeshSolarBoard : public NRF52BoardOTA { -public: - MeshSolarBoard() : NRF52BoardOTA("MESH_SOLAR_OTA") {} - void begin(); - - uint16_t getBattMilliVolts() override { - return meshSolarGetBattVoltage(); - } - - const char* getManufacturerName() const override { - return "Heltec Mesh Solar"; - } -}; diff --git a/variants/heltec_mesh_solar/platformio.ini b/variants/heltec_mesh_solar/platformio.ini deleted file mode 100644 index 7bfbac85..00000000 --- a/variants/heltec_mesh_solar/platformio.ini +++ /dev/null @@ -1,95 +0,0 @@ -[Heltec_mesh_solar] -extends = nrf52_base -board = heltec_mesh_solar -platform_packages = framework-arduinoadafruitnrf52 -board_build.ldscript = boards/nrf52840_s140_v6.ld -build_flags = ${nrf52_base.build_flags} - -I src/helpers/nrf52 - -I lib/nrf52/s140_nrf52_6.1.1_API/include - -I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52 - -I variants/heltec_mesh_solar - -D HELTEC_MESH_SOLAR - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -D SX126X_CURRENT_LIMIT=140 - -D SX126X_RX_BOOSTED_GAIN=1 -build_src_filter = ${nrf52_base.build_src_filter} - + - +<../variants/heltec_mesh_solar> -lib_deps = - ${nrf52_base.lib_deps} - rweather/Crypto @ ^0.4.0 - stevemarple/MicroNMEA @ ^2.0.6 - adafruit/Adafruit NeoPixel@^1.10.0 - https://github.com/NMIoT/meshsolar/archive/dfc5330dad443982e6cdd37a61d33fc7252f468b.zip -debug_tool = jlink -upload_protocol = nrfutil - -[env:Heltec_mesh_solar_repeater] -extends = Heltec_mesh_solar -build_src_filter = ${Heltec_mesh_solar.build_src_filter} - +<../examples/simple_repeater> - -build_flags = - ${Heltec_mesh_solar.build_flags} - -D ADVERT_NAME='"Heltec_Mesh_Solar 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 - -[env:Heltec_mesh_solar_room_server] -extends = Heltec_mesh_solar -build_src_filter = ${Heltec_mesh_solar.build_src_filter} - +<../examples/simple_room_server> -build_flags = - ${Heltec_mesh_solar.build_flags} - -D ADVERT_NAME='"Heltec_Mesh_Solar 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 - -[env:Heltec_mesh_solar_companion_radio_ble] -extends = Heltec_mesh_solar -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = - ${Heltec_mesh_solar.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 -; -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_mesh_solar.build_src_filter} - + - +<../examples/companion_radio/*.cpp> -lib_deps = - ${Heltec_mesh_solar.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_mesh_solar_companion_radio_usb] -extends = Heltec_mesh_solar -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = - ${Heltec_mesh_solar.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 -; -D BLE_PIN_CODE=123456 -; -D BLE_DEBUG_LOGGING=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_mesh_solar.build_src_filter} - + - +<../examples/companion_radio/*.cpp> -lib_deps = - ${Heltec_mesh_solar.lib_deps} - densaugeo/base64 @ ~1.4.0 \ No newline at end of file diff --git a/variants/heltec_mesh_solar/target.cpp b/variants/heltec_mesh_solar/target.cpp deleted file mode 100644 index ad79f717..00000000 --- a/variants/heltec_mesh_solar/target.cpp +++ /dev/null @@ -1,123 +0,0 @@ -#include -#include "target.h" -#include -#include - -MeshSolarBoard board; - -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); - -WRAPPER_CLASS radio_driver(radio, board); - -VolatileRTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1); -SolarSensorManager sensors = SolarSensorManager(nmea); - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; -#endif - -bool radio_init() { - rtc_clock.begin(Wire); - return radio.std_init(&SPI); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} - -void SolarSensorManager::start_gps() { - if (!gps_active) { - gps_active = true; - _location->begin(); - } -} - -void SolarSensorManager::stop_gps() { - if (gps_active) { - gps_active = false; - _location->stop(); - } -} - -bool SolarSensorManager::begin() { - Serial1.begin(9600); - - // We'll consider GPS detected if we see any data on Serial1 - gps_detected = (Serial1.available() > 0); - - if (gps_detected) { - MESH_DEBUG_PRINTLN("GPS detected"); - } else { - MESH_DEBUG_PRINTLN("No GPS detected"); - } - - return true; -} - -bool SolarSensorManager::querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) { - if (requester_permissions & TELEM_PERM_LOCATION) { // does requester have permission? - telemetry.addGPS(TELEM_CHANNEL_SELF, node_lat, node_lon, node_altitude); - } - return true; -} - -void SolarSensorManager::loop() { - static long next_gps_update = 0; - - _location->loop(); - - if (millis() > next_gps_update) { - if (_location->isValid()) { - node_lat = ((double)_location->getLatitude())/1000000.; - node_lon = ((double)_location->getLongitude())/1000000.; - node_altitude = ((double)_location->getAltitude()) / 1000.0; - MESH_DEBUG_PRINTLN("lat %f lon %f", node_lat, node_lon); - } - next_gps_update = millis() + 1000; - } -} - -int SolarSensorManager::getNumSettings() const { - return gps_detected ? 1 : 0; // only show GPS setting if GPS is detected -} - -const char* SolarSensorManager::getSettingName(int i) const { - return (gps_detected && i == 0) ? "gps" : NULL; -} - -const char* SolarSensorManager::getSettingValue(int i) const { - if (gps_detected && i == 0) { - return gps_active ? "1" : "0"; - } - return NULL; -} - -bool SolarSensorManager::setSettingValue(const char* name, const char* value) { - if (gps_detected && strcmp(name, "gps") == 0) { - if (strcmp(value, "0") == 0) { - stop_gps(); - } else { - start_gps(); - } - return true; - } - return false; // not supported -} diff --git a/variants/heltec_mesh_solar/target.h b/variants/heltec_mesh_solar/target.h deleted file mode 100644 index e301a273..00000000 --- a/variants/heltec_mesh_solar/target.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include -#endif - -class SolarSensorManager : public SensorManager { - bool gps_active = false; - bool gps_detected = false; - LocationProvider* _location; - - void start_gps(); - void stop_gps(); -public: - SolarSensorManager(LocationProvider &location): _location(&location) { } - bool begin() override; - bool querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) override; - void loop() override; - int getNumSettings() const override; - const char* getSettingName(int i) const override; - const char* getSettingValue(int i) const override; - bool setSettingValue(const char* name, const char* value) override; -}; - -extern MeshSolarBoard board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern SolarSensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/heltec_mesh_solar/variant.cpp b/variants/heltec_mesh_solar/variant.cpp deleted file mode 100644 index 03dd54b7..00000000 --- a/variants/heltec_mesh_solar/variant.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "variant.h" -#include "wiring_constants.h" -#include "wiring_digital.h" - -const uint32_t g_ADigitalPinMap[] = { - 0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47 -}; - -void initVariant() -{ - pinMode(PIN_USER_BTN, INPUT); - pinMode(BQ4050_EMERGENCY_SHUTDOWN_PIN, INPUT); -} diff --git a/variants/heltec_mesh_solar/variant.h b/variants/heltec_mesh_solar/variant.h deleted file mode 100644 index 14956619..00000000 --- a/variants/heltec_mesh_solar/variant.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * variant.h - * Copyright (C) 2023 Seeed K.K. - * MIT License - */ - -#pragma once - -#include "WVariant.h" - -//////////////////////////////////////////////////////////////////////////////// -// Low frequency clock source - -#define USE_LFXO // 32.768 kHz crystal oscillator -#define VARIANT_MCK (64000000ul) - - -//////////////////////////////////////////////////////////////////////////////// -// Power - -#define NRF_APM - -//////////////////////////////////////////////////////////////////////////////// -// Number of pins - -#define PINS_COUNT (48) -#define NUM_DIGITAL_PINS (48) -#define NUM_ANALOG_INPUTS (1) -#define NUM_ANALOG_OUTPUTS (0) - -//////////////////////////////////////////////////////////////////////////////// -// UART pin definition - -#define PIN_SERIAL1_RX (37) -#define PIN_SERIAL1_TX (39) - -#define PIN_SERIAL2_RX (9) -#define PIN_SERIAL2_TX (10) - -//////////////////////////////////////////////////////////////////////////////// -// I2C pin definition -#define WIRE_INTERFACES_COUNT (2) - -#define PIN_WIRE_SDA (6) -#define PIN_WIRE_SCL (26) - -#define PIN_WIRE1_SDA (30) -#define PIN_WIRE1_SCL (5) - -//////////////////////////////////////////////////////////////////////////////// -// SPI pin definition - -#define SPI_INTERFACES_COUNT (2) - -#define PIN_SPI_MISO (23) -#define PIN_SPI_MOSI (22) -#define PIN_SPI_SCK (19) -#define PIN_SPI_NSS (24) - -//////////////////////////////////////////////////////////////////////////////// -// Builtin LEDs - -#define LED_BUILTIN (12) -#define PIN_LED LED_BUILTIN -#define LED_RED LED_BUILTIN -#define LED_BLUE (-1) // No blue led, prevents Bluefruit flashing the green LED during advertising -#define LED_PIN LED_BUILTIN - -#define LED_STATE_ON LOW - -#define PIN_NEOPIXEL (47) -#define NEOPIXEL_NUM (1) - -//////////////////////////////////////////////////////////////////////////////// -// Builtin buttons - -#define PIN_BUTTON1 (42) -#define BUTTON_PIN PIN_BUTTON1 - -// #define PIN_BUTTON2 (11) -// #define BUTTON_PIN2 PIN_BUTTON2 - -#define PIN_USER_BTN BUTTON_PIN - -#define EXTERNAL_FLASH_DEVICES MX25R1635F -#define EXTERNAL_FLASH_USE_QSPI - -//////////////////////////////////////////////////////////////////////////////// -// Lora - -#define USE_SX1262 -#define LORA_CS (24) -#define SX126X_DIO1 (20) -#define SX126X_BUSY (17) -#define SX126X_RESET (25) -#define SX126X_DIO2_AS_RF_SWITCH -#define SX126X_DIO3_TCXO_VOLTAGE 1.8 - -#define PIN_SPI1_MISO (43) -#define PIN_SPI1_MOSI (41) -#define PIN_SPI1_SCK (40) - -//////////////////////////////////////////////////////////////////////////////// -// Buzzer - -// #define PIN_BUZZER (46) - - -//////////////////////////////////////////////////////////////////////////////// -// GPS - -#define GPS_RESET (38) - -//////////////////////////////////////////////////////////////////////////////// -// TFT -// #define PIN_TFT_SCL (40) -// #define PIN_TFT_SDA (41) -// #define PIN_TFT_RST (2) -// #define PIN_TFT_VDD_CTL (3) -// #define PIN_TFT_LEDA_CTL (15) -// #define PIN_TFT_CS (11) -// #define PIN_TFT_DC (12) - -//////////////////////////////////////////////////////////////////////////////// -#define BQ4050_SDA_PIN (33) // I2C data line pin -#define BQ4050_SCL_PIN (32) // I2C clock line pin -#define BQ4050_EMERGENCY_SHUTDOWN_PIN (35) // Emergency shutdown pin \ No newline at end of file diff --git a/variants/heltec_t114/T114Board.cpp b/variants/heltec_t114/T114Board.cpp deleted file mode 100644 index 2a36bd90..00000000 --- a/variants/heltec_t114/T114Board.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "T114Board.h" - -#include -#include - -#ifdef NRF52_POWER_MANAGEMENT -// Static configuration for power management -// Values come from variant.h defines -const PowerMgtConfig power_config = { - .lpcomp_ain_channel = PWRMGT_LPCOMP_AIN, - .lpcomp_refsel = PWRMGT_LPCOMP_REFSEL, - .voltage_bootlock = PWRMGT_VOLTAGE_BOOTLOCK -}; - -void T114Board::initiateShutdown(uint8_t reason) { -#if ENV_INCLUDE_GPS == 1 - pinMode(GPS_EN, OUTPUT); - digitalWrite(GPS_EN, LOW); -#endif - digitalWrite(SX126X_POWER_EN, LOW); - - bool enable_lpcomp = (reason == SHUTDOWN_REASON_LOW_VOLTAGE || - reason == SHUTDOWN_REASON_BOOT_PROTECT); - pinMode(PIN_BAT_CTL, OUTPUT); - digitalWrite(PIN_BAT_CTL, enable_lpcomp ? HIGH : LOW); - - if (enable_lpcomp) { - configureVoltageWake(power_config.lpcomp_ain_channel, power_config.lpcomp_refsel); - } - - enterSystemOff(reason); -} -#endif // NRF52_POWER_MANAGEMENT - -void T114Board::begin() { - NRF52Board::begin(); - NRF_POWER->DCDCEN = 1; - - pinMode(PIN_VBAT_READ, INPUT); - -#if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL) - Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL); -#endif - - Wire.begin(); - -#ifdef P_LORA_TX_LED - pinMode(P_LORA_TX_LED, OUTPUT); - digitalWrite(P_LORA_TX_LED, HIGH); -#endif - - pinMode(SX126X_POWER_EN, OUTPUT); -#ifdef NRF52_POWER_MANAGEMENT - // Boot voltage protection check (may not return if voltage too low) - // We need to call this after we configure SX126X_POWER_EN as output but before we pull high - checkBootVoltage(&power_config); -#endif - digitalWrite(SX126X_POWER_EN, HIGH); - delay(10); // give sx1262 some time to power up -} \ No newline at end of file diff --git a/variants/heltec_t114/T114Board.h b/variants/heltec_t114/T114Board.h deleted file mode 100644 index cf0f656d..00000000 --- a/variants/heltec_t114/T114Board.h +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once - -#include -#include -#include - -// built-ins -#define PIN_VBAT_READ 4 -#define PIN_BAT_CTL 6 -#define MV_LSB (3000.0F / 4096.0F) // 12-bit ADC with 3.0V input range - -class T114Board : public NRF52BoardOTA { -protected: -#ifdef NRF52_POWER_MANAGEMENT - void initiateShutdown(uint8_t reason) override; -#endif - -public: - T114Board() : NRF52BoardOTA("T114_OTA") {} - void begin(); - -#if defined(P_LORA_TX_LED) - void onBeforeTransmit() override { - digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED on - } - void onAfterTransmit() override { - digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED off - } -#endif - - uint16_t getBattMilliVolts() override { - int adcvalue = 0; - analogReadResolution(12); - analogReference(AR_INTERNAL_3_0); - pinMode(PIN_BAT_CTL, OUTPUT); // battery adc can be read only ctrl pin 6 set to high - digitalWrite(PIN_BAT_CTL, 1); - - delay(10); - adcvalue = analogRead(PIN_VBAT_READ); - digitalWrite(6, 0); - - return (uint16_t)((float)adcvalue * MV_LSB * 4.9); - } - - const char* getManufacturerName() const override { - return "Heltec T114"; - } - - void powerOff() override { -#ifdef LED_PIN - digitalWrite(LED_PIN, HIGH); -#endif -#if ENV_INCLUDE_GPS == 1 - pinMode(GPS_EN, OUTPUT); - digitalWrite(GPS_EN, LOW); -#endif - sd_power_system_off(); - } -}; diff --git a/variants/heltec_t114/platformio.ini b/variants/heltec_t114/platformio.ini deleted file mode 100644 index 20f5e8fe..00000000 --- a/variants/heltec_t114/platformio.ini +++ /dev/null @@ -1,249 +0,0 @@ -; -; Heltec T114 without display -; -[Heltec_t114] -extends = nrf52_base -board = heltec_t114 -board_build.ldscript = boards/nrf52840_s140_v6.ld -build_flags = ${nrf52_base.build_flags} - -I lib/nrf52/s140_nrf52_6.1.1_API/include - -I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52 - -I variants/heltec_t114 - -I src/helpers/ui - -D HELTEC_T114 - -D NRF52_POWER_MANAGEMENT - -D P_LORA_DIO_1=20 - -D P_LORA_NSS=24 - -D P_LORA_RESET=25 - -D P_LORA_BUSY=17 - -D P_LORA_SCLK=19 - -D P_LORA_MISO=23 - -D P_LORA_MOSI=22 - -D P_LORA_TX_LED=35 - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -D SX126X_POWER_EN=37 - -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 DISPLAY_CLASS=NullDisplayDriver - -D ST7789 - -D PIN_GPS_RX=39 - -D PIN_GPS_TX=37 - -D PIN_GPS_EN=21 - -D PIN_GPS_RESET=38 - -D PIN_GPS_RESET_ACTIVE=LOW -build_src_filter = ${nrf52_base.build_src_filter} - + - +<../variants/heltec_t114> -lib_deps = - ${nrf52_base.lib_deps} - stevemarple/MicroNMEA @ ^2.0.6 - adafruit/Adafruit GFX Library @ ^1.12.1 -debug_tool = jlink -upload_protocol = nrfutil - -[env:Heltec_t114_without_display_repeater] -extends = Heltec_t114 -build_src_filter = ${Heltec_t114.build_src_filter} - +<../examples/simple_repeater> - -build_flags = - ${Heltec_t114.build_flags} - -D ADVERT_NAME='"Heltec_T114 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 - -[env:Heltec_t114_without_display_repeater_bridge_rs232] -extends = Heltec_t114 -build_flags = - ${Heltec_t114.build_flags} - -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=9 - -D WITH_RS232_BRIDGE_TX=10 -; -D BRIDGE_DEBUG=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_t114.build_src_filter} - + - +<../examples/simple_repeater> - -[env:Heltec_t114_without_display_room_server] -extends = Heltec_t114 -build_src_filter = ${Heltec_t114.build_src_filter} - +<../examples/simple_room_server> -build_flags = - ${Heltec_t114.build_flags} - -D ADVERT_NAME='"Heltec_T114 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 - -[env:Heltec_t114_without_display_companion_radio_ble] -extends = Heltec_t114 -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = - ${Heltec_t114.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 -; -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_t114.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_t114.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_t114_without_display_companion_radio_usb] -extends = Heltec_t114 -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = - ${Heltec_t114.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 -; -D BLE_PIN_CODE=123456 -; -D BLE_DEBUG_LOGGING=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_t114.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_t114.lib_deps} - densaugeo/base64 @ ~1.4.0 - -; -; Heltec T114 with ST7789 display -; -[Heltec_t114_with_display] -extends = Heltec_t114 -board = heltec_t114 -board_build.ldscript = boards/nrf52840_s140_v6.ld -build_flags = ${Heltec_t114.build_flags} - -D HELTEC_T114_WITH_DISPLAY - -D DISPLAY_CLASS=ST7789Display -build_src_filter = ${Heltec_t114.build_src_filter} - + - + - + - + -lib_deps = - ${Heltec_t114.lib_deps} -debug_tool = jlink -upload_protocol = nrfutil - -[env:Heltec_t114_repeater] -extends = Heltec_t114_with_display -build_src_filter = ${Heltec_t114_with_display.build_src_filter} - +<../examples/simple_repeater> - -build_flags = - ${Heltec_t114_with_display.build_flags} - -D ADVERT_NAME='"Heltec_T114 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 - -[env:Heltec_t114_repeater_bridge_rs232] -extends = Heltec_t114 -build_flags = - ${Heltec_t114.build_flags} - -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=9 - -D WITH_RS232_BRIDGE_TX=10 -; -D BRIDGE_DEBUG=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_t114_with_display.build_src_filter} - + - +<../examples/simple_repeater> - -[env:Heltec_t114_room_server] -extends = Heltec_t114_with_display -build_src_filter = ${Heltec_t114_with_display.build_src_filter} - +<../examples/simple_room_server> -build_flags = - ${Heltec_t114_with_display.build_flags} - -D ADVERT_NAME='"Heltec_T114 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 - -[env:Heltec_t114_companion_radio_ble] -extends = Heltec_t114_with_display -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = - ${Heltec_t114_with_display.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 - -D ENV_INCLUDE_GPS=1 ; enable the GPS page in UI -; -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_t114_with_display.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_t114_with_display.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_t114_companion_radio_usb] -extends = Heltec_t114_with_display -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = - ${Heltec_t114_with_display.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 -; -D BLE_PIN_CODE=123456 -; -D BLE_DEBUG_LOGGING=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_t114_with_display.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_t114_with_display.lib_deps} - densaugeo/base64 @ ~1.4.0 \ No newline at end of file diff --git a/variants/heltec_t114/target.cpp b/variants/heltec_t114/target.cpp deleted file mode 100644 index c3341103..00000000 --- a/variants/heltec_t114/target.cpp +++ /dev/null @@ -1,133 +0,0 @@ -#include -#include "target.h" -#include -#include - -T114Board board; - -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); - -WRAPPER_CLASS radio_driver(radio, board); - -VolatileRTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, &rtc_clock); -T114SensorManager sensors = T114SensorManager(nmea); - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - rtc_clock.begin(Wire); - - return radio.std_init(&SPI); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} - -void T114SensorManager::start_gps() { - if (!gps_active) { - gps_active = true; - _location->begin(); - } -} - -void T114SensorManager::stop_gps() { - if (gps_active) { - gps_active = false; - _location->stop(); - } -} - -bool T114SensorManager::begin() { - Serial1.begin(9600); - - // Try to detect if GPS is physically connected to determine if we should expose the setting - pinMode(GPS_EN, OUTPUT); - digitalWrite(GPS_EN, HIGH); // Power on GPS - - // Give GPS a moment to power up and send data - delay(1500); - - // We'll consider GPS detected if we see any data on Serial1 - gps_detected = (Serial1.available() > 0); - - if (gps_detected) { - MESH_DEBUG_PRINTLN("GPS detected"); - } else { - MESH_DEBUG_PRINTLN("No GPS detected"); - } - digitalWrite(GPS_EN, LOW); // Power off GPS until the setting is changed - - return true; -} - -bool T114SensorManager::querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) { - if (requester_permissions & TELEM_PERM_LOCATION) { // does requester have permission? - telemetry.addGPS(TELEM_CHANNEL_SELF, node_lat, node_lon, node_altitude); - } - return true; -} - -void T114SensorManager::loop() { - static long next_gps_update = 0; - - _location->loop(); - - if (millis() > next_gps_update) { - if (_location->isValid()) { - node_lat = ((double)_location->getLatitude())/1000000.; - node_lon = ((double)_location->getLongitude())/1000000.; - node_altitude = ((double)_location->getAltitude()) / 1000.0; - MESH_DEBUG_PRINTLN("lat %f lon %f", node_lat, node_lon); - } - next_gps_update = millis() + 1000; - } -} - -int T114SensorManager::getNumSettings() const { - return gps_detected ? 1 : 0; // only show GPS setting if GPS is detected -} - -const char* T114SensorManager::getSettingName(int i) const { - return (gps_detected && i == 0) ? "gps" : NULL; -} - -const char* T114SensorManager::getSettingValue(int i) const { - if (gps_detected && i == 0) { - return gps_active ? "1" : "0"; - } - return NULL; -} - -bool T114SensorManager::setSettingValue(const char* name, const char* value) { - if (gps_detected && strcmp(name, "gps") == 0) { - if (strcmp(value, "0") == 0) { - stop_gps(); - } else { - start_gps(); - } - return true; - } - return false; // not supported -} diff --git a/variants/heltec_t114/target.h b/variants/heltec_t114/target.h deleted file mode 100644 index 6306cd69..00000000 --- a/variants/heltec_t114/target.h +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#include - -#ifdef DISPLAY_CLASS -#include -#ifdef HELTEC_T114_WITH_DISPLAY -#include -#else -#include "helpers/ui/NullDisplayDriver.h" -#endif -#endif - -class T114SensorManager : public SensorManager { - bool gps_active = false; - bool gps_detected = false; - LocationProvider* _location; - - void start_gps(); - void stop_gps(); -public: - T114SensorManager(LocationProvider &location): _location(&location) { } - bool begin() override; - bool querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) override; - void loop() override; - LocationProvider* getLocationProvider() override { return gps_detected ? _location : NULL; } - int getNumSettings() const override; - const char* getSettingName(int i) const override; - const char* getSettingValue(int i) const override; - bool setSettingValue(const char* name, const char* value) override; -}; - -extern T114Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern T114SensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/heltec_t114/variant.cpp b/variants/heltec_t114/variant.cpp deleted file mode 100644 index 2bca56a1..00000000 --- a/variants/heltec_t114/variant.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "variant.h" -#include "wiring_constants.h" -#include "wiring_digital.h" - -const uint32_t g_ADigitalPinMap[] = { - 0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47 -}; - -void initVariant() -{ - pinMode(PIN_USER_BTN, INPUT); -} diff --git a/variants/heltec_t114/variant.h b/variants/heltec_t114/variant.h deleted file mode 100644 index ac9dbbe6..00000000 --- a/variants/heltec_t114/variant.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * variant.h - * Copyright (C) 2023 Seeed K.K. - * MIT License - */ - -#pragma once - -#include "WVariant.h" - -//////////////////////////////////////////////////////////////////////////////// -// Low frequency clock source - -#define USE_LFXO // 32.768 kHz crystal oscillator -#define VARIANT_MCK (64000000ul) - -#define WIRE_INTERFACES_COUNT (1) - -//////////////////////////////////////////////////////////////////////////////// -// Power - -#define NRF_APM -#define PIN_3V3_EN (38) - -#define BATTERY_PIN (4) -#define ADC_MULTIPLIER (4.90F) - -#define ADC_RESOLUTION (14) -#define BATTERY_SENSE_RES (12) - -#define AREF_VOLTAGE (3.0) - -// Power management boot protection threshold (millivolts) -// Set to 0 to disable boot protection -#define PWRMGT_VOLTAGE_BOOTLOCK 3300 // Won't boot below this voltage (mV) -// LPCOMP wake configuration (voltage recovery from SYSTEMOFF) -// AIN2 = P0.04 = BATTERY_PIN / PIN_VBAT_READ -#define PWRMGT_LPCOMP_AIN 2 -#define PWRMGT_LPCOMP_REFSEL 1 // 2/8 VDD (~3.68-4.04V) - -//////////////////////////////////////////////////////////////////////////////// -// Number of pins - -#define PINS_COUNT (48) -#define NUM_DIGITAL_PINS (48) -#define NUM_ANALOG_INPUTS (1) -#define NUM_ANALOG_OUTPUTS (0) - -//////////////////////////////////////////////////////////////////////////////// -// UART pin definition - -#define PIN_SERIAL1_RX (37) -#define PIN_SERIAL1_TX (39) - -#define PIN_SERIAL2_RX (9) -#define PIN_SERIAL2_TX (10) - -//////////////////////////////////////////////////////////////////////////////// -// I2C pin definition - -#define PIN_WIRE_SDA (16) // P0.16 -#define PIN_WIRE_SCL (13) // P0.13 - -//////////////////////////////////////////////////////////////////////////////// -// SPI pin definition - -#define SPI_INTERFACES_COUNT (2) - -#define PIN_SPI_MISO (23) -#define PIN_SPI_MOSI (22) -#define PIN_SPI_SCK (19) -#define PIN_SPI_NSS (24) - -//////////////////////////////////////////////////////////////////////////////// -// Builtin LEDs - -#define LED_BUILTIN (35) -#define PIN_LED LED_BUILTIN -#define LED_RED LED_BUILTIN -#define LED_BLUE (-1) // No blue led, prevents Bluefruit flashing the green LED during advertising -#define LED_PIN LED_BUILTIN - -#define LED_STATE_ON LOW - -#define PIN_NEOPIXEL (14) -#define NEOPIXEL_NUM (2) - -//////////////////////////////////////////////////////////////////////////////// -// Builtin buttons - -#define PIN_BUTTON1 (42) -#define BUTTON_PIN PIN_BUTTON1 - -// #define PIN_BUTTON2 (11) -// #define BUTTON_PIN2 PIN_BUTTON2 - -#define PIN_USER_BTN BUTTON_PIN - -#define EXTERNAL_FLASH_DEVICES MX25R1635F -#define EXTERNAL_FLASH_USE_QSPI - -//////////////////////////////////////////////////////////////////////////////// -// Lora - -#define USE_SX1262 -#define LORA_CS (24) -#define SX126X_DIO1 (20) -#define SX126X_BUSY (17) -#define SX126X_RESET (25) -#define SX126X_DIO2_AS_RF_SWITCH -#define SX126X_DIO3_TCXO_VOLTAGE 1.8 - -#define PIN_SPI1_MISO (43) -#define PIN_SPI1_MOSI (41) -#define PIN_SPI1_SCK (40) - -//////////////////////////////////////////////////////////////////////////////// -// Buzzer - -// #define PIN_BUZZER (46) - - -//////////////////////////////////////////////////////////////////////////////// -// GPS - -#define GPS_EN (21) -#define GPS_RESET (38) -#define PIN_GPS_RX (39) // This is for bits going TOWARDS the GPS -#define PIN_GPS_TX (37) // This is for bits going TOWARDS the CPU - -//////////////////////////////////////////////////////////////////////////////// -// TFT -#define PIN_TFT_SCL (40) -#define PIN_TFT_SDA (41) -#define PIN_TFT_RST (2) -#define PIN_TFT_VDD_CTL (3) -#define PIN_TFT_LEDA_CTL (15) -#define PIN_TFT_CS (11) -#define PIN_TFT_DC (12) diff --git a/variants/heltec_t190/HeltecT190Board.cpp b/variants/heltec_t190/HeltecT190Board.cpp deleted file mode 100644 index 4f35be40..00000000 --- a/variants/heltec_t190/HeltecT190Board.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "HeltecT190Board.h" - -void HeltecT190Board::begin() { - ESP32Board::begin(); - - pinMode(PIN_ADC_CTRL, OUTPUT); - digitalWrite(PIN_ADC_CTRL, LOW); // Initially inactive - - periph_power.begin(); - - esp_reset_reason_t reason = esp_reset_reason(); - if (reason == ESP_RST_DEEPSLEEP) { - long wakeup_source = esp_sleep_get_ext1_wakeup_status(); - if (wakeup_source & (1 << P_LORA_DIO_1)) { // received a LoRa packet (while in deep sleep) - startup_reason = BD_STARTUP_RX_PACKET; - } - - rtc_gpio_hold_dis((gpio_num_t)P_LORA_NSS); - rtc_gpio_deinit((gpio_num_t)P_LORA_DIO_1); - } - } - - void HeltecT190Board::enterDeepSleep(uint32_t secs, int pin_wake_btn) { - esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON); - - // Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep - rtc_gpio_set_direction((gpio_num_t)P_LORA_DIO_1, RTC_GPIO_MODE_INPUT_ONLY); - rtc_gpio_pulldown_en((gpio_num_t)P_LORA_DIO_1); - - rtc_gpio_hold_en((gpio_num_t)P_LORA_NSS); - - if (pin_wake_btn < 0) { - esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet - } else { - esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1) | (1L << pin_wake_btn), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet OR wake btn - } - - if (secs > 0) { - esp_sleep_enable_timer_wakeup(secs * 1000000); - } - - // Finally set ESP32 into sleep - esp_deep_sleep_start(); // CPU halts here and never returns! - } - - void HeltecT190Board::powerOff() { - enterDeepSleep(0); - } - - uint16_t HeltecT190Board::getBattMilliVolts() { - analogReadResolution(10); - digitalWrite(PIN_ADC_CTRL, HIGH); - delay(10); - uint32_t raw = 0; - for (int i = 0; i < 8; i++) { - raw += analogRead(PIN_VBAT_READ); - } - raw = raw / 8; - - digitalWrite(PIN_ADC_CTRL, LOW); - - return (5.42 * (3.3 / 1024.0) * raw) * 1000; - } - - const char* HeltecT190Board::getManufacturerName() const { - return "Heltec T190"; - } diff --git a/variants/heltec_t190/HeltecT190Board.h b/variants/heltec_t190/HeltecT190Board.h deleted file mode 100644 index bc38c1e0..00000000 --- a/variants/heltec_t190/HeltecT190Board.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -class HeltecT190Board : public ESP32Board { - -public: - RefCountedDigitalPin periph_power; - - HeltecT190Board() : periph_power(PIN_VEXT_EN,PIN_VEXT_EN_ACTIVE) { } - - void begin(); - void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1); - void powerOff() override; - uint16_t getBattMilliVolts() override; - const char* getManufacturerName() const override ; - -}; diff --git a/variants/heltec_t190/pins_arduino.h b/variants/heltec_t190/pins_arduino.h deleted file mode 100644 index 56856106..00000000 --- a/variants/heltec_t190/pins_arduino.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -static const uint8_t LED_BUILTIN = 45; // LED is not populated on earliest board variant -#define BUILTIN_LED LED_BUILTIN // Backward compatibility -#define LED_BUILTIN LED_BUILTIN - -static const uint8_t TX = 43; -static const uint8_t RX = 44; - -static const uint8_t SDA = 2; -static const uint8_t SCL = 1; - -static const uint8_t SS = 8; -static const uint8_t MOSI = 10; -static const uint8_t MISO = 11; -static const uint8_t SCK = 9; - -static const uint8_t A0 = 1; -static const uint8_t A1 = 2; -static const uint8_t A2 = 3; -static const uint8_t A3 = 4; -static const uint8_t A4 = 5; -static const uint8_t A5 = 6; -static const uint8_t A6 = 7; -static const uint8_t A7 = 8; -static const uint8_t A8 = 9; -static const uint8_t A9 = 10; -static const uint8_t A10 = 11; -static const uint8_t A11 = 12; -static const uint8_t A12 = 13; -static const uint8_t A13 = 14; -static const uint8_t A14 = 15; -static const uint8_t A15 = 16; -static const uint8_t A16 = 17; -static const uint8_t A17 = 18; -static const uint8_t A18 = 19; -static const uint8_t A19 = 20; - -static const uint8_t T1 = 1; -static const uint8_t T2 = 2; -static const uint8_t T3 = 3; -static const uint8_t T4 = 4; -static const uint8_t T5 = 5; -static const uint8_t T6 = 6; -static const uint8_t T7 = 7; -static const uint8_t T8 = 8; -static const uint8_t T9 = 9; -static const uint8_t T10 = 10; -static const uint8_t T11 = 11; -static const uint8_t T12 = 12; -static const uint8_t T13 = 13; -static const uint8_t T14 = 14; - -static const uint8_t RST_LoRa = 12; -static const uint8_t BUSY_LoRa = 13; -static const uint8_t DIO1 = 14; - -#endif /* Pins_Arduino_h */ diff --git a/variants/heltec_t190/platformio.ini b/variants/heltec_t190/platformio.ini deleted file mode 100644 index 8d21c523..00000000 --- a/variants/heltec_t190/platformio.ini +++ /dev/null @@ -1,154 +0,0 @@ -[Heltec_T190_base] -extends = esp32_base -board = heltec_t190 -build_flags = - ${esp32_base.build_flags} - -I variants/heltec_t190 - -I src/helpers/ui - -D HELTEC_VISION_MASTER_T190 - -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 LORA_TX_POWER=22 - -D PIN_USER_BTN=0 - -D PIN_VEXT_EN=5 - -D PIN_VEXT_EN_ACTIVE=HIGH - -D PIN_VBAT_READ=6 - -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=2 - -D PIN_BOARD_SCL=1 - -D PIN_TFT_SCL=38 - -D PIN_TFT_SDA=48 - -D PIN_TFT_RST=40 - -D PIN_TFT_VDD_CTL=7 - -D PIN_TFT_LEDA_CTL=17 - -D PIN_TFT_LEDA_CTL_ACTIVE=HIGH - -D PIN_TFT_CS=39 - -D PIN_TFT_DC=47 - -D ST7789 - -D DISPLAY_CLASS=ST7789Display -build_src_filter = ${esp32_base.build_src_filter} - +<../variants/heltec_t190> - + - + - + - + -lib_deps = - ${esp32_base.lib_deps} - adafruit/Adafruit GFX Library @ ^1.12.1 - -[env:Heltec_T190_companion_radio_ble_] -extends = Heltec_T190_base -build_flags = - ${Heltec_T190_base.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 ; dynamic, random PIN - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -build_src_filter = ${Heltec_T190_base.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_T190_base.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_T190_companion_radio_usb_] -extends = Heltec_T190_base -build_flags = - ${Heltec_T190_base.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D OFFLINE_QUEUE_SIZE=256 -build_src_filter = ${Heltec_T190_base.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_T190_base.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_T190_repeater_] -extends = Heltec_T190_base -build_flags = - ${Heltec_T190_base.build_flags} - -D ADVERT_NAME='"Heltec T190 Repeater"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D MAX_NEIGHBOURS=50 -build_src_filter = ${Heltec_T190_base.build_src_filter} - +<../examples/simple_repeater> -lib_deps = - ${Heltec_T190_base.lib_deps} - ${esp32_ota.lib_deps} - -; [env:Heltec_T190_repeater_bridge_rs232_] -; extends = Heltec_T190_base -; build_flags = -; ${Heltec_T190_base.build_flags} -; -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_T190_base.build_src_filter} -; + -; +<../examples/simple_repeater> -; lib_deps = -; ${Heltec_T190_base.lib_deps} -; ${esp32_ota.lib_deps} - -[env:Heltec_T190_repeater_bridge_espnow_] -extends = Heltec_T190_base -build_flags = - ${Heltec_T190_base.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 -build_src_filter = ${Heltec_T190_base.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_T190_base.lib_deps} - ${esp32_ota.lib_deps} - -[env:Heltec_T190_room_server_] -extends = Heltec_T190_base -build_flags = - ${Heltec_T190_base.build_flags} - -D ADVERT_NAME='"Heltec T190 Room"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D ROOM_PASSWORD='"hello"' -build_src_filter = ${Heltec_T190_base.build_src_filter} - +<../examples/simple_room_server> -lib_deps = - ${Heltec_T190_base.lib_deps} - ${esp32_ota.lib_deps} diff --git a/variants/heltec_t190/target.cpp b/variants/heltec_t190/target.cpp deleted file mode 100644 index b9357594..00000000 --- a/variants/heltec_t190/target.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "target.h" -#include - -HeltecT190Board board; - -#if defined(P_LORA_SCLK) - static SPIClass spi(FSPI); - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -#else - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY); -#endif - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); - -SensorManager sensors; - -#ifdef DISPLAY_CLASS -DISPLAY_CLASS display; -MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - -#if defined(P_LORA_SCLK) - return radio.std_init(&spi); -#else - return radio.std_init(); -#endif -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/heltec_t190/target.h b/variants/heltec_t190/target.h deleted file mode 100644 index 8a5fc716..00000000 --- a/variants/heltec_t190/target.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS -#include -#include -#endif - -extern HeltecT190Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern SensorManager sensors; - -#ifdef DISPLAY_CLASS -extern DISPLAY_CLASS display; -extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); \ No newline at end of file diff --git a/variants/heltec_tracker/platformio.ini b/variants/heltec_tracker/platformio.ini deleted file mode 100644 index 797eafdc..00000000 --- a/variants/heltec_tracker/platformio.ini +++ /dev/null @@ -1,157 +0,0 @@ -[Heltec_tracker_base] -extends = esp32_base -board = esp32-s3-devkitc-1 -build_flags = - ${esp32_base.build_flags} - -I variants/heltec_tracker - -D HELTEC_LORA_V3 - -D ARDUINO_USB_CDC_ON_BOOT=1 ; need for Serial - -D ESP32_CPU_FREQ=80 - -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 RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -D P_LORA_TX_LED=18 - -D PIN_BOARD_SDA=45 - -D PIN_BOARD_SCL=46 - -D PIN_USER_BTN=0 - -D PIN_ADC_CTRL=2 - -D PIN_TFT_SDA=42 ; SDIN - -D PIN_TFT_SCL=41 ; SCLK - -D PIN_TFT_DC=40 ; RS (register select) - -D PIN_TFT_RST=39 ; RES - -D PIN_TFT_CS=38 - -D USE_PIN_TFT=1 - -D PIN_VEXT_EN=3 ; Vext is connected to VDD which is also connected to OLED & GPS - -D PIN_TFT_LEDA_CTL=21 ; LEDK (switches on/off via mosfet to create the ground) - -D PIN_GPS_RX=33 - -D PIN_GPS_TX=34 - -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 -build_src_filter = ${esp32_base.build_src_filter} - +<../variants/heltec_tracker> -lib_deps = - ${esp32_base.lib_deps} - stevemarple/MicroNMEA @ ^2.0.6 - adafruit/Adafruit ST7735 and ST7789 Library @ ^1.11.0 - -[env:Heltec_Wireless_Tracker_companion_radio_ble] -extends = Heltec_tracker_base -build_flags = - ${Heltec_tracker_base.build_flags} - -I src/helpers/ui - -I examples/companion_radio/ui-new - -D DISPLAY_ROTATION=1 - -D DISPLAY_CLASS=ST7735Display - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 ; HWT will use display for pin - -D OFFLINE_QUEUE_SIZE=256 -; -D BLE_DEBUG_LOGGING=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_tracker_base.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> - + -lib_deps = - ${Heltec_tracker_base.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_Wireless_Tracker_repeater] -extends = Heltec_tracker_base -build_flags = - ${Heltec_tracker_base.build_flags} - -D DISPLAY_ROTATION=1 - -D DISPLAY_CLASS=ST7735Display - -D ADVERT_NAME='"Heltec 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 -build_src_filter = ${Heltec_tracker_base.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_tracker_base.lib_deps} - ${esp32_ota.lib_deps} - -; [env:Heltec_Wireless_Tracker_repeater_bridge_rs232] -; extends = Heltec_tracker_base -; build_flags = -; ${Heltec_tracker_base.build_flags} -; -D DISPLAY_ROTATION=1 -; -D DISPLAY_CLASS=ST7735Display -; -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_tracker_base.build_src_filter} -; + -; + -; +<../examples/simple_repeater> -; lib_deps = -; ${Heltec_tracker_base.lib_deps} -; ${esp32_ota.lib_deps} - -[env:Heltec_Wireless_Tracker_repeater_bridge_espnow] -extends = Heltec_tracker_base -build_flags = - ${Heltec_tracker_base.build_flags} - -D DISPLAY_ROTATION=1 - -D DISPLAY_CLASS=ST7735Display - -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_tracker_base.build_src_filter} - + - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_tracker_base.lib_deps} - ${esp32_ota.lib_deps} - -[env:Heltec_Wireless_Tracker_room_server] -extends = Heltec_tracker_base -build_flags = - ${Heltec_tracker_base.build_flags} - -D DISPLAY_ROTATION=1 - -D DISPLAY_CLASS=ST7735Display - -D ADVERT_NAME='"Heltec 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 -build_src_filter = ${Heltec_tracker_base.build_src_filter} - + - +<../examples/simple_room_server> -lib_deps = - ${Heltec_tracker_base.lib_deps} - ${esp32_ota.lib_deps} diff --git a/variants/heltec_tracker/target.cpp b/variants/heltec_tracker/target.cpp deleted file mode 100644 index 5ba9a8fb..00000000 --- a/variants/heltec_tracker/target.cpp +++ /dev/null @@ -1,126 +0,0 @@ -#include -#include "target.h" - -#include - -HeltecV3Board board; - -#if defined(P_LORA_SCLK) - static SPIClass spi; - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -#else - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY); -#endif - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1); -HWTSensorManager sensors = HWTSensorManager(nmea); - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display(&board.periph_power); // peripheral power pin is shared - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - -#if defined(P_LORA_SCLK) - return radio.std_init(&spi); -#else - return radio.std_init(); -#endif - -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} - -void HWTSensorManager::start_gps() { - if (!gps_active) { - board.periph_power.claim(); - - gps_active = true; - Serial1.println("$CFGSYS,h35155*68"); - } -} - -void HWTSensorManager::stop_gps() { - if (gps_active) { - gps_active = false; - - board.periph_power.release(); - } -} - -bool HWTSensorManager::begin() { - // init GPS port - Serial1.begin(115200, SERIAL_8N1, PIN_GPS_RX, PIN_GPS_TX); - return true; -} - -bool HWTSensorManager::querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) { - if (requester_permissions & TELEM_PERM_LOCATION) { // does requester have permission? - telemetry.addGPS(TELEM_CHANNEL_SELF, node_lat, node_lon, node_altitude); - } - return true; -} - -void HWTSensorManager::loop() { - static long next_gps_update = 0; - - _location->loop(); - - if (millis() > next_gps_update) { - if (gps_active && _location->isValid()) { - node_lat = ((double)_location->getLatitude())/1000000.; - node_lon = ((double)_location->getLongitude())/1000000.; - node_altitude = ((double)_location->getAltitude()) / 1000.0; - MESH_DEBUG_PRINTLN("lat %f lon %f", node_lat, node_lon); - } - next_gps_update = millis() + 1000; - } -} - -int HWTSensorManager::getNumSettings() const { return 1; } // just one supported: "gps" (power switch) - -const char* HWTSensorManager::getSettingName(int i) const { - return i == 0 ? "gps" : NULL; -} -const char* HWTSensorManager::getSettingValue(int i) const { - if (i == 0) { - return gps_active ? "1" : "0"; - } - return NULL; -} -bool HWTSensorManager::setSettingValue(const char* name, const char* value) { - if (strcmp(name, "gps") == 0) { - if (strcmp(value, "0") == 0) { - stop_gps(); - } else { - start_gps(); - } - return true; - } - return false; // not supported -} diff --git a/variants/heltec_tracker/target.h b/variants/heltec_tracker/target.h deleted file mode 100644 index 23fab16e..00000000 --- a/variants/heltec_tracker/target.h +++ /dev/null @@ -1,47 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include <../heltec_v3/HeltecV3Board.h> -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -class HWTSensorManager : public SensorManager { - bool gps_active = false; - LocationProvider * _location; - - void start_gps(); - void stop_gps(); -public: - HWTSensorManager(LocationProvider &location): _location(&location) { } - bool begin() override; - bool querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) override; - void loop() override; - int getNumSettings() const override; - const char* getSettingName(int i) const override; - const char* getSettingValue(int i) const override; - bool setSettingValue(const char* name, const char* value) override; -}; - -extern HeltecV3Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern HWTSensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/heltec_tracker_v2/HeltecTrackerV2Board.cpp b/variants/heltec_tracker_v2/HeltecTrackerV2Board.cpp deleted file mode 100644 index 4975d5cd..00000000 --- a/variants/heltec_tracker_v2/HeltecTrackerV2Board.cpp +++ /dev/null @@ -1,88 +0,0 @@ -#include "HeltecTrackerV2Board.h" - -void HeltecTrackerV2Board::begin() { - ESP32Board::begin(); - - pinMode(PIN_ADC_CTRL, OUTPUT); - digitalWrite(PIN_ADC_CTRL, LOW); // Initially inactive - - pinMode(P_LORA_PA_POWER, OUTPUT); - digitalWrite(P_LORA_PA_POWER,HIGH); - - rtc_gpio_hold_dis((gpio_num_t)P_LORA_PA_EN); - pinMode(P_LORA_PA_EN, OUTPUT); - digitalWrite(P_LORA_PA_EN,HIGH); - pinMode(P_LORA_PA_TX_EN, OUTPUT); - digitalWrite(P_LORA_PA_TX_EN,LOW); - - periph_power.begin(); - - esp_reset_reason_t reason = esp_reset_reason(); - if (reason == ESP_RST_DEEPSLEEP) { - long wakeup_source = esp_sleep_get_ext1_wakeup_status(); - if (wakeup_source & (1 << P_LORA_DIO_1)) { // received a LoRa packet (while in deep sleep) - startup_reason = BD_STARTUP_RX_PACKET; - } - - rtc_gpio_hold_dis((gpio_num_t)P_LORA_NSS); - rtc_gpio_deinit((gpio_num_t)P_LORA_DIO_1); - } - } - - void HeltecTrackerV2Board::onBeforeTransmit(void) { - digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED on - digitalWrite(P_LORA_PA_TX_EN,HIGH); - } - - void HeltecTrackerV2Board::onAfterTransmit(void) { - digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED off - digitalWrite(P_LORA_PA_TX_EN,LOW); - } - - void HeltecTrackerV2Board::enterDeepSleep(uint32_t secs, int pin_wake_btn) { - esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON); - - // Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep - rtc_gpio_set_direction((gpio_num_t)P_LORA_DIO_1, RTC_GPIO_MODE_INPUT_ONLY); - rtc_gpio_pulldown_en((gpio_num_t)P_LORA_DIO_1); - - rtc_gpio_hold_en((gpio_num_t)P_LORA_NSS); - - rtc_gpio_hold_en((gpio_num_t)P_LORA_PA_EN); //It also needs to be enabled in receive mode - - if (pin_wake_btn < 0) { - esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet - } else { - esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1) | (1L << pin_wake_btn), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet OR wake btn - } - - if (secs > 0) { - esp_sleep_enable_timer_wakeup(secs * 1000000); - } - - // Finally set ESP32 into sleep - esp_deep_sleep_start(); // CPU halts here and never returns! - } - - void HeltecTrackerV2Board::powerOff() { - enterDeepSleep(0); - } - - uint16_t HeltecTrackerV2Board::getBattMilliVolts() { - analogReadResolution(10); - digitalWrite(PIN_ADC_CTRL, HIGH); - delay(10); - uint32_t raw = 0; - for (int i = 0; i < 8; i++) { - raw += analogRead(PIN_VBAT_READ); - } - raw = raw / 8; - - digitalWrite(PIN_ADC_CTRL, LOW); - - return (5.42 * (3.3 / 1024.0) * raw) * 1000; - } - - const char* HeltecTrackerV2Board::getManufacturerName() const { - return "Heltec Tracker V2"; - } diff --git a/variants/heltec_tracker_v2/HeltecTrackerV2Board.h b/variants/heltec_tracker_v2/HeltecTrackerV2Board.h deleted file mode 100644 index d93c86cd..00000000 --- a/variants/heltec_tracker_v2/HeltecTrackerV2Board.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -class HeltecTrackerV2Board : public ESP32Board { - -public: - RefCountedDigitalPin periph_power; - - HeltecTrackerV2Board() : periph_power(PIN_VEXT_EN,PIN_VEXT_EN_ACTIVE) { } - - void begin(); - void onBeforeTransmit(void) override; - void onAfterTransmit(void) override; - void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1); - void powerOff() override; - uint16_t getBattMilliVolts() override; - const char* getManufacturerName() const override ; - -}; diff --git a/variants/heltec_tracker_v2/pins_arduino.h b/variants/heltec_tracker_v2/pins_arduino.h deleted file mode 100644 index 982cb5e5..00000000 --- a/variants/heltec_tracker_v2/pins_arduino.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -static const uint8_t LED_BUILTIN = 18; -#define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN - -static const uint8_t TX = 43; -static const uint8_t RX = 44; - -static const uint8_t SDA = 5; -static const uint8_t SCL = 6; - -static const uint8_t SS = 8; -static const uint8_t MOSI = 10; -static const uint8_t MISO = 11; -static const uint8_t SCK = 9; - -static const uint8_t A0 = 1; -static const uint8_t A1 = 2; -static const uint8_t A2 = 3; -static const uint8_t A3 = 4; -static const uint8_t A4 = 5; -static const uint8_t A5 = 6; -static const uint8_t A6 = 7; -static const uint8_t A7 = 8; -static const uint8_t A8 = 9; -static const uint8_t A9 = 10; -static const uint8_t A10 = 11; -static const uint8_t A11 = 12; -static const uint8_t A12 = 13; -static const uint8_t A13 = 14; -static const uint8_t A14 = 15; -static const uint8_t A15 = 16; -static const uint8_t A16 = 17; -static const uint8_t A17 = 18; -static const uint8_t A18 = 19; -static const uint8_t A19 = 20; - -static const uint8_t T1 = 1; -static const uint8_t T2 = 2; -static const uint8_t T3 = 3; -static const uint8_t T4 = 4; -static const uint8_t T5 = 5; -static const uint8_t T6 = 6; -static const uint8_t T7 = 7; -static const uint8_t T8 = 8; -static const uint8_t T9 = 9; -static const uint8_t T10 = 10; -static const uint8_t T11 = 11; -static const uint8_t T12 = 12; -static const uint8_t T13 = 13; -static const uint8_t T14 = 14; - -static const uint8_t Vext = 3; -static const uint8_t LED = 18; - -#endif /* Pins_Arduino_h */ \ No newline at end of file diff --git a/variants/heltec_tracker_v2/platformio.ini b/variants/heltec_tracker_v2/platformio.ini deleted file mode 100644 index 36de671e..00000000 --- a/variants/heltec_tracker_v2/platformio.ini +++ /dev/null @@ -1,219 +0,0 @@ -[Heltec_tracker_v2] -extends = esp32_base -board = heltec_tracker_v2 -build_flags = - ${esp32_base.build_flags} - ${sensor_base.build_flags} - -I variants/heltec_tracker_v2 - -D HELTEC_TRACKER_V2 - -D ESP32_CPU_FREQ=160 - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D P_LORA_TX_LED=18 - -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_PA_POWER=7 ;power en - -D P_LORA_PA_EN=4 - -D P_LORA_PA_TX_EN=46 ;enable tx - -D LORA_TX_POWER=10 ;If it is configured as 10 here, the final output will be 22 dbm. - -D MAX_LORA_TX_POWER=22 ;Max SX1262 output - -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=5 - -D PIN_BOARD_SCL=6 - -D PIN_USER_BTN=0 - -D PIN_TFT_SDA=42 ; SDIN - -D PIN_TFT_SCL=41 ; SCLK - -D PIN_TFT_DC=40 ; RS (register select) - -D PIN_TFT_RST=39 ; RES - -D PIN_TFT_CS=38 - -D USE_PIN_TFT=1 - -D PIN_VEXT_EN=3 ; Vext is connected to VDD which is also connected to OLED & GPS - -D PIN_VEXT_EN_ACTIVE=HIGH - -D PIN_TFT_LEDA_CTL=21 ; LEDK (switches on/off via mosfet to create the ground) - -D DISPLAY_ROTATION=1 - -D PIN_GPS_RX=34 - -D PIN_GPS_TX=33 - -D PIN_GPS_RESET=35 - -D PIN_GPS_RESET_ACTIVE=LOW - -D GPS_BAUD_RATE=115200 - -D ENV_INCLUDE_GPS=1 - -D PIN_ADC_CTRL=2 - -D PIN_VBAT_READ=1 -build_src_filter = ${esp32_base.build_src_filter} - +<../variants/heltec_tracker_v2> - + -lib_deps = - ${esp32_base.lib_deps} - ${sensor_base.lib_deps} - adafruit/Adafruit ST7735 and ST7789 Library @ ^1.11.0 - -[env:heltec_tracker_v2_repeater] -extends = Heltec_tracker_v2 -build_flags = - ${Heltec_tracker_v2.build_flags} - -D DISPLAY_CLASS=ST7735Display - -D ADVERT_NAME='"Heltec 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 -build_src_filter = ${Heltec_tracker_v2.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_tracker_v2.lib_deps} - ${esp32_ota.lib_deps} - bakercp/CRC32 @ ^2.0.0 - -[env:heltec_tracker_v2_repeater_bridge_espnow] -extends = Heltec_tracker_v2 -build_flags = - ${Heltec_tracker_v2.build_flags} - -D DISPLAY_CLASS=ST7735Display - -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_tracker_v2.build_src_filter} - + - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_tracker_v2.lib_deps} - ${esp32_ota.lib_deps} - -[env:heltec_tracker_v2_room_server] -extends = Heltec_tracker_v2 -build_flags = - ${Heltec_tracker_v2.build_flags} - -D DISPLAY_CLASS=ST7735Display - -D ADVERT_NAME='"Heltec 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 -build_src_filter = ${Heltec_tracker_v2.build_src_filter} - + - +<../examples/simple_room_server> -lib_deps = - ${Heltec_tracker_v2.lib_deps} - ${esp32_ota.lib_deps} - -[env:heltec_tracker_v2_terminal_chat] -extends = Heltec_tracker_v2 -build_flags = - ${Heltec_tracker_v2.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_tracker_v2.build_src_filter} - +<../examples/simple_secure_chat/main.cpp> -lib_deps = - ${Heltec_tracker_v2.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:heltec_tracker_v2_companion_radio_usb] -extends = Heltec_tracker_v2 -build_flags = - ${Heltec_tracker_v2.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D DISPLAY_CLASS=ST7735Display -; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 -; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 -build_src_filter = ${Heltec_tracker_v2.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_tracker_v2.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:heltec_tracker_v2_companion_radio_ble] -extends = Heltec_tracker_v2 -build_flags = - ${Heltec_tracker_v2.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D DISPLAY_CLASS=ST7735Display - -D BLE_PIN_CODE=123456 ; dynamic, random PIN - -D AUTO_SHUTDOWN_MILLIVOLTS=3400 - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 - ; -D BLE_DEBUG_LOGGING=1 - ; -D MESH_PACKET_LOGGING=1 - ; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_tracker_v2.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_tracker_v2.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:heltec_tracker_v2_companion_radio_wifi] -extends = Heltec_tracker_v2 -build_flags = - ${Heltec_tracker_v2.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D DISPLAY_CLASS=ST7735Display - -D WIFI_DEBUG_LOGGING=1 - -D WIFI_SSID='"myssid"' - -D WIFI_PWD='"mypwd"' - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_tracker_v2.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_tracker_v2.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:heltec_tracker_v2_sensor] -extends = Heltec_tracker_v2 -build_flags = - ${Heltec_tracker_v2.build_flags} - -D ADVERT_NAME='"Heltec Tracker V2 Sensor"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D ENV_PIN_SDA=3 - -D ENV_PIN_SCL=4 - -D DISPLAY_CLASS=ST7735Display -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_tracker_v2.build_src_filter} - + - +<../examples/simple_sensor> -lib_deps = - ${Heltec_tracker_v2.lib_deps} - ${esp32_ota.lib_deps} diff --git a/variants/heltec_tracker_v2/target.cpp b/variants/heltec_tracker_v2/target.cpp deleted file mode 100644 index da397fb7..00000000 --- a/variants/heltec_tracker_v2/target.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include -#include "target.h" - -HeltecTrackerV2Board board; - -#if defined(P_LORA_SCLK) - static SPIClass spi; - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -#else - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY); -#endif - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); - -#if ENV_INCLUDE_GPS - #include - MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, NULL, GPS_RESET, GPS_EN, &board.periph_power); - EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea); -#else - EnvironmentSensorManager sensors; -#endif - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display(&board.periph_power); // peripheral power pin is shared - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - -#if defined(P_LORA_SCLK) - return radio.std_init(&spi); -#else - return radio.std_init(); -#endif -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/heltec_tracker_v2/target.h b/variants/heltec_tracker_v2/target.h deleted file mode 100644 index 190404ef..00000000 --- a/variants/heltec_tracker_v2/target.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -extern HeltecTrackerV2Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/heltec_v2/HeltecV2Board.h b/variants/heltec_v2/HeltecV2Board.h deleted file mode 100644 index a6221036..00000000 --- a/variants/heltec_v2/HeltecV2Board.h +++ /dev/null @@ -1,67 +0,0 @@ -#pragma once - -#include -#include - -// built-ins -#define PIN_VBAT_READ 37 -#define PIN_LED_BUILTIN 25 - -#include - -class HeltecV2Board : public ESP32Board { -public: - void begin() { - ESP32Board::begin(); - - esp_reset_reason_t reason = esp_reset_reason(); - if (reason == ESP_RST_DEEPSLEEP) { - long wakeup_source = esp_sleep_get_ext1_wakeup_status(); - if (wakeup_source & (1 << P_LORA_DIO_1)) { // received a LoRa packet (while in deep sleep) - startup_reason = BD_STARTUP_RX_PACKET; - } - - rtc_gpio_hold_dis((gpio_num_t)P_LORA_NSS); - rtc_gpio_deinit((gpio_num_t)P_LORA_DIO_1); - } - } - - void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1) { - esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON); - - // Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep - rtc_gpio_set_direction((gpio_num_t)P_LORA_DIO_1, RTC_GPIO_MODE_INPUT_ONLY); - rtc_gpio_pulldown_en((gpio_num_t)P_LORA_DIO_1); - - rtc_gpio_hold_en((gpio_num_t)P_LORA_NSS); - - if (pin_wake_btn < 0) { - esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet - } else { - esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1) | (1L << pin_wake_btn), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet OR wake btn - } - - if (secs > 0) { - esp_sleep_enable_timer_wakeup(secs * 1000000); - } - - // Finally set ESP32 into sleep - esp_deep_sleep_start(); // CPU halts here and never returns! - } - - uint16_t getBattMilliVolts() override { - analogReadResolution(10); - - uint32_t raw = 0; - for (int i = 0; i < 8; i++) { - raw += analogRead(PIN_VBAT_READ); - } - raw = raw / 8; - - return (1.98 * (2 / 1024.0) * raw) * 1000; - } - - const char* getManufacturerName() const override { - return "Heltec V2"; - } -}; diff --git a/variants/heltec_v2/platformio.ini b/variants/heltec_v2/platformio.ini deleted file mode 100644 index f8cc9360..00000000 --- a/variants/heltec_v2/platformio.ini +++ /dev/null @@ -1,197 +0,0 @@ -[Heltec_lora32_v2] -extends = esp32_base -board = heltec_wifi_lora_32_V2 ; heltec_wifi_lora_32_V2 -build_flags = - ${esp32_base.build_flags} - -I variants/heltec_v2 - -D HELTEC_LORA_V2 - -D RADIO_CLASS=CustomSX1276 - -D WRAPPER_CLASS=CustomSX1276Wrapper - -D P_LORA_DIO_1=26 - -D P_LORA_NSS=18 - -D P_LORA_RESET=RADIOLIB_NC - -D P_LORA_BUSY=RADIOLIB_NC - -D P_LORA_SCLK=5 - -D P_LORA_MISO=19 - -D P_LORA_MOSI=27 - -D P_LORA_TX_LED=25 - -D SX127X_CURRENT_LIMIT=120 - -D LORA_TX_POWER=20 - -D PIN_BOARD_SDA=4 - -D PIN_BOARD_SCL=15 - -D PIN_USER_BTN=0 - -D PIN_OLED_RESET=16 -build_src_filter = ${esp32_base.build_src_filter} - +<../variants/heltec_v2> -lib_deps = - ${esp32_base.lib_deps} - adafruit/Adafruit SSD1306 @ ^2.5.13 - -[env:Heltec_v2_repeater] -extends = Heltec_lora32_v2 -build_flags = - ${Heltec_lora32_v2.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -D ADVERT_NAME='"Heltec 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 -build_src_filter = ${Heltec_lora32_v2.build_src_filter} - +<../examples/simple_repeater> - + - + -lib_deps = - ${Heltec_lora32_v2.lib_deps} - ${esp32_ota.lib_deps} - -; [env:Heltec_v2_repeater_bridge_rs232] -; extends = Heltec_lora32_v2 -; build_flags = -; ${Heltec_lora32_v2.build_flags} -; -D DISPLAY_CLASS=SSD1306Display -; -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_lora32_v2.build_src_filter} -; + -; + -; + -; +<../examples/simple_repeater> -; lib_deps = -; ${Heltec_lora32_v2.lib_deps} -; ${esp32_ota.lib_deps} - -[env:Heltec_v2_repeater_bridge_espnow] -extends = Heltec_lora32_v2 -build_flags = - ${Heltec_lora32_v2.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -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_lora32_v2.build_src_filter} - + - + - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_lora32_v2.lib_deps} - ${esp32_ota.lib_deps} - -[env:Heltec_v2_room_server] -extends = Heltec_lora32_v2 -build_flags = - ${Heltec_lora32_v2.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -D ADVERT_NAME='"Heltec 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 -build_src_filter = ${Heltec_lora32_v2.build_src_filter} - + - + - +<../examples/simple_room_server> -lib_deps = - ${Heltec_lora32_v2.lib_deps} - ${esp32_ota.lib_deps} - -[env:Heltec_v2_terminal_chat] -extends = Heltec_lora32_v2 -build_flags = - ${Heltec_lora32_v2.build_flags} - -D MAX_CONTACTS=160 - -D MAX_GROUP_CHANNELS=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v2.build_src_filter} - +<../examples/simple_secure_chat/main.cpp> -lib_deps = - ${Heltec_lora32_v2.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_v2_companion_radio_usb] -extends = Heltec_lora32_v2 -build_flags = - ${Heltec_lora32_v2.build_flags} - -I examples/companion_radio/ui-new - -D DISPLAY_CLASS=SSD1306Display - -D MAX_CONTACTS=160 - -D MAX_GROUP_CHANNELS=8 -; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 -; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v2.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_lora32_v2.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_v2_companion_radio_ble] -extends = Heltec_lora32_v2 -build_flags = - ${Heltec_lora32_v2.build_flags} - -I examples/companion_radio/ui-new - -D DISPLAY_CLASS=SSD1306Display - -D MAX_CONTACTS=160 - -D MAX_GROUP_CHANNELS=8 - -D BLE_PIN_CODE=123456 - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v2.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_lora32_v2.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_v2_companion_radio_wifi] -extends = Heltec_lora32_v2 -build_flags = - ${Heltec_lora32_v2.build_flags} - -I examples/companion_radio/ui-new - -D DISPLAY_CLASS=SSD1306Display - -D MAX_CONTACTS=160 - -D MAX_GROUP_CHANNELS=8 - -D WIFI_DEBUG_LOGGING=1 - -D WIFI_SSID='"myssid"' - -D WIFI_PWD='"mypwd"' - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v2.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_lora32_v2.lib_deps} - densaugeo/base64 @ ~1.4.0 diff --git a/variants/heltec_v2/target.cpp b/variants/heltec_v2/target.cpp deleted file mode 100644 index df71d3f4..00000000 --- a/variants/heltec_v2/target.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include -#include "target.h" - -HeltecV2Board board; - -#if defined(P_LORA_SCLK) - static SPIClass spi; - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -#else - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY); -#endif - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -SensorManager sensors; - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - -#if defined(P_LORA_SCLK) - return radio.std_init(&spi); -#else - return radio.std_init(); -#endif -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/heltec_v2/target.h b/variants/heltec_v2/target.h deleted file mode 100644 index 48d750be..00000000 --- a/variants/heltec_v2/target.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -extern HeltecV2Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern SensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/heltec_v3/HeltecV3Board.h b/variants/heltec_v3/HeltecV3Board.h deleted file mode 100644 index afdaf639..00000000 --- a/variants/heltec_v3/HeltecV3Board.h +++ /dev/null @@ -1,97 +0,0 @@ -#pragma once - -#include -#include -#include - -// built-ins -#ifndef PIN_VBAT_READ // set in platformio.ini for boards like Heltec Wireless Paper (20) - #define PIN_VBAT_READ 1 -#endif -#ifndef PIN_ADC_CTRL // set in platformio.ini for Heltec Wireless Tracker (2) - #define PIN_ADC_CTRL 37 -#endif -#define PIN_ADC_CTRL_ACTIVE LOW -#define PIN_ADC_CTRL_INACTIVE HIGH - -#include - -class HeltecV3Board : public ESP32Board { -private: - bool adc_active_state; - -public: - RefCountedDigitalPin periph_power; - - HeltecV3Board() : periph_power(PIN_VEXT_EN) { } - - void begin() { - ESP32Board::begin(); - - // Auto-detect correct ADC_CTRL pin polarity (different for boards >3.2) - pinMode(PIN_ADC_CTRL, INPUT); - adc_active_state = !digitalRead(PIN_ADC_CTRL); - - pinMode(PIN_ADC_CTRL, OUTPUT); - digitalWrite(PIN_ADC_CTRL, !adc_active_state); // Initially inactive - - periph_power.begin(); - - esp_reset_reason_t reason = esp_reset_reason(); - if (reason == ESP_RST_DEEPSLEEP) { - long wakeup_source = esp_sleep_get_ext1_wakeup_status(); - if (wakeup_source & (1 << P_LORA_DIO_1)) { // received a LoRa packet (while in deep sleep) - startup_reason = BD_STARTUP_RX_PACKET; - } - - rtc_gpio_hold_dis((gpio_num_t)P_LORA_NSS); - rtc_gpio_deinit((gpio_num_t)P_LORA_DIO_1); - } - } - - void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1) { - esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON); - - // Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep - rtc_gpio_set_direction((gpio_num_t)P_LORA_DIO_1, RTC_GPIO_MODE_INPUT_ONLY); - rtc_gpio_pulldown_en((gpio_num_t)P_LORA_DIO_1); - - rtc_gpio_hold_en((gpio_num_t)P_LORA_NSS); - - if (pin_wake_btn < 0) { - esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet - } else { - esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1) | (1L << pin_wake_btn), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet OR wake btn - } - - if (secs > 0) { - esp_sleep_enable_timer_wakeup(secs * 1000000); - } - - // Finally set ESP32 into sleep - esp_deep_sleep_start(); // CPU halts here and never returns! - } - - void powerOff() override { - enterDeepSleep(0); - } - - uint16_t getBattMilliVolts() override { - analogReadResolution(10); - digitalWrite(PIN_ADC_CTRL, adc_active_state); - - uint32_t raw = 0; - for (int i = 0; i < 8; i++) { - raw += analogRead(PIN_VBAT_READ); - } - raw = raw / 8; - - digitalWrite(PIN_ADC_CTRL, !adc_active_state); - - return (5.42 * (3.3 / 1024.0) * raw) * 1000; - } - - const char* getManufacturerName() const override { - return "Heltec V3"; - } -}; diff --git a/variants/heltec_v3/platformio.ini b/variants/heltec_v3/platformio.ini deleted file mode 100644 index 6b61eff5..00000000 --- a/variants/heltec_v3/platformio.ini +++ /dev/null @@ -1,369 +0,0 @@ -[Heltec_lora32_v3] -extends = esp32_base -board = esp32-s3-devkitc-1 -build_flags = - ${esp32_base.build_flags} - ${sensor_base.build_flags} - -I variants/heltec_v3 - -D HELTEC_LORA_V3 - -D ESP32_CPU_FREQ=80 - -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 RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -D P_LORA_TX_LED=35 - -D PIN_BOARD_SDA=17 - -D PIN_BOARD_SCL=18 - -D PIN_USER_BTN=0 - -D PIN_VEXT_EN=36 - -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_GPS_RX=47 - -D PIN_GPS_TX=48 - -D PIN_GPS_EN=26 -build_src_filter = ${esp32_base.build_src_filter} - +<../variants/heltec_v3> - + -lib_deps = - ${esp32_base.lib_deps} - ${sensor_base.lib_deps} - -[env:Heltec_v3_repeater] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -D ADVERT_NAME='"Heltec 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 -build_src_filter = ${Heltec_lora32_v3.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - ${esp32_ota.lib_deps} - bakercp/CRC32 @ ^2.0.0 - -[env:Heltec_v3_repeater_bridge_rs232] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -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_lora32_v3.build_src_filter} - + - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - ${esp32_ota.lib_deps} - -[env:Heltec_v3_repeater_bridge_espnow] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -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_lora32_v3.build_src_filter} - + - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - ${esp32_ota.lib_deps} - -[env:Heltec_v3_room_server] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -D ADVERT_NAME='"Heltec 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 -build_src_filter = ${Heltec_lora32_v3.build_src_filter} - + - +<../examples/simple_room_server> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - ${esp32_ota.lib_deps} - -[env:Heltec_v3_terminal_chat] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v3.build_src_filter} - +<../examples/simple_secure_chat/main.cpp> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_v3_companion_radio_usb] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D DISPLAY_CLASS=SSD1306Display -; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 -; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v3.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_v3_companion_radio_ble] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D DISPLAY_CLASS=SSD1306Display - -D BLE_PIN_CODE=123456 ; dynamic, random PIN - -D AUTO_SHUTDOWN_MILLIVOLTS=3400 - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v3.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_v3_companion_radio_wifi] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D DISPLAY_CLASS=SSD1306Display - -D WIFI_DEBUG_LOGGING=1 - -D WIFI_SSID='"myssid"' - -D WIFI_PWD='"mypwd"' - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v3.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_v3_sensor] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.build_flags} - -D ADVERT_NAME='"Heltec v3 Sensor"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D ENV_PIN_SDA=33 - -D ENV_PIN_SCL=34 - -D DISPLAY_CLASS=SSD1306Display -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v3.build_src_filter} - + - +<../examples/simple_sensor> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - ${esp32_ota.lib_deps} - -[env:Heltec_WSL3_repeater] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.build_flags} - -D ADVERT_NAME='"Heltec 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 -build_src_filter = ${Heltec_lora32_v3.build_src_filter} - +<../examples/simple_repeater> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - ${esp32_ota.lib_deps} - bakercp/CRC32 @ ^2.0.0 - -[env:Heltec_WSL3_repeater_bridge_rs232] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.build_flags} - -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_lora32_v3.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - ${esp32_ota.lib_deps} - bakercp/CRC32 @ ^2.0.0 - -[env:Heltec_WSL3_repeater_bridge_espnow] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.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 -build_src_filter = ${Heltec_lora32_v3.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - ${esp32_ota.lib_deps} - bakercp/CRC32 @ ^2.0.0 - -[env:Heltec_WSL3_room_server] -extends = Heltec_lora32_v3 -build_src_filter = ${Heltec_lora32_v3.build_src_filter} - +<../examples/simple_room_server> -build_flags = - ${Heltec_lora32_v3.build_flags} - -D ADVERT_NAME='"Heltec 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 = - ${Heltec_lora32_v3.lib_deps} - ${esp32_ota.lib_deps} - -[env:Heltec_WSL3_companion_radio_ble] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v3.build_src_filter} - + - +<../examples/companion_radio/*.cpp> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_WSL3_companion_radio_usb] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 -; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 -; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v3.build_src_filter} - +<../examples/companion_radio/*.cpp> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_WSL3_companion_radio_wifi] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D WIFI_DEBUG_LOGGING=1 - -D WIFI_SSID='"myssid"' - -D WIFI_PWD='"mypwd"' - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v3.build_src_filter} - + - +<../examples/companion_radio/*.cpp> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Heltec_WSL3_sensor] -extends = Heltec_lora32_v3 -build_flags = - ${Heltec_lora32_v3.build_flags} - -D ADVERT_NAME='"Heltec Sensor"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v3.build_src_filter} - +<../examples/simple_sensor> -lib_deps = - ${Heltec_lora32_v3.lib_deps} - ${esp32_ota.lib_deps} diff --git a/variants/heltec_v3/target.cpp b/variants/heltec_v3/target.cpp deleted file mode 100644 index 78b88197..00000000 --- a/variants/heltec_v3/target.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include -#include "target.h" - -HeltecV3Board board; - -#if defined(P_LORA_SCLK) - static SPIClass spi; - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -#else - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY); -#endif - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); - -#if ENV_INCLUDE_GPS - #include - MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1); - EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea); -#else - EnvironmentSensorManager sensors; -#endif - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - -#if defined(P_LORA_SCLK) - return radio.std_init(&spi); -#else - return radio.std_init(); -#endif -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/heltec_v3/target.h b/variants/heltec_v3/target.h deleted file mode 100644 index 739aecfe..00000000 --- a/variants/heltec_v3/target.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -extern HeltecV3Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/heltec_v4/HeltecV4Board.cpp b/variants/heltec_v4/HeltecV4Board.cpp deleted file mode 100644 index f143db36..00000000 --- a/variants/heltec_v4/HeltecV4Board.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#include "HeltecV4Board.h" - -void HeltecV4Board::begin() { - ESP32Board::begin(); - - - pinMode(PIN_ADC_CTRL, OUTPUT); - digitalWrite(PIN_ADC_CTRL, LOW); // Initially inactive - - pinMode(P_LORA_PA_POWER, OUTPUT); - digitalWrite(P_LORA_PA_POWER,HIGH); - - rtc_gpio_hold_dis((gpio_num_t)P_LORA_PA_EN); - pinMode(P_LORA_PA_EN, OUTPUT); - digitalWrite(P_LORA_PA_EN,HIGH); - pinMode(P_LORA_PA_TX_EN, OUTPUT); - digitalWrite(P_LORA_PA_TX_EN,LOW); - - - periph_power.begin(); - - esp_reset_reason_t reason = esp_reset_reason(); - if (reason == ESP_RST_DEEPSLEEP) { - long wakeup_source = esp_sleep_get_ext1_wakeup_status(); - if (wakeup_source & (1 << P_LORA_DIO_1)) { // received a LoRa packet (while in deep sleep) - startup_reason = BD_STARTUP_RX_PACKET; - } - - rtc_gpio_hold_dis((gpio_num_t)P_LORA_NSS); - rtc_gpio_deinit((gpio_num_t)P_LORA_DIO_1); - } - } - - void HeltecV4Board::onBeforeTransmit(void) { - digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED on - digitalWrite(P_LORA_PA_TX_EN,HIGH); - } - - void HeltecV4Board::onAfterTransmit(void) { - digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED off - digitalWrite(P_LORA_PA_TX_EN,LOW); - } - - void HeltecV4Board::enterDeepSleep(uint32_t secs, int pin_wake_btn) { - esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON); - - // Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep - rtc_gpio_set_direction((gpio_num_t)P_LORA_DIO_1, RTC_GPIO_MODE_INPUT_ONLY); - rtc_gpio_pulldown_en((gpio_num_t)P_LORA_DIO_1); - - rtc_gpio_hold_en((gpio_num_t)P_LORA_NSS); - - rtc_gpio_hold_en((gpio_num_t)P_LORA_PA_EN); //It also needs to be enabled in receive mode - - if (pin_wake_btn < 0) { - esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet - } else { - esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1) | (1L << pin_wake_btn), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet OR wake btn - } - - if (secs > 0) { - esp_sleep_enable_timer_wakeup(secs * 1000000); - } - - // Finally set ESP32 into sleep - esp_deep_sleep_start(); // CPU halts here and never returns! - } - - void HeltecV4Board::powerOff() { - enterDeepSleep(0); - } - - uint16_t HeltecV4Board::getBattMilliVolts() { - analogReadResolution(10); - digitalWrite(PIN_ADC_CTRL, HIGH); - delay(10); - uint32_t raw = 0; - for (int i = 0; i < 8; i++) { - raw += analogRead(PIN_VBAT_READ); - } - raw = raw / 8; - - digitalWrite(PIN_ADC_CTRL, LOW); - - return (5.42 * (3.3 / 1024.0) * raw) * 1000; - } - - const char* HeltecV4Board::getManufacturerName() const { - return "Heltec V4"; - } diff --git a/variants/heltec_v4/HeltecV4Board.h b/variants/heltec_v4/HeltecV4Board.h deleted file mode 100644 index 745e8d8f..00000000 --- a/variants/heltec_v4/HeltecV4Board.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -class HeltecV4Board : public ESP32Board { - -public: - RefCountedDigitalPin periph_power; - - HeltecV4Board() : periph_power(PIN_VEXT_EN,PIN_VEXT_EN_ACTIVE) { } - - void begin(); - void onBeforeTransmit(void) override; - void onAfterTransmit(void) override; - void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1); - void powerOff() override; - uint16_t getBattMilliVolts() override; - const char* getManufacturerName() const override ; - -}; diff --git a/variants/heltec_v4/pins_arduino.h b/variants/heltec_v4/pins_arduino.h deleted file mode 100644 index a8b9f291..00000000 --- a/variants/heltec_v4/pins_arduino.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#include - -static const uint8_t LED_BUILTIN = 35; -#define BUILTIN_LED LED_BUILTIN // backward compatibility -#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN - -static const uint8_t TX = 43; -static const uint8_t RX = 44; - -static const uint8_t SDA = 3; -static const uint8_t SCL = 4; - -static const uint8_t SS = 8; -static const uint8_t MOSI = 10; -static const uint8_t MISO = 11; -static const uint8_t SCK = 9; - -static const uint8_t A0 = 1; -static const uint8_t A1 = 2; -static const uint8_t A2 = 3; -static const uint8_t A3 = 4; -static const uint8_t A4 = 5; -static const uint8_t A5 = 6; -static const uint8_t A6 = 7; -static const uint8_t A7 = 8; -static const uint8_t A8 = 9; -static const uint8_t A9 = 10; -static const uint8_t A10 = 11; -static const uint8_t A11 = 12; -static const uint8_t A12 = 13; -static const uint8_t A13 = 14; -static const uint8_t A14 = 15; -static const uint8_t A15 = 16; -static const uint8_t A16 = 17; -static const uint8_t A17 = 18; -static const uint8_t A18 = 19; -static const uint8_t A19 = 20; - -static const uint8_t T1 = 1; -static const uint8_t T2 = 2; -static const uint8_t T3 = 3; -static const uint8_t T4 = 4; -static const uint8_t T5 = 5; -static const uint8_t T6 = 6; -static const uint8_t T7 = 7; -static const uint8_t T8 = 8; -static const uint8_t T9 = 9; -static const uint8_t T10 = 10; -static const uint8_t T11 = 11; -static const uint8_t T12 = 12; -static const uint8_t T13 = 13; -static const uint8_t T14 = 14; - -static const uint8_t Vext = 36; -static const uint8_t LED = 35; -static const uint8_t RST_OLED = 21; -static const uint8_t SCL_OLED = 18; -static const uint8_t SDA_OLED = 17; - -static const uint8_t RST_LoRa = 12; -static const uint8_t BUSY_LoRa = 13; -static const uint8_t DIO0 = 14; - -#endif /* Pins_Arduino_h */ \ No newline at end of file diff --git a/variants/heltec_v4/platformio.ini b/variants/heltec_v4/platformio.ini deleted file mode 100644 index ecfd7889..00000000 --- a/variants/heltec_v4/platformio.ini +++ /dev/null @@ -1,210 +0,0 @@ -[Heltec_lora32_v4] -extends = esp32_base -board = heltec_v4 -build_flags = - ${esp32_base.build_flags} - ${sensor_base.build_flags} - -I variants/heltec_v4 - -D HELTEC_LORA_V4 - -D ESP32_CPU_FREQ=80 - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D P_LORA_TX_LED=35 - -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_PA_POWER=7 ;power en - -D P_LORA_PA_EN=2 - -D P_LORA_PA_TX_EN=46 ;enable tx - -D PIN_BOARD_SDA=17 - -D PIN_BOARD_SCL=18 - -D PIN_USER_BTN=0 - -D PIN_VEXT_EN=36 - -D PIN_VEXT_EN_ACTIVE=HIGH - -D LORA_TX_POWER=10 ;If it is configured as 10 here, the final output will be 22 dbm. - -D MAX_LORA_TX_POWER=22 ; Max SX1262 output - -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_GPS_RX=38 - -D PIN_GPS_TX=39 - -D PIN_GPS_RESET=42 - -D PIN_GPS_RESET_ACTIVE=LOW - -D PIN_GPS_EN=34 - -D PIN_GPS_EN_ACTIVE=LOW - -D ENV_INCLUDE_GPS=1 - -D PIN_ADC_CTRL=37 - -D PIN_VBAT_READ=1 -build_src_filter = ${esp32_base.build_src_filter} - +<../variants/heltec_v4> - + -lib_deps = - ${esp32_base.lib_deps} - ${sensor_base.lib_deps} - -[env:heltec_v4_repeater] -extends = Heltec_lora32_v4 -build_flags = - ${Heltec_lora32_v4.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -D ADVERT_NAME='"Heltec 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 -build_src_filter = ${Heltec_lora32_v4.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_lora32_v4.lib_deps} - ${esp32_ota.lib_deps} - bakercp/CRC32 @ ^2.0.0 - -[env:heltec_v4_repeater_bridge_espnow] -extends = Heltec_lora32_v4 -build_flags = - ${Heltec_lora32_v4.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -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_lora32_v4.build_src_filter} - + - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_lora32_v4.lib_deps} - ${esp32_ota.lib_deps} - -[env:heltec_v4_room_server] -extends = Heltec_lora32_v4 -build_flags = - ${Heltec_lora32_v4.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -D ADVERT_NAME='"Heltec 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 -build_src_filter = ${Heltec_lora32_v4.build_src_filter} - + - +<../examples/simple_room_server> -lib_deps = - ${Heltec_lora32_v4.lib_deps} - ${esp32_ota.lib_deps} - -[env:heltec_v4_terminal_chat] -extends = Heltec_lora32_v4 -build_flags = - ${Heltec_lora32_v4.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v4.build_src_filter} - +<../examples/simple_secure_chat/main.cpp> -lib_deps = - ${Heltec_lora32_v4.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:heltec_v4_companion_radio_usb] -extends = Heltec_lora32_v4 -build_flags = - ${Heltec_lora32_v4.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D DISPLAY_CLASS=SSD1306Display -; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 -; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v4.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_lora32_v4.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:heltec_v4_companion_radio_ble] -extends = Heltec_lora32_v4 -build_flags = - ${Heltec_lora32_v4.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D DISPLAY_CLASS=SSD1306Display - -D BLE_PIN_CODE=123456 ; dynamic, random PIN - -D AUTO_SHUTDOWN_MILLIVOLTS=3400 - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v4.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_lora32_v4.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:heltec_v4_companion_radio_wifi] -extends = Heltec_lora32_v4 -build_flags = - ${Heltec_lora32_v4.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D DISPLAY_CLASS=SSD1306Display - -D WIFI_DEBUG_LOGGING=1 - -D WIFI_SSID='"myssid"' - -D WIFI_PWD='"mypwd"' - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v4.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_lora32_v4.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:heltec_v4_sensor] -extends = Heltec_lora32_v4 -build_flags = - ${Heltec_lora32_v4.build_flags} - -D ADVERT_NAME='"Heltec v3 Sensor"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D ENV_PIN_SDA=3 - -D ENV_PIN_SCL=4 - -D DISPLAY_CLASS=SSD1306Display -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Heltec_lora32_v4.build_src_filter} - + - +<../examples/simple_sensor> -lib_deps = - ${Heltec_lora32_v4.lib_deps} - ${esp32_ota.lib_deps} diff --git a/variants/heltec_v4/target.cpp b/variants/heltec_v4/target.cpp deleted file mode 100644 index 015c3a8e..00000000 --- a/variants/heltec_v4/target.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include -#include "target.h" - -HeltecV4Board board; - -#if defined(P_LORA_SCLK) - static SPIClass spi; - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -#else - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY); -#endif - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); - -#if ENV_INCLUDE_GPS - #include - MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1); - EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea); -#else - EnvironmentSensorManager sensors; -#endif - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - -#if defined(P_LORA_SCLK) - return radio.std_init(&spi); -#else - return radio.std_init(); -#endif -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/heltec_v4/target.h b/variants/heltec_v4/target.h deleted file mode 100644 index a153b2af..00000000 --- a/variants/heltec_v4/target.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -extern HeltecV4Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/heltec_wireless_paper/platformio.ini b/variants/heltec_wireless_paper/platformio.ini deleted file mode 100644 index f0bca860..00000000 --- a/variants/heltec_wireless_paper/platformio.ini +++ /dev/null @@ -1,142 +0,0 @@ -[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 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} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Heltec_Wireless_Paper_base.lib_deps} - densaugeo/base64 @ ~1.4.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} - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_Wireless_Paper_base.lib_deps} - ${esp32_ota.lib_deps} - -; [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} -; + -; + -; +<../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} - + - + - +<../examples/simple_repeater> -lib_deps = - ${Heltec_Wireless_Paper_base.lib_deps} - ${esp32_ota.lib_deps} - -[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} - + - +<../examples/simple_room_server> -lib_deps = - ${Heltec_Wireless_Paper_base.lib_deps} - ${esp32_ota.lib_deps} diff --git a/variants/heltec_wireless_paper/target.cpp b/variants/heltec_wireless_paper/target.cpp deleted file mode 100644 index dd2d51c0..00000000 --- a/variants/heltec_wireless_paper/target.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "target.h" -#include - -HeltecV3Board board; - -#if defined(P_LORA_SCLK) - static SPIClass spi; - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -#else - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY); -#endif - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); - -SensorManager sensors; - -#ifdef DISPLAY_CLASS -DISPLAY_CLASS display; -MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); -#if defined(P_LORA_SCLK) - return radio.std_init(&spi); -#else - return radio.std_init(); -#endif -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/heltec_wireless_paper/target.h b/variants/heltec_wireless_paper/target.h deleted file mode 100644 index b89c486f..00000000 --- a/variants/heltec_wireless_paper/target.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include <../heltec_v3/HeltecV3Board.h> -#include -#include -#include -#ifdef DISPLAY_CLASS -#include -#include -#endif - -extern HeltecV3Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern SensorManager sensors; - -#ifdef DISPLAY_CLASS -extern DISPLAY_CLASS display; -extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); \ No newline at end of file diff --git a/variants/ikoka_handheld_nrf/IkokaNrf52Board.cpp b/variants/ikoka_handheld_nrf/IkokaNrf52Board.cpp deleted file mode 100644 index f1d9f17d..00000000 --- a/variants/ikoka_handheld_nrf/IkokaNrf52Board.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#ifdef IKOKA_NRF52 - -#include -#include - -#include "IkokaNrf52Board.h" - -void IkokaNrf52Board::begin() { - NRF52Board::begin(); - - // ensure we have pull ups on the screen i2c, this isn't always available - // in hardware and it should only be 20k ohms. Disable the pullups if we - // are using the rotated lcd breakout board - #if defined(DISPLAY_CLASS) && DISPLAY_ROTATION == 0 - pinMode(PIN_WIRE_SDA, INPUT_PULLUP); - pinMode(PIN_WIRE_SCL, INPUT_PULLUP); - #endif - - pinMode(PIN_VBAT, INPUT); - pinMode(VBAT_ENABLE, OUTPUT); - digitalWrite(VBAT_ENABLE, HIGH); - - // required button pullup is handled as part of button initilization - // in target.cpp - -#if defined(PIN_WIRE_SDA) && defined(PIN_WIRE_SCL) - Wire.setPins(PIN_WIRE_SDA, PIN_WIRE_SCL); -#endif - - Wire.begin(); - -#ifdef P_LORA_TX_LED - pinMode(P_LORA_TX_LED, OUTPUT); - digitalWrite(P_LORA_TX_LED, HIGH); -#endif - - delay(10); // give sx1262 some time to power up -} - -#endif diff --git a/variants/ikoka_handheld_nrf/IkokaNrf52Board.h b/variants/ikoka_handheld_nrf/IkokaNrf52Board.h deleted file mode 100644 index acb58b3c..00000000 --- a/variants/ikoka_handheld_nrf/IkokaNrf52Board.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -#include -#include -#include - -#ifdef IKOKA_NRF52 - -class IkokaNrf52Board : public NRF52BoardOTA { -public: - IkokaNrf52Board() : NRF52BoardOTA("XIAO_NRF52_OTA") {} - void begin(); - -#if defined(P_LORA_TX_LED) - void onBeforeTransmit() override { - digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED on - } - void onAfterTransmit() override { - digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED off - } -#endif - - uint16_t getBattMilliVolts() override { - // Please read befor going further ;) - // https://wiki.seeedstudio.com/XIAO_BLE#q3-what-are-the-considerations-when-using-xiao-nrf52840-sense-for-battery-charging - - // We can't drive VBAT_ENABLE to HIGH as long - // as we don't know wether we are charging or not ... - // this is a 3mA loss (4/1500) - digitalWrite(VBAT_ENABLE, LOW); - int adcvalue = 0; - analogReadResolution(12); - analogReference(AR_INTERNAL_3_0); - delay(10); - adcvalue = analogRead(PIN_VBAT); - return (adcvalue * ADC_MULTIPLIER * AREF_VOLTAGE) / 4.096; - } - - const char* getManufacturerName() const override { - return "Ikoka Handheld E22 30dBm (Xiao_nrf52)"; - } -}; - -#endif diff --git a/variants/ikoka_handheld_nrf/platformio.ini b/variants/ikoka_handheld_nrf/platformio.ini deleted file mode 100644 index d2bbeffe..00000000 --- a/variants/ikoka_handheld_nrf/platformio.ini +++ /dev/null @@ -1,103 +0,0 @@ -[ikoka_handheld_nrf] -extends = nrf52_base -build_flags = ${nrf52_base.build_flags} - ${sensor_base.build_flags} - -I lib/nrf52/s140_nrf52_7.3.0_API/include - -I lib/nrf52/s140_nrf52_7.3.0_API/include/nrf52 - -I variants/ikoka_handheld_nrf - -UENV_INCLUDE_GPS - -D IKOKA_NRF52 - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D P_LORA_TX_LED=11 - -D P_LORA_DIO_1=D1 - -D P_LORA_RESET=D2 - -D P_LORA_BUSY=D3 - -D P_LORA_NSS=D4 - -D SX126X_RXEN=D5 - -D SX126X_TXEN=RADIOLIB_NC - -D SX126X_DIO2_AS_RF_SWITCH=1 - -D SX126X_DIO3_TCXO_VOLTAGE=1.8 - -D SX126X_CURRENT_LIMIT=140 - -D SX126X_RX_BOOSTED_GAIN=1 -build_src_filter = ${nrf52_base.build_src_filter} - +<../variants/ikoka_handheld_nrf> - + -lib_deps = ${nrf52_base.lib_deps} - ${sensor_base.lib_deps} - densaugeo/base64 @ ~1.4.0 - -# larger screen has a different driver, this is for the 0.96 inch -[ikoka_handheld_nrf_ssd1306_companion] -lib_deps = ${ikoka_handheld_nrf.lib_deps} - adafruit/Adafruit SSD1306 @ ^2.5.13 -build_flags = ${ikoka_handheld_nrf.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -D DISPLAY_ROTATION=0 - -D PIN_WIRE_SCL=D6 - -D PIN_WIRE_SDA=D7 - -D PIN_USER_BTN=D0 - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D OFFLINE_QUEUE_SIZE=256 - -D QSPIFLASH=1 - -I examples/companion_radio/ui-new -build_src_filter = ${ikoka_handheld_nrf.build_src_filter} - + - +<../examples/companion_radio/ui-new/UITask.cpp> - +<../examples/companion_radio/*.cpp> - -[env:ikoka_handheld_nrf_e22_30dbm_096_companion_radio_ble] -extends = ikoka_nrf52 -build_flags = ${ikoka_handheld_nrf_ssd1306_companion.build_flags} - -D BLE_PIN_CODE=123456 - -D LORA_TX_POWER=20 -build_src_filter = ${ikoka_handheld_nrf_ssd1306_companion.build_src_filter} - + - -[env:ikoka_handheld_nrf_e22_30dbm_096_rotated_companion_radio_ble] -extends = ikoka_nrf52 -build_flags = ${ikoka_handheld_nrf_ssd1306_companion.build_flags} - -D BLE_PIN_CODE=123456 - -D LORA_TX_POWER=20 - -D DISPLAY_ROTATION=2 -build_src_filter = ${ikoka_handheld_nrf_ssd1306_companion.build_src_filter} - + - -[env:ikoka_handheld_nrf_e22_30dbm_096_companion_radio_usb] -extends = ikoka_nrf52 -build_flags = ${ikoka_handheld_nrf_ssd1306_companion.build_flags} - -D LORA_TX_POWER=20 -build_src_filter = ${ikoka_handheld_nrf_ssd1306_companion.build_src_filter} - -[env:ikoka_handheld_nrf_e22_30dbm_096_rotated_companion_radio_usb] -extends = ikoka_nrf52 -build_flags = ${ikoka_handheld_nrf_ssd1306_companion.build_flags} - -D LORA_TX_POWER=20 - -D DISPLAY_ROTATION=2 -build_src_filter = ${ikoka_handheld_nrf_ssd1306_companion.build_src_filter} - -[env:ikoka_handheld_nrf_e22_30dbm_repeater] -extends = ikoka_nrf52 -build_flags = - ${ikoka_handheld_nrf.build_flags} - -D ADVERT_NAME='"ikoka_handheld Repeater"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D MAX_NEIGHBOURS=50 - -D LORA_TX_POWER=20 -build_src_filter = ${ikoka_handheld_nrf.build_src_filter} - +<../examples/simple_repeater/*.cpp> - -[env:ikoka_handheld_nrf_e22_30dbm_room_server] -extends = ikoka_nrf52 -build_flags = - ${ikoka_handheld_nrf.build_flags} - -D ADVERT_NAME='"ikoka_handheld Room"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D LORA_TX_POWER=20 -build_src_filter = ${ikoka_handheld_nrf.build_src_filter} - +<../examples/simple_room_server/*.cpp> diff --git a/variants/ikoka_handheld_nrf/target.cpp b/variants/ikoka_handheld_nrf/target.cpp deleted file mode 100644 index efa6669f..00000000 --- a/variants/ikoka_handheld_nrf/target.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include -#include "target.h" -#include - -IkokaNrf52Board board; - -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); - -WRAPPER_CLASS radio_driver(radio, board); - -VolatileRTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); - -EnvironmentSensorManager sensors; - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true); -#endif - - -bool radio_init() { - rtc_clock.begin(Wire); - - return radio.std_init(&SPI); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/ikoka_handheld_nrf/target.h b/variants/ikoka_handheld_nrf/target.h deleted file mode 100644 index a28ca81a..00000000 --- a/variants/ikoka_handheld_nrf/target.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#include - -#ifdef DISPLAY_CLASS - #include - #include - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - - -extern IkokaNrf52Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/ikoka_handheld_nrf/variant.cpp b/variants/ikoka_handheld_nrf/variant.cpp deleted file mode 100644 index 38a94c89..00000000 --- a/variants/ikoka_handheld_nrf/variant.cpp +++ /dev/null @@ -1,84 +0,0 @@ -#include "variant.h" - -#include "nrf.h" -#include "wiring_constants.h" -#include "wiring_digital.h" - -const uint32_t g_ADigitalPinMap[] = { - // D0 .. D10 - 2, // D0 is P0.02 (A0) - 3, // D1 is P0.03 (A1) - 28, // D2 is P0.28 (A2) - 29, // D3 is P0.29 (A3) - 4, // D4 is P0.04 (A4,SDA) - 5, // D5 is P0.05 (A5,SCL) - 43, // D6 is P1.11 (TX) - 44, // D7 is P1.12 (RX) - 45, // D8 is P1.13 (SCK) - 46, // D9 is P1.14 (MISO) - 47, // D10 is P1.15 (MOSI) - - // LEDs - 26, // D11 is P0.26 (LED RED) - 6, // D12 is P0.06 (LED BLUE) - 30, // D13 is P0.30 (LED GREEN) - 14, // D14 is P0.14 (READ_BAT) - - // LSM6DS3TR - 40, // D15 is P1.08 (6D_PWR) - 27, // D16 is P0.27 (6D_I2C_SCL) - 7, // D17 is P0.07 (6D_I2C_SDA) - 11, // D18 is P0.11 (6D_INT1) - - // MIC - 42, // D19 is P1.10 (MIC_PWR) - 32, // D20 is P1.00 (PDM_CLK) - 16, // D21 is P0.16 (PDM_DATA) - - // BQ25100 - 13, // D22 is P0.13 (HICHG) - 17, // D23 is P0.17 (~CHG) - - // - 21, // D24 is P0.21 (QSPI_SCK) - 25, // D25 is P0.25 (QSPI_CSN) - 20, // D26 is P0.20 (QSPI_SIO_0 DI) - 24, // D27 is P0.24 (QSPI_SIO_1 DO) - 22, // D28 is P0.22 (QSPI_SIO_2 WP) - 23, // D29 is P0.23 (QSPI_SIO_3 HOLD) - - // NFC - 9, // D30 is P0.09 (NFC1) - 10, // D31 is P0.10 (NFC2) - - // VBAT - 31, // D32 is P0.31 (VBAT) -}; - -void initVariant() { - // Disable reading of the BAT voltage. - // https://wiki.seeedstudio.com/XIAO_BLE#q3-what-are-the-considerations-when-using-xiao-nrf52840-sense-for-battery-charging - pinMode(VBAT_ENABLE, OUTPUT); - // digitalWrite(VBAT_ENABLE, HIGH); - // This was taken from Seeed github butis not coherent with the doc, - // VBAT_ENABLE should be kept to LOW to protect P0.14, (1500/500)*(4.2-3.3)+3.3 = 3.9V > 3.6V - // This induces a 3mA current in the resistors :( but it's better than burning the nrf - digitalWrite(VBAT_ENABLE, LOW); - - // disable xiao charging current, the handheld uses a tp4056 to charge - // instead of the onboard xiao charging circuit. This charges at a max of - // 780ma instead of 100ma. In theory you could enable both, but in practice - // fire is scary. - pinMode(PIN_CHARGING_CURRENT, OUTPUT); - digitalWrite(PIN_CHARGING_CURRENT, HIGH); - - pinMode(PIN_QSPI_CS, OUTPUT); - digitalWrite(PIN_QSPI_CS, HIGH); - - pinMode(LED_RED, OUTPUT); - digitalWrite(LED_RED, HIGH); - pinMode(LED_GREEN, OUTPUT); - digitalWrite(LED_GREEN, HIGH); - pinMode(LED_BLUE, OUTPUT); - digitalWrite(LED_BLUE, HIGH); -} diff --git a/variants/ikoka_handheld_nrf/variant.h b/variants/ikoka_handheld_nrf/variant.h deleted file mode 100644 index 8e6a8ed1..00000000 --- a/variants/ikoka_handheld_nrf/variant.h +++ /dev/null @@ -1,148 +0,0 @@ -#ifndef _SEEED_XIAO_NRF52840_H_ -#define _SEEED_XIAO_NRF52840_H_ - -/** Master clock frequency */ -#define VARIANT_MCK (64000000ul) - -#define USE_LFXO // Board uses 32khz crystal for LF -//#define USE_LFRC // Board uses RC for LF - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "WVariant.h" - -#ifdef __cplusplus -extern "C" -{ -#endif // __cplusplus - -#define PINS_COUNT (33) -#define NUM_DIGITAL_PINS (33) -#define NUM_ANALOG_INPUTS (8) -#define NUM_ANALOG_OUTPUTS (0) - -// LEDs -#define PIN_LED (LED_RED) -#define LED_PWR (PINS_COUNT) -#define PIN_NEOPIXEL (PINS_COUNT) -#define NEOPIXEL_NUM (0) - -#define LED_BUILTIN (PIN_LED) - -#define LED_RED (11) -#define LED_GREEN (13) -#define LED_BLUE (12) - -#define LED_STATE_ON (1) // State when LED is litted - -// Buttons -#define PIN_BUTTON1 (PINS_COUNT) - -// Digital PINs -static const uint8_t D0 = 0 ; -static const uint8_t D1 = 1 ; -static const uint8_t D2 = 2 ; -static const uint8_t D3 = 3 ; -static const uint8_t D4 = 4 ; -static const uint8_t D5 = 5 ; -static const uint8_t D6 = 6 ; -static const uint8_t D7 = 7 ; -static const uint8_t D8 = 8 ; -static const uint8_t D9 = 9 ; -static const uint8_t D10 = 10; - -#define VBAT_ENABLE (14) // Output LOW to enable reading of the BAT voltage. - // https://wiki.seeedstudio.com/XIAO_BLE#q3-what-are-the-considerations-when-using-xiao-nrf52840-sense-for-battery-charging - -#define PIN_CHARGING_CURRENT (22) // Battery Charging current - // https://wiki.seedstudio.com/XIAO_BLE#battery-charging-current -// Analog pins -#define PIN_A0 (0) -#define PIN_A1 (1) -#define PIN_A2 (2) -#define PIN_A3 (3) -#define PIN_A4 (4) -#define PIN_A5 (5) -#define PIN_VBAT (32) // Read the BAT voltage. - // https://wiki.seeedstudio.com/XIAO_BLE#q3-what-are-the-considerations-when-using-xiao-nrf52840-sense-for-battery-charging - -#define BAT_NOT_CHARGING (23) // LOW when charging - -#define AREF_VOLTAGE (3.0) -#define ADC_MULTIPLIER (3.0F) // 1M, 512k divider bridge - -static const uint8_t A0 = PIN_A0; -static const uint8_t A1 = PIN_A1; -static const uint8_t A2 = PIN_A2; -static const uint8_t A3 = PIN_A3; -static const uint8_t A4 = PIN_A4; -static const uint8_t A5 = PIN_A5; - -#define ADC_RESOLUTION (12) - -// Other pins -#define PIN_NFC1 (30) -#define PIN_NFC2 (31) - -// Serial interfaces -#define PIN_SERIAL1_RX (7) -#define PIN_SERIAL1_TX (6) - -// SPI Interfaces -#define SPI_INTERFACES_COUNT (2) - -#define PIN_SPI_MISO (9) -#define PIN_SPI_MOSI (10) -#define PIN_SPI_SCK (8) - -#define PIN_SPI1_MISO (25) -#define PIN_SPI1_MOSI (26) -#define PIN_SPI1_SCK (29) - -// Lora SPI is on SPI0 -#define P_LORA_SCLK PIN_SPI_SCK -#define P_LORA_MISO PIN_SPI_MISO -#define P_LORA_MOSI PIN_SPI_MOSI - -// Wire Interfaces -#define WIRE_INTERFACES_COUNT (1) - -#define PIN_WIRE_SDA (6) // 4 and 5 are used for the sx1262 ! -#define PIN_WIRE_SCL (7) // use WIRE1_SDA - -static const uint8_t SDA = (6); -static const uint8_t SCL = (7); - -//#define PIN_WIRE1_SDA (17) -//#define PIN_WIRE1_SCL (16) -#define PIN_LSM6DS3TR_C_POWER (15) -#define PIN_LSM6DS3TR_C_INT1 (18) - -// PDM Interfaces -#define PIN_PDM_PWR (19) -#define PIN_PDM_CLK (20) -#define PIN_PDM_DIN (21) - -// QSPI Pins -#define PIN_QSPI_SCK (24) -#define PIN_QSPI_CS (25) -#define PIN_QSPI_IO0 (26) -#define PIN_QSPI_IO1 (27) -#define PIN_QSPI_IO2 (28) -#define PIN_QSPI_IO3 (29) - -// On-board QSPI Flash -#define EXTERNAL_FLASH_DEVICES (P25Q16H) -#define EXTERNAL_FLASH_USE_QSPI - -#ifdef __cplusplus -} -#endif - -/*---------------------------------------------------------------------------- - * Arduino objects - C++ only - *----------------------------------------------------------------------------*/ - -#endif diff --git a/variants/ikoka_nano_nrf/IkokaNanoNRFBoard.cpp b/variants/ikoka_nano_nrf/IkokaNanoNRFBoard.cpp deleted file mode 100644 index b963b2f4..00000000 --- a/variants/ikoka_nano_nrf/IkokaNanoNRFBoard.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#ifdef XIAO_NRF52 - -#include -#include - -#include "IkokaNanoNRFBoard.h" - -void IkokaNanoNRFBoard::begin() { - NRF52Board::begin(); - - pinMode(PIN_VBAT, INPUT); - pinMode(VBAT_ENABLE, OUTPUT); - digitalWrite(VBAT_ENABLE, HIGH); - -#ifdef PIN_USER_BTN - pinMode(PIN_USER_BTN, INPUT_PULLUP); -#endif - -#if defined(PIN_WIRE_SDA) && defined(PIN_WIRE_SCL) - Wire.setPins(PIN_WIRE_SDA, PIN_WIRE_SCL); -#endif - - Wire.begin(); - -#ifdef P_LORA_TX_LED - pinMode(P_LORA_TX_LED, OUTPUT); - digitalWrite(P_LORA_TX_LED, HIGH); -#endif - -// pinMode(SX126X_POWER_EN, OUTPUT); -// digitalWrite(SX126X_POWER_EN, HIGH); - delay(10); // give sx1262 some time to power up -} - -#endif diff --git a/variants/ikoka_nano_nrf/IkokaNanoNRFBoard.h b/variants/ikoka_nano_nrf/IkokaNanoNRFBoard.h deleted file mode 100644 index c7e96921..00000000 --- a/variants/ikoka_nano_nrf/IkokaNanoNRFBoard.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#include -#include -#include - -#ifdef XIAO_NRF52 - -class IkokaNanoNRFBoard : public NRF52BoardOTA { -public: - IkokaNanoNRFBoard() : NRF52BoardOTA("XIAO_NRF52_OTA") {} - void begin(); - -#if defined(P_LORA_TX_LED) - void onBeforeTransmit() override { - digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED on - #if defined(LED_BLUE) - // turn off that annoying blue LED before transmitting - digitalWrite(LED_BLUE, HIGH); - #endif - } - void onAfterTransmit() override { - digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED off - #if defined(LED_BLUE) - // do it after transmitting too, just in case - digitalWrite(LED_BLUE, HIGH); - #endif - } -#endif - - uint16_t getBattMilliVolts() override { - // Please read befor going further ;) - // https://wiki.seeedstudio.com/XIAO_BLE#q3-what-are-the-considerations-when-using-xiao-nrf52840-sense-for-battery-charging - - // We can't drive VBAT_ENABLE to HIGH as long - // as we don't know wether we are charging or not ... - // this is a 3mA loss (4/1500) - digitalWrite(VBAT_ENABLE, LOW); - int adcvalue = 0; - analogReadResolution(12); - analogReference(AR_INTERNAL_3_0); - delay(10); - adcvalue = analogRead(PIN_VBAT); - return (adcvalue * ADC_MULTIPLIER * AREF_VOLTAGE) / 4.096; - } - - const char *getManufacturerName() const override { - return MANUFACTURER_STRING; - } -}; - -#endif diff --git a/variants/ikoka_nano_nrf/platformio.ini b/variants/ikoka_nano_nrf/platformio.ini deleted file mode 100644 index 08b1101b..00000000 --- a/variants/ikoka_nano_nrf/platformio.ini +++ /dev/null @@ -1,280 +0,0 @@ -[ikoka_nano_nrf] -extends = nrf52_base -board = seeed-xiao-afruitnrf52-nrf52840 -board_build.ldscript = boards/nrf52840_s140_v7.ld -build_flags = ${nrf52_base.build_flags} - ${sensor_base.build_flags} - -D NRF52_PLATFORM -D XIAO_NRF52 - -I lib/nrf52/s140_nrf52_7.3.0_API/include - -I lib/nrf52/s140_nrf52_7.3.0_API/include/nrf52 - -I variants/ikoka_nano_nrf - -I src/helpers/nrf52 - -D P_LORA_TX_LED=11 - -D DISPLAY_CLASS=NullDisplayDriver - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D P_LORA_DIO_1=D1 - -D P_LORA_BUSY=D2 - -D P_LORA_RESET=D3 - -D P_LORA_NSS=D0 - -D SX126X_RXEN=D7 - -D SX126X_TXEN=RADIOLIB_NC - -D SX126X_DIO2_AS_RF_SWITCH=1 - -D SX126X_DIO3_TCXO_VOLTAGE=1.8 - -D SX126X_CURRENT_LIMIT=140 - -D SX126X_RX_BOOSTED_GAIN=1 - -D PIN_WIRE_SCL=5 - -D PIN_WIRE_SDA=4 - -UENV_INCLUDE_GPS -debug_tool = jlink -upload_protocol = nrfutil -lib_deps = ${nrf52_base.lib_deps} - ${sensor_base.lib_deps} - -[ikoka_nano_nrf_e22_22dbm] -extends = ikoka_nano_nrf -; No PA in this model, full 22dBm -build_flags = - ${ikoka_nano_nrf.build_flags} - -D MANUFACTURER_STRING='"Ikoka Nano-E22-22dBm (Xiao_nrf52)"' - -D LORA_TX_POWER=22 -build_src_filter = ${ikoka_nano_nrf.build_src_filter} - + - + - + - +<../variants/ikoka_nano_nrf> - -[ikoka_nano_nrf_e22_30dbm] -extends = ikoka_nano_nrf -; limit txpower to 20dBm on E22-900M30S. Anything higher will -; cause distortion in the PA output. 20dBm in -> 30dBm out -build_flags = - ${ikoka_nano_nrf.build_flags} - -D MANUFACTURER_STRING='"Ikoka Nano-E22-30dBm (Xiao_nrf52)"' - -D LORA_TX_POWER=20 -build_src_filter = ${ikoka_nano_nrf.build_src_filter} - + - + - + - +<../variants/ikoka_nano_nrf> - -[ikoka_nano_nrf_e22_33dbm] -extends = ikoka_nano_nrf -; limit txpower to 9dBm on E22-900M33S to avoid hardware damage -; to the rf amplifier frontend. 9dBm in -> 33dBm out -build_flags = - ${ikoka_nano_nrf.build_flags} - -D MANUFACTURER_STRING='"Ikoka Nano-E22-33dBm (Xiao_nrf52)"' - -D LORA_TX_POWER=9 -build_src_filter = ${ikoka_nano_nrf.build_src_filter} - + - + - + - +<../variants/ikoka_nano_nrf> - -[ikoka_nano_nrf_companion_radio_ble] -extends = ikoka_nano_nrf -board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld -board_upload.maximum_size = 708608 -build_flags = - ${ikoka_nano_nrf.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 - -D OFFLINE_QUEUE_SIZE=256 - -I examples/companion_radio/ui-new - -D QSPIFLASH=1 -; -D BLE_DEBUG_LOGGING=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${ikoka_nano_nrf.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${ikoka_nano_nrf.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[ikoka_nano_nrf_companion_radio_usb] -extends = ikoka_nano_nrf -board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld -board_upload.maximum_size = 708608 -build_flags = - ${ikoka_nano_nrf.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -I examples/companion_radio/ui-new - -D QSPIFLASH=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${ikoka_nano_nrf.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${ikoka_nano_nrf.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[ikoka_nano_nrf_repeater] -extends = ikoka_nano_nrf -build_flags = - ${ikoka_nano_nrf.build_flags} - -D ADVERT_NAME='"Ikoka Nano 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 -build_src_filter = ${ikoka_nano_nrf.build_src_filter} - +<../examples/simple_repeater/*.cpp> - -[ikoka_nano_nrf_room_server] -extends = ikoka_nano_nrf -build_flags = - ${ikoka_nano_nrf.build_flags} - -D ADVERT_NAME='"Ikoka Nano Room"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${ikoka_nano_nrf.build_src_filter} - +<../examples/simple_room_server/*.cpp> - -;;; 22dBm EBYTE E22-900M22 variants -[env:ikoka_nano_nrf_22dbm_companion_radio_usb] -extends = - ikoka_nano_nrf_e22_22dbm - ikoka_nano_nrf_companion_radio_usb -build_flags = - ${ikoka_nano_nrf_companion_radio_usb.build_flags} - ${ikoka_nano_nrf_e22_22dbm.build_flags} -build_src_filter = - ${ikoka_nano_nrf_companion_radio_usb.build_src_filter} - ${ikoka_nano_nrf_e22_22dbm.build_src_filter} - -[env:ikoka_nano_nrf_22dbm_companion_radio_ble] -extends = - ikoka_nano_nrf_e22_22dbm - ikoka_nano_nrf_companion_radio_ble -build_flags = - ${ikoka_nano_nrf_companion_radio_ble.build_flags} - ${ikoka_nano_nrf_e22_22dbm.build_flags} -build_src_filter = - ${ikoka_nano_nrf_companion_radio_ble.build_src_filter} - ${ikoka_nano_nrf_e22_22dbm.build_src_filter} - -[env:ikoka_nano_nrf_22dbm_repeater] -extends = - ikoka_nano_nrf_e22_22dbm - ikoka_nano_nrf_repeater -build_flags = - ${ikoka_nano_nrf_repeater.build_flags} - ${ikoka_nano_nrf_e22_22dbm.build_flags} -build_src_filter = - ${ikoka_nano_nrf_repeater.build_src_filter} - ${ikoka_nano_nrf_e22_22dbm.build_src_filter} - -[env:ikoka_nano_nrf_22dbm_room_server] -extends = - ikoka_nano_nrf_e22_22dbm - ikoka_nano_nrf_room_server -build_flags = - ${ikoka_nano_nrf_room_server.build_flags} - ${ikoka_nano_nrf_e22_22dbm.build_flags} -build_src_filter = - ${ikoka_nano_nrf_room_server.build_src_filter} - ${ikoka_nano_nrf_e22_22dbm.build_src_filter} - - -;;; 30dBm EBYTE E22-900M30 variants -[env:ikoka_nano_nrf_30dbm_companion_radio_usb] -extends = - ikoka_nano_nrf_e22_30dbm - ikoka_nano_nrf_companion_radio_usb -build_flags = - ${ikoka_nano_nrf_companion_radio_usb.build_flags} - ${ikoka_nano_nrf_e22_30dbm.build_flags} -build_src_filter = - ${ikoka_nano_nrf_companion_radio_usb.build_src_filter} - ${ikoka_nano_nrf_e22_30dbm.build_src_filter} - -[env:ikoka_nano_nrf_30dbm_companion_radio_ble] -extends = - ikoka_nano_nrf_e22_30dbm - ikoka_nano_nrf_companion_radio_ble -build_flags = - ${ikoka_nano_nrf_companion_radio_ble.build_flags} - ${ikoka_nano_nrf_e22_30dbm.build_flags} -build_src_filter = - ${ikoka_nano_nrf_companion_radio_ble.build_src_filter} - ${ikoka_nano_nrf_e22_30dbm.build_src_filter} - -[env:ikoka_nano_nrf_30dbm_repeater] -extends = - ikoka_nano_nrf_e22_30dbm - ikoka_nano_nrf_repeater -build_flags = - ${ikoka_nano_nrf_repeater.build_flags} - ${ikoka_nano_nrf_e22_30dbm.build_flags} -build_src_filter = - ${ikoka_nano_nrf_repeater.build_src_filter} - ${ikoka_nano_nrf_e22_30dbm.build_src_filter} - -[env:ikoka_nano_nrf_30dbm_room_server] -extends = - ikoka_nano_nrf_e22_30dbm - ikoka_nano_nrf_room_server -build_flags = - ${ikoka_nano_nrf_room_server.build_flags} - ${ikoka_nano_nrf_e22_30dbm.build_flags} -build_src_filter = - ${ikoka_nano_nrf_room_server.build_src_filter} - ${ikoka_nano_nrf_e22_30dbm.build_src_filter} - - -;;; 33dBm EBYTE E22-900M33 variants -[env:ikoka_nano_nrf_33dbm_companion_radio_usb] -extends = - ikoka_nano_nrf_e22_33dbm - ikoka_nano_nrf_companion_radio_usb -build_flags = - ${ikoka_nano_nrf_companion_radio_usb.build_flags} - ${ikoka_nano_nrf_e22_33dbm.build_flags} -build_src_filter = - ${ikoka_nano_nrf_companion_radio_usb.build_src_filter} - ${ikoka_nano_nrf_e22_33dbm.build_src_filter} - -[env:ikoka_nano_nrf_33dbm_companion_radio_ble] -extends = - ikoka_nano_nrf_e22_33dbm - ikoka_nano_nrf_companion_radio_ble -build_flags = - ${ikoka_nano_nrf_companion_radio_ble.build_flags} - ${ikoka_nano_nrf_e22_33dbm.build_flags} -build_src_filter = - ${ikoka_nano_nrf_companion_radio_ble.build_src_filter} - ${ikoka_nano_nrf_e22_33dbm.build_src_filter} - -[env:ikoka_nano_nrf_33dbm_repeater] -extends = - ikoka_nano_nrf_e22_33dbm - ikoka_nano_nrf_repeater -build_flags = - ${ikoka_nano_nrf_repeater.build_flags} - ${ikoka_nano_nrf_e22_33dbm.build_flags} -build_src_filter = - ${ikoka_nano_nrf_repeater.build_src_filter} - ${ikoka_nano_nrf_e22_33dbm.build_src_filter} - -[env:ikoka_nano_nrf_33dbm_room_server] -extends = - ikoka_nano_nrf_e22_33dbm - ikoka_nano_nrf_room_server -build_flags = - ${ikoka_nano_nrf_room_server.build_flags} - ${ikoka_nano_nrf_e22_33dbm.build_flags} -build_src_filter = - ${ikoka_nano_nrf_room_server.build_src_filter} - ${ikoka_nano_nrf_e22_33dbm.build_src_filter} diff --git a/variants/ikoka_nano_nrf/target.cpp b/variants/ikoka_nano_nrf/target.cpp deleted file mode 100644 index aed59182..00000000 --- a/variants/ikoka_nano_nrf/target.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include -#include "target.h" -#include - -IkokaNanoNRFBoard board; - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - // MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); - -WRAPPER_CLASS radio_driver(radio, board); - -VolatileRTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -EnvironmentSensorManager sensors; - -bool radio_init() { - rtc_clock.begin(Wire); - - return radio.std_init(&SPI); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/ikoka_nano_nrf/target.h b/variants/ikoka_nano_nrf/target.h deleted file mode 100644 index 9b4e908e..00000000 --- a/variants/ikoka_nano_nrf/target.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#include - -#ifdef DISPLAY_CLASS - #include - #include - extern DISPLAY_CLASS display; - // extern MomentaryButton user_btn; -#endif - -extern IkokaNanoNRFBoard board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/ikoka_nano_nrf/variant.cpp b/variants/ikoka_nano_nrf/variant.cpp deleted file mode 100644 index 16542e27..00000000 --- a/variants/ikoka_nano_nrf/variant.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#include "variant.h" -#include "wiring_constants.h" -#include "wiring_digital.h" -#include "nrf.h" - -const uint32_t g_ADigitalPinMap[] = -{ - // D0 .. D10 - 2, // D0 is P0.02 (A0) - 3, // D1 is P0.03 (A1) - 28, // D2 is P0.28 (A2) - 29, // D3 is P0.29 (A3) - 4, // D4 is P0.04 (A4,SDA) - 5, // D5 is P0.05 (A5,SCL) - 43, // D6 is P1.11 (TX) - 44, // D7 is P1.12 (RX) - 45, // D8 is P1.13 (SCK) - 46, // D9 is P1.14 (MISO) - 47, // D10 is P1.15 (MOSI) - - // LEDs - 26, // D11 is P0.26 (LED RED) - 6, // D12 is P0.06 (LED BLUE) - 30, // D13 is P0.30 (LED GREEN) - 14, // D14 is P0.14 (READ_BAT) - - // LSM6DS3TR - 40, // D15 is P1.08 (6D_PWR) - 27, // D16 is P0.27 (6D_I2C_SCL) - 7, // D17 is P0.07 (6D_I2C_SDA) - 11, // D18 is P0.11 (6D_INT1) - - // MIC - 42, // D19 is P1.10 (MIC_PWR) - 32, // D20 is P1.00 (PDM_CLK) - 16, // D21 is P0.16 (PDM_DATA) - - // BQ25100 - 13, // D22 is P0.13 (HICHG) - 17, // D23 is P0.17 (~CHG) - - // - 21, // D24 is P0.21 (QSPI_SCK) - 25, // D25 is P0.25 (QSPI_CSN) - 20, // D26 is P0.20 (QSPI_SIO_0 DI) - 24, // D27 is P0.24 (QSPI_SIO_1 DO) - 22, // D28 is P0.22 (QSPI_SIO_2 WP) - 23, // D29 is P0.23 (QSPI_SIO_3 HOLD) - - // NFC - 9, // D30 is P0.09 (NFC1) - 10, // D31 is P0.10 (NFC2) - - // VBAT - 31, // D32 is P0.31 (VBAT) -}; - -void initVariant() -{ - // Disable reading of the BAT voltage. - // https://wiki.seeedstudio.com/XIAO_BLE#q3-what-are-the-considerations-when-using-xiao-nrf52840-sense-for-battery-charging - pinMode(VBAT_ENABLE, OUTPUT); - //digitalWrite(VBAT_ENABLE, HIGH); - // This was taken from Seeed github butis not coherent with the doc, - // VBAT_ENABLE should be kept to LOW to protect P0.14, (1500/500)*(4.2-3.3)+3.3 = 3.9V > 3.6V - // This induces a 3mA current in the resistors :( but it's better than burning the nrf - digitalWrite(VBAT_ENABLE, LOW); - - // Low charging current (50mA) - // https://wiki.seeedstudio.com/XIAO_BLE#battery-charging-current - //pinMode(PIN_CHARGING_CURRENT, INPUT); - - // High charging current (100mA) - pinMode(PIN_CHARGING_CURRENT, OUTPUT); - digitalWrite(PIN_CHARGING_CURRENT, LOW); - - pinMode(PIN_QSPI_CS, OUTPUT); - digitalWrite(PIN_QSPI_CS, HIGH); - - pinMode(LED_RED, OUTPUT); - digitalWrite(LED_RED, HIGH); - pinMode(LED_GREEN, OUTPUT); - digitalWrite(LED_GREEN, HIGH); - pinMode(LED_BLUE, OUTPUT); - digitalWrite(LED_BLUE, HIGH); -} diff --git a/variants/ikoka_nano_nrf/variant.h b/variants/ikoka_nano_nrf/variant.h deleted file mode 100644 index 1496aad0..00000000 --- a/variants/ikoka_nano_nrf/variant.h +++ /dev/null @@ -1,149 +0,0 @@ -#ifndef _IKOKA_NANO_NRF_H_ -#define _IKOKA_NANO_NRF_H_ - -/** Master clock frequency */ -#define VARIANT_MCK (64000000ul) - -#define USE_LFXO // Board uses 32khz crystal for LF -//#define USE_LFRC // Board uses RC for LF - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "WVariant.h" - -#ifdef __cplusplus -extern "C" -{ -#endif // __cplusplus - -#define PINS_COUNT (33) -#define NUM_DIGITAL_PINS (33) -#define NUM_ANALOG_INPUTS (8) -#define NUM_ANALOG_OUTPUTS (0) - -// LEDs -#define PIN_LED (LED_RED) -#define LED_PWR (PINS_COUNT) -#define PIN_NEOPIXEL (PINS_COUNT) -#define NEOPIXEL_NUM (0) - -#define LED_BUILTIN (PIN_LED) - -#define LED_RED (11) -#define LED_GREEN (13) -#define LED_BLUE (12) - -#define LED_STATE_ON (0) // State when LED is litted - -// Buttons -// #define PIN_BUTTON1 (PINS_COUNT) - -// Digital PINs -static const uint8_t D0 = 0 ; -static const uint8_t D1 = 1 ; -static const uint8_t D2 = 2 ; -static const uint8_t D3 = 3 ; -static const uint8_t D4 = 4 ; -static const uint8_t D5 = 5 ; -static const uint8_t D6 = 6 ; -static const uint8_t D7 = 7 ; -static const uint8_t D8 = 8 ; -static const uint8_t D9 = 9 ; -static const uint8_t D10 = 10; - -#define VBAT_ENABLE (14) // Output LOW to enable reading of the BAT voltage. - // https://wiki.seeedstudio.com/XIAO_BLE#q3-what-are-the-considerations-when-using-xiao-nrf52840-sense-for-battery-charging - -#define PIN_CHARGING_CURRENT (22) // Battery Charging current - // https://wiki.seeedstudio.com/XIAO_BLE#battery-charging-current - -// Analog pins -#define PIN_A0 (0) -#define PIN_A1 (1) -#define PIN_A2 (2) -#define PIN_A3 (3) -#define PIN_A4 (4) -#define PIN_A5 (5) -#define PIN_VBAT (32) // Read the BAT voltage. - // https://wiki.seeedstudio.com/XIAO_BLE#q3-what-are-the-considerations-when-using-xiao-nrf52840-sense-for-battery-charging - -#define BAT_NOT_CHARGING (23) // LOW when charging - -#define AREF_VOLTAGE (3.0) -#define ADC_MULTIPLIER (3.0F) // 1M, 512k divider bridge - -static const uint8_t A0 = PIN_A0; -static const uint8_t A1 = PIN_A1; -static const uint8_t A2 = PIN_A2; -static const uint8_t A3 = PIN_A3; -static const uint8_t A4 = PIN_A4; -static const uint8_t A5 = PIN_A5; - -#define ADC_RESOLUTION (12) - -// Other pins -#define PIN_NFC1 (30) -#define PIN_NFC2 (31) - -// Serial interfaces -#define PIN_SERIAL1_RX (7) -#define PIN_SERIAL1_TX (6) - -// SPI Interfaces -#define SPI_INTERFACES_COUNT (2) - -#define PIN_SPI_MISO (9) -#define PIN_SPI_MOSI (10) -#define PIN_SPI_SCK (8) - -#define PIN_SPI1_MISO (25) -#define PIN_SPI1_MOSI (26) -#define PIN_SPI1_SCK (29) - -// Lora SPI is on SPI0 -#define P_LORA_SCLK PIN_SPI_SCK -#define P_LORA_MISO PIN_SPI_MISO -#define P_LORA_MOSI PIN_SPI_MOSI - -// Wire Interfaces -#define WIRE_INTERFACES_COUNT (1) - -// #define PIN_WIRE_SDA (17) // 4 and 5 are used for the sx1262 ! -// #define PIN_WIRE_SCL (16) // use WIRE1_SDA - -static const uint8_t SDA = PIN_WIRE_SDA; -static const uint8_t SCL = PIN_WIRE_SCL; - -//#define PIN_WIRE1_SDA (17) -//#define PIN_WIRE1_SCL (16) -#define PIN_LSM6DS3TR_C_POWER (15) -#define PIN_LSM6DS3TR_C_INT1 (18) - -// PDM Interfaces -#define PIN_PDM_PWR (19) -#define PIN_PDM_CLK (20) -#define PIN_PDM_DIN (21) - -// QSPI Pins -#define PIN_QSPI_SCK (24) -#define PIN_QSPI_CS (25) -#define PIN_QSPI_IO0 (26) -#define PIN_QSPI_IO1 (27) -#define PIN_QSPI_IO2 (28) -#define PIN_QSPI_IO3 (29) - -// On-board QSPI Flash -#define EXTERNAL_FLASH_DEVICES (P25Q16H) -#define EXTERNAL_FLASH_USE_QSPI - -#ifdef __cplusplus -} -#endif - -/*---------------------------------------------------------------------------- - * Arduino objects - C++ only - *----------------------------------------------------------------------------*/ - -#endif diff --git a/variants/ikoka_stick_nrf/IkokaStickNRFBoard.cpp b/variants/ikoka_stick_nrf/IkokaStickNRFBoard.cpp deleted file mode 100644 index 1c416039..00000000 --- a/variants/ikoka_stick_nrf/IkokaStickNRFBoard.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#ifdef XIAO_NRF52 - -#include -#include - -#include "IkokaStickNRFBoard.h" - -void IkokaStickNRFBoard::begin() { - NRF52Board::begin(); - - pinMode(PIN_VBAT, INPUT); - pinMode(VBAT_ENABLE, OUTPUT); - digitalWrite(VBAT_ENABLE, HIGH); - -#ifdef PIN_USER_BTN - pinMode(PIN_USER_BTN, INPUT_PULLUP); -#endif - -#if defined(PIN_WIRE_SDA) && defined(PIN_WIRE_SCL) - Wire.setPins(PIN_WIRE_SDA, PIN_WIRE_SCL); -#endif - - Wire.begin(); - -#ifdef P_LORA_TX_LED - pinMode(P_LORA_TX_LED, OUTPUT); - digitalWrite(P_LORA_TX_LED, HIGH); -#endif - -// pinMode(SX126X_POWER_EN, OUTPUT); -// digitalWrite(SX126X_POWER_EN, HIGH); - delay(10); // give sx1262 some time to power up -} - -#endif diff --git a/variants/ikoka_stick_nrf/IkokaStickNRFBoard.h b/variants/ikoka_stick_nrf/IkokaStickNRFBoard.h deleted file mode 100644 index 00a26029..00000000 --- a/variants/ikoka_stick_nrf/IkokaStickNRFBoard.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#include -#include -#include - -#ifdef XIAO_NRF52 - -class IkokaStickNRFBoard : public NRF52BoardOTA { -public: - IkokaStickNRFBoard() : NRF52BoardOTA("XIAO_NRF52_OTA") {} - void begin(); - -#if defined(P_LORA_TX_LED) - void onBeforeTransmit() override { - digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED on - #if defined(LED_BLUE) - // turn off that annoying blue LED before transmitting - digitalWrite(LED_BLUE, HIGH); - #endif - } - void onAfterTransmit() override { - digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED off - #if defined(LED_BLUE) - // do it after transmitting too, just in case - digitalWrite(LED_BLUE, HIGH); - #endif - } -#endif - - uint16_t getBattMilliVolts() override { - // Please read befor going further ;) - // https://wiki.seeedstudio.com/XIAO_BLE#q3-what-are-the-considerations-when-using-xiao-nrf52840-sense-for-battery-charging - - // We can't drive VBAT_ENABLE to HIGH as long - // as we don't know wether we are charging or not ... - // this is a 3mA loss (4/1500) - digitalWrite(VBAT_ENABLE, LOW); - int adcvalue = 0; - analogReadResolution(12); - analogReference(AR_INTERNAL_3_0); - delay(10); - adcvalue = analogRead(PIN_VBAT); - return (adcvalue * ADC_MULTIPLIER * AREF_VOLTAGE) / 4.096; - } - - const char *getManufacturerName() const override { - return MANUFACTURER_STRING; - } -}; - -#endif diff --git a/variants/ikoka_stick_nrf/platformio.ini b/variants/ikoka_stick_nrf/platformio.ini deleted file mode 100644 index 2e43b700..00000000 --- a/variants/ikoka_stick_nrf/platformio.ini +++ /dev/null @@ -1,291 +0,0 @@ -[ikoka_stick_nrf] -extends = nrf52_base -board = seeed-xiao-afruitnrf52-nrf52840 -board_build.ldscript = boards/nrf52840_s140_v7.ld -build_flags = ${nrf52_base.build_flags} - ${sensor_base.build_flags} - -D NRF52_PLATFORM -D XIAO_NRF52 - -I lib/nrf52/s140_nrf52_7.3.0_API/include - -I lib/nrf52/s140_nrf52_7.3.0_API/include/nrf52 - -I variants/ikoka_stick_nrf - -I src/helpers/nrf52 - -D P_LORA_TX_LED=11 - -D DISPLAY_CLASS=SSD1306Display - -D DISPLAY_ROTATION=2 - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D P_LORA_DIO_1=D1 - -D P_LORA_RESET=D2 - -D P_LORA_BUSY=D3 - -D P_LORA_NSS=D4 - -D SX126X_RXEN=D5 - -D SX126X_TXEN=RADIOLIB_NC - -D SX126X_DIO2_AS_RF_SWITCH=1 - -D SX126X_DIO3_TCXO_VOLTAGE=1.8 - -D SX126X_CURRENT_LIMIT=140 - -D SX126X_RX_BOOSTED_GAIN=1 - -D PIN_USER_BTN=0 - -D PIN_WIRE_SCL=7 - -D PIN_WIRE_SDA=6 - -UENV_INCLUDE_GPS -lib_deps = ${nrf52_base.lib_deps} - ${sensor_base.lib_deps} - -[ikoka_stick_nrf_e22_22dbm] -extends = ikoka_stick_nrf -; No PA in this model, full 22dBm -build_flags = - ${ikoka_stick_nrf.build_flags} - -D MANUFACTURER_STRING='"Ikoka Stick-E22-22dBm (Xiao_nrf52)"' - -D LORA_TX_POWER=22 -build_src_filter = ${ikoka_stick_nrf.build_src_filter} - + - + - + - + - +<../variants/ikoka_stick_nrf> - -[ikoka_stick_nrf_e22_30dbm] -extends = ikoka_stick_nrf -; limit txpower to 20dBm on E22-900M30S. Anything higher will -; cause distortion in the PA output. 20dBm in -> 30dBm out -build_flags = - ${ikoka_stick_nrf.build_flags} - -D MANUFACTURER_STRING='"Ikoka Stick-E22-30dBm (Xiao_nrf52)"' - -D LORA_TX_POWER=20 -build_src_filter = ${ikoka_stick_nrf.build_src_filter} - + - + - + - + - +<../variants/ikoka_stick_nrf> - -[ikoka_stick_nrf_e22_33dbm] -extends = ikoka_stick_nrf -; limit txpower to 9dBm on E22-900M33S to avoid hardware damage -; to the rf amplifier frontend. 9dBm in -> 33dBm out -build_flags = - ${ikoka_stick_nrf.build_flags} - -D MANUFACTURER_STRING='"Ikoka Stick-E22-33dBm (Xiao_nrf52)"' - -D LORA_TX_POWER=9 -build_src_filter = ${ikoka_stick_nrf.build_src_filter} - + - + - + - + - +<../variants/ikoka_stick_nrf> - -;;; abstracted firmware roles - -[ikoka_stick_nrf_companion_radio_ble] -extends = ikoka_stick_nrf -board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld -board_upload.maximum_size = 708608 -build_flags = - ${ikoka_stick_nrf.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 - -D OFFLINE_QUEUE_SIZE=256 - -I examples/companion_radio/ui-new - -D QSPIFLASH=1 -; -D BLE_DEBUG_LOGGING=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${ikoka_stick_nrf.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${ikoka_stick_nrf.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[ikoka_stick_nrf_companion_radio_usb] -extends = ikoka_stick_nrf -board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld -board_upload.maximum_size = 708608 -build_flags = - ${ikoka_stick_nrf.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -I examples/companion_radio/ui-new - -D QSPIFLASH=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${ikoka_stick_nrf.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${ikoka_stick_nrf.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[ikoka_stick_nrf_repeater] -extends = ikoka_stick_nrf -build_flags = - ${ikoka_stick_nrf.build_flags} - -D ADVERT_NAME='"Ikoka Stick 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 -build_src_filter = ${ikoka_stick_nrf.build_src_filter} - + - +<../examples/simple_repeater/*.cpp> - -[ikoka_stick_nrf_room_server] -extends = ikoka_stick_nrf -build_flags = - ${ikoka_stick_nrf.build_flags} - -D ADVERT_NAME='"Ikoka Stick Room"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${ikoka_stick_nrf.build_src_filter} - +<../examples/simple_room_server/*.cpp> - -;;; hardware + firmware variants - -;;; 22dBm EBYTE E22-900M22 variants - -[env:ikoka_stick_nrf_22dbm_companion_radio_usb] -extends = - ikoka_stick_nrf_e22_22dbm - ikoka_stick_nrf_companion_radio_usb -build_flags = - ${ikoka_stick_nrf_companion_radio_usb.build_flags} - ${ikoka_stick_nrf_e22_22dbm.build_flags} -build_src_filter = - ${ikoka_stick_nrf_companion_radio_usb.build_src_filter} - ${ikoka_stick_nrf_e22_22dbm.build_src_filter} - -[env:ikoka_stick_nrf_22dbm_companion_radio_ble] -extends = - ikoka_stick_nrf_e22_22dbm - ikoka_stick_nrf_companion_radio_ble -build_flags = - ${ikoka_stick_nrf_companion_radio_ble.build_flags} - ${ikoka_stick_nrf_e22_22dbm.build_flags} -build_src_filter = - ${ikoka_stick_nrf_companion_radio_ble.build_src_filter} - ${ikoka_stick_nrf_e22_22dbm.build_src_filter} - -[env:ikoka_stick_nrf_22dbm_repeater] -extends = - ikoka_stick_nrf_e22_22dbm - ikoka_stick_nrf_repeater -build_flags = - ${ikoka_stick_nrf_repeater.build_flags} - ${ikoka_stick_nrf_e22_22dbm.build_flags} -build_src_filter = - ${ikoka_stick_nrf_repeater.build_src_filter} - ${ikoka_stick_nrf_e22_22dbm.build_src_filter} - -[env:ikoka_stick_nrf_22dbm_room_server] -extends = - ikoka_stick_nrf_e22_22dbm - ikoka_stick_nrf_room_server -build_flags = - ${ikoka_stick_nrf_room_server.build_flags} - ${ikoka_stick_nrf_e22_22dbm.build_flags} -build_src_filter = - ${ikoka_stick_nrf_room_server.build_src_filter} - ${ikoka_stick_nrf_e22_22dbm.build_src_filter} - - -;;; 30dBm EBYTE E22-900M30 variants - -[env:ikoka_stick_nrf_30dbm_companion_radio_usb] -extends = - ikoka_stick_nrf_e22_30dbm - ikoka_stick_nrf_companion_radio_usb -build_flags = - ${ikoka_stick_nrf_companion_radio_usb.build_flags} - ${ikoka_stick_nrf_e22_30dbm.build_flags} -build_src_filter = - ${ikoka_stick_nrf_companion_radio_usb.build_src_filter} - ${ikoka_stick_nrf_e22_30dbm.build_src_filter} - -[env:ikoka_stick_nrf_30dbm_companion_radio_ble] -extends = - ikoka_stick_nrf_e22_30dbm - ikoka_stick_nrf_companion_radio_ble -build_flags = - ${ikoka_stick_nrf_companion_radio_ble.build_flags} - ${ikoka_stick_nrf_e22_30dbm.build_flags} -build_src_filter = - ${ikoka_stick_nrf_companion_radio_ble.build_src_filter} - ${ikoka_stick_nrf_e22_30dbm.build_src_filter} - -[env:ikoka_stick_nrf_30dbm_repeater] -extends = - ikoka_stick_nrf_e22_30dbm - ikoka_stick_nrf_repeater -build_flags = - ${ikoka_stick_nrf_repeater.build_flags} - ${ikoka_stick_nrf_e22_30dbm.build_flags} -build_src_filter = - ${ikoka_stick_nrf_repeater.build_src_filter} - ${ikoka_stick_nrf_e22_30dbm.build_src_filter} - -[env:ikoka_stick_nrf_30dbm_room_server] -extends = - ikoka_stick_nrf_e22_30dbm - ikoka_stick_nrf_room_server -build_flags = - ${ikoka_stick_nrf_room_server.build_flags} - ${ikoka_stick_nrf_e22_30dbm.build_flags} -build_src_filter = - ${ikoka_stick_nrf_room_server.build_src_filter} - ${ikoka_stick_nrf_e22_30dbm.build_src_filter} - - -;;; 33dBm EBYTE E22-900M33 variants - -[env:ikoka_stick_nrf_33dbm_companion_radio_usb] -extends = - ikoka_stick_nrf_e22_33dbm - ikoka_stick_nrf_companion_radio_usb -build_flags = - ${ikoka_stick_nrf_companion_radio_usb.build_flags} - ${ikoka_stick_nrf_e22_33dbm.build_flags} -build_src_filter = - ${ikoka_stick_nrf_companion_radio_usb.build_src_filter} - ${ikoka_stick_nrf_e22_33dbm.build_src_filter} - -[env:ikoka_stick_nrf_33dbm_companion_radio_ble] -extends = - ikoka_stick_nrf_e22_33dbm - ikoka_stick_nrf_companion_radio_ble -build_flags = - ${ikoka_stick_nrf_companion_radio_ble.build_flags} - ${ikoka_stick_nrf_e22_33dbm.build_flags} -build_src_filter = - ${ikoka_stick_nrf_companion_radio_ble.build_src_filter} - ${ikoka_stick_nrf_e22_33dbm.build_src_filter} - -[env:ikoka_stick_nrf_33dbm_repeater] -extends = - ikoka_stick_nrf_e22_33dbm - ikoka_stick_nrf_repeater -build_flags = - ${ikoka_stick_nrf_repeater.build_flags} - ${ikoka_stick_nrf_e22_33dbm.build_flags} -build_src_filter = - ${ikoka_stick_nrf_repeater.build_src_filter} - ${ikoka_stick_nrf_e22_33dbm.build_src_filter} - -[env:ikoka_stick_nrf_33dbm_room_server] -extends = - ikoka_stick_nrf_e22_33dbm - ikoka_stick_nrf_room_server -build_flags = - ${ikoka_stick_nrf_room_server.build_flags} - ${ikoka_stick_nrf_e22_33dbm.build_flags} -build_src_filter = - ${ikoka_stick_nrf_room_server.build_src_filter} - ${ikoka_stick_nrf_e22_33dbm.build_src_filter} diff --git a/variants/ikoka_stick_nrf/target.cpp b/variants/ikoka_stick_nrf/target.cpp deleted file mode 100644 index bd803399..00000000 --- a/variants/ikoka_stick_nrf/target.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include -#include "target.h" -#include - -IkokaStickNRFBoard board; - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); - -WRAPPER_CLASS radio_driver(radio, board); - -VolatileRTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -EnvironmentSensorManager sensors; - -bool radio_init() { - rtc_clock.begin(Wire); - - return radio.std_init(&SPI); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/ikoka_stick_nrf/target.h b/variants/ikoka_stick_nrf/target.h deleted file mode 100644 index c276e89f..00000000 --- a/variants/ikoka_stick_nrf/target.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#include - -#ifdef DISPLAY_CLASS - #include - #include - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -extern IkokaStickNRFBoard board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/ikoka_stick_nrf/variant.cpp b/variants/ikoka_stick_nrf/variant.cpp deleted file mode 100644 index 16542e27..00000000 --- a/variants/ikoka_stick_nrf/variant.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#include "variant.h" -#include "wiring_constants.h" -#include "wiring_digital.h" -#include "nrf.h" - -const uint32_t g_ADigitalPinMap[] = -{ - // D0 .. D10 - 2, // D0 is P0.02 (A0) - 3, // D1 is P0.03 (A1) - 28, // D2 is P0.28 (A2) - 29, // D3 is P0.29 (A3) - 4, // D4 is P0.04 (A4,SDA) - 5, // D5 is P0.05 (A5,SCL) - 43, // D6 is P1.11 (TX) - 44, // D7 is P1.12 (RX) - 45, // D8 is P1.13 (SCK) - 46, // D9 is P1.14 (MISO) - 47, // D10 is P1.15 (MOSI) - - // LEDs - 26, // D11 is P0.26 (LED RED) - 6, // D12 is P0.06 (LED BLUE) - 30, // D13 is P0.30 (LED GREEN) - 14, // D14 is P0.14 (READ_BAT) - - // LSM6DS3TR - 40, // D15 is P1.08 (6D_PWR) - 27, // D16 is P0.27 (6D_I2C_SCL) - 7, // D17 is P0.07 (6D_I2C_SDA) - 11, // D18 is P0.11 (6D_INT1) - - // MIC - 42, // D19 is P1.10 (MIC_PWR) - 32, // D20 is P1.00 (PDM_CLK) - 16, // D21 is P0.16 (PDM_DATA) - - // BQ25100 - 13, // D22 is P0.13 (HICHG) - 17, // D23 is P0.17 (~CHG) - - // - 21, // D24 is P0.21 (QSPI_SCK) - 25, // D25 is P0.25 (QSPI_CSN) - 20, // D26 is P0.20 (QSPI_SIO_0 DI) - 24, // D27 is P0.24 (QSPI_SIO_1 DO) - 22, // D28 is P0.22 (QSPI_SIO_2 WP) - 23, // D29 is P0.23 (QSPI_SIO_3 HOLD) - - // NFC - 9, // D30 is P0.09 (NFC1) - 10, // D31 is P0.10 (NFC2) - - // VBAT - 31, // D32 is P0.31 (VBAT) -}; - -void initVariant() -{ - // Disable reading of the BAT voltage. - // https://wiki.seeedstudio.com/XIAO_BLE#q3-what-are-the-considerations-when-using-xiao-nrf52840-sense-for-battery-charging - pinMode(VBAT_ENABLE, OUTPUT); - //digitalWrite(VBAT_ENABLE, HIGH); - // This was taken from Seeed github butis not coherent with the doc, - // VBAT_ENABLE should be kept to LOW to protect P0.14, (1500/500)*(4.2-3.3)+3.3 = 3.9V > 3.6V - // This induces a 3mA current in the resistors :( but it's better than burning the nrf - digitalWrite(VBAT_ENABLE, LOW); - - // Low charging current (50mA) - // https://wiki.seeedstudio.com/XIAO_BLE#battery-charging-current - //pinMode(PIN_CHARGING_CURRENT, INPUT); - - // High charging current (100mA) - pinMode(PIN_CHARGING_CURRENT, OUTPUT); - digitalWrite(PIN_CHARGING_CURRENT, LOW); - - pinMode(PIN_QSPI_CS, OUTPUT); - digitalWrite(PIN_QSPI_CS, HIGH); - - pinMode(LED_RED, OUTPUT); - digitalWrite(LED_RED, HIGH); - pinMode(LED_GREEN, OUTPUT); - digitalWrite(LED_GREEN, HIGH); - pinMode(LED_BLUE, OUTPUT); - digitalWrite(LED_BLUE, HIGH); -} diff --git a/variants/ikoka_stick_nrf/variant.h b/variants/ikoka_stick_nrf/variant.h deleted file mode 100644 index ff5a41a6..00000000 --- a/variants/ikoka_stick_nrf/variant.h +++ /dev/null @@ -1,149 +0,0 @@ -#ifndef _IKOKA_STICK_NRF_H_ -#define _IKOKA_STICK_NRF_H_ - -/** Master clock frequency */ -#define VARIANT_MCK (64000000ul) - -#define USE_LFXO // Board uses 32khz crystal for LF -//#define USE_LFRC // Board uses RC for LF - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "WVariant.h" - -#ifdef __cplusplus -extern "C" -{ -#endif // __cplusplus - -#define PINS_COUNT (33) -#define NUM_DIGITAL_PINS (33) -#define NUM_ANALOG_INPUTS (8) -#define NUM_ANALOG_OUTPUTS (0) - -// LEDs -#define PIN_LED (LED_RED) -#define LED_PWR (PINS_COUNT) -#define PIN_NEOPIXEL (PINS_COUNT) -#define NEOPIXEL_NUM (0) - -#define LED_BUILTIN (PIN_LED) - -#define LED_RED (11) -#define LED_GREEN (13) -#define LED_BLUE (12) - -#define LED_STATE_ON (0) // State when LED is litted - -// Buttons -#define PIN_BUTTON1 (PINS_COUNT) - -// Digital PINs -static const uint8_t D0 = 0 ; -static const uint8_t D1 = 1 ; -static const uint8_t D2 = 2 ; -static const uint8_t D3 = 3 ; -static const uint8_t D4 = 4 ; -static const uint8_t D5 = 5 ; -static const uint8_t D6 = 6 ; -static const uint8_t D7 = 7 ; -static const uint8_t D8 = 8 ; -static const uint8_t D9 = 9 ; -static const uint8_t D10 = 10; - -#define VBAT_ENABLE (14) // Output LOW to enable reading of the BAT voltage. - // https://wiki.seeedstudio.com/XIAO_BLE#q3-what-are-the-considerations-when-using-xiao-nrf52840-sense-for-battery-charging - -#define PIN_CHARGING_CURRENT (22) // Battery Charging current - // https://wiki.seeedstudio.com/XIAO_BLE#battery-charging-current - -// Analog pins -#define PIN_A0 (0) -#define PIN_A1 (1) -#define PIN_A2 (2) -#define PIN_A3 (3) -#define PIN_A4 (4) -#define PIN_A5 (5) -#define PIN_VBAT (32) // Read the BAT voltage. - // https://wiki.seeedstudio.com/XIAO_BLE#q3-what-are-the-considerations-when-using-xiao-nrf52840-sense-for-battery-charging - -#define BAT_NOT_CHARGING (23) // LOW when charging - -#define AREF_VOLTAGE (3.0) -#define ADC_MULTIPLIER (3.0F) // 1M, 512k divider bridge - -static const uint8_t A0 = PIN_A0; -static const uint8_t A1 = PIN_A1; -static const uint8_t A2 = PIN_A2; -static const uint8_t A3 = PIN_A3; -static const uint8_t A4 = PIN_A4; -static const uint8_t A5 = PIN_A5; - -#define ADC_RESOLUTION (12) - -// Other pins -#define PIN_NFC1 (30) -#define PIN_NFC2 (31) - -// Serial interfaces -#define PIN_SERIAL1_RX (7) -#define PIN_SERIAL1_TX (6) - -// SPI Interfaces -#define SPI_INTERFACES_COUNT (2) - -#define PIN_SPI_MISO (9) -#define PIN_SPI_MOSI (10) -#define PIN_SPI_SCK (8) - -#define PIN_SPI1_MISO (25) -#define PIN_SPI1_MOSI (26) -#define PIN_SPI1_SCK (29) - -// Lora SPI is on SPI0 -#define P_LORA_SCLK PIN_SPI_SCK -#define P_LORA_MISO PIN_SPI_MISO -#define P_LORA_MOSI PIN_SPI_MOSI - -// Wire Interfaces -#define WIRE_INTERFACES_COUNT (1) - -// #define PIN_WIRE_SDA (17) // 4 and 5 are used for the sx1262 ! -// #define PIN_WIRE_SCL (16) // use WIRE1_SDA - -static const uint8_t SDA = PIN_WIRE_SDA; -static const uint8_t SCL = PIN_WIRE_SCL; - -//#define PIN_WIRE1_SDA (17) -//#define PIN_WIRE1_SCL (16) -#define PIN_LSM6DS3TR_C_POWER (15) -#define PIN_LSM6DS3TR_C_INT1 (18) - -// PDM Interfaces -#define PIN_PDM_PWR (19) -#define PIN_PDM_CLK (20) -#define PIN_PDM_DIN (21) - -// QSPI Pins -#define PIN_QSPI_SCK (24) -#define PIN_QSPI_CS (25) -#define PIN_QSPI_IO0 (26) -#define PIN_QSPI_IO1 (27) -#define PIN_QSPI_IO2 (28) -#define PIN_QSPI_IO3 (29) - -// On-board QSPI Flash -#define EXTERNAL_FLASH_DEVICES (P25Q16H) -#define EXTERNAL_FLASH_USE_QSPI - -#ifdef __cplusplus -} -#endif - -/*---------------------------------------------------------------------------- - * Arduino objects - C++ only - *----------------------------------------------------------------------------*/ - -#endif diff --git a/variants/keepteen_lt1/KeepteenLT1Board.cpp b/variants/keepteen_lt1/KeepteenLT1Board.cpp deleted file mode 100644 index 2f1fa5f9..00000000 --- a/variants/keepteen_lt1/KeepteenLT1Board.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include - -#include "KeepteenLT1Board.h" - -void KeepteenLT1Board::begin() { - NRF52Board::begin(); - btn_prev_state = HIGH; - - pinMode(PIN_VBAT_READ, INPUT); - - #if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL) - Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL); - #endif - - Wire.begin(); -} \ No newline at end of file diff --git a/variants/keepteen_lt1/KeepteenLT1Board.h b/variants/keepteen_lt1/KeepteenLT1Board.h deleted file mode 100644 index a9844c90..00000000 --- a/variants/keepteen_lt1/KeepteenLT1Board.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -#include -#include -#include - -class KeepteenLT1Board : public NRF52BoardOTA { -protected: - uint8_t btn_prev_state; - -public: - KeepteenLT1Board() : NRF52BoardOTA("KeepteenLT1_OTA") {} - void begin(); - - #define BATTERY_SAMPLES 8 - - uint16_t getBattMilliVolts() override { - analogReadResolution(12); - - uint32_t raw = 0; - for (int i = 0; i < BATTERY_SAMPLES; i++) { - raw += analogRead(PIN_VBAT_READ); - } - raw = raw / BATTERY_SAMPLES; - return (ADC_MULTIPLIER * raw); - } - - const char* getManufacturerName() const override { - return "Keepteen LT1"; - } - -#if defined(P_LORA_TX_LED) - void onBeforeTransmit() override { - digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED on - } - void onAfterTransmit() override { - digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED off - } -#endif - - void powerOff() override { - sd_power_system_off(); - } -}; diff --git a/variants/keepteen_lt1/platformio.ini b/variants/keepteen_lt1/platformio.ini deleted file mode 100644 index cb3ea9c8..00000000 --- a/variants/keepteen_lt1/platformio.ini +++ /dev/null @@ -1,101 +0,0 @@ -[KeepteenLT1] -extends = nrf52_base -board = keepteen_lt1 -build_flags = ${nrf52_base.build_flags} - -I variants/keepteen_lt1 - -D KEEPTEEN_LT1 - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -D SX126X_CURRENT_LIMIT=140 - -D SX126X_RX_BOOSTED_GAIN=1 - -D PIN_BOARD_SDA=34 - -D PIN_BOARD_SCL=36 - -D ENV_INCLUDE_GPS=1 -build_src_filter = ${nrf52_base.build_src_filter} - + - +<../variants/keepteen_lt1> -lib_deps= ${nrf52_base.lib_deps} - adafruit/Adafruit SSD1306 @ ^2.5.13 - stevemarple/MicroNMEA @ ^2.0.6 - -[env:KeepteenLT1_repeater] -extends = KeepteenLT1 -build_src_filter = ${KeepteenLT1.build_src_filter} - +<../examples/simple_repeater> - + - + -build_flags = - ${KeepteenLT1.build_flags} - -D ADVERT_NAME='"KeepteenLT1 Repeater"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D MAX_NEIGHBOURS=50 - -D DISPLAY_CLASS=SSD1306Display -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -lib_deps = ${KeepteenLT1.lib_deps} - adafruit/RTClib @ ^2.1.3 - -[env:KeepteenLT1_room_server] -extends = KeepteenLT1 -build_src_filter = ${KeepteenLT1.build_src_filter} - +<../examples/simple_room_server> - + - + -build_flags = ${KeepteenLT1.build_flags} - -D ADVERT_NAME='"KeepteenLT1 Room"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D ROOM_PASSWORD='"hello"' - -D DISPLAY_CLASS=SSD1306Display -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -lib_deps = ${KeepteenLT1.lib_deps} - adafruit/RTClib @ ^2.1.3 - -[env:KeepteenLT1_companion_radio_usb] -extends = KeepteenLT1 -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = ${KeepteenLT1.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D DISPLAY_CLASS=SSD1306Display -; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 -; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 -build_src_filter = ${KeepteenLT1.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = ${KeepteenLT1.lib_deps} - adafruit/RTClib @ ^2.1.3 - densaugeo/base64 @ ~1.4.0 - -[env:KeepteenLT1_companion_radio_ble] -extends = KeepteenLT1 -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = ${KeepteenLT1.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 - -D DISPLAY_CLASS=SSD1306Display -; -D MESH_PACKET_LOGGING=1 - -D MESH_DEBUG=1 -build_src_filter = ${KeepteenLT1.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = ${KeepteenLT1.lib_deps} - adafruit/RTClib @ ^2.1.3 - densaugeo/base64 @ ~1.4.0 \ No newline at end of file diff --git a/variants/keepteen_lt1/target.cpp b/variants/keepteen_lt1/target.cpp deleted file mode 100644 index e72abf08..00000000 --- a/variants/keepteen_lt1/target.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include "target.h" -#include - -KeepteenLT1Board board; - -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); - -WRAPPER_CLASS radio_driver(radio, board); - -VolatileRTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -#if ENV_INCLUDE_GPS - #include - MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1); - EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea); -#else - EnvironmentSensorManager sensors; -#endif - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true); -#endif - -bool radio_init() { - rtc_clock.begin(Wire); - - return radio.std_init(&SPI); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} - diff --git a/variants/keepteen_lt1/target.h b/variants/keepteen_lt1/target.h deleted file mode 100644 index 0f1aa756..00000000 --- a/variants/keepteen_lt1/target.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -#include - -extern KeepteenLT1Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/keepteen_lt1/variant.cpp b/variants/keepteen_lt1/variant.cpp deleted file mode 100644 index 47a20f13..00000000 --- a/variants/keepteen_lt1/variant.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "variant.h" -#include "wiring_constants.h" -#include "wiring_digital.h" - -const uint32_t g_ADigitalPinMap[] = { - 0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47 -}; - -void initVariant() -{ - // set LED pin as output and set it low for off - pinMode(PIN_LED, OUTPUT); - digitalWrite(PIN_LED, LOW); - - // set INPUT_PULLUP for user button - pinMode(PIN_USER_BTN, INPUT_PULLUP); - -} - diff --git a/variants/keepteen_lt1/variant.h b/variants/keepteen_lt1/variant.h deleted file mode 100644 index a2b63fad..00000000 --- a/variants/keepteen_lt1/variant.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef _KEEPTEEN_LT1_H_ -#define _KEEPTEEN_LT1_H_ - -/** Master clock frequency */ -#define VARIANT_MCK (64000000ul) -#define USE_LFRC - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "WVariant.h" - -#define PINS_COUNT (48) -#define NUM_DIGITAL_PINS (48) -#define NUM_ANALOG_INPUTS (1) -#define NUM_ANALOG_OUTPUTS (0) - -// LEDs -#define PIN_LED (15) // Blue LED -#define PIN_LED2 (13) // Maybe red power LED? -#define LED_BLUE (-1) // Disable annoying flashing caused by Bluefruit -#define LED_BUILTIN PIN_LED -#define P_LORA_TX_LED PIN_LED -#define LED_STATE_ON 1 - -// Buttons -#define PIN_BUTTON1 (32) // Menu / User Button -#define PIN_USER_BTN PIN_BUTTON1 - -// Analog pins -#define PIN_VBAT_READ (31) -#define AREF_VOLTAGE (3.6F) -#define ADC_MULTIPLIER (1.535F) -#define ADC_RESOLUTION (12) - -// Serial interfaces -#define PIN_SERIAL1_RX (22) -#define PIN_SERIAL1_TX (20) - -// SPI Interfaces -#define SPI_INTERFACES_COUNT (1) - -#define PIN_SPI_MISO (2) -#define PIN_SPI_MOSI (38) -#define PIN_SPI_SCK (43) - -// Lora Pins -#define P_LORA_BUSY (29) -#define P_LORA_MISO PIN_SPI_MISO -#define P_LORA_MOSI PIN_SPI_MOSI -#define P_LORA_NSS (45) -#define P_LORA_SCLK PIN_SPI_SCK -#define P_LORA_DIO_1 (10) -#define P_LORA_RESET (9) -#define SX126X_RXEN RADIOLIB_NC -#define SX126X_TXEN RADIOLIB_NC -#define SX126X_DIO2_AS_RF_SWITCH true -#define SX126X_DIO3_TCXO_VOLTAGE (1.8f) - -// Wire Interfaces -#define WIRE_INTERFACES_COUNT (1) - -#define PIN_WIRE_SDA (34) -#define PIN_WIRE_SCL (36) -#define I2C_NO_RESCAN - -// GPS L76KB -#define GPS_BAUDRATE 9600 -#define PIN_GPS_TX PIN_SERIAL1_RX -#define PIN_GPS_RX PIN_SERIAL1_TX -#define PIN_GPS_EN (24) - -#endif // _KEEPTEEN_LT1_H_ \ No newline at end of file diff --git a/variants/lilygo_t3s3/platformio.ini b/variants/lilygo_t3s3/platformio.ini deleted file mode 100644 index 0f01c9b7..00000000 --- a/variants/lilygo_t3s3/platformio.ini +++ /dev/null @@ -1,174 +0,0 @@ -[LilyGo_T3S3_sx1262] -extends = esp32_base -board = t3_s3_v1_x -build_flags = - ${esp32_base.build_flags} - -I variants/lilygo_t3s3 - -D LILYGO_T3S3 - -D P_LORA_DIO_1=33 - -D P_LORA_NSS=7 - -D P_LORA_RESET=8 ; RADIOLIB_NC - -D P_LORA_BUSY=34 - -D P_LORA_SCLK=5 - -D P_LORA_MISO=3 - -D P_LORA_MOSI=6 - -D P_LORA_TX_LED=37 - -D PIN_VBAT_READ=1 - -D PIN_USER_BTN=0 - -D PIN_BOARD_SDA=18 - -D PIN_BOARD_SCL=17 - -D P_LORA_TX_LED=37 - -D PIN_OLED_RESET=21 - -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/lilygo_t3s3> -lib_deps = - ${esp32_base.lib_deps} - adafruit/Adafruit SSD1306 @ ^2.5.13 - -; === LilyGo T3S3 with SX1262 environments === -[env:LilyGo_T3S3_sx1262_repeater] -extends = LilyGo_T3S3_sx1262 -build_flags = - ${LilyGo_T3S3_sx1262.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -D ADVERT_NAME='"T3S3-1262 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 -build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${LilyGo_T3S3_sx1262.lib_deps} - ${esp32_ota.lib_deps} - -; [env:LilyGo_T3S3_sx1262_repeater_bridge_rs232] -; extends = LilyGo_T3S3_sx1262 -; build_flags = -; ${LilyGo_T3S3_sx1262.build_flags} -; -D DISPLAY_CLASS=SSD1306Display -; -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 = ${LilyGo_T3S3_sx1262.build_src_filter} -; + -; + -; +<../examples/simple_repeater> -; lib_deps = -; ${LilyGo_T3S3_sx1262.lib_deps} -; ${esp32_ota.lib_deps} - -[env:LilyGo_T3S3_sx1262_repeater_bridge_espnow] -extends = LilyGo_T3S3_sx1262 -build_flags = - ${LilyGo_T3S3_sx1262.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -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 = ${LilyGo_T3S3_sx1262.build_src_filter} - + - + - +<../examples/simple_repeater> -lib_deps = - ${LilyGo_T3S3_sx1262.lib_deps} - ${esp32_ota.lib_deps} - -[env:LilyGo_T3S3_sx1262_terminal_chat] -extends = LilyGo_T3S3_sx1262 -build_flags = - ${LilyGo_T3S3_sx1262.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} - +<../examples/simple_secure_chat/main.cpp> -lib_deps = - ${LilyGo_T3S3_sx1262.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:LilyGo_T3S3_sx1262_room_server] -extends = LilyGo_T3S3_sx1262 -build_flags = - ${LilyGo_T3S3_sx1262.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -D ADVERT_NAME='"T3S3-1262 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 -build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} - + - +<../examples/simple_room_server> -lib_deps = - ${LilyGo_T3S3_sx1262.lib_deps} - ${esp32_ota.lib_deps} - -[env:LilyGo_T3S3_sx1262_companion_radio_usb] -extends = LilyGo_T3S3_sx1262 -build_flags = - ${LilyGo_T3S3_sx1262.build_flags} - -I examples/companion_radio/ui-new - -D DISPLAY_CLASS=SSD1306Display - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 -; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 -; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 -build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${LilyGo_T3S3_sx1262.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:LilyGo_T3S3_sx1262_companion_radio_ble] -extends = LilyGo_T3S3_sx1262 -build_flags = - ${LilyGo_T3S3_sx1262.build_flags} - -I examples/companion_radio/ui-new - -D DISPLAY_CLASS=SSD1306Display - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${LilyGo_T3S3_sx1262.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${LilyGo_T3S3_sx1262.lib_deps} - densaugeo/base64 @ ~1.4.0 diff --git a/variants/lilygo_t3s3/target.cpp b/variants/lilygo_t3s3/target.cpp deleted file mode 100644 index 1c7b3b09..00000000 --- a/variants/lilygo_t3s3/target.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include -#include "target.h" - -ESP32Board board; - -static SPIClass spi; -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -SensorManager sensors; - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -#ifndef LORA_CR - #define LORA_CR 5 -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - - return radio.std_init(&spi); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/lilygo_t3s3/target.h b/variants/lilygo_t3s3/target.h deleted file mode 100644 index f184c757..00000000 --- a/variants/lilygo_t3s3/target.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -extern ESP32Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern SensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/lilygo_t3s3_sx1276/platformio.ini b/variants/lilygo_t3s3_sx1276/platformio.ini deleted file mode 100644 index 5a7ece2c..00000000 --- a/variants/lilygo_t3s3_sx1276/platformio.ini +++ /dev/null @@ -1,171 +0,0 @@ -[LilyGo_T3S3_sx1276] -extends = esp32_base -board = t3_s3_v1_x -build_flags = - ${esp32_base.build_flags} - -I variants/lilygo_t3s3_sx1276 - -D LILYGO_T3S3 - -D P_LORA_DIO_0=9 - -D P_LORA_DIO_1=33 - -D P_LORA_NSS=7 - -D P_LORA_RESET=8 - -D P_LORA_SCLK=5 - -D P_LORA_MISO=3 - -D P_LORA_MOSI=6 - -D P_LORA_TX_LED=37 - -D PIN_VBAT_READ=1 - -D PIN_USER_BTN=0 - -D PIN_BOARD_SDA=18 - -D PIN_BOARD_SCL=17 - -D PIN_OLED_RESET=21 - -D RADIO_CLASS=CustomSX1276 - -D WRAPPER_CLASS=CustomSX1276Wrapper - -D SX127X_CURRENT_LIMIT=120 - -D SX176X_RXEN=21 - -D SX176X_TXEN=10 - -D LORA_TX_POWER=20 -build_src_filter = ${esp32_base.build_src_filter} - +<../variants/lilygo_t3s3_sx1276> -lib_deps = - ${esp32_base.lib_deps} - adafruit/Adafruit SSD1306 @ ^2.5.13 - -; === LilyGo T3S3 with SX1276 environments === -[env:LilyGo_T3S3_sx1276_repeater] -extends = LilyGo_T3S3_sx1276 -build_flags = - ${LilyGo_T3S3_sx1276.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -D ADVERT_NAME='"T3S3-1276 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 -build_src_filter = ${LilyGo_T3S3_sx1276.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${LilyGo_T3S3_sx1276.lib_deps} - ${esp32_ota.lib_deps} - -; [env:LilyGo_T3S3_sx1276_repeater_bridge_rs232] -; extends = LilyGo_T3S3_sx1276 -; build_flags = -; ${LilyGo_T3S3_sx1276.build_flags} -; -D DISPLAY_CLASS=SSD1306Display -; -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 = ${LilyGo_T3S3_sx1276.build_src_filter} -; + -; + -; +<../examples/simple_repeater> -; lib_deps = -; ${LilyGo_T3S3_sx1276.lib_deps} -; ${esp32_ota.lib_deps} - -[env:LilyGo_T3S3_sx1276_repeater_bridge_espnow] -extends = LilyGo_T3S3_sx1276 -build_flags = - ${LilyGo_T3S3_sx1276.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -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 = ${LilyGo_T3S3_sx1276.build_src_filter} - + - + - +<../examples/simple_repeater> -lib_deps = - ${LilyGo_T3S3_sx1276.lib_deps} - ${esp32_ota.lib_deps} - -[env:LilyGo_T3S3_sx1276_terminal_chat] -extends = LilyGo_T3S3_sx1276 -build_flags = - ${LilyGo_T3S3_sx1276.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${LilyGo_T3S3_sx1276.build_src_filter} - +<../examples/simple_secure_chat/main.cpp> -lib_deps = - ${LilyGo_T3S3_sx1276.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:LilyGo_T3S3_sx1276_room_server] -extends = LilyGo_T3S3_sx1276 -build_flags = - ${LilyGo_T3S3_sx1276.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -D ADVERT_NAME='"T3S3-1276 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 -build_src_filter = ${LilyGo_T3S3_sx1276.build_src_filter} - + - +<../examples/simple_room_server> -lib_deps = - ${LilyGo_T3S3_sx1276.lib_deps} - ${esp32_ota.lib_deps} - -[env:LilyGo_T3S3_sx1276_companion_radio_usb] -extends = LilyGo_T3S3_sx1276 -upload_speed = 115200 -build_flags = - ${LilyGo_T3S3_sx1276.build_flags} - -I examples/companion_radio/ui-new - -D DISPLAY_CLASS=SSD1306Display - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 -build_src_filter = ${LilyGo_T3S3_sx1276.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${LilyGo_T3S3_sx1276.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:LilyGo_T3S3_sx1276_companion_radio_ble] -extends = LilyGo_T3S3_sx1276 -build_flags = - ${LilyGo_T3S3_sx1276.build_flags} - -I examples/companion_radio/ui-new - -D DISPLAY_CLASS=SSD1306Display - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${LilyGo_T3S3_sx1276.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${LilyGo_T3S3_sx1276.lib_deps} - densaugeo/base64 @ ~1.4.0 \ No newline at end of file diff --git a/variants/lilygo_t3s3_sx1276/target.cpp b/variants/lilygo_t3s3_sx1276/target.cpp deleted file mode 100644 index 042ff206..00000000 --- a/variants/lilygo_t3s3_sx1276/target.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include "target.h" - -ESP32Board board; - -#if defined(P_LORA_SCLK) - static SPIClass spi; - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_0, P_LORA_RESET, P_LORA_DIO_1, spi); -#else - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_0, P_LORA_RESET, P_LORA_DIO_1); -#endif - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -SensorManager sensors; - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - -#if defined(P_LORA_SCLK) - spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI); - return radio.std_init(&spi); -#else - return radio.std_init(); -#endif -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} \ No newline at end of file diff --git a/variants/lilygo_t3s3_sx1276/target.h b/variants/lilygo_t3s3_sx1276/target.h deleted file mode 100644 index 98a0fe35..00000000 --- a/variants/lilygo_t3s3_sx1276/target.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -extern ESP32Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern SensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); \ No newline at end of file diff --git a/variants/lilygo_tbeam_SX1262/platformio.ini b/variants/lilygo_tbeam_SX1262/platformio.ini deleted file mode 100644 index 9fb4805f..00000000 --- a/variants/lilygo_tbeam_SX1262/platformio.ini +++ /dev/null @@ -1,134 +0,0 @@ -[LilyGo_TBeam_SX1262] -extends = esp32_base -board = ttgo-t-beam -build_flags = - ${esp32_base.build_flags} - -I variants/lilygo_tbeam_SX1262 - -D TBEAM_SX1262 - -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 RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D DISPLAY_CLASS=SSD1306Display - -D LORA_TX_POWER=22 - -D P_LORA_TX_LED=4 - -D PIN_BOARD_SDA=21 - -D PIN_BOARD_SCL=22 - -D PIN_GPS_RX=12 - -D PIN_GPS_TX=34 - -D PIN_USER_BTN=38 - -D ENV_INCLUDE_GPS=1 -build_src_filter = ${esp32_base.build_src_filter} - +<../variants/lilygo_tbeam_SX1262> - + - + - + -board_build.partitions = min_spiffs.csv ; get around 4mb flash limit -lib_deps = - ${esp32_base.lib_deps} - lewisxhe/XPowersLib@^0.2.7 - adafruit/Adafruit SSD1306 @ ^2.5.13 - stevemarple/MicroNMEA @ ^2.0.6 - -[env:Tbeam_SX1262_companion_radio_ble] -extends = LilyGo_TBeam_SX1262 -board_build.upload.maximum_ram_size=2000000 -build_flags = - ${LilyGo_TBeam_SX1262.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=160 - -D MAX_GROUP_CHANNELS=8 - -D BLE_PIN_CODE=123456 - -D OFFLINE_QUEUE_SIZE=256 -; -D BLE_DEBUG_LOGGING=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -; -D RADIOLIB_DEBUG_BASIC=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${LilyGo_TBeam_SX1262.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${LilyGo_TBeam_SX1262.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Tbeam_SX1262_repeater] -extends = LilyGo_TBeam_SX1262 -build_flags = - ${LilyGo_TBeam_SX1262.build_flags} - -D ADVERT_NAME='"Tbeam SX1262 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 -build_src_filter = ${LilyGo_TBeam_SX1262.build_src_filter} - +<../examples/simple_repeater> -lib_deps = - ${LilyGo_TBeam_SX1262.lib_deps} - ${esp32_ota.lib_deps} - -; [env:Tbeam_SX1262_repeater_bridge_rs232] -; extends = LilyGo_TBeam_SX1262 -; build_flags = -; ${LilyGo_TBeam_SX1262.build_flags} -; -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 = ${LilyGo_TBeam_SX1262.build_src_filter} -; + -; +<../examples/simple_repeater> -; lib_deps = -; ${LilyGo_TBeam_SX1262.lib_deps} -; ${esp32_ota.lib_deps} - -[env:Tbeam_SX1262_repeater_bridge_espnow] -extends = LilyGo_TBeam_SX1262 -build_flags = - ${LilyGo_TBeam_SX1262.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 -build_src_filter = ${LilyGo_TBeam_SX1262.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${LilyGo_TBeam_SX1262.lib_deps} - ${esp32_ota.lib_deps} - -[env:Tbeam_SX1262_room_server] -extends = LilyGo_TBeam_SX1262 -build_flags = - ${LilyGo_TBeam_SX1262.build_flags} - -D ADVERT_NAME='"Tbeam SX1262 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 -build_src_filter = ${LilyGo_TBeam_SX1262.build_src_filter} - +<../examples/simple_room_server> -lib_deps = - ${LilyGo_TBeam_SX1262.lib_deps} - ${esp32_ota.lib_deps} diff --git a/variants/lilygo_tbeam_SX1262/target.cpp b/variants/lilygo_tbeam_SX1262/target.cpp deleted file mode 100644 index a8caecb3..00000000 --- a/variants/lilygo_tbeam_SX1262/target.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include -#include "target.h" - -TBeamBoard board; - -#if defined(P_LORA_SCLK) - static SPIClass spi; - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -#else - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY); -#endif - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); - -#if ENV_INCLUDE_GPS - #include - MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1); - EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea); -#else - EnvironmentSensorManager sensors; -#endif - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - return radio.std_init(&spi); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/lilygo_tbeam_SX1262/target.h b/variants/lilygo_tbeam_SX1262/target.h deleted file mode 100644 index 5f33abb8..00000000 --- a/variants/lilygo_tbeam_SX1262/target.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -extern TBeamBoard board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/lilygo_tbeam_SX1276/platformio.ini b/variants/lilygo_tbeam_SX1276/platformio.ini deleted file mode 100644 index 3562c40e..00000000 --- a/variants/lilygo_tbeam_SX1276/platformio.ini +++ /dev/null @@ -1,133 +0,0 @@ -[LilyGo_TBeam_SX1276] -extends = esp32_base -board = ttgo-t-beam -build_flags = - ${esp32_base.build_flags} - -I variants/lilygo_tbeam_SX1276 - -D TBEAM_SX1276 - -D SX127X_CURRENT_LIMIT=120 - -D RADIO_CLASS=CustomSX1276 - -D WRAPPER_CLASS=CustomSX1276Wrapper - -D DISPLAY_CLASS=SSD1306Display - -D LORA_TX_POWER=20 - -D P_LORA_TX_LED=4 - -D PIN_BOARD_SDA=21 - -D PIN_BOARD_SCL=22 - -D PIN_GPS_RX=12 - -D PIN_GPS_TX=34 - -D PIN_USER_BTN=38 - -D ENV_INCLUDE_GPS=1 - ;-D ENV_INCLUDE_BME680 -build_src_filter = ${esp32_base.build_src_filter} - +<../variants/lilygo_tbeam_SX1276> - + - + - + -board_build.partitions = min_spiffs.csv ; get around 4mb flash limit -lib_deps = - ${esp32_base.lib_deps} - lewisxhe/XPowersLib@^0.2.7 - adafruit/Adafruit SSD1306 @ ^2.5.13 - stevemarple/MicroNMEA @ ^2.0.6 - boschsensortec/BSEC Software Library @ ^1.8.1492 - -[env:Tbeam_SX1276_companion_radio_ble] -extends = LilyGo_TBeam_SX1276 -board_build.upload.maximum_ram_size=2000000 -build_flags = - ${LilyGo_TBeam_SX1276.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=160 - -D MAX_GROUP_CHANNELS=8 - -D BLE_PIN_CODE=123456 -; -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -; -D RADIOLIB_DEBUG_BASIC=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${LilyGo_TBeam_SX1276.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${LilyGo_TBeam_SX1276.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Tbeam_SX1276_repeater] -extends = LilyGo_TBeam_SX1276 -build_flags = - ${LilyGo_TBeam_SX1276.build_flags} - -D ADVERT_NAME='"Tbeam Repeater"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D MAX_NEIGHBOURS=50 - -D PERSISTANT_GPS=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${LilyGo_TBeam_SX1276.build_src_filter} - +<../examples/simple_repeater> -lib_deps = - ${LilyGo_TBeam_SX1276.lib_deps} - ${esp32_ota.lib_deps} - -; [env:Tbeam_SX1276_repeater_bridge_rs232] -; extends = LilyGo_TBeam_SX1276 -; build_flags = -; ${LilyGo_TBeam_SX1276.build_flags} -; -D ADVERT_NAME='"RS232 Bridge"' -; -D ADVERT_LAT=0.0 -; -D ADVERT_LON=0.0 -; -D ADMIN_PASSWORD='"password"' -; -D MAX_NEIGHBOURS=50 -; -D PERSISTANT_GPS=1 -; -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 = ${LilyGo_TBeam_SX1276.build_src_filter} -; + -; +<../examples/simple_repeater> -; lib_deps = -; ${LilyGo_TBeam_SX1276.lib_deps} -; ${esp32_ota.lib_deps} - -[env:Tbeam_SX1276_repeater_bridge_espnow] -extends = LilyGo_TBeam_SX1276 -build_flags = - ${LilyGo_TBeam_SX1276.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 PERSISTANT_GPS=1 - -D WITH_ESPNOW_BRIDGE=1 -; -D BRIDGE_DEBUG=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${LilyGo_TBeam_SX1276.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${LilyGo_TBeam_SX1276.lib_deps} - ${esp32_ota.lib_deps} - -[env:Tbeam_SX1276_room_server] -extends = LilyGo_TBeam_SX1276 -build_flags = - ${LilyGo_TBeam_SX1276.build_flags} - -D ADVERT_NAME='"Tbeam Room"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${LilyGo_TBeam_SX1276.build_src_filter} - +<../examples/simple_room_server> -lib_deps = - ${LilyGo_TBeam_SX1276.lib_deps} - ${esp32_ota.lib_deps} diff --git a/variants/lilygo_tbeam_SX1276/target.cpp b/variants/lilygo_tbeam_SX1276/target.cpp deleted file mode 100644 index 0a7517a2..00000000 --- a/variants/lilygo_tbeam_SX1276/target.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include -#include "target.h" - -TBeamBoard board; - -#if defined(P_LORA_SCLK) - static SPIClass spi; - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_0, P_LORA_RESET, P_LORA_DIO_1, spi); -#else - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_0, P_LORA_RESET, P_LORA_DIO_1); -#endif - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); - -#if ENV_INCLUDE_GPS - #include - MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1); - EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea); -#else - EnvironmentSensorManager sensors; -#endif - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - -#if defined(P_LORA_SCLK) - return radio.std_init(&spi); -#else - return radio.std_init(); -#endif -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/lilygo_tbeam_SX1276/target.h b/variants/lilygo_tbeam_SX1276/target.h deleted file mode 100644 index b382b652..00000000 --- a/variants/lilygo_tbeam_SX1276/target.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -//#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -extern TBeamBoard board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/lilygo_tbeam_supreme_SX1262/platformio.ini b/variants/lilygo_tbeam_supreme_SX1262/platformio.ini deleted file mode 100644 index 2d2a095a..00000000 --- a/variants/lilygo_tbeam_supreme_SX1262/platformio.ini +++ /dev/null @@ -1,133 +0,0 @@ -[T_Beam_S3_Supreme_SX1262] -extends = esp32_base -board = t_beams3_supreme ; LILYGO T-Beam Supreme ESP32S3 with SX1262 -build_flags = - ${esp32_base.build_flags} - -I variants/lilygo_tbeam_supreme_SX1262 - -D TBEAM_SUPREME_SX1262 - -D SX126X_CURRENT_LIMIT=140 - -D SX126X_RX_BOOSTED_GAIN=1 - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D DISPLAY_CLASS=SH1106Display - -D LORA_TX_POWER=22 - -D P_LORA_TX_LED=6 - -D PIN_BOARD_SDA=17 - -D PIN_BOARD_SCL=18 - -D PIN_GPS_RX=8 - -D PIN_GPS_TX=9 - -D PIN_GPS_EN=7 - -D PIN_USER_BTN=0 - -D TELEM_BME280_ADDRESS=0x77 - -D ENV_INCLUDE_GPS=1 - -D ENV_INCLUDE_BME280=1 -build_src_filter = ${esp32_base.build_src_filter} - +<../variants/lilygo_tbeam_supreme_SX1262> - + - + - + -board_build.partitions = min_spiffs.csv ; get around 4mb flash limit -lib_deps = - ${esp32_base.lib_deps} - lewisxhe/XPowersLib @ ^0.2.7 - adafruit/Adafruit SH110X @ ^2.1.13 - stevemarple/MicroNMEA @ ^2.0.6 - adafruit/Adafruit BME280 Library @ ^2.3.0 - -; === LILYGO T-Beam S3 Supreme with SX1262 environments === -[env:T_Beam_S3_Supreme_SX1262_repeater] -extends = T_Beam_S3_Supreme_SX1262 -build_flags = - ${T_Beam_S3_Supreme_SX1262.build_flags} - -D ADVERT_NAME='"T-Beam S3 Supreme SX1262 Repeater"' - -D ADVERT_LAT=0 - -D ADVERT_LON=0 - -D ADMIN_PASSWORD='"password"' - -D MAX_NEIGHBOURS=50 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${T_Beam_S3_Supreme_SX1262.build_src_filter} - +<../examples/simple_repeater> -lib_deps = - ${T_Beam_S3_Supreme_SX1262.lib_deps} - ${esp32_ota.lib_deps} - -; [env:T_Beam_S3_Supreme_SX1262_repeater_bridge_rs232] -; extends = T_Beam_S3_Supreme_SX1262 -; build_flags = -; ${T_Beam_S3_Supreme_SX1262.build_flags} -; -D ADVERT_NAME='"RS232 Bridge"' -; -D ADVERT_LAT=0 -; -D ADVERT_LON=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 = ${T_Beam_S3_Supreme_SX1262.build_src_filter} -; + -; +<../examples/simple_repeater> -; lib_deps = -; ${T_Beam_S3_Supreme_SX1262.lib_deps} -; ${esp32_ota.lib_deps} - -[env:T_Beam_S3_Supreme_SX1262_repeater_bridge_espnow] -extends = T_Beam_S3_Supreme_SX1262 -build_flags = - ${T_Beam_S3_Supreme_SX1262.build_flags} - -D ADVERT_NAME='"ESPNow Bridge"' - -D ADVERT_LAT=0 - -D ADVERT_LON=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 = ${T_Beam_S3_Supreme_SX1262.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${T_Beam_S3_Supreme_SX1262.lib_deps} - ${esp32_ota.lib_deps} - -[env:T_Beam_S3_Supreme_SX1262_room_server] -extends = T_Beam_S3_Supreme_SX1262 -build_flags = - ${T_Beam_S3_Supreme_SX1262.build_flags} - -D ADVERT_NAME='"T_Beam_S3_Supreme_SX1262 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 -build_src_filter = ${T_Beam_S3_Supreme_SX1262.build_src_filter} - +<../examples/simple_room_server> -lib_deps = - ${T_Beam_S3_Supreme_SX1262.lib_deps} - ${esp32_ota.lib_deps} - -[env:T_Beam_S3_Supreme_SX1262_companion_radio_ble] -extends = T_Beam_S3_Supreme_SX1262 -build_flags = - ${T_Beam_S3_Supreme_SX1262.build_flags} - -I examples/companion_radio/ui-new - -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=8 -; -D MESH_DEBUG=1 -build_src_filter = ${T_Beam_S3_Supreme_SX1262.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${T_Beam_S3_Supreme_SX1262.lib_deps} - densaugeo/base64 @ ~1.4.0 diff --git a/variants/lilygo_tbeam_supreme_SX1262/target.cpp b/variants/lilygo_tbeam_supreme_SX1262/target.cpp deleted file mode 100644 index 8ad306f1..00000000 --- a/variants/lilygo_tbeam_supreme_SX1262/target.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include "target.h" - -TBeamBoard board; - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -static SPIClass spi; - -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); - -#if ENV_INCLUDE_GPS - #include - MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1); - EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea); -#else - EnvironmentSensorManager sensors; -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire1); - return radio.std_init(&spi); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/lilygo_tbeam_supreme_SX1262/target.h b/variants/lilygo_tbeam_supreme_SX1262/target.h deleted file mode 100644 index c6ffa0a6..00000000 --- a/variants/lilygo_tbeam_supreme_SX1262/target.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include - -#ifdef DISPLAY_CLASS - #include - extern DISPLAY_CLASS display; - #include - extern MomentaryButton user_btn; -#endif - -extern TBeamBoard board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); \ No newline at end of file diff --git a/variants/lilygo_techo/TechoBoard.cpp b/variants/lilygo_techo/TechoBoard.cpp deleted file mode 100644 index 81d3d0c9..00000000 --- a/variants/lilygo_techo/TechoBoard.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include - -#include "TechoBoard.h" - -#ifdef LILYGO_TECHO - -void TechoBoard::begin() { - NRF52Board::begin(); - - Wire.begin(); - - pinMode(SX126X_POWER_EN, OUTPUT); - digitalWrite(SX126X_POWER_EN, HIGH); - delay(10); // give sx1262 some time to power up -} - -uint16_t TechoBoard::getBattMilliVolts() { - int adcvalue = 0; - - analogReference(AR_INTERNAL_3_0); - analogReadResolution(12); - delay(10); - - // ADC range is 0..3000mV and resolution is 12-bit (0..4095) - adcvalue = analogRead(PIN_VBAT_READ); - // Convert the raw value to compensated mv, taking the resistor- - // divider into account (providing the actual LIPO voltage) - return (uint16_t)((float)adcvalue * REAL_VBAT_MV_PER_LSB); -} -#endif diff --git a/variants/lilygo_techo/TechoBoard.h b/variants/lilygo_techo/TechoBoard.h deleted file mode 100644 index c9bdc229..00000000 --- a/variants/lilygo_techo/TechoBoard.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -#include -#include -#include - -// built-ins -#define VBAT_MV_PER_LSB (0.73242188F) // 3.0V ADC range and 12-bit ADC resolution = 3000mV/4096 - -#define VBAT_DIVIDER (0.5F) // 150K + 150K voltage divider on VBAT -#define VBAT_DIVIDER_COMP (2.0F) // Compensation factor for the VBAT divider - -#define PIN_VBAT_READ (4) -#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB) - -class TechoBoard : public NRF52BoardOTA { -public: - TechoBoard() : NRF52BoardOTA("TECHO_OTA") {} - void begin(); - uint16_t getBattMilliVolts() override; - - const char* getManufacturerName() const override { - return "LilyGo T-Echo"; - } - - void powerOff() override { - #ifdef LED_RED - digitalWrite(LED_RED, HIGH); - #endif - #ifdef LED_GREEN - digitalWrite(LED_GREEN, HIGH); - #endif - #ifdef LED_BLUE - digitalWrite(LED_BLUE, HIGH); - #endif - #ifdef DISP_BACKLIGHT - digitalWrite(DISP_BACKLIGHT, LOW); - #endif - #ifdef PIN_PWR_EN - digitalWrite(PIN_PWR_EN, LOW); - #endif - sd_power_system_off(); - } -}; diff --git a/variants/lilygo_techo/platformio.ini b/variants/lilygo_techo/platformio.ini deleted file mode 100644 index e2172b1d..00000000 --- a/variants/lilygo_techo/platformio.ini +++ /dev/null @@ -1,128 +0,0 @@ -[LilyGo_T-Echo] -extends = nrf52_base -board = t-echo -board_build.ldscript = boards/nrf52840_s140_v6.ld -build_flags = ${nrf52_base.build_flags} - -I variants/lilygo_techo - -I src/helpers/nrf52 - -I lib/nrf52/s140_nrf52_6.1.1_API/include - -I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52 - -D LILYGO_TECHO - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -D P_LORA_DIO_1=20 - -D P_LORA_NSS=24 - -D P_LORA_RESET=25 - -D P_LORA_BUSY=17 - -D P_LORA_SCLK=19 - -D P_LORA_MISO=23 - -D P_LORA_MOSI=22 - -D SX126X_POWER_EN=37 - -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 P_LORA_TX_LED=LED_GREEN - -D DISABLE_DIAGNOSTIC_OUTPUT - -D ENV_INCLUDE_GPS=1 - -D ENV_INCLUDE_BME280=1 - -D GPS_BAUD_RATE=9600 - -D PIN_GPS_EN=GPS_EN - -D PIN_GPS_RESET_ACTIVE=LOW - -D TELEM_BME280_ADDRESS=0x77 - -D DISPLAY_CLASS=GxEPDDisplay - -D BACKLIGHT_BTN=PIN_BUTTON2 - -D AUTO_OFF_MILLIS=0 -build_src_filter = ${nrf52_base.build_src_filter} - + - + - + - + - + - +<../variants/lilygo_techo> -lib_deps = - ${nrf52_base.lib_deps} - stevemarple/MicroNMEA @ ^2.0.6 - adafruit/Adafruit BME280 Library @ ^2.3.0 - zinggjm/GxEPD2 @ 1.6.2 - bakercp/CRC32 @ ^2.0.0 -debug_tool = jlink -upload_protocol = nrfutil - -[env:LilyGo_T-Echo_repeater] -extends = LilyGo_T-Echo -build_src_filter = ${LilyGo_T-Echo.build_src_filter} - +<../examples/simple_repeater> -build_flags = - ${LilyGo_T-Echo.build_flags} - -D ADVERT_NAME='"T-Echo 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 - -[env:LilyGo_T-Echo_room_server] -extends = LilyGo_T-Echo -build_src_filter = ${LilyGo_T-Echo.build_src_filter} - +<../examples/simple_room_server> -build_flags = - ${LilyGo_T-Echo.build_flags} - -D ADVERT_NAME='"T-Echo Room"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 - -[env:LilyGo_T-Echo_companion_radio_ble] -extends = LilyGo_T-Echo -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = - ${LilyGo_T-Echo.build_flags} - -I src/helpers/ui - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D QSPIFLASH=1 - -D BLE_PIN_CODE=123456 -; -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 - -D UI_RECENT_LIST_SIZE=9 - -D UI_SENSORS_PAGE=1 - -D UI_GPS_PAGE=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 - -D AUTO_SHUTDOWN_MILLIVOLTS=3300 -build_src_filter = ${LilyGo_T-Echo.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${LilyGo_T-Echo.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:LilyGo_T-Echo_companion_radio_usb] -extends = LilyGo_T-Echo -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = - ${LilyGo_T-Echo.build_flags} - -I src/helpers/ui - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D OFFLINE_QUEUE_SIZE=256 - -D UI_RECENT_LIST_SIZE=9 - -D UI_SENSORS_PAGE=1 - -D AUTO_SHUTDOWN_MILLIVOLTS=3300 - -D QSPIFLASH=1 -build_src_filter = ${LilyGo_T-Echo.build_src_filter} - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${LilyGo_T-Echo.lib_deps} - densaugeo/base64 @ ~1.4.0 diff --git a/variants/lilygo_techo/target.cpp b/variants/lilygo_techo/target.cpp deleted file mode 100644 index 2ebc0641..00000000 --- a/variants/lilygo_techo/target.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include -#include "target.h" -#include -#include - -TechoBoard board; - -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); - -WRAPPER_CLASS radio_driver(radio, board); - -VolatileRTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); - -#ifdef ENV_INCLUDE_GPS -MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, &rtc_clock); -EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea); -#else -EnvironmentSensorManager sensors = EnvironmentSensorManager(); -#endif - - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - rtc_clock.begin(Wire); - - return radio.std_init(&SPI); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} - diff --git a/variants/lilygo_techo/target.h b/variants/lilygo_techo/target.h deleted file mode 100644 index 2b6ed45f..00000000 --- a/variants/lilygo_techo/target.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -extern TechoBoard board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/lilygo_techo/variant.cpp b/variants/lilygo_techo/variant.cpp deleted file mode 100644 index 0bad7829..00000000 --- a/variants/lilygo_techo/variant.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include "variant.h" -#include "wiring_constants.h" -#include "wiring_digital.h" - -const int MISO = PIN_SPI1_MISO; -const int MOSI = PIN_SPI1_MOSI; -const int SCK = PIN_SPI1_SCK; - -const uint32_t g_ADigitalPinMap[] = { - 0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47 -}; - -void initVariant() { - pinMode(PIN_PWR_EN, OUTPUT); - digitalWrite(PIN_PWR_EN, HIGH); - - pinMode(PIN_BUTTON1, INPUT_PULLUP); - pinMode(PIN_BUTTON2, INPUT_PULLUP); - - pinMode(LED_RED, OUTPUT); - pinMode(LED_GREEN, OUTPUT); - pinMode(LED_BLUE, OUTPUT); - digitalWrite(LED_BLUE, HIGH); - digitalWrite(LED_GREEN, HIGH); - digitalWrite(LED_RED, HIGH); - - pinMode(PIN_TXCO, OUTPUT); - digitalWrite(PIN_TXCO, HIGH); - - // shutdown gps - pinMode(GPS_EN, OUTPUT); - digitalWrite(GPS_EN, LOW); -} diff --git a/variants/lilygo_techo/variant.h b/variants/lilygo_techo/variant.h deleted file mode 100644 index 1de62d91..00000000 --- a/variants/lilygo_techo/variant.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * variant.h - * Copyright (C) 2023 Seeed K.K. - * MIT License - */ - -#pragma once - -#include "WVariant.h" - -//////////////////////////////////////////////////////////////////////////////// -// Low frequency clock source - -#define USE_LFXO // 32.768 kHz crystal oscillator -#define VARIANT_MCK (64000000ul) - -#define WIRE_INTERFACES_COUNT (1) -#define PIN_TXCO (21) -//////////////////////////////////////////////////////////////////////////////// -// Power - -#define PIN_PWR_EN (12) - -#define BATTERY_PIN (4) -#define ADC_MULTIPLIER (4.90F) - -#define ADC_RESOLUTION (14) -#define BATTERY_SENSE_RES (12) - -#define AREF_VOLTAGE (3.0) - -//////////////////////////////////////////////////////////////////////////////// -// Number of pins - -#define PINS_COUNT (48) -#define NUM_DIGITAL_PINS (48) -#define NUM_ANALOG_INPUTS (1) -#define NUM_ANALOG_OUTPUTS (0) - -//////////////////////////////////////////////////////////////////////////////// -// UART pin definition - -#define PIN_SERIAL1_RX PIN_GPS_TX -#define PIN_SERIAL1_TX PIN_GPS_RX -//////////////////////////////////////////////////////////////////////////////// -// I2C pin definition - -#define PIN_WIRE_SDA (26) // P0.26 -#define PIN_WIRE_SCL (27) // P0.27 - -//////////////////////////////////////////////////////////////////////////////// -// SPI pin definition - -#define SPI_INTERFACES_COUNT (2) - -#define PIN_SPI_MISO (23) -#define PIN_SPI_MOSI (22) -#define PIN_SPI_SCK (19) -#define PIN_SPI_NSS (24) - -//////////////////////////////////////////////////////////////////////////////// -// QSPI FLASH - -#define PIN_QSPI_SCK (46) -#define PIN_QSPI_CS (47) -#define PIN_QSPI_IO0 (44) -#define PIN_QSPI_IO1 (45) -#define PIN_QSPI_IO2 (7) -#define PIN_QSPI_IO3 (5) - -#define EXTERNAL_FLASH_DEVICES ZD25WQ16BUIGR -#define EXTERNAL_FLASH_USE_QSPI - -//////////////////////////////////////////////////////////////////////////////// -// Builtin LEDs - -#define LED_RED (13) -#define LED_BLUE (14) -#define LED_GREEN (15) - -//#define PIN_STATUS_LED LED_BLUE -#define LED_BUILTIN (-1) -#define LED_PIN LED_BUILTIN -#define LED_STATE_ON LOW - -//////////////////////////////////////////////////////////////////////////////// -// Builtin buttons - -#define PIN_BUTTON1 (42) -#define BUTTON_PIN PIN_BUTTON1 -#define PIN_USER_BTN BUTTON_PIN - -#define PIN_BUTTON2 (11) -#define BUTTON_PIN2 PIN_BUTTON2 - -#define EXTERNAL_FLASH_DEVICES MX25R1635F -#define EXTERNAL_FLASH_USE_QSPI - -//////////////////////////////////////////////////////////////////////////////// -// Lora - -#define USE_SX1262 -#define LORA_CS (24) -#define SX126X_DIO1 (20) -#define SX126X_BUSY (17) -#define SX126X_RESET (25) -#define SX126X_DIO2_AS_RF_SWITCH -#define SX126X_DIO3_TCXO_VOLTAGE 1.8 - -//////////////////////////////////////////////////////////////////////////////// -// SPI1 - -#define PIN_SPI1_MISO (38) -#define PIN_SPI1_MOSI (29) -#define PIN_SPI1_SCK (31) - -// GxEPD2 needs that for a panel that is not even used ! -extern const int MISO; -extern const int MOSI; -extern const int SCK; - -//////////////////////////////////////////////////////////////////////////////// -// Display - -#define DISP_MISO (38) -#define DISP_MOSI (29) -#define DISP_SCLK (31) -#define DISP_CS (30) -#define DISP_DC (28) -#define DISP_RST (2) -#define DISP_BUSY (3) -#define DISP_BACKLIGHT (43) - -//////////////////////////////////////////////////////////////////////////////// -// GPS - -#define PIN_GPS_RX (40) -#define PIN_GPS_TX (41) -#define GPS_EN (34) -#define PIN_GPS_RESET (37) -#define PIN_GPS_PPS (36) diff --git a/variants/lilygo_tlora_c6/platformio.ini b/variants/lilygo_tlora_c6/platformio.ini deleted file mode 100644 index b29cd036..00000000 --- a/variants/lilygo_tlora_c6/platformio.ini +++ /dev/null @@ -1,85 +0,0 @@ -[tlora_c6] -extends = esp32c6_base -board = esp32-c6-devkitm-1 -board_build.partitions = min_spiffs.csv ; get around 4mb flash limit -build_flags = - ${esp32c6_base.build_flags} - -I variants/lilygo_tlora_c6 - -D ARDUINO_USB_CDC_ON_BOOT=1 - -D ARDUINO_USB_MODE=1 - -D P_LORA_TX_LED=7 - -D P_LORA_SCLK=6 - -D P_LORA_MISO=1 - -D P_LORA_MOSI=0 - -D P_LORA_NSS=18 - -D P_LORA_DIO_1=23 - -D P_LORA_BUSY=22 - -D P_LORA_RESET=21 - -D PIN_BOARD_SDA=8 - -D PIN_BOARD_SCL=9 - -D SX126X_RXEN=15 - -D SX126X_TXEN=14 - -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 RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -D DISABLE_WIFI_OTA=1 -build_src_filter = ${esp32c6_base.build_src_filter} - +<../variants/lilygo_tlora_c6> - -[env:LilyGo_Tlora_C6_repeater_] -extends = tlora_c6 -build_src_filter = ${tlora_c6.build_src_filter} - +<../examples/simple_repeater/*.cpp> -build_flags = - ${tlora_c6.build_flags} - -D ADVERT_NAME='"Tlora C6 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 = - ${tlora_c6.lib_deps} -; ${esp32_ota.lib_deps} - -[env:LilyGo_Tlora_C6_room_server_] -extends = tlora_c6 -build_src_filter = ${tlora_c6.build_src_filter} - +<../examples/simple_room_server> -build_flags = - ${tlora_c6.build_flags} - -D ADVERT_NAME='"Tlora C6 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 = - ${tlora_c6.lib_deps} -; ${esp32_ota.lib_deps} - -[env:LilyGo_Tlora_C6_companion_radio_ble_] -extends = tlora_c6 -build_flags = ${tlora_c6.build_flags} - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 - -D ENABLE_PRIVATE_KEY_IMPORT=1 - -D ENABLE_PRIVATE_KEY_EXPORT=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${tlora_c6.build_src_filter} - + - - - +<../examples/companion_radio/*.cpp> -lib_deps = - ${tlora_c6.lib_deps} - densaugeo/base64 @ ~1.4.0 diff --git a/variants/lilygo_tlora_c6/target.cpp b/variants/lilygo_tlora_c6/target.cpp deleted file mode 100644 index e12c58b5..00000000 --- a/variants/lilygo_tlora_c6/target.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include -#include "target.h" - -ESP32Board board; - -#if defined(P_LORA_SCLK) - static SPIClass spi(0); - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -#else - RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY); -#endif - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -SensorManager sensors; - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - -#if defined(P_LORA_SCLK) - return radio.std_init(&spi); -#else - return radio.std_init(); -#endif -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/lilygo_tlora_c6/target.h b/variants/lilygo_tlora_c6/target.h deleted file mode 100644 index c26d5958..00000000 --- a/variants/lilygo_tlora_c6/target.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include - -extern ESP32Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern SensorManager sensors; - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/lilygo_tlora_v2_1/LilyGoTLoraBoard.h b/variants/lilygo_tlora_v2_1/LilyGoTLoraBoard.h deleted file mode 100644 index 545219b2..00000000 --- a/variants/lilygo_tlora_v2_1/LilyGoTLoraBoard.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include -#include - -// LILYGO T-LoRa V2.1-1.6 board with SX1276 -class LilyGoTLoraBoard : public ESP32Board { -public: - const char* getManufacturerName() const override { - return "LILYGO T-LoRa V2.1-1.6"; - } - - uint16_t getBattMilliVolts() override { - analogReadResolution(12); - - uint32_t raw = 0; - for (int i = 0; i < 8; i++) { - raw += analogReadMilliVolts(PIN_VBAT_READ); - } - raw = raw / 8; - - return (2 * raw); - } -}; \ No newline at end of file diff --git a/variants/lilygo_tlora_v2_1/platformio.ini b/variants/lilygo_tlora_v2_1/platformio.ini deleted file mode 100644 index f27f57fd..00000000 --- a/variants/lilygo_tlora_v2_1/platformio.ini +++ /dev/null @@ -1,194 +0,0 @@ -[LilyGo_TLora_V2_1_1_6] -extends = esp32_base -board = ttgo-lora32-v1 ; LILYGO T-LoRa V2.1-1.6 ESP32 with SX1276 -build_unflags = -Os -build_type = release ; Set build type to release -board_build.partitions = min_spiffs.csv ; get around 4mb flash limit -build_flags = - ${esp32_base.build_flags} - ${sensor_base.build_flags} - -UENV_INCLUDE_GPS - -I variants/lilygo_tlora_v2_1 - -Os -ffunction-sections -fdata-sections ; Optimize for size - -D LILYGO_TLORA ; LILYGO T-LoRa V2.1-1.6 ESP32 with SX1276 - -D P_LORA_DIO_0=26 ; SX1276 DIO0 interrupt pin - -D P_LORA_DIO_1=33 ; SX1276 DIO1 interrupt pin - -D P_LORA_NSS=18 ; Chip select - SS pin - -D P_LORA_RESET=14 ; Reset pin - -D P_LORA_SCLK=5 ; SPI clock - -D P_LORA_MISO=19 ; SPI MISO - -D P_LORA_MOSI=27 ; SPI MOSI - -D P_LORA_TX_LED=2 ; LED pin for TX indication - -D PIN_BOARD_SDA=21 - -D PIN_BOARD_SCL=22 - -D PIN_VBAT_READ=35 ; Battery voltage reading (analog pin) - -D PIN_USER_BTN=0 - -D ARDUINO_LOOP_STACK_SIZE=16384 - -D DISPLAY_CLASS=SSD1306Display - -D RADIO_CLASS=CustomSX1276 - -D WRAPPER_CLASS=CustomSX1276Wrapper - -D SX127X_CURRENT_LIMIT=120 - -D LORA_TX_POWER=20 -build_src_filter = ${esp32_base.build_src_filter} - + - +<../variants/lilygo_tlora_v2_1> - + -lib_deps = - ${esp32_base.lib_deps} - ${sensor_base.lib_deps} - -; === LILYGO T-LoRa V2.1-1.6 with SX1276 environments === -[env:LilyGo_TLora_V2_1_1_6_repeater] -extends = LilyGo_TLora_V2_1_1_6 -build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - +<../examples/simple_repeater> -build_flags = - ${LilyGo_TLora_V2_1_1_6.build_flags} - -D ADVERT_NAME='"TLora-V2.1-1.6 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 -; -D CORE_DEBUG_LEVEL=3 -lib_deps = - ${LilyGo_TLora_V2_1_1_6.lib_deps} - ${esp32_ota.lib_deps} - -[env:LilyGo_TLora_V2_1_1_6_terminal_chat] -extends = LilyGo_TLora_V2_1_1_6 -build_flags = - ${LilyGo_TLora_V2_1_1_6.build_flags} - -D MAX_CONTACTS=160 - -D MAX_GROUP_CHANNELS=8 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - +<../examples/simple_repeater> -lib_deps = - ${LilyGo_TLora_V2_1_1_6.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:LilyGo_TLora_V2_1_1_6_companion_radio_usb] -extends = LilyGo_TLora_V2_1_1_6 -build_flags = - ${LilyGo_TLora_V2_1_1_6.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=160 - -D MAX_GROUP_CHANNELS=8 -; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 -; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 -build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${LilyGo_TLora_V2_1_1_6.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:LilyGo_TLora_V2_1_1_6_companion_radio_ble] -extends = LilyGo_TLora_V2_1_1_6 -build_flags = - ${LilyGo_TLora_V2_1_1_6.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=160 - -D MAX_GROUP_CHANNELS=8 - -D BLE_PIN_CODE=123456 - -D OFFLINE_QUEUE_SIZE=256 -; -D BLE_DEBUG_LOGGING=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${LilyGo_TLora_V2_1_1_6.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:LilyGo_TLora_V2_1_1_6_room_server] -extends = LilyGo_TLora_V2_1_1_6 -build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - + - +<../examples/simple_room_server> -build_flags = - ${LilyGo_TLora_V2_1_1_6.build_flags} - -D ADVERT_NAME='"TLora-V2.1-1.6 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 = - ${LilyGo_TLora_V2_1_1_6.lib_deps} - ${esp32_ota.lib_deps} - -[env:LilyGo_TLora_V2_1_1_6_companion_radio_wifi] -extends = LilyGo_TLora_V2_1_1_6 -build_flags = - ${LilyGo_TLora_V2_1_1_6.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=160 - -D MAX_GROUP_CHANNELS=8 - -D WIFI_SSID='"ssid"' - -D WIFI_PWD='"password"' - -D WIFI_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${LilyGo_TLora_V2_1_1_6.lib_deps} - densaugeo/base64 @ ~1.4.0 - -; -; Repeater Bridges -; -[env:LilyGo_TLora_V2_1_1_6_repeater_bridge_rs232] -extends = LilyGo_TLora_V2_1_1_6 -build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - + - +<../examples/simple_repeater> -build_flags = - ${LilyGo_TLora_V2_1_1_6.build_flags} - -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=34 - -D WITH_RS232_BRIDGE_TX=25 -; -D BRIDGE_DEBUG=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -; -D CORE_DEBUG_LEVEL=3 -lib_deps = - ${LilyGo_TLora_V2_1_1_6.lib_deps} - ${esp32_ota.lib_deps} - -[env:LilyGo_TLora_V2_1_1_6_repeater_bridge_espnow] -extends = LilyGo_TLora_V2_1_1_6 -build_src_filter = ${LilyGo_TLora_V2_1_1_6.build_src_filter} - + - +<../examples/simple_repeater> -build_flags = - ${LilyGo_TLora_V2_1_1_6.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 -; -D CORE_DEBUG_LEVEL=3 -lib_deps = - ${LilyGo_TLora_V2_1_1_6.lib_deps} - ${esp32_ota.lib_deps} \ No newline at end of file diff --git a/variants/lilygo_tlora_v2_1/target.cpp b/variants/lilygo_tlora_v2_1/target.cpp deleted file mode 100644 index 65a78c19..00000000 --- a/variants/lilygo_tlora_v2_1/target.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include -#include "target.h" - -LilyGoTLoraBoard board; - -static SPIClass spi; -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_0, P_LORA_RESET, P_LORA_DIO_1, spi); - -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -EnvironmentSensorManager sensors; - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - -#if defined(P_LORA_SCLK) - return radio.std_init(&spi); -#else - return radio.std_init(); -#endif -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/lilygo_tlora_v2_1/target.h b/variants/lilygo_tlora_v2_1/target.h deleted file mode 100644 index 326a0dee..00000000 --- a/variants/lilygo_tlora_v2_1/target.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -extern LilyGoTLoraBoard board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/mesh_pocket/MeshPocket.cpp b/variants/mesh_pocket/MeshPocket.cpp deleted file mode 100644 index 0c53121f..00000000 --- a/variants/mesh_pocket/MeshPocket.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include - -#include "MeshPocket.h" - -void HeltecMeshPocket::begin() { - NRF52Board::begin(); - Serial.begin(115200); - pinMode(PIN_VBAT_READ, INPUT); - - pinMode(PIN_USER_BTN, INPUT); -} diff --git a/variants/mesh_pocket/MeshPocket.h b/variants/mesh_pocket/MeshPocket.h deleted file mode 100644 index db65c99b..00000000 --- a/variants/mesh_pocket/MeshPocket.h +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -#include -#include -#include - -// built-ins -#define PIN_VBAT_READ 29 -#define PIN_BAT_CTL 34 -#define MV_LSB (3000.0F / 4096.0F) // 12-bit ADC with 3.0V input range - -class HeltecMeshPocket : public NRF52BoardOTA { -public: - HeltecMeshPocket() : NRF52BoardOTA("MESH_POCKET_OTA") {} - void begin(); - - uint16_t getBattMilliVolts() override { - int adcvalue = 0; - analogReadResolution(12); - analogReference(AR_INTERNAL_3_0); - pinMode(PIN_BAT_CTL, OUTPUT); // battery adc can be read only ctrl pin set to high - pinMode(PIN_VBAT_READ, INPUT); - digitalWrite(PIN_BAT_CTL, HIGH); - - delay(10); - adcvalue = analogRead(PIN_VBAT_READ); - digitalWrite(PIN_BAT_CTL, LOW); - - return (uint16_t)((float)adcvalue * MV_LSB * 4.9); - } - - const char* getManufacturerName() const override { - return "Heltec MeshPocket"; - } - - void powerOff() override { - sd_power_system_off(); - } -}; diff --git a/variants/mesh_pocket/platformio.ini b/variants/mesh_pocket/platformio.ini deleted file mode 100644 index 015c2ca4..00000000 --- a/variants/mesh_pocket/platformio.ini +++ /dev/null @@ -1,112 +0,0 @@ -[Mesh_pocket] -extends = nrf52_base -board = heltec_mesh_pocket -platform_packages = framework-arduinoadafruitnrf52 -board_build.ldscript = boards/nrf52840_s140_v6.ld -build_flags = ${nrf52_base.build_flags} - -I src/helpers/nrf52 - -I lib/nrf52/s140_nrf52_6.1.1_API/include - -I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52 - -I variants/mesh_pocket - -D HELTEC_MESH_POCKET - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -D SX126X_CURRENT_LIMIT=140 - -D SX126X_RX_BOOSTED_GAIN=1 - -D EINK_DISPLAY_MODEL=GxEPD2_213_B74 - -D EINK_SCALE_X=1.953125f - -D EINK_SCALE_Y=1.28f - -D EINK_X_OFFSET=0 - -D EINK_Y_OFFSET=10 - -D DISPLAY_CLASS=GxEPDDisplay - -D DISABLE_DIAGNOSTIC_OUTPUT -build_src_filter = ${nrf52_base.build_src_filter} - + - +<../variants/mesh_pocket> - + -lib_deps = - ${nrf52_base.lib_deps} - adafruit/Adafruit EPD @ 4.6.1 - rweather/Crypto @ ^0.4.0 - stevemarple/MicroNMEA @ ^2.0.6 - zinggjm/GxEPD2 @ 1.6.2 - bakercp/CRC32 @ ^2.0.0 - -debug_tool = jlink -upload_protocol = nrfutil - -[env:Mesh_pocket_repeater] -extends = Mesh_pocket -build_src_filter = ${Mesh_pocket.build_src_filter} - +<../examples/simple_repeater> - -build_flags = - ${Mesh_pocket.build_flags} - -D ADVERT_NAME='"Heltec_Mesh_Pocket 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 - -[env:Mesh_pocket_room_server] -extends = Mesh_pocket -build_src_filter = ${Mesh_pocket.build_src_filter} - +<../examples/simple_room_server> -build_flags = - ${Mesh_pocket.build_flags} - -D ADVERT_NAME='"Heltec_Mesh_Pocket 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 - -[env:Mesh_pocket_companion_radio_ble] -extends = Mesh_pocket -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = - ${Mesh_pocket.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 - -D OFFLINE_QUEUE_SIZE=256 - -D AUTO_OFF_MILLIS=0 -; -D BLE_DEBUG_LOGGING=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 - -build_src_filter = ${Mesh_pocket.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Mesh_pocket.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Mesh_pocket_companion_radio_usb] -extends = Mesh_pocket -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = - ${Mesh_pocket.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D AUTO_OFF_MILLIS=0 -; -D BLE_PIN_CODE=123456 -; -D BLE_DEBUG_LOGGING=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Mesh_pocket.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Mesh_pocket.lib_deps} - densaugeo/base64 @ ~1.4.0 \ No newline at end of file diff --git a/variants/mesh_pocket/target.cpp b/variants/mesh_pocket/target.cpp deleted file mode 100644 index a7f6c7fb..00000000 --- a/variants/mesh_pocket/target.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include -#include "target.h" -#include -#include - -HeltecMeshPocket board; - -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); - -WRAPPER_CLASS radio_driver(radio, board); - -SensorManager sensors = SensorManager(); - -VolatileRTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - return radio.std_init(&SPI); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/mesh_pocket/target.h b/variants/mesh_pocket/target.h deleted file mode 100644 index 2aa95669..00000000 --- a/variants/mesh_pocket/target.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#include "MeshPocket.h" - -#ifdef DISPLAY_CLASS -#include -#include -#endif - -extern HeltecMeshPocket board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); - -extern SensorManager sensors; - diff --git a/variants/mesh_pocket/variant.cpp b/variants/mesh_pocket/variant.cpp deleted file mode 100644 index cf7dd44f..00000000 --- a/variants/mesh_pocket/variant.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "variant.h" -#include "nrf.h" -#include "wiring_constants.h" -#include "wiring_digital.h" - -const int MISO = PIN_SPI1_MISO; -const int MOSI = PIN_SPI1_MOSI; -const int SCK = PIN_SPI1_SCK; - -const uint32_t g_ADigitalPinMap[] = { - // P0 - pins 0 and 1 are hardwired for xtal and should never be enabled - 0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - - // P1 - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}; \ No newline at end of file diff --git a/variants/mesh_pocket/variant.h b/variants/mesh_pocket/variant.h deleted file mode 100644 index 870d062a..00000000 --- a/variants/mesh_pocket/variant.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * variant.h - * MIT License - */ - -#pragma once - -#include "WVariant.h" - -//////////////////////////////////////////////////////////////////////////////// -// Low frequency clock source - -#define USE_LFXO // 32.768 kHz crystal oscillator -#define VARIANT_MCK (64000000ul) - - -//////////////////////////////////////////////////////////////////////////////// -// Power - -#define BATTERY_PIN (0 + 29) -#define PIN_BAT_CTRL (32 + 2) -#define ADC_MULTIPLIER (4.90F) - -#define ADC_RESOLUTION (14) -#define BATTERY_SENSE_RES (12) - -#define AREF_VOLTAGE (3.0) - -//////////////////////////////////////////////////////////////////////////////// -// Number of pins - -#define PINS_COUNT (48) -#define NUM_DIGITAL_PINS (48) -#define NUM_ANALOG_INPUTS (1) -#define NUM_ANALOG_OUTPUTS (0) - -//////////////////////////////////////////////////////////////////////////////// -// UART pin definition - -#define PIN_SERIAL1_RX (37) -#define PIN_SERIAL1_TX (39) - -#define PIN_SERIAL2_RX (7) -#define PIN_SERIAL2_TX (8) - -//////////////////////////////////////////////////////////////////////////////// -// I2C pin definition -#define WIRE_INTERFACES_COUNT (1) - -#define PIN_WIRE_SDA (32+15) -#define PIN_WIRE_SCL (32+13) - -//////////////////////////////////////////////////////////////////////////////// -// Builtin LEDs - -#define LED_BUILTIN (13) -#define PIN_LED LED_BUILTIN -#define LED_RED LED_BUILTIN -#define LED_BLUE (-1) // No blue led, prevents Bluefruit flashing the green LED during advertising -#define PIN_STATUS_LED LED_BUILTIN - -#define LED_STATE_ON LOW - -//////////////////////////////////////////////////////////////////////////////// -// Builtin buttons - -#define PIN_BUTTON1 (32 + 10) -#define BUTTON_PIN PIN_BUTTON1 - -// #define PIN_BUTTON2 (0 + 18) -// #define BUTTON_PIN2 PIN_BUTTON2 - -#define PIN_USER_BTN BUTTON_PIN - -//////////////////////////////////////////////////////////////////////////////// - -// SPI pin definition -#define SPI_INTERFACES_COUNT (2) - -// Lora -#define USE_SX1262 -#define SX126X_CS (0 + 26) -#define SX126X_DIO1 (0 + 16) -#define SX126X_BUSY (0 + 15) -#define SX126X_RESET (0 + 12) -#define SX126X_DIO2_AS_RF_SWITCH true -#define SX126X_DIO3_TCXO_VOLTAGE 1.8 - -#define PIN_SPI_MISO (32 + 9) -#define PIN_SPI_MOSI (0 + 5) -#define PIN_SPI_SCK (0 + 4) - -#define LORA_CS SX126X_CS -#define P_LORA_DIO_1 SX126X_DIO1 -#define P_LORA_NSS SX126X_CS -#define P_LORA_RESET SX126X_RESET -#define P_LORA_BUSY SX126X_BUSY -#define P_LORA_SCLK PIN_SPI_SCK -#define P_LORA_MISO PIN_SPI_MISO -#define P_LORA_MOSI PIN_SPI_MOSI - - -//////////////////////////////////////////////////////////////////////////////// -// EInk - -#define PIN_DISPLAY_CS (24) -#define PIN_DISPLAY_BUSY (32 + 6) -#define PIN_DISPLAY_DC (31) -#define PIN_DISPLAY_RST (32 + 4) - -#define PIN_SPI1_MISO (-1) -#define PIN_SPI1_MOSI (20) -#define PIN_SPI1_SCK (22) - - -// GxEPD2 needs that for a panel that is not even used ! -extern const int MISO; -extern const int MOSI; -extern const int SCK; - - -#undef HAS_GPS -#define HAS_GPS 0 -#define HAS_RTC 0 \ No newline at end of file diff --git a/variants/meshadventurer/platformio.ini b/variants/meshadventurer/platformio.ini deleted file mode 100644 index 18b64ac3..00000000 --- a/variants/meshadventurer/platformio.ini +++ /dev/null @@ -1,347 +0,0 @@ -[Meshadventurer] -extends = esp32_base -board = esp32doit-devkit-v1 -board_build.partitions = min_spiffs.csv ; get around 4mb flash limit -build_flags = - ${esp32_base.build_flags} - -I variants/meshadventurer - -D MESHADVENTURER - -D P_LORA_TX_LED=2 - -D PIN_VBAT_READ=35 - -D PIN_USER_BTN=39 - -D P_LORA_DIO_1=33 - -D P_LORA_NSS=18 - -D P_LORA_RESET=23 - -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=false - -D SX126X_DIO3_TCXO_VOLTAGE=1.8 - -D SX126X_RX_BOOSTED_GAIN=1 - -D PIN_GPS_RX=12 - -D PIN_GPS_TX=15 - -D DISPLAY_CLASS=SSD1306Display -build_src_filter = ${esp32_base.build_src_filter} - +<../variants/meshadventurer> - + -lib_deps = - ${esp32_base.lib_deps} - stevemarple/MicroNMEA @ ^2.0.6 - adafruit/Adafruit SSD1306 @ ^2.5.13 - -[env:Meshadventurer_sx1262_repeater] -extends = Meshadventurer -build_src_filter = ${Meshadventurer.build_src_filter} - +<../examples/simple_repeater> - + -build_flags = - ${Meshadventurer.build_flags} - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -D ADVERT_NAME='"Meshadventurer 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 = - ${Meshadventurer.lib_deps} - ${esp32_ota.lib_deps} - -; [env:Meshadventurer_sx1262_repeater_bridge_rs232] -; extends = Meshadventurer -; build_src_filter = ${Meshadventurer.build_src_filter} -; + -; +<../examples/simple_repeater> -; + -; build_flags = -; ${Meshadventurer.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 = -; ${Meshadventurer.lib_deps} -; ${esp32_ota.lib_deps} - -[env:Meshadventurer_sx1262_repeater_bridge_espnow] -extends = Meshadventurer -build_src_filter = ${Meshadventurer.build_src_filter} - + - +<../examples/simple_repeater> - + -build_flags = - ${Meshadventurer.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 = - ${Meshadventurer.lib_deps} - ${esp32_ota.lib_deps} - -[env:Meshadventurer_sx1268_repeater] -extends = Meshadventurer -build_src_filter = ${Meshadventurer.build_src_filter} - +<../examples/simple_repeater> - + -build_flags = - ${Meshadventurer.build_flags} - -D RADIO_CLASS=CustomSX1268 - -D WRAPPER_CLASS=CustomSX1268Wrapper - -D LORA_TX_POWER=22 - -D ADVERT_NAME='"Meshadventurer 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 = - ${Meshadventurer.lib_deps} - ${esp32_ota.lib_deps} - -; [env:Meshadventurer_sx1268_repeater_bridge_rs232] -; extends = Meshadventurer -; build_src_filter = ${Meshadventurer.build_src_filter} -; + -; +<../examples/simple_repeater> -; + -; build_flags = -; ${Meshadventurer.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 = -; ${Meshadventurer.lib_deps} -; ${esp32_ota.lib_deps} - -[env:Meshadventurer_sx1268_repeater_bridge_espnow] -extends = Meshadventurer -build_src_filter = ${Meshadventurer.build_src_filter} - + - +<../examples/simple_repeater> - + -build_flags = - ${Meshadventurer.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 = - ${Meshadventurer.lib_deps} - ${esp32_ota.lib_deps} - -[env:Meshadventurer_sx1262_companion_radio_usb] -extends = Meshadventurer -build_src_filter = ${Meshadventurer.build_src_filter} - +<../examples/companion_radio/*.cpp> - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -build_flags = - ${Meshadventurer.build_flags} - -I examples/companion_radio/ui-new - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -D MAX_CONTACTS=100 - -D MAX_GROUP_CHANNELS=40 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -lib_deps = - ${Meshadventurer.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Meshadventurer_sx1262_companion_radio_ble] -extends = Meshadventurer -build_src_filter = ${Meshadventurer.build_src_filter} - +<../examples/companion_radio/*.cpp> - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -build_flags = - ${Meshadventurer.build_flags} - -I examples/companion_radio/ui-new - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -D MAX_CONTACTS=100 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 - -D MESH_PACKET_LOGGING=1 - -D MESH_DEBUG=1 -lib_deps = - ${Meshadventurer.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Meshadventurer_sx1262_terminal_chat] -extends = Meshadventurer -build_flags = - ${Meshadventurer.build_flags} - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -D MAX_CONTACTS=100 - -D MAX_GROUP_CHANNELS=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Meshadventurer.build_src_filter} - +<../examples/simple_secure_chat/main.cpp> - + -lib_deps = - ${Meshadventurer.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Meshadventurer_sx1262_room_server] -extends = Meshadventurer -build_flags = - ${Meshadventurer.build_flags} - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -D ADVERT_NAME='"Meshadventurer 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 -build_src_filter = ${Meshadventurer.build_src_filter} - +<../examples/simple_room_server> - + -lib_deps = - ${Meshadventurer.lib_deps} - ${esp32_ota.lib_deps} - -[env:Meshadventurer_sx1268_companion_radio_usb] -extends = Meshadventurer -build_src_filter = ${Meshadventurer.build_src_filter} - +<../examples/companion_radio/*.cpp> - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -build_flags = - ${Meshadventurer.build_flags} - -I examples/companion_radio/ui-new - -D RADIO_CLASS=CustomSX1268 - -D WRAPPER_CLASS=CustomSX1268Wrapper - -D LORA_TX_POWER=22 - -D MAX_CONTACTS=100 - -D MAX_GROUP_CHANNELS=40 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -lib_deps = - ${Meshadventurer.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Meshadventurer_sx1268_companion_radio_ble] -extends = Meshadventurer -build_src_filter = ${Meshadventurer.build_src_filter} - +<../examples/companion_radio/*.cpp> - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -build_flags = - ${Meshadventurer.build_flags} - -I examples/companion_radio/ui-new - -D RADIO_CLASS=CustomSX1268 - -D WRAPPER_CLASS=CustomSX1268Wrapper - -D LORA_TX_POWER=22 - -D MAX_CONTACTS=100 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 - -D MESH_PACKET_LOGGING=1 - -D MESH_DEBUG=1 -lib_deps = - ${Meshadventurer.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Meshadventurer_sx1268_terminal_chat] -extends = Meshadventurer -build_flags = - ${Meshadventurer.build_flags} - -D RADIO_CLASS=CustomSX1268 - -D WRAPPER_CLASS=CustomSX1268Wrapper - -D LORA_TX_POWER=22 - -D MAX_CONTACTS=100 - -D MAX_GROUP_CHANNELS=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Meshadventurer.build_src_filter} - +<../examples/simple_secure_chat/main.cpp> - + -lib_deps = - ${Meshadventurer.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:Meshadventurer_sx1268_room_server] -extends = Meshadventurer -build_flags = - ${Meshadventurer.build_flags} - -D RADIO_CLASS=CustomSX1268 - -D WRAPPER_CLASS=CustomSX1268Wrapper - -D LORA_TX_POWER=22 - -D ADVERT_NAME='"Meshadventurer 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 -build_src_filter = ${Meshadventurer.build_src_filter} - +<../examples/simple_room_server> - + -lib_deps = - ${Meshadventurer.lib_deps} - ${esp32_ota.lib_deps} \ No newline at end of file diff --git a/variants/meshadventurer/target.cpp b/variants/meshadventurer/target.cpp deleted file mode 100644 index 0e3b03f2..00000000 --- a/variants/meshadventurer/target.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include -#include "target.h" - -#include - -MeshadventurerBoard board; - -static SPIClass spi; -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1); -MASensorManager sensors = MASensorManager(nmea); - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - -#if defined(P_LORA_SCLK) - return radio.std_init(&spi); -#else - return radio.std_init(); -#endif -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} - -void MASensorManager::start_gps() { - if(!gps_active) { - MESH_DEBUG_PRINTLN("starting GPS"); - gps_active = true; - } -} - -void MASensorManager::stop_gps() { - if(gps_active) { - MESH_DEBUG_PRINTLN("stopping GPS"); - gps_active = false; - } -} - -bool MASensorManager::begin() { - Serial1.setPins(PIN_GPS_RX, PIN_GPS_TX); - Serial1.begin(9600); - delay(500); - return true; -} - -bool MASensorManager::querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) { - if(requester_permissions & TELEM_PERM_LOCATION) { // does requester have permission? - telemetry.addGPS(TELEM_CHANNEL_SELF, node_lat, node_lon, node_altitude); - } - return true; -} - -void MASensorManager::loop() { - static long next_gps_update = 0; - _location->loop(); - if(millis() > next_gps_update && gps_active) { - if(_location->isValid()) { - node_lat = ((double)_location->getLatitude()) / 1000000.; - node_lon = ((double)_location->getLongitude()) / 1000000.; - node_altitude = ((double)_location->getAltitude()) / 1000.0; - MESH_DEBUG_PRINTLN("lat %f lon %f", node_lat, node_lon); - } - next_gps_update = millis() + 1000; - } -} - -int MASensorManager::getNumSettings() const { return 1; } // just one supported: "gps" (power switch) - -const char* MASensorManager::getSettingName(int i) const { - return i == 0 ? "gps" : NULL; -} -const char* MASensorManager::getSettingValue(int i) const { - if(i == 0) { - return gps_active ? "1" : "0"; - } - return NULL; -} -bool MASensorManager::setSettingValue(const char* name, const char* value) { - if(strcmp(name, "gps") == 0) { - if(strcmp(value, "0") == 0) { - stop_gps(); - } else { - start_gps(); - } - return true; - } - return false; // not supported -} diff --git a/variants/meshadventurer/target.h b/variants/meshadventurer/target.h deleted file mode 100644 index 31bc4066..00000000 --- a/variants/meshadventurer/target.h +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -class MASensorManager : public SensorManager { - bool gps_active = false; - LocationProvider * _location; - - void start_gps(); - void stop_gps(); -public: - MASensorManager(LocationProvider &location): _location(&location) { } - bool begin() override; - bool querySensors(uint8_t requester_permissions, CayenneLPP& telemetry) override; - void loop() override; - int getNumSettings() const override; - const char* getSettingName(int i) const override; - const char* getSettingValue(int i) const override; - bool setSettingValue(const char* name, const char* value) override; -}; - -extern MeshadventurerBoard board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern MASensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/meshadventurer/variant.h b/variants/meshadventurer/variant.h deleted file mode 100644 index 356a3e17..00000000 --- a/variants/meshadventurer/variant.h +++ /dev/null @@ -1,44 +0,0 @@ -// For OLED LCD -#define I2C_SDA 21 -#define I2C_SCL 22 - -// For GPS, 'undef's not needed -#define GPS_TX_PIN 15 -#define GPS_RX_PIN 12 -#define PIN_GPS_EN 4 -#define GPS_POWER_TOGGLE // Moved definition from platformio.ini to here - -#define BUTTON_PIN 39 // The middle button GPIO on the T-Beam -#define BATTERY_PIN 35 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage -#define ADC_CHANNEL ADC1_GPIO35_CHANNEL -#define ADC_MULTIPLIER 2 -#define EXT_PWR_DETECT 4 // Pin to detect connected external power source for LILYGO® TTGO T-Energy T18 and other DIY boards -#define EXT_NOTIFY_OUT 12 // Overridden default pin to use for Ext Notify Module (#975). -#define LED_PIN 2 // add status LED (compatible with core-pcb and DIY targets) - -// Radio -#define USE_SX1262 // E22-900M30S uses SX1262 -#define USE_SX1268 // E22-400M30S uses SX1268 -#define SX126X_MAX_POWER 22 // Outputting 22dBm from SX1262 results in ~30dBm E22-900M30S output (module only uses last stage of the YP2233W PA) -#define SX126X_DIO3_TCXO_VOLTAGE 1.8 // E22 series TCXO reference voltage is 1.8V - -#define SX126X_CS 18 // EBYTE module's NSS pin -#define SX126X_SCK 5 // EBYTE module's SCK pin -#define SX126X_MOSI 27 // EBYTE module's MOSI pin -#define SX126X_MISO 19 // EBYTE module's MISO pin -#define SX126X_RESET 23 // EBYTE module's NRST pin -#define SX126X_BUSY 32 // EBYTE module's BUSY pin -#define SX126X_DIO1 33 // EBYTE module's DIO1 pin - -// The E22's TXEN pin is connected to MCU pin, E22's RXEN pin is connected to MCU pin (allows for ramping up PA before transmission -// Don't define DIO2_AS_RF_SWITCH because we only use DIO2 or an MCU pin mutually exclusively to connect to E22's TXEN (to prevent -// a short if they are both connected at the same time and there's a slight non-neglibible delay and/or voltage difference between -// DIO2 and TXEN). -#define SX126X_TXEN 13 // Schematic connects EBYTE module's TXEN pin to MCU -#define SX126X_RXEN 14 // Schematic connects EBYTE module's RXEN pin to MCU - -#define LORA_CS SX126X_CS // Compatibility with variant file configuration structure -#define LORA_SCK SX126X_SCK // Compatibility with variant file configuration structure -#define LORA_MOSI SX126X_MOSI // Compatibility with variant file configuration structure -#define LORA_MISO SX126X_MISO // Compatibility with variant file configuration structure -#define LORA_DIO1 SX126X_DIO1 // Compatibility with variant file configuration structure diff --git a/variants/minewsemi_me25ls01/MinewsemiME25LS01Board.cpp b/variants/minewsemi_me25ls01/MinewsemiME25LS01Board.cpp deleted file mode 100644 index 0267185c..00000000 --- a/variants/minewsemi_me25ls01/MinewsemiME25LS01Board.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -#include "MinewsemiME25LS01Board.h" - -void MinewsemiME25LS01Board::begin() { - NRF52Board::begin(); - btn_prev_state = HIGH; - - pinMode(PIN_VBAT_READ, INPUT); - -#ifdef BUTTON_PIN - pinMode(BUTTON_PIN, INPUT); - pinMode(LED_PIN, OUTPUT); -#endif - -#if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL) - Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL); -#endif - - Wire.begin(); - -#ifdef P_LORA_TX_LED - pinMode(P_LORA_TX_LED, OUTPUT); - digitalWrite(P_LORA_TX_LED, LOW); -#endif - - delay(10); // give sx1262 some time to power up -} \ No newline at end of file diff --git a/variants/minewsemi_me25ls01/MinewsemiME25LS01Board.h b/variants/minewsemi_me25ls01/MinewsemiME25LS01Board.h deleted file mode 100644 index 805f9dfa..00000000 --- a/variants/minewsemi_me25ls01/MinewsemiME25LS01Board.h +++ /dev/null @@ -1,79 +0,0 @@ -#pragma once - -#include -#include -#include - -// LoRa and SPI pins - -#define P_LORA_DIO_1 (32 + 12) // P1.12 -#define P_LORA_NSS (32 + 13) // P1.13 -#define P_LORA_RESET (32 + 11) // P1.11 -#define P_LORA_BUSY (32 + 10) // P1.10 -#define P_LORA_SCLK (32 + 15) // P1.15 -#define P_LORA_MISO (0 + 29) // P0.29 -#define P_LORA_MOSI (0 + 2) // P0.2 - -#define LR11X0_DIO_AS_RF_SWITCH true -#define LR11X0_DIO3_TCXO_VOLTAGE 1.6 - -#define PIN_VBAT_READ BATTERY_PIN -#define ADC_MULTIPLIER (1.815f) // dependent on voltage divider resistors. TODO: more accurate battery tracking - -class MinewsemiME25LS01Board : public NRF52BoardOTA { -protected: - uint8_t btn_prev_state; - -public: - MinewsemiME25LS01Board() : NRF52BoardOTA("Minewsemi_OTA") {} - void begin(); - -#define BATTERY_SAMPLES 8 - - uint16_t getBattMilliVolts() override { - analogReadResolution(12); - - uint32_t raw = 0; - for (int i = 0; i < BATTERY_SAMPLES; i++) { - raw += analogRead(PIN_VBAT_READ); - } - raw = raw / BATTERY_SAMPLES; - return (ADC_MULTIPLIER * raw); - } - - const char* getManufacturerName() const override { - return "Minewsemi"; - } - - void powerOff() override { - #ifdef HAS_GPS - digitalWrite(GPS_VRTC_EN, LOW); - digitalWrite(GPS_RESET, LOW); - digitalWrite(GPS_SLEEP_INT, LOW); - digitalWrite(GPS_RTC_INT, LOW); - pinMode(GPS_RESETB, OUTPUT); - digitalWrite(GPS_RESETB, LOW); - #endif - - #ifdef BUZZER_EN - digitalWrite(BUZZER_EN, LOW); - #endif - - #ifdef LED_PIN - digitalWrite(LED_PIN, LOW); - #endif - #ifdef BUTTON_PIN - nrf_gpio_cfg_sense_input(digitalPinToInterrupt(BUTTON_PIN), NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_HIGH); - #endif - sd_power_system_off(); - } - - #if defined(P_LORA_TX_LED) - void onBeforeTransmit() override { - digitalWrite(P_LORA_TX_LED, HIGH);// turn TX LED on - } - void onAfterTransmit() override { - digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED off - } -#endif -}; \ No newline at end of file diff --git a/variants/minewsemi_me25ls01/NullDisplayDriver.h b/variants/minewsemi_me25ls01/NullDisplayDriver.h deleted file mode 100644 index 38bf93f1..00000000 --- a/variants/minewsemi_me25ls01/NullDisplayDriver.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include - -class NullDisplayDriver : public DisplayDriver { -public: - NullDisplayDriver() : DisplayDriver(128, 64) { } - bool begin() { return false; } // not present - - bool isOn() override { return false; } - void turnOn() override { } - void turnOff() override { } - void clear() override { } - void startFrame(Color bkg = DARK) override { } - void setTextSize(int sz) override { } - void setColor(Color c) override { } - void setCursor(int x, int y) override { } - void print(const char* str) override { } - void fillRect(int x, int y, int w, int h) override { } - void drawRect(int x, int y, int w, int h) override { } - void drawXbm(int x, int y, const uint8_t* bits, int w, int h) override { } - uint16_t getTextWidth(const char* str) override { return 0; } - void endFrame() { } -}; diff --git a/variants/minewsemi_me25ls01/platformio.ini b/variants/minewsemi_me25ls01/platformio.ini deleted file mode 100644 index fd9c3819..00000000 --- a/variants/minewsemi_me25ls01/platformio.ini +++ /dev/null @@ -1,172 +0,0 @@ -; ----------------- NRF52 me25ls01--------------------- -[nrf52840_me25ls01] -extends = nrf52_base -platform_packages = framework-arduinoadafruitnrf52 -build_flags = ${nrf52_base.build_flags} - -I src/helpers/nrf52 - -I lib/nrf52/s140_nrf52_7.3.0_API/include - -I lib/nrf52/s140_nrf52_7.3.0_API/include/nrf52 -lib_ignore = - BluetoothOTA - lib5b4 -lib_deps = - ${nrf52_base.lib_deps} - rweather/Crypto @ ^0.4.0 - -[me25ls01] -extends = nrf52840_me25ls01 -board = minewsemi_me25ls01 -board_build.ldscript = boards/nrf52840_s140_v7.ld -build_flags = ${nrf52840_me25ls01.build_flags} - -I variants/minewsemi_me25ls01 - -D me25ls01 - -D PIN_USER_BTN=27 - -D USER_BTN_PRESSED=HIGH - -D PIN_STATUS_LED=39 - -D P_LORA_TX_LED=22 - -D RADIO_CLASS=CustomLR1110 - -D WRAPPER_CLASS=CustomLR1110Wrapper - -D LORA_TX_POWER=22 - -D ENV_INCLUDE_GPS=0 - -D ENV_INCLUDE_AHTX0=1 - -D ENV_INCLUDE_BME280=1 - -D ENV_INCLUDE_INA3221=1 - -D ENV_INCLUDE_INA219=1 -build_src_filter = ${nrf52840_me25ls01.build_src_filter} - + - +<../variants/minewsemi_me25ls01> - + -debug_tool = jlink -upload_protocol = nrfutil -lib_deps = ${nrf52840_me25ls01.lib_deps} - densaugeo/base64 @ ~1.4.0 - stevemarple/MicroNMEA @ ^2.0.6 - end2endzone/NonBlockingRTTTL@^1.3.0 - adafruit/Adafruit SSD1306 @ ^2.5.13 - adafruit/Adafruit INA3221 Library @ ^1.0.1 - adafruit/Adafruit INA219 @ ^1.2.3 - adafruit/Adafruit AHTX0 @ ^2.0.5 - adafruit/Adafruit BME280 Library @ ^2.3.0 - -[env:Minewsemi_me25ls01_companion_radio_ble] -extends = me25ls01 -board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld -board_upload.maximum_size = 708608 -build_flags = ${me25ls01.build_flags} - -I examples/companion_radio/ui-orig - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 -; -D BLE_DEBUG_LOGGING=1 - -D MESH_PACKET_LOGGING=1 - -D MESH_DEBUG=1 - -D OFFLINE_QUEUE_SIZE=256 - -D RX_BOOSTED_GAIN=true - -D RF_SWITCH_TABLE - -D DISPLAY_CLASS=NullDisplayDriver - ;-D PIN_BUZZER=25 - ;-D PIN_BUZZER_EN=37 -build_src_filter = ${me25ls01.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> -lib_deps = ${me25ls01.lib_deps} - adafruit/RTClib @ ^2.1.3 - - -[env:Minewsemi_me25ls01_repeater] -extends = me25ls01 -build_flags = ${me25ls01.build_flags} - -D MAX_CONTACTS=100 - -D MAX_GROUP_CHANNELS=8 - -D BLE_PIN_CODE=123456 -; -D BLE_DEBUG_LOGGING=1 - -D MESH_PACKET_LOGGING=1 - -D MESH_DEBUG=1 - -D OFFLINE_QUEUE_SIZE=256 - -D RX_BOOSTED_GAIN=true - -D RF_SWITCH_TABLE - -D ADVERT_NAME='"ME25LS01 Repeater"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D MAX_NEIGHBOURS=50 - -D DISPLAY_CLASS=NullDisplayDriver -build_src_filter = ${me25ls01.build_src_filter} - +<../examples/simple_repeater> -lib_deps = ${me25ls01.lib_deps} - adafruit/RTClib @ ^2.1.3 - - - -[env:Minewsemi_me25ls01_room_server] -extends = me25ls01 -build_flags = ${me25ls01.build_flags} - -D MAX_CONTACTS=100 - -D MAX_GROUP_CHANNELS=8 -; -D BLE_PIN_CODE=123456 -; -D BLE_DEBUG_LOGGING=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 - -D OFFLINE_QUEUE_SIZE=256 - -D RX_BOOSTED_GAIN=true - -D RF_SWITCH_TABLE - -D ADVERT_NAME='"ME25LS01 Room"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D ROOM_PASSWORD='"hello"' - -D MAX_NEIGHBOURS=50 - -D DISPLAY_CLASS=NullDisplayDriver -build_src_filter = ${me25ls01.build_src_filter} - +<../examples/simple_room_server> -lib_deps = ${me25ls01.lib_deps} - adafruit/RTClib @ ^2.1.3 - -[env:Minewsemi_me25ls01_terminal_chat] -extends = me25ls01 -build_flags = ${me25ls01.build_flags} - -D MAX_CONTACTS=100 - -D MAX_GROUP_CHANNELS=8 - -D BLE_PIN_CODE=123456 -; -D BLE_DEBUG_LOGGING=1 - -D MESH_PACKET_LOGGING=1 - -D MESH_DEBUG=1 - -D OFFLINE_QUEUE_SIZE=256 - -D RX_BOOSTED_GAIN=true - -D RF_SWITCH_TABLE - -D ADVERT_NAME='"ME25LS01 Chat"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D ROOM_PASSWORD='"hello"' - -D MAX_NEIGHBOURS=50 - -D DISPLAY_CLASS=NullDisplayDriver -build_src_filter = ${me25ls01.build_src_filter} - +<../examples/simple_secure_chat/main.cpp> -lib_deps = ${me25ls01.lib_deps} - adafruit/RTClib @ ^2.1.3 - -[env:Minewsemi_me25ls01_companion_radio_usb] -extends = me25ls01 -board_build.ldscript = boards/nrf52840_s140_v7_extrafs.ld -board_upload.maximum_size = 708608 -build_flags = ${me25ls01.build_flags} - -I examples/companion_radio/ui-orig - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - ;-D BLE_PIN_CODE=123456 -; -D BLE_DEBUG_LOGGING=1 - -D MESH_PACKET_LOGGING=1 - -D MESH_DEBUG=1 - -D OFFLINE_QUEUE_SIZE=256 - -D RX_BOOSTED_GAIN=true - -D RF_SWITCH_TABLE - -D DISPLAY_CLASS=NullDisplayDriver -build_src_filter = ${me25ls01.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> -lib_deps = ${me25ls01.lib_deps} - adafruit/RTClib @ ^2.1.3 - diff --git a/variants/minewsemi_me25ls01/target.cpp b/variants/minewsemi_me25ls01/target.cpp deleted file mode 100644 index 13306762..00000000 --- a/variants/minewsemi_me25ls01/target.cpp +++ /dev/null @@ -1,98 +0,0 @@ -#include -#include "target.h" - -MinewsemiME25LS01Board board; - -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); - -WRAPPER_CLASS radio_driver(radio, board); - -VolatileRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; -#if ENV_INCLUDE_GPS - #include - MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1, &rtc_clock); - EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea); -#else - EnvironmentSensorManager sensors; -#endif - -#ifdef DISPLAY_CLASS - NullDisplayDriver display; -#endif - -#ifndef LORA_CR - #define LORA_CR 5 -#endif - -#ifdef RF_SWITCH_TABLE -static const uint32_t rfswitch_dios[Module::RFSWITCH_MAX_PINS] = { - RADIOLIB_LR11X0_DIO5, - RADIOLIB_LR11X0_DIO6, - RADIOLIB_LR11X0_DIO7, - RADIOLIB_LR11X0_DIO8, - RADIOLIB_NC -}; - -static const Module::RfSwitchMode_t rfswitch_table[] = { - // mode DIO5 DIO6 DIO7 DIO8 - { LR11x0::MODE_STBY, {LOW, LOW, LOW, LOW }}, - { LR11x0::MODE_RX, {HIGH, LOW, LOW, HIGH }}, - { LR11x0::MODE_TX, {HIGH, HIGH, LOW, HIGH }}, - { LR11x0::MODE_TX_HP, {LOW, HIGH, LOW, HIGH }}, - { LR11x0::MODE_TX_HF, {LOW, LOW, LOW, LOW }}, - { LR11x0::MODE_GNSS, {LOW, LOW, HIGH, LOW }}, - { LR11x0::MODE_WIFI, {LOW, LOW, LOW, LOW }}, - END_OF_MODE_TABLE, -}; -#endif - -bool radio_init() { - //rtc_clock.begin(Wire); - -#ifdef LR11X0_DIO3_TCXO_VOLTAGE - float tcxo = LR11X0_DIO3_TCXO_VOLTAGE; -#else - float tcxo = 1.6f; -#endif - - SPI.setPins(P_LORA_MISO, P_LORA_SCLK, P_LORA_MOSI); - SPI.begin(); - int status = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, RADIOLIB_LR11X0_LORA_SYNC_WORD_PRIVATE, LORA_TX_POWER, 16, tcxo); - if (status != RADIOLIB_ERR_NONE) { - Serial.print("ERROR: radio init failed: "); - Serial.println(status); - return false; // fail - } - - radio.setCRC(1); - -#ifdef RF_SWITCH_TABLE - radio.setRfSwitchTable(rfswitch_dios, rfswitch_table); -#endif -#ifdef RX_BOOSTED_GAIN - radio.setRxBoostedGainMode(RX_BOOSTED_GAIN); -#endif - - return true; // success -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} \ No newline at end of file diff --git a/variants/minewsemi_me25ls01/target.h b/variants/minewsemi_me25ls01/target.h deleted file mode 100644 index a5da5823..00000000 --- a/variants/minewsemi_me25ls01/target.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include "NullDisplayDriver.h" -#endif - -#ifdef DISPLAY_CLASS - extern NullDisplayDriver display; -#endif - -extern MinewsemiME25LS01Board board; -extern WRAPPER_CLASS radio_driver; -extern VolatileRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/minewsemi_me25ls01/variant.cpp b/variants/minewsemi_me25ls01/variant.cpp deleted file mode 100644 index 5dbac9d3..00000000 --- a/variants/minewsemi_me25ls01/variant.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include "variant.h" -#include "wiring_constants.h" -#include "wiring_digital.h" - -const uint32_t g_ADigitalPinMap[PINS_COUNT + 1] = -{ - 0, // P0.00 - 1, // P0.01 - 2, // P0.02 - 3, // P0.03 - 4, // P0.04 - 5, // P0.05 - 6, // P0.06 - 7, // P0.07 - 8, // P0.08 - 9, // P0.09 - 10, // P0.10 - 11, // P0.11 - 12, // P0.12 - 13, // P0.13, PIN_SERIAL1_TX - 14, // P0.14, PIN_SERIAL1_RX - 15, // P0.15, PIN_SERIAL2_RX - 16, // P0.16, PIN_WIRE_SCL - 17, // P0.17, PIN_SERIAL2_TX - 18, // P0.18 - 19, // P0.19 - 20, // P0.20 - 21, // P0.21, PIN_WIRE_SDA - 22, // P0.22 - 23, // P0.23 - 24, // P0.24, - 25, // P0.25, - 26, // P0.26, - 27, // P0.27, - 28, // P0.28 - 29, // P0.29, - 30, // P0.30 - 31, // P0.31, BATTERY_PIN - 32, // P1.00 - 33, // P1.01, LORA_DIO_1 - 34, // P1.02 - 35, // P1.03, - 36, // P1.04 - 37, // P1.05, LR1110_EN - 38, // P1.06, - 39, // P1.07, - 40, // P1.08, PIN_SPI_MISO - 41, // P1.09, PIN_SPI_MOSI - 42, // P1.10, LORA_RESET - 43, // P1.11, GPS_EN - 44, // P1.12, GPS_SLEEP_INT - 45, // P1.13 - 46, // P1.14, GPS_RESETB - 47, // P1.15, PIN_GPS_RESET - 255, // NRFX_SPIM_PIN_NOT_USED -}; - -void initVariant() -{ - pinMode(BATTERY_PIN, INPUT); - pinMode(PIN_BUTTON1, INPUT); - - // pinMode(PIN_3V3_EN, OUTPUT); - // pinMode(PIN_3V3_ACC_EN, OUTPUT); - pinMode(LED_PIN, OUTPUT); - pinMode(P_LORA_TX_LED, OUTPUT); - - digitalWrite(LED_PIN, HIGH); - digitalWrite(P_LORA_TX_LED, LOW); -} diff --git a/variants/minewsemi_me25ls01/variant.h b/variants/minewsemi_me25ls01/variant.h deleted file mode 100644 index a8bbbe3a..00000000 --- a/variants/minewsemi_me25ls01/variant.h +++ /dev/null @@ -1,94 +0,0 @@ -#pragma once - -#include "WVariant.h" - -// Low frequency clock source -#define USE_LFXO // 32.768 kHz crystal oscillator -#define VARIANT_MCK (64000000ul) -// #define USE_LFRC // 32.768 kHz RC oscillator - -// Power -#define BATTERY_PIN (31) -#define BATTERY_IMMUTABLE -#define ADC_MULTIPLIER (2.0F) - -#define ADC_RESOLUTION (14) -#define BATTERY_SENSE_RES (12) - -// Number of pins -#define PINS_COUNT (48) -#define NUM_DIGITAL_PINS (48) -#define NUM_ANALOG_INPUTS (6) -#define NUM_ANALOG_OUTPUTS (0) - -// UART pin definition -#define PIN_SERIAL1_RX (14) // P0.14 -#define PIN_SERIAL1_TX (13) // P0.13 - -#define PIN_SERIAL2_RX (15) // P0.15 -#define PIN_SERIAL2_TX (17) // P0.17 - -// I2C pin definition -#define HAS_WIRE (1) -#define WIRE_INTERFACES_COUNT (1) - -#define PIN_WIRE_SDA (21) // P0.21 -#define PIN_WIRE_SCL (16) // P0.16 -#define I2C_NO_RESCAN - -// SPI pin definition -#define SPI_INTERFACES_COUNT (1) - -#define PIN_SPI_MISO (0 + 29) // P0.29 -#define PIN_SPI_MOSI (0 + 2) // P0.2 -#define PIN_SPI_SCK (32 + 15) // P1.15 -#define PIN_SPI_NSS (32 + 13) // P1.13 - -// Builtin LEDs -#define LED_BUILTIN (-1) -#define LED_RED (32 + 5) // P1.5 -#define LED_BLUE (32 + 7) // P1.7 -#define LED_PIN LED_BLUE -#define P_LORA_TX_LED LED_RED - -#define LED_STATE_ON HIGH - -// Builtin buttons - -#define PIN_BUTTON1 (0 + 27) // P0.6 -#define BUTTON_PIN PIN_BUTTON1 - -// LR1110 -#define LORA_DIO_1 (32 + 12) // P1.12 -#define LORA_DIO_2 (32 + 10) // P1.10 -#define LORA_NSS (PIN_SPI_NSS) // P1.13 -#define LORA_RESET (32 + 11) // P1.11 -#define LORA_BUSY (32 + 10) // P1.10 -#define LORA_SCLK (PIN_SPI_SCK) // P1.15 -#define LORA_MISO (PIN_SPI_MISO) // P0.29 -#define LORA_MOSI (PIN_SPI_MOSI) // P0.2 -#define LORA_CS PIN_SPI_NSS // P1.13 - -#define LR11X0_DIO_AS_RF_SWITCH true -#define LR11X0_DIO3_TCXO_VOLTAGE 1.6 - -#define LR1110_IRQ_PIN LORA_DIO_1 -#define LR1110_NRESET_PIN LORA_RESET -#define LR1110_BUSY_PIN LORA_DIO_2 -#define LR1110_SPI_NSS_PIN LORA_CS -#define LR1110_SPI_SCK_PIN LORA_SCLK -#define LR1110_SPI_MOSI_PIN LORA_MOSI -#define LR1110_SPI_MISO_PIN LORA_MISO - -// GPS -#define HAS_GPS 0 -#define GPS_RX_PIN PIN_SERIAL1_RX -#define GPS_TX_PIN PIN_SERIAL1_TX - -#define GPS_EN (-1) // P1.11 -#define GPS_RESET (-1) // P1.15 - -#define GPS_VRTC_EN (-1) // P0.8 -#define GPS_SLEEP_INT (-1) // P1.12 -#define GPS_RTC_INT (-1) // P0.15 -#define GPS_RESETB (-1) // P1.14 diff --git a/variants/nano_g2_ultra/nano-g2.cpp b/variants/nano_g2_ultra/nano-g2.cpp deleted file mode 100644 index 6a749aab..00000000 --- a/variants/nano_g2_ultra/nano-g2.cpp +++ /dev/null @@ -1,103 +0,0 @@ -#include -#include "nano-g2.h" - -#ifdef NANO_G2_ULTRA - -#include -#include - -static BLEDfu bledfu; - -static void connect_callback(uint16_t conn_handle) -{ - (void)conn_handle; - MESH_DEBUG_PRINTLN("BLE client connected"); -} - -static void disconnect_callback(uint16_t conn_handle, uint8_t reason) -{ - (void)conn_handle; - (void)reason; - - MESH_DEBUG_PRINTLN("BLE client disconnected"); -} - -void NanoG2Ultra::begin() -{ - NRF52Board::begin(); - - // set user button - pinMode(PIN_BUTTON1, INPUT); - - // the external notification circuit is shared for both buzzer and led - pinMode(EXT_NOTIFY_OUT, OUTPUT); - digitalWrite(EXT_NOTIFY_OUT, LOW); - - pinMode(GPS_EN, OUTPUT); // Initialize GPS power pin - - Wire.begin(); - pinMode(SX126X_POWER_EN, OUTPUT); - digitalWrite(SX126X_POWER_EN, HIGH); - - delay(10); -} - -uint16_t NanoG2Ultra::getBattMilliVolts() -{ - int adcvalue = 0; - - analogReference(AR_INTERNAL_3_0); - analogReadResolution(12); - delay(10); - - // ADC range is 0..3000mV and resolution is 12-bit (0..4095) - adcvalue = analogRead(PIN_VBAT_READ); - // Convert the raw value to compensated mv, taking the resistor- - // divider into account (providing the actual LIPO voltage) - return (uint16_t)((float)adcvalue * REAL_VBAT_MV_PER_LSB); -} - -bool NanoG2Ultra::startOTAUpdate(const char *id, char reply[]) -{ - // Config the peripheral connection with maximum bandwidth - // more SRAM required by SoftDevice - // Note: All config***() function must be called before begin() - Bluefruit.configPrphBandwidth(BANDWIDTH_MAX); - Bluefruit.configPrphConn(92, BLE_GAP_EVENT_LENGTH_MIN, 16, 16); - - Bluefruit.begin(1, 0); - // Set max power. Accepted values are: -40, -30, -20, -16, -12, -8, -4, 0, 4 - Bluefruit.setTxPower(4); - // Set the BLE device name - Bluefruit.setName("NANO_G2_OTA"); - - Bluefruit.Periph.setConnectCallback(connect_callback); - Bluefruit.Periph.setDisconnectCallback(disconnect_callback); - - // To be consistent OTA DFU should be added first if it exists - bledfu.begin(); - - // Set up and start advertising - // Advertising packet - Bluefruit.Advertising.addFlags(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE); - Bluefruit.Advertising.addTxPower(); - Bluefruit.Advertising.addName(); - - /* Start Advertising - - Enable auto advertising if disconnected - - Interval: fast mode = 20 ms, slow mode = 152.5 ms - - Timeout for fast mode is 30 seconds - - Start(timeout) with timeout = 0 will advertise forever (until connected) - - For recommended advertising interval - https://developer.apple.com/library/content/qa/qa1931/_index.html - */ - Bluefruit.Advertising.restartOnDisconnect(true); - Bluefruit.Advertising.setInterval(32, 244); // in unit of 0.625 ms - Bluefruit.Advertising.setFastTimeout(30); // number of seconds in fast mode - Bluefruit.Advertising.start(0); // 0 = Don't stop advertising after n seconds - - strcpy(reply, "OK - started"); - return true; -} -#endif diff --git a/variants/nano_g2_ultra/nano-g2.h b/variants/nano_g2_ultra/nano-g2.h deleted file mode 100644 index 6961fc86..00000000 --- a/variants/nano_g2_ultra/nano-g2.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include "variant.h" - -#include -#include -#include - -// LoRa radio module pins -#define P_LORA_DIO_1 (32 + 10) -#define P_LORA_NSS (32 + 13) -#define P_LORA_RESET (32 + 15) -#define P_LORA_BUSY (32 + 11) -#define P_LORA_SCLK (0 + 12) -#define P_LORA_MISO (32 + 9) -#define P_LORA_MOSI (0 + 11) - -#define SX126X_DIO2_AS_RF_SWITCH true -#define SX126X_DIO3_TCXO_VOLTAGE 1.8 -#define SX126X_POWER_EN 37 - -// buttons -#define PIN_BUTTON1 (32 + 6) -#define BUTTON_PIN PIN_BUTTON1 -#define PIN_USER_BTN BUTTON_PIN - -// GPS -#define GPS_EN PIN_GPS_STANDBY -// built-ins -#define VBAT_MV_PER_LSB (0.73242188F) // 3.0V ADC range and 12-bit ADC resolution = 3000mV/4096 - -#define VBAT_DIVIDER (0.5F) // 150K + 150K voltage divider on VBAT, actually 100K + 100K -#define VBAT_DIVIDER_COMP (2.0F) // Compensation factor for the VBAT divider - -#define PIN_VBAT_READ (0 + 2) -#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB) - -class NanoG2Ultra : public NRF52Board { -public: - void begin(); - uint16_t getBattMilliVolts() override; - bool startOTAUpdate(const char *id, char reply[]) override; - - const char *getManufacturerName() const override { return "Nano G2 Ultra"; } - - void powerOff() override { - // put GPS chip to sleep - digitalWrite(PIN_GPS_STANDBY, LOW); - // TODO: unset buzzer to prevent notification circuit activating on hibernate - // needs to be set as silent or somehow stop using macros for pins - - nrf_gpio_cfg_sense_input(digitalPinToInterrupt(PIN_USER_BTN), NRF_GPIO_PIN_NOPULL, - NRF_GPIO_PIN_SENSE_LOW); - - sd_power_system_off(); - } -}; diff --git a/variants/nano_g2_ultra/platformio.ini b/variants/nano_g2_ultra/platformio.ini deleted file mode 100644 index 116a1f25..00000000 --- a/variants/nano_g2_ultra/platformio.ini +++ /dev/null @@ -1,93 +0,0 @@ -[nrf52840_g2_ultra] -extends = nrf52_base -platform_packages = framework-arduinoadafruitnrf52 -build_flags = ${nrf52_base.build_flags} - -I src/helpers/nrf52 - -I lib/nrf52/s140_nrf52_6.1.1_API/include - -I lib/nrf52/s140_nrf52_6.1.1_API/include/nrf52 -lib_deps = - ${nrf52_base.lib_deps} - rweather/Crypto @ ^0.4.0 - lewisxhe/PCF8563_Library@^1.0.1 - -[Nano_G2_Ultra] -extends = nrf52840_g2_ultra -board = nano-g2-ultra -board_build.ldscript = boards/nrf52840_s140_v6.ld -build_flags = ${nrf52840_g2_ultra.build_flags} - -I variants/nano_g2_ultra - -D NANO_G2_ULTRA - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -D SX126X_CURRENT_LIMIT=140 - -D SX126X_RX_BOOSTED_GAIN=1 - -D PIN_USER_BTN=38 -build_src_filter = ${nrf52840_g2_ultra.build_src_filter} - + - +<../variants/nano_g2_ultra> -debug_tool = jlink -upload_protocol = nrfutil - -[env:Nano_G2_Ultra_companion_radio_ble] -extends = Nano_G2_Ultra -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = - ${Nano_G2_Ultra.build_flags} - -I src/helpers/ui - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 -; -D BLE_DEBUG_LOGGING=0 - -D OFFLINE_QUEUE_SIZE=256 - -D DISPLAY_CLASS=SH1106Display - -D PIN_BUZZER=4 - -D QSPIFLASH=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Nano_G2_Ultra.build_src_filter} - + - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Nano_G2_Ultra.lib_deps} - densaugeo/base64 @ ~1.4.0 - adafruit/Adafruit SH110X @ ~2.1.13 - adafruit/Adafruit GFX Library @ ^1.12.1 - stevemarple/MicroNMEA @ ^2.0.6 - end2endzone/NonBlockingRTTTL@^1.3.0 - -[env:Nano_G2_Ultra_companion_radio_usb] -extends = Nano_G2_Ultra -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = - ${Nano_G2_Ultra.build_flags} - -I src/helpers/ui - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D QSPIFLASH=1 - -D OFFLINE_QUEUE_SIZE=256 - -D DISPLAY_CLASS=SH1106Display - -D PIN_BUZZER=4 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Nano_G2_Ultra.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${Nano_G2_Ultra.lib_deps} - densaugeo/base64 @ ~1.4.0 - adafruit/Adafruit SH110X @ ~2.1.13 - adafruit/Adafruit GFX Library @ ^1.12.1 - stevemarple/MicroNMEA @ ^2.0.6 - end2endzone/NonBlockingRTTTL@^1.3.0 diff --git a/variants/nano_g2_ultra/target.cpp b/variants/nano_g2_ultra/target.cpp deleted file mode 100644 index 81e7744f..00000000 --- a/variants/nano_g2_ultra/target.cpp +++ /dev/null @@ -1,143 +0,0 @@ -#include "target.h" - -#include -#include -#include - -NanoG2Ultra board; - -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); - -WRAPPER_CLASS radio_driver(radio, board); - -VolatileRTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1); -NanoG2UltraSensorManager sensors = NanoG2UltraSensorManager(nmea); - -#ifdef DISPLAY_CLASS -DISPLAY_CLASS display; -MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -bool radio_init() { - rtc_clock.begin(Wire); - return radio.std_init(&SPI); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -void NanoG2UltraSensorManager::start_gps() { - MESH_DEBUG_PRINTLN("Starting GPS"); - if (!gps_active) { - digitalWrite(PIN_GPS_STANDBY, HIGH); // Wake GPS from standby - Serial1.setPins(PIN_GPS_TX, PIN_GPS_RX); - Serial1.begin(9600); - MESH_DEBUG_PRINTLN("Waiting for gps to power up"); - delay(1000); - gps_active = true; - } - _location->begin(); -} - -void NanoG2UltraSensorManager::stop_gps() { - MESH_DEBUG_PRINTLN("Stopping GPS"); - if (gps_active) { - digitalWrite(PIN_GPS_STANDBY, LOW); // sleep GPS - gps_active = false; - } - _location->stop(); -} - -bool NanoG2UltraSensorManager::begin() { - digitalWrite(PIN_GPS_STANDBY, HIGH); // Wake GPS from standby - Serial1.setPins(PIN_GPS_TX, PIN_GPS_RX); - Serial1.begin(9600); - MESH_DEBUG_PRINTLN("Checking GPS switch state"); - delay(1000); - - // Check initial switch state to determine if GPS should be active - if (Serial1.available() > 0) { - MESH_DEBUG_PRINTLN("GPS was on at boot, GPS enabled"); - start_gps(); - } else { - MESH_DEBUG_PRINTLN("GPS was not on at boot, GPS disabled"); - } - - return true; -} - -bool NanoG2UltraSensorManager::querySensors(uint8_t requester_permissions, CayenneLPP &telemetry) { - if (requester_permissions & TELEM_PERM_LOCATION) { // does requester have permission? - telemetry.addGPS(TELEM_CHANNEL_SELF, node_lat, node_lon, node_altitude); - } - return true; -} - -void NanoG2UltraSensorManager::loop() { - static long next_gps_update = 0; - - if (!gps_active) { - return; // GPS is not active, skip further processing - } - - _location->loop(); - - if (millis() > next_gps_update) { - if (_location->isValid()) { - node_lat = ((double)_location->getLatitude()) / 1000000.; - node_lon = ((double)_location->getLongitude()) / 1000000.; - node_altitude = ((double)_location->getAltitude()) / 1000.0; - MESH_DEBUG_PRINTLN("VALID location: lat %f lon %f", node_lat, node_lon); - } else { - MESH_DEBUG_PRINTLN("INVALID location, waiting for fix"); - } - MESH_DEBUG_PRINTLN("GPS satellites: %d", _location->satellitesCount()); - next_gps_update = millis() + 1000; - } -} - -int NanoG2UltraSensorManager::getNumSettings() const { - return 1; -} // just one supported: "gps" (power switch) - -const char *NanoG2UltraSensorManager::getSettingName(int i) const { - return i == 0 ? "gps" : NULL; -} - -const char *NanoG2UltraSensorManager::getSettingValue(int i) const { - if (i == 0) { - return gps_active ? "1" : "0"; - } - return NULL; -} - -bool NanoG2UltraSensorManager::setSettingValue(const char *name, const char *value) { - if (strcmp(name, "gps") == 0) { - if (strcmp(value, "0") == 0) { - stop_gps(); - } else { - start_gps(); - } - return true; - } - return false; // not supported -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/nano_g2_ultra/target.h b/variants/nano_g2_ultra/target.h deleted file mode 100644 index 3e58b900..00000000 --- a/variants/nano_g2_ultra/target.h +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include "nano-g2.h" - -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS -#include -#include -#endif -#include - -class NanoG2UltraSensorManager : public SensorManager { - bool gps_active = false; - LocationProvider *_location; - - void start_gps(); - void stop_gps(); - -public: - NanoG2UltraSensorManager(LocationProvider &location) : _location(&location) {} - bool begin() override; - bool querySensors(uint8_t requester_permissions, CayenneLPP &telemetry) override; - void loop() override; - int getNumSettings() const override; - const char *getSettingName(int i) const override; - const char *getSettingValue(int i) const override; - bool setSettingValue(const char *name, const char *value) override; -}; - -extern NanoG2Ultra board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern NanoG2UltraSensorManager sensors; - -#ifdef DISPLAY_CLASS -extern DISPLAY_CLASS display; -extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/nano_g2_ultra/variant.cpp b/variants/nano_g2_ultra/variant.cpp deleted file mode 100644 index 4ad554cd..00000000 --- a/variants/nano_g2_ultra/variant.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (c) 2014-2015 Arduino LLC. All right reserved. - Copyright (c) 2016 Sandeep Mistry All right reserved. - Copyright (c) 2018, Adafruit Industries (adafruit.com) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "variant.h" -#include "nrf.h" -#include "wiring_constants.h" -#include "wiring_digital.h" - -const uint32_t g_ADigitalPinMap[] = { - // P0 - pins 0 and 1 are hardwired for xtal and should never be enabled - 0xff, 0xff, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - - // P1 - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47}; - -void initVariant() -{ - // Nothing need to be inited for now -} \ No newline at end of file diff --git a/variants/nano_g2_ultra/variant.h b/variants/nano_g2_ultra/variant.h deleted file mode 100644 index b8a53fcf..00000000 --- a/variants/nano_g2_ultra/variant.h +++ /dev/null @@ -1,193 +0,0 @@ -/* - Copyright (c) 2014-2015 Arduino LLC. All right reserved. - Copyright (c) 2016 Sandeep Mistry All right reserved. - Copyright (c) 2018, Adafruit Industries (adafruit.com) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef _VARIANT_Nano_G2_ -#define _VARIANT_Nano_G2_ - -/** Master clock frequency */ -#define VARIANT_MCK (64000000ul) - -#define USE_LFXO // Board uses 32khz crystal for LF -// #define USE_LFRC // Board uses 32khz RC for LF - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "WVariant.h" - -#ifdef __cplusplus -extern "C" -{ -#endif // __cplusplus - -// Number of pins defined in PinDescription array -#define PINS_COUNT (48) -#define NUM_DIGITAL_PINS (48) -#define NUM_ANALOG_INPUTS (1) -#define NUM_ANALOG_OUTPUTS (0) - -// LEDs -#define PIN_LED1 (-1) -#define PIN_LED2 (-1) -#define PIN_LED3 (-1) - -#define LED_RED PIN_LED3 -#define LED_BLUE PIN_LED1 -#define LED_GREEN PIN_LED2 - -#define LED_BUILTIN LED_BLUE -#define LED_CONN PIN_GREEN - -#define LED_STATE_ON 0 // State when LED is lit - -/* - * Buttons - */ -#define PIN_BUTTON1 (32 + 6) - -#define EXT_NOTIFY_OUT (0 + 4) // Default pin to use for Ext Notify Module. - -/* - * Analog pins - */ -#define PIN_A4 (0 + 2) // Battery ADC - -#define BATTERY_PIN PIN_A4 - - static const uint8_t A4 = PIN_A4; - -#define ADC_RESOLUTION 14 - -/* - * Serial interfaces - */ -#define PIN_SERIAL2_RX (0 + 22) -#define PIN_SERIAL2_TX (0 + 20) - -/** - Wire Interfaces - */ -#define WIRE_INTERFACES_COUNT 1 - -#define PIN_WIRE_SDA (0 + 17) -#define PIN_WIRE_SCL (0 + 15) - -#define PIN_RTC_INT (0 + 14) // Interrupt from the PCF8563 RTC - -/* -External serial flash W25Q16JV_IQ -*/ - -// QSPI Pins -#define PIN_QSPI_SCK (0 + 8) -#define PIN_QSPI_CS (32 + 7) -#define PIN_QSPI_IO0 (0 + 6) // MOSI if using two bit interface -#define PIN_QSPI_IO1 (0 + 26) // MISO if using two bit interface -#define PIN_QSPI_IO2 (32 + 4) // WP if using two bit interface (i.e. not used) -#define PIN_QSPI_IO3 (32 + 2) // HOLD if using two bit interface (i.e. not used) - -// On-board QSPI Flash -#define EXTERNAL_FLASH_DEVICES W25Q16JV_IQ -#define EXTERNAL_FLASH_USE_QSPI - - /* - * Lora radio - */ - -#define USE_SX1262 -#define SX126X_CS (32 + 13) // FIXME - we really should define LORA_CS instead -#define SX126X_DIO1 (32 + 10) -// Note DIO2 is attached internally to the module to an analog switch for TX/RX switching -// #define SX1262_DIO3 (0 + 21) -// This is used as an *output* from the sx1262 and connected internally to power the tcxo, do not drive from the main CPU? -#define SX126X_BUSY (32 + 11) -#define SX126X_RESET (32 + 15) -// DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3 -#define SX126X_DIO2_AS_RF_SWITCH -#define SX126X_DIO3_TCXO_VOLTAGE 1.8 - - // #define LORA_DISABLE_SENDING // Define this to disable transmission for testing (power testing etc...) - - // #undef SX126X_CS - - /* - * GPS pins - */ - -#define HAS_GPS 1 -#define GPS_L76K - -#define PIN_GPS_STANDBY (0 + 13) // An output to wake GPS, low means allow sleep, high means force wake STANDBY -#define PIN_GPS_TX (0 + 9) // This is for bits going TOWARDS the CPU -#define PIN_GPS_RX (0 + 10) // This is for bits going TOWARDS the GPS -#define GPS_RX_PIN PIN_GPS_RX -#define GPS_TX_PIN PIN_GPS_TX - - - // #define GPS_THREAD_INTERVAL 50 - -#define PIN_SERIAL1_RX PIN_GPS_TX -#define PIN_SERIAL1_TX PIN_GPS_RX - -// PCF8563 RTC Module -#define PCF8563_RTC 0x51 - -/* - * SPI Interfaces - */ -#define SPI_INTERFACES_COUNT 1 - -// For LORA, spi 0 -#define PIN_SPI_MISO (32 + 9) -#define PIN_SPI_MOSI (0 + 11) -#define PIN_SPI_SCK (0 + 12) - -// #define PIN_PWR_EN (0 + 6) - -// To debug via the segger JLINK console rather than the CDC-ACM serial device -// #define USE_SEGGER - -// Battery -// The battery sense is hooked to pin A0 (2) -// it is defined in the anlaolgue pin section of this file -// and has 12 bit resolution -#define BATTERY_SENSE_RESOLUTION_BITS 12 -#define BATTERY_SENSE_RESOLUTION 4096.0 -#undef AREF_VOLTAGE -#define AREF_VOLTAGE 3.0 -#define VBAT_AR_INTERNAL AR_INTERNAL_3_0 -#define ADC_MULTIPLIER (2.0F) - -#define HAS_RTC 1 - -/** - OLED Screen Model - */ -#define ARDUINO_ARCH_AVR -#define USE_SH1107_128_64 - -#ifdef __cplusplus -} -#endif - -/*---------------------------------------------------------------------------- - * Arduino objects - C++ only - *----------------------------------------------------------------------------*/ - -#endif \ No newline at end of file diff --git a/variants/nibble_screen_connect/platformio.ini b/variants/nibble_screen_connect/platformio.ini deleted file mode 100644 index 0d3d4652..00000000 --- a/variants/nibble_screen_connect/platformio.ini +++ /dev/null @@ -1,160 +0,0 @@ -[nibble_screen_connect_base] -extends = esp32_base -board = esp32-s3-zero -build_flags = - ${esp32_base.build_flags} - -I variants/nibble_screen_connect - -D NIBBLE_SCREEN_CONNECT - -D P_LORA_DIO_1=4 - -D P_LORA_NSS=10 - -D P_LORA_RESET=6 - -D P_LORA_BUSY=5 - -D P_LORA_SCLK=13 - -D P_LORA_MISO=12 - -D P_LORA_MOSI=11 - -D PIN_USER_BTN=1 - -D PIN_BOARD_SDA=8 - -D PIN_BOARD_SCL=7 - -D HAS_NEOPIXEL - -D NEOPIXEL_COUNT=1 - -D NEOPIXEL_DATA=21 - -D NEOPIXEL_TYPE=(NEO_GRB+NEO_KHZ800) - -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/nibble_screen_connect> -lib_deps = - ${esp32_base.lib_deps} - adafruit/Adafruit SSD1306 @ ^2.5.13 - adafruit/Adafruit NeoPixel @ ^1.12.3 - -[env:nibble_screen_connect_repeater] -extends = nibble_screen_connect_base -build_flags = - ${nibble_screen_connect_base.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -D ADVERT_NAME='"Nibble Repeater"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D MAX_NEIGHBOURS=50 -build_src_filter = ${nibble_screen_connect_base.build_src_filter} - + - +<../examples/simple_repeater> -lib_deps = - ${nibble_screen_connect_base.lib_deps} - ${esp32_ota.lib_deps} - -[env:nibble_screen_connect_repeater_bridge_espnow] -extends = nibble_screen_connect_base -build_flags = - ${nibble_screen_connect_base.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -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 -build_src_filter = ${nibble_screen_connect_base.build_src_filter} - + - + - +<../examples/simple_repeater> -lib_deps = - ${nibble_screen_connect_base.lib_deps} - ${esp32_ota.lib_deps} - -[env:nibble_screen_connect_terminal_chat] -extends = nibble_screen_connect_base -build_flags = - ${nibble_screen_connect_base.build_flags} - -D MAX_CONTACTS=300 - -D MAX_GROUP_CHANNELS=1 -build_src_filter = ${nibble_screen_connect_base.build_src_filter} - +<../examples/simple_secure_chat/main.cpp> -lib_deps = - ${nibble_screen_connect_base.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:nibble_screen_connect_room_server] -extends = nibble_screen_connect_base -build_flags = - ${nibble_screen_connect_base.build_flags} - -D DISPLAY_CLASS=SSD1306Display - -D ADVERT_NAME='"Nibble Room"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D ROOM_PASSWORD='"hello"' -build_src_filter = ${nibble_screen_connect_base.build_src_filter} - + - +<../examples/simple_room_server> -lib_deps = - ${nibble_screen_connect_base.lib_deps} - ${esp32_ota.lib_deps} - -[env:nibble_screen_connect_companion_radio_usb] -extends = nibble_screen_connect_base -build_flags = - ${nibble_screen_connect_base.build_flags} - -I examples/companion_radio/ui-new - -D DISPLAY_CLASS=SSD1306Display - -D MAX_CONTACTS=300 - -D MAX_GROUP_CHANNELS=8 -build_src_filter = ${nibble_screen_connect_base.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${nibble_screen_connect_base.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:nibble_screen_connect_companion_radio_ble] -extends = nibble_screen_connect_base -build_flags = - ${nibble_screen_connect_base.build_flags} - -I examples/companion_radio/ui-new - -D DISPLAY_CLASS=SSD1306Display - -D MAX_CONTACTS=300 - -D MAX_GROUP_CHANNELS=8 - -D BLE_PIN_CODE=123456 - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 -build_src_filter = ${nibble_screen_connect_base.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${nibble_screen_connect_base.lib_deps} - densaugeo/base64 @ ~1.4.0 - -[env:nibble_screen_connect_companion_radio_wifi] -extends = nibble_screen_connect_base -build_flags = - ${nibble_screen_connect_base.build_flags} - -I examples/companion_radio/ui-new - -D DISPLAY_CLASS=SSD1306Display - -D MAX_CONTACTS=300 - -D MAX_GROUP_CHANNELS=8 - -D WIFI_DEBUG_LOGGING=1 - -D WIFI_SSID='"myssid"' - -D WIFI_PWD='"mypwd"' - -D OFFLINE_QUEUE_SIZE=256 -build_src_filter = ${nibble_screen_connect_base.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = - ${nibble_screen_connect_base.lib_deps} - densaugeo/base64 @ ~1.4.0 - diff --git a/variants/nibble_screen_connect/target.cpp b/variants/nibble_screen_connect/target.cpp deleted file mode 100644 index 1980e039..00000000 --- a/variants/nibble_screen_connect/target.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include -#include "target.h" - -ESP32Board board; - -static SPIClass spi; -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi); -WRAPPER_CLASS radio_driver(radio, board); - -ESP32RTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -SensorManager sensors; - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true); -#endif - -#ifndef LORA_CR - #define LORA_CR 5 -#endif - -bool radio_init() { - fallback_clock.begin(); - rtc_clock.begin(Wire); - - return radio.std_init(&spi); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); -} - diff --git a/variants/nibble_screen_connect/target.h b/variants/nibble_screen_connect/target.h deleted file mode 100644 index 66e69901..00000000 --- a/variants/nibble_screen_connect/target.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -extern ESP32Board board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern SensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); - diff --git a/variants/promicro/PromicroBoard.cpp b/variants/promicro/PromicroBoard.cpp deleted file mode 100644 index 7011521b..00000000 --- a/variants/promicro/PromicroBoard.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include -#include - -#include "PromicroBoard.h" - -void PromicroBoard::begin() { - NRF52Board::begin(); - btn_prev_state = HIGH; - - pinMode(PIN_VBAT_READ, INPUT); - - #ifdef BUTTON_PIN - pinMode(BUTTON_PIN, INPUT_PULLUP); - #endif - - #if defined(PIN_BOARD_SDA) && defined(PIN_BOARD_SCL) - Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL); - #endif - - Wire.begin(); - - pinMode(SX126X_POWER_EN, OUTPUT); - digitalWrite(SX126X_POWER_EN, HIGH); - delay(10); // give sx1262 some time to power up -} \ No newline at end of file diff --git a/variants/promicro/PromicroBoard.h b/variants/promicro/PromicroBoard.h deleted file mode 100644 index c23ed1c9..00000000 --- a/variants/promicro/PromicroBoard.h +++ /dev/null @@ -1,79 +0,0 @@ -#pragma once - -#include -#include -#include - -#define P_LORA_NSS 13 //P1.13 45 -#define P_LORA_DIO_1 11 //P0.10 10 -#define P_LORA_RESET 10 //P0.09 9 -#define P_LORA_BUSY 16 //P0.29 29 -#define P_LORA_MISO 15 //P0.02 2 -#define P_LORA_SCLK 12 //P1.11 43 -#define P_LORA_MOSI 14 //P1.15 47 -#define SX126X_POWER_EN 21 //P0.13 13 -#define SX126X_RXEN 2 //P0.17 -#define SX126X_TXEN RADIOLIB_NC -#define SX126X_DIO2_AS_RF_SWITCH true -#define SX126X_DIO3_TCXO_VOLTAGE (1.8f) - -#define PIN_VBAT_READ 17 -#define ADC_MULTIPLIER (1.815f) // dependent on voltage divider resistors. TODO: more accurate battery tracking - -class PromicroBoard : public NRF52BoardOTA { -protected: - uint8_t btn_prev_state; - float adc_mult = ADC_MULTIPLIER; - -public: - PromicroBoard() : NRF52BoardOTA("ProMicro_OTA") {} - void begin(); - - #define BATTERY_SAMPLES 8 - - uint16_t getBattMilliVolts() override { - analogReadResolution(12); - - uint32_t raw = 0; - for (int i = 0; i < BATTERY_SAMPLES; i++) { - raw += analogRead(PIN_VBAT_READ); - } - raw = raw / BATTERY_SAMPLES; - return (adc_mult * raw); - } - - bool setAdcMultiplier(float multiplier) override { - if (multiplier == 0.0f) { - adc_mult = ADC_MULTIPLIER;} - else { - adc_mult = multiplier; - } - return true; - } - float getAdcMultiplier() const override { - if (adc_mult == 0.0f) { - return ADC_MULTIPLIER; - } else { - return adc_mult; - } - } - - const char* getManufacturerName() const override { - return "ProMicro DIY"; - } - - int buttonStateChanged() { - #ifdef BUTTON_PIN - uint8_t v = digitalRead(BUTTON_PIN); - if (v != btn_prev_state) { - btn_prev_state = v; - return (v == LOW) ? 1 : -1; - } - #endif - return 0; - } - - void powerOff() override { - sd_power_system_off(); - } -}; diff --git a/variants/promicro/platformio.ini b/variants/promicro/platformio.ini deleted file mode 100644 index 15bb5ce6..00000000 --- a/variants/promicro/platformio.ini +++ /dev/null @@ -1,172 +0,0 @@ -[Promicro] -extends = nrf52_base -board = promicro_nrf52840 -build_flags = ${nrf52_base.build_flags} - -I variants/promicro - -D PROMICRO - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D LORA_TX_POWER=22 - -D SX126X_CURRENT_LIMIT=140 - -D SX126X_RX_BOOSTED_GAIN=1 - -D PIN_BOARD_SCL=7 - -D PIN_BOARD_SDA=8 - -D PIN_OLED_RESET=-1 - -D PIN_USER_BTN=6 - -D PIN_GPS_RX=3 - -D PIN_GPS_TX=4 - -D PIN_GPS_EN=5 - -D ENV_INCLUDE_GPS=1 - -D ENV_INCLUDE_AHTX0=1 - -D ENV_INCLUDE_BME280=1 - -D ENV_INCLUDE_BMP280=1 - -D ENV_INCLUDE_INA3221=1 - -D ENV_INCLUDE_INA219=1 -build_src_filter = ${nrf52_base.build_src_filter} - + - +<../variants/promicro> -lib_deps= ${nrf52_base.lib_deps} - adafruit/Adafruit SSD1306 @ ^2.5.13 - adafruit/Adafruit INA3221 Library @ ^1.0.1 - adafruit/Adafruit INA219 @ ^1.2.3 - adafruit/Adafruit AHTX0 @ ^2.0.5 - adafruit/Adafruit BME280 Library @ ^2.3.0 - adafruit/Adafruit BMP280 Library@^2.6.8 - stevemarple/MicroNMEA @ ^2.0.6 - -[env:ProMicro_repeater] -extends = Promicro -build_src_filter = ${Promicro.build_src_filter} - +<../examples/simple_repeater> - + - + -build_flags = - ${Promicro.build_flags} - -D ADVERT_NAME='"ProMicro Repeater"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D MAX_NEIGHBOURS=50 - -D DISPLAY_CLASS=SSD1306Display -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -lib_deps = ${Promicro.lib_deps} - adafruit/RTClib @ ^2.1.3 - -[env:ProMicro_repeater_bridge_rs232_serial1] -extends = Promicro -build_src_filter = ${Promicro.build_src_filter} - +<../examples/simple_repeater> - + - + - + -build_flags = - ${Promicro.build_flags} - -D ADVERT_NAME='"RS232 Bridge"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D MAX_NEIGHBOURS=50 - -D DISPLAY_CLASS=SSD1306Display - -D WITH_RS232_BRIDGE=Serial1 - -D WITH_RS232_BRIDGE_RX=PIN_SERIAL1_RX - -D WITH_RS232_BRIDGE_TX=PIN_SERIAL1_TX - -UENV_INCLUDE_GPS -; -D BRIDGE_DEBUG=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -lib_deps = ${Promicro.lib_deps} - adafruit/RTClib @ ^2.1.3 - -[env:ProMicro_room_server] -extends = Promicro -build_src_filter = ${Promicro.build_src_filter} - +<../examples/simple_room_server> - + - + -build_flags = ${Promicro.build_flags} - -D ADVERT_NAME='"ProMicro Room"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D ROOM_PASSWORD='"hello"' - -D DISPLAY_CLASS=SSD1306Display -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -lib_deps = ${Promicro.lib_deps} - adafruit/RTClib @ ^2.1.3 - -[env:ProMicro_terminal_chat] -extends = Promicro -build_flags = ${Promicro.build_flags} - -D MAX_CONTACTS=100 - -D MAX_GROUP_CHANNELS=1 -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Promicro.build_src_filter} - +<../examples/simple_secure_chat/main.cpp> -lib_deps = ${Promicro.lib_deps} - densaugeo/base64 @ ~1.4.0 - adafruit/RTClib @ ^2.1.3 - -[env:ProMicro_companion_radio_usb] -extends = Promicro -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = ${Promicro.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D DISPLAY_CLASS=SSD1306Display -; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 -; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 -build_src_filter = ${Promicro.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = ${Promicro.lib_deps} - adafruit/RTClib @ ^2.1.3 - densaugeo/base64 @ ~1.4.0 - -[env:ProMicro_companion_radio_ble] -extends = Promicro -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = ${Promicro.build_flags} - -I examples/companion_radio/ui-new - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 - -D DISPLAY_CLASS=SSD1306Display -; -D MESH_PACKET_LOGGING=1 - -D MESH_DEBUG=1 -build_src_filter = ${Promicro.build_src_filter} - + - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-new/*.cpp> -lib_deps = ${Promicro.lib_deps} - adafruit/RTClib @ ^2.1.3 - densaugeo/base64 @ ~1.4.0 - -[env:ProMicro_sensor] -extends = Promicro -build_flags = - ${Promicro.build_flags} - -D ADVERT_NAME='"ProMicro Sensor"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' - -D DISPLAY_CLASS=SSD1306Display -; -D MESH_PACKET_LOGGING=1 -; -D MESH_DEBUG=1 -build_src_filter = ${Promicro.build_src_filter} - + - + - +<../examples/simple_sensor> -lib_deps = - ${Promicro.lib_deps} diff --git a/variants/promicro/target.cpp b/variants/promicro/target.cpp deleted file mode 100644 index b26320e4..00000000 --- a/variants/promicro/target.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include "target.h" -#include - -PromicroBoard board; - -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); - -WRAPPER_CLASS radio_driver(radio, board); - -VolatileRTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); -#if ENV_INCLUDE_GPS - #include - MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1); - EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea); -#else - EnvironmentSensorManager sensors; -#endif - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true); -#endif - -bool radio_init() { - rtc_clock.begin(Wire); - - return radio.std_init(&SPI); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} - diff --git a/variants/promicro/target.h b/variants/promicro/target.h deleted file mode 100644 index 38c4b4e8..00000000 --- a/variants/promicro/target.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#ifdef DISPLAY_CLASS - #include - #include -#endif - -#include - -extern PromicroBoard board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; - -#ifdef DISPLAY_CLASS - extern DISPLAY_CLASS display; - extern MomentaryButton user_btn; -#endif - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/promicro/variant.cpp b/variants/promicro/variant.cpp deleted file mode 100644 index 0a4c3aac..00000000 --- a/variants/promicro/variant.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "variant.h" -#include "wiring_constants.h" -#include "wiring_digital.h" - -const uint32_t g_ADigitalPinMap[] = { - 8, 6, 17, 20, 22, 24, 32, 11, 36, 38, - 9, 10, 43, 45, 47, 2, 29, 31, - 33, 34, 37, - 13, 15 -}; - -void initVariant() -{ -} - diff --git a/variants/promicro/variant.h b/variants/promicro/variant.h deleted file mode 100644 index 98489da1..00000000 --- a/variants/promicro/variant.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * variant.h - * Copyright (C) 2023 Seeed K.K. - * MIT License - */ - - #pragma once - - #include "WVariant.h" - - //////////////////////////////////////////////////////////////////////////////// - // Low frequency clock source - -#define VARIANT_MCK (64000000ul) - -//#define USE_LFXO // 32.768 kHz crystal oscillator -#define USE_LFRC // 32.768 kHz RC oscillator - -//////////////////////////////////////////////////////////////////////////////// -// Power - -#define PIN_EXT_VCC (21) -#define EXT_VCC (PIN_EXT_VCC) - -#define BATTERY_PIN (17) -#define ADC_RESOLUTION 12 - -//////////////////////////////////////////////////////////////////////////////// -// Number of pins - -#define PINS_COUNT (23) -#define NUM_DIGITAL_PINS (23) -#define NUM_ANALOG_INPUTS (3) -#define NUM_ANALOG_OUTPUTS (0) - -//////////////////////////////////////////////////////////////////////////////// -// UART pin definition - -#define PIN_SERIAL1_TX (1) -#define PIN_SERIAL1_RX (0) - -//////////////////////////////////////////////////////////////////////////////// -// I2C pin definition - -#define WIRE_INTERFACES_COUNT 2 - -#define PIN_WIRE_SDA (6) -#define PIN_WIRE_SCL (7) -#define PIN_WIRE1_SDA (13) -#define PIN_WIRE1_SCL (14) - -//////////////////////////////////////////////////////////////////////////////// -// SPI pin definition - -#define SPI_INTERFACES_COUNT 2 - -#define PIN_SPI_SCK (2) -#define PIN_SPI_MISO (3) -#define PIN_SPI_MOSI (4) - -#define PIN_SPI_NSS (5) - -#define PIN_SPI1_SCK (18) -#define PIN_SPI1_MISO (19) -#define PIN_SPI1_MOSI (20) - -//////////////////////////////////////////////////////////////////////////////// -// Builtin LEDs - -#define PIN_LED (22) -#define LED_PIN PIN_LED -#define LED_BLUE PIN_LED -#define LED_BUILTIN PIN_LED -#define LED_STATE_ON 1 - -//////////////////////////////////////////////////////////////////////////////// -// Builtin buttons - -#define PIN_BUTTON1 (6) -#define BUTTON_PIN PIN_BUTTON1 - - diff --git a/variants/rak_wismesh_tag/RAKWismeshTagBoard.cpp b/variants/rak_wismesh_tag/RAKWismeshTagBoard.cpp deleted file mode 100644 index 7eab4bc9..00000000 --- a/variants/rak_wismesh_tag/RAKWismeshTagBoard.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include - -#include "RAKWismeshTagBoard.h" - -void RAKWismeshTagBoard::begin() { - NRF52BoardDCDC::begin(); - - pinMode(PIN_VBAT_READ, INPUT); - pinMode(PIN_USER_BTN, INPUT_PULLUP); - - Wire.setPins(PIN_BOARD_SDA, PIN_BOARD_SCL); - Wire.begin(); - - pinMode(SX126X_POWER_EN, OUTPUT); - digitalWrite(SX126X_POWER_EN, HIGH); - delay(10); // give sx1262 some time to power up -} \ No newline at end of file diff --git a/variants/rak_wismesh_tag/RAKWismeshTagBoard.h b/variants/rak_wismesh_tag/RAKWismeshTagBoard.h deleted file mode 100644 index 9aa457d2..00000000 --- a/variants/rak_wismesh_tag/RAKWismeshTagBoard.h +++ /dev/null @@ -1,74 +0,0 @@ -#pragma once - -#include -#include -#include - -// built-ins -#define PIN_VBAT_READ 5 -#define ADC_MULTIPLIER (3 * 1.73 * 1.187 * 1000) - -class RAKWismeshTagBoard : public NRF52BoardDCDC, public NRF52BoardOTA { -public: - RAKWismeshTagBoard() : NRF52BoardOTA("WISMESHTAG_OTA") {} - void begin(); - -#if defined(P_LORA_TX_LED) && defined(LED_STATE_ON) - void onBeforeTransmit() override { - digitalWrite(P_LORA_TX_LED, LED_STATE_ON); // turn TX LED on - } - void onAfterTransmit() override { - digitalWrite(P_LORA_TX_LED, !LED_STATE_ON); // turn TX LED off - } -#endif - - #define BATTERY_SAMPLES 8 - - uint16_t getBattMilliVolts() override { - analogReadResolution(12); - - uint32_t raw = 0; - for (int i = 0; i < BATTERY_SAMPLES; i++) { - raw += analogRead(PIN_VBAT_READ); - } - raw = raw / BATTERY_SAMPLES; - - return (ADC_MULTIPLIER * raw) / 4096; - } - - const char* getManufacturerName() const override { - return "RAK WisMesh Tag"; - } - - void powerOff() override { - #ifdef BUZZER_EN - digitalWrite(BUZZER_EN, LOW); - #endif - - #ifdef PIN_GPS_EN - digitalWrite(PIN_GPS_EN, LOW); - #endif - - // set led on and wait for button release before poweroff - #ifdef LED_PIN - digitalWrite(LED_PIN, HIGH); - #endif - #ifdef BUTTON_PIN - // wismesh tag uses LOW to indicate button is pressed, wait until it goes HIGH to indicate it was released - while(digitalRead(BUTTON_PIN) == LOW); - #endif - #ifdef LED_GREEN - digitalWrite(LED_GREEN, LOW); - #endif - #ifdef LED_BLUE - digitalWrite(LED_BLUE, LOW); - #endif - - #ifdef BUTTON_PIN - // configure button press to wake up when in powered off state - nrf_gpio_cfg_sense_input(digitalPinToInterrupt(BUTTON_PIN), NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW); - #endif - - sd_power_system_off(); - } -}; diff --git a/variants/rak_wismesh_tag/platformio.ini b/variants/rak_wismesh_tag/platformio.ini deleted file mode 100644 index 081cb0d0..00000000 --- a/variants/rak_wismesh_tag/platformio.ini +++ /dev/null @@ -1,121 +0,0 @@ -[rak_wismesh_tag] -extends = nrf52_base -board = rak4631 -board_check = true -build_flags = ${nrf52_base.build_flags} - ${sensor_base.build_flags} - -I variants/rak_wismesh_tag - -I src/helpers/ui - -D RAK_WISMESH_TAG - -D RAK_BOARD - -D P_LORA_TX_LED=LED_GREEN - -D P_LORA_DIO_1=SX126X_DIO1 - -D P_LORA_NSS=PIN_SPI_NSS - -D P_LORA_RESET=SX126X_RESET - -D P_LORA_BUSY=SX126X_BUSY - -D P_LORA_SCLK=PIN_SPI_SCK - -D P_LORA_MISO=PIN_SPI_MISO - -D P_LORA_MOSI=PIN_SPI_MOSI - -D RADIO_CLASS=CustomSX1262 - -D WRAPPER_CLASS=CustomSX1262Wrapper - -D DISPLAY_CLASS=NullDisplayDriver - -D LORA_TX_POWER=22 - -D SX126X_CURRENT_LIMIT=140 - -D SX126X_RX_BOOSTED_GAIN=1 - -D PIN_BUZZER=21 - -D PIN_BOARD_SDA=PIN_WIRE_SDA - -D PIN_BOARD_SCL=PIN_WIRE_SCL -build_src_filter = ${nrf52_base.build_src_filter} - +<../variants/rak_wismesh_tag> - + - + - + -lib_deps = - ${nrf52_base.lib_deps} - ${sensor_base.lib_deps} - -[env:RAK_WisMesh_Tag_repeater] -extends = rak_wismesh_tag -build_flags = - ${rak_wismesh_tag.build_flags} - -D ADVERT_NAME='"RAK WM 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 -build_src_filter = ${rak_wismesh_tag.build_src_filter} - +<../examples/simple_repeater> - -[env:RAK_WisMesh_Tag_room_server] -extends = rak_wismesh_tag -build_flags = - ${rak_wismesh_tag.build_flags} - -D ADVERT_NAME='"RAK WM 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 -build_src_filter = ${rak_wismesh_tag.build_src_filter} - +<../examples/simple_room_server> - -[env:RAK_WisMesh_Tag_companion_radio_usb] -extends = rak_wismesh_tag -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = - ${rak_wismesh_tag.build_flags} - -I examples/companion_radio/ui-orig - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 -; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1 -; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1 -build_src_filter = ${rak_wismesh_tag.build_src_filter} - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> -lib_deps = - ${rak_wismesh_tag.lib_deps} - densaugeo/base64 @ ~1.4.0 - end2endzone/NonBlockingRTTTL@^1.3.0 - -[env:RAK_WisMesh_Tag_companion_radio_ble] -extends = rak_wismesh_tag -board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld -board_upload.maximum_size = 712704 -build_flags = - ${rak_wismesh_tag.build_flags} - -I examples/companion_radio/ui-orig - -D MAX_CONTACTS=350 - -D MAX_GROUP_CHANNELS=40 - -D BLE_PIN_CODE=123456 - -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 - -D PIN_GPS_EN=34 -; -D MESH_PACKET_LOGGING=1 - -D MESH_DEBUG=1 -build_src_filter = ${rak_wismesh_tag.build_src_filter} - + - + - +<../examples/companion_radio/*.cpp> - +<../examples/companion_radio/ui-orig/*.cpp> -lib_deps = - ${rak4631.lib_deps} - densaugeo/base64 @ ~1.4.0 - end2endzone/NonBlockingRTTTL@^1.3.0 - -[env:RAK_WisMesh_Tag_sensor] -extends = rak4631 -build_flags = - ${rak4631.build_flags} - -D ADVERT_NAME='"RAK WM Sensor"' - -D ADVERT_LAT=0.0 - -D ADVERT_LON=0.0 - -D ADMIN_PASSWORD='"password"' -; -D MESH_PACKET_LOGGING=1 - -D MESH_DEBUG=1 -build_src_filter = ${rak4631.build_src_filter} - +<../examples/simple_sensor> \ No newline at end of file diff --git a/variants/rak_wismesh_tag/target.cpp b/variants/rak_wismesh_tag/target.cpp deleted file mode 100644 index 2bd30864..00000000 --- a/variants/rak_wismesh_tag/target.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include "target.h" -#include - -RAKWismeshTagBoard board; - -#ifndef PIN_USER_BTN - #define PIN_USER_BTN (-1) -#endif - -#ifdef DISPLAY_CLASS - DISPLAY_CLASS display; - MomentaryButton user_btn(PIN_USER_BTN, 1000, true, true); -#endif - -RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, SPI); - -WRAPPER_CLASS radio_driver(radio, board); - -VolatileRTCClock fallback_clock; -AutoDiscoverRTCClock rtc_clock(fallback_clock); - -#if ENV_INCLUDE_GPS - #include - MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1); - EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea); -#else - EnvironmentSensorManager sensors; -#endif - -bool radio_init() { - rtc_clock.begin(Wire); - return radio.std_init(&SPI); -} - -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(uint8_t dbm) { - radio.setOutputPower(dbm); -} - -mesh::LocalIdentity radio_new_identity() { - RadioNoiseListener rng(radio); - return mesh::LocalIdentity(&rng); // create new random identity -} diff --git a/variants/rak_wismesh_tag/target.h b/variants/rak_wismesh_tag/target.h deleted file mode 100644 index 150d0831..00000000 --- a/variants/rak_wismesh_tag/target.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#define RADIOLIB_STATIC_ONLY 1 -#include -#include -#include -#include -#include -#include - -#ifdef DISPLAY_CLASS - #include - extern DISPLAY_CLASS display; - #include - extern MomentaryButton user_btn; -#endif - -extern RAKWismeshTagBoard board; -extern WRAPPER_CLASS radio_driver; -extern AutoDiscoverRTCClock rtc_clock; -extern EnvironmentSensorManager sensors; - -bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(uint8_t dbm); -mesh::LocalIdentity radio_new_identity(); diff --git a/variants/rak_wismesh_tag/variant.cpp b/variants/rak_wismesh_tag/variant.cpp deleted file mode 100644 index ac3af5d2..00000000 --- a/variants/rak_wismesh_tag/variant.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "variant.h" -#include "nrf.h" -#include "wiring_constants.h" -#include "wiring_digital.h" - -const uint32_t g_ADigitalPinMap[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47 -}; - -void initVariant() { - // LEDs - pinMode(LED_BLUE, OUTPUT); - pinMode(LED_GREEN, OUTPUT); - digitalWrite(LED_BLUE, LOW); - digitalWrite(LED_GREEN, LOW); - - // GPS - pinMode(PIN_GPS_EN, OUTPUT); - digitalWrite(PIN_GPS_EN, HIGH); -} \ No newline at end of file diff --git a/variants/rak_wismesh_tag/variant.h b/variants/rak_wismesh_tag/variant.h deleted file mode 100644 index 3b8e079f..00000000 --- a/variants/rak_wismesh_tag/variant.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * variant.h - * Copyright (C) 2023 Seeed K.K. - * MIT License - */ - -#pragma once - -#include "WVariant.h" - -//////////////////////////////////////////////////////////////////////////////// -// Low frequency clock source - -#define USE_LFXO // 32.768 kHz crystal oscillator -#define VARIANT_MCK (64000000ul) - -#define WIRE_INTERFACES_COUNT (1) -#define PIN_TXCO (21) -//////////////////////////////////////////////////////////////////////////////// -// Power - -#define PIN_PWR_EN (12) - -#define BATTERY_PIN (5) -#define ADC_MULTIPLIER (1.73F) - -#define ADC_RESOLUTION (14) -#define BATTERY_SENSE_RES (12) - -#define AREF_VOLTAGE (3.0) - -//////////////////////////////////////////////////////////////////////////////// -// Number of pins - -#define PINS_COUNT (48) -#define NUM_DIGITAL_PINS (48) -#define NUM_ANALOG_INPUTS (6) -#define NUM_ANALOG_OUTPUTS (0) - -//////////////////////////////////////////////////////////////////////////////// -// UART pin definition - -#define PIN_SERIAL1_RX (15) -#define PIN_SERIAL1_TX (16) - -//////////////////////////////////////////////////////////////////////////////// -// I2C pin definition -#define WIRE_INTERFACES_COUNT (1) -#define PIN_WIRE_SDA (25) -#define PIN_WIRE_SCL (24) - -//////////////////////////////////////////////////////////////////////////////// -// SPI pin definition - -#define SPI_INTERFACES_COUNT (2) - -#define PIN_SPI_MISO (45) -#define PIN_SPI_MOSI (44) -#define PIN_SPI_SCK (43) -#define PIN_SPI_NSS (42) - -//////////////////////////////////////////////////////////////////////////////// -// Builtin LEDs - -#define LED_RED (-1) -#define LED_BLUE (36) -#define LED_GREEN (35) - -#define PIN_STATUS_LED LED_BLUE -#define LED_BUILTIN LED_GREEN -#define LED_PIN LED_GREEN -#define LED_STATE_ON HIGH - -//////////////////////////////////////////////////////////////////////////////// -// Builtin buttons - -#define PIN_BUTTON1 (9) -#define BUTTON_PIN PIN_BUTTON1 -#define PIN_USER_BTN BUTTON_PIN - -#define PIN_BUTTON2 (12) -#define BUTTON_PIN2 PIN_BUTTON2 - -//////////////////////////////////////////////////////////////////////////////// -// Lora - -#define USE_SX1262 -#define LORA_CS (42) -#define SX126X_DIO1 (47) -#define SX126X_BUSY (46) -#define SX126X_RESET (38) -#define SX126X_POWER_EN (37) -#define SX126X_DIO2_AS_RF_SWITCH -#define SX126X_DIO3_TCXO_VOLTAGE 1.8 - -//////////////////////////////////////////////////////////////////////////////// -// SPI1 - -#define PIN_SPI1_MISO (29) -#define PIN_SPI1_MOSI (30) -#define PIN_SPI1_SCK (3) - -// GxEPD2 needs that for a panel that is not even used ! -extern const int MISO; -extern const int MOSI; -extern const int SCK; - -//////////////////////////////////////////////////////////////////////////////// -// GPS - -#define PIN_GPS_RX (PIN_SERIAL1_TX) -#define PIN_GPS_TX (PIN_SERIAL1_RX) -#define PIN_GPS_PPS (17) -#define PIN_GPS_EN (34) - -/////////////////////////////////////////////////////////////////////////////// -// OTHER PINS -#define PIN_AREF (2) -#define PIN_NFC1 (9) -#define PIN_NFC2 (10) -#define PIN_BUZZER (21)