mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
commit
3e3e364dae
37 changed files with 732 additions and 136 deletions
|
|
@ -17,7 +17,7 @@ build_flags =
|
|||
-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_CURRENT_LIMIT=160
|
||||
-D SX126X_RX_BOOSTED_GAIN=1
|
||||
-D PIN_GPS_RX=47
|
||||
-D PIN_GPS_TX=48
|
||||
|
|
@ -129,6 +129,7 @@ lib_deps =
|
|||
extends = Heltec_lora32_v3
|
||||
build_flags =
|
||||
${Heltec_lora32_v3.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-D MAX_CONTACTS=100
|
||||
-D MAX_GROUP_CHANNELS=8
|
||||
-D DISPLAY_CLASS=SSD1306Display
|
||||
|
|
@ -141,7 +142,8 @@ build_src_filter = ${Heltec_lora32_v3.build_src_filter}
|
|||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<../examples/companion_radio>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
${Heltec_lora32_v3.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ lib_deps =
|
|||
extends = Heltec_Vision_Master_E290_base
|
||||
build_flags =
|
||||
${Heltec_Vision_Master_E290_base.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-D MAX_CONTACTS=100
|
||||
-D MAX_GROUP_CHANNELS=8
|
||||
-D DISPLAY_CLASS=E290Display
|
||||
|
|
@ -40,7 +41,8 @@ build_flags =
|
|||
build_src_filter = ${Heltec_Vision_Master_E290_base.build_src_filter}
|
||||
+<helpers/ui/E290Display.cpp>
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<../examples/companion_radio>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
${Heltec_Vision_Master_E290_base.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ SensorManager sensors;
|
|||
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include <helpers/SensorManager.h>
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/E290Display.h>
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#endif
|
||||
|
||||
extern HeltecE290Board board;
|
||||
|
|
@ -18,6 +19,7 @@ extern SensorManager sensors;
|
|||
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
|
|
|||
|
|
@ -5,20 +5,6 @@
|
|||
|
||||
#ifdef XIAO_NRF52
|
||||
|
||||
// redefine lora pins if using the S3 variant of SX1262 board
|
||||
#ifdef SX1262_XIAO_S3_VARIANT
|
||||
#undef P_LORA_DIO_1
|
||||
#undef P_LORA_BUSY
|
||||
#undef P_LORA_RESET
|
||||
#undef P_LORA_NSS
|
||||
#undef SX126X_RXEN
|
||||
#define P_LORA_DIO_1 D0
|
||||
#define P_LORA_BUSY D1
|
||||
#define P_LORA_RESET D2
|
||||
#define P_LORA_NSS D3
|
||||
#define SX126X_RXEN D4
|
||||
#endif
|
||||
|
||||
class ikoka_stick_nrf_board : public mesh::MainBoard {
|
||||
protected:
|
||||
uint8_t startup_reason;
|
||||
|
|
@ -29,10 +15,10 @@ public:
|
|||
|
||||
#if defined(P_LORA_TX_LED)
|
||||
void onBeforeTransmit() override {
|
||||
digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED on
|
||||
digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED on
|
||||
}
|
||||
void onAfterTransmit() override {
|
||||
digitalWrite(P_LORA_TX_LED, LOW); // turn TX LED off
|
||||
digitalWrite(P_LORA_TX_LED, HIGH); // turn TX LED off
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -19,11 +19,10 @@ lib_deps =
|
|||
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 BME280 Library @ ^2.3.0
|
||||
adafruit/Adafruit SSD1306 @ ^2.5.13
|
||||
|
||||
|
||||
[ikoka_stick_nrf]
|
||||
[ikoka_stick_nrf_baseboard]
|
||||
extends = nrf52840_xiao
|
||||
;board_build.ldscript = boards/nrf52840_s140_v7.ld
|
||||
build_flags = ${nrf52840_xiao.build_flags}
|
||||
|
|
@ -34,7 +33,6 @@ build_flags = ${nrf52840_xiao.build_flags}
|
|||
-D DISPLAY_ROTATION=2
|
||||
-D RADIO_CLASS=CustomSX1262
|
||||
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
||||
-D LORA_TX_POWER=9
|
||||
-D P_LORA_DIO_1=D1
|
||||
-D P_LORA_RESET=D2
|
||||
-D P_LORA_BUSY=D3
|
||||
|
|
@ -52,19 +50,59 @@ build_flags = ${nrf52840_xiao.build_flags}
|
|||
-D ENV_INCLUDE_BME280=1
|
||||
-D ENV_INCLUDE_INA3221=1
|
||||
-D ENV_INCLUDE_INA219=1
|
||||
debug_tool = jlink
|
||||
upload_protocol = nrfutil
|
||||
|
||||
|
||||
;;; abstracted hardware variants
|
||||
|
||||
[ikoka_stick_nrf_e22_22dbm]
|
||||
extends = ikoka_stick_nrf_baseboard
|
||||
; No PA in this model, full 22dBm
|
||||
build_flags =
|
||||
${ikoka_stick_nrf_baseboard.build_flags}
|
||||
-D LORA_TX_POWER=22
|
||||
build_src_filter = ${nrf52840_xiao.build_src_filter}
|
||||
+<helpers/*.cpp>
|
||||
+<helpers/sensors>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../variants/ikoka_stick_nrf>
|
||||
debug_tool = jlink
|
||||
upload_protocol = nrfutil
|
||||
|
||||
[env:ikoka_stick_nrf_companion_radio_ble]
|
||||
extends = ikoka_stick_nrf
|
||||
[ikoka_stick_nrf_e22_30dbm]
|
||||
extends = ikoka_stick_nrf_baseboard
|
||||
; 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}
|
||||
${ikoka_stick_nrf_baseboard.build_flags}
|
||||
-D LORA_TX_POWER=20
|
||||
build_src_filter = ${nrf52840_xiao.build_src_filter}
|
||||
+<helpers/*.cpp>
|
||||
+<helpers/sensors>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../variants/ikoka_stick_nrf>
|
||||
|
||||
[ikoka_stick_nrf_e22_33dbm]
|
||||
extends = ikoka_stick_nrf_baseboard
|
||||
; 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_baseboard.build_flags}
|
||||
-D LORA_TX_POWER=9
|
||||
build_src_filter = ${nrf52840_xiao.build_src_filter}
|
||||
+<helpers/*.cpp>
|
||||
+<helpers/sensors>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../variants/ikoka_stick_nrf>
|
||||
|
||||
;;; abstracted firmware roles
|
||||
|
||||
[ikoka_stick_nrf_companion_radio_ble]
|
||||
extends = ikoka_stick_nrf_baseboard
|
||||
build_flags =
|
||||
${ikoka_stick_nrf_baseboard.build_flags}
|
||||
-D MAX_CONTACTS=100
|
||||
-D MAX_GROUP_CHANNELS=8
|
||||
-D BLE_PIN_CODE=123456
|
||||
|
|
@ -73,35 +111,35 @@ build_flags =
|
|||
; -D BLE_DEBUG_LOGGING=1
|
||||
; -D MESH_PACKET_LOGGING=1
|
||||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${ikoka_stick_nrf.build_src_filter}
|
||||
build_src_filter = ${ikoka_stick_nrf_baseboard.build_src_filter}
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
${ikoka_stick_nrf.lib_deps}
|
||||
${ikoka_stick_nrf_baseboard.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
[env:ikoka_stick_nrf_companion_radio_usb]
|
||||
extends = ikoka_stick_nrf
|
||||
[ikoka_stick_nrf_companion_radio_usb]
|
||||
extends = ikoka_stick_nrf_baseboard
|
||||
build_flags =
|
||||
${ikoka_stick_nrf.build_flags}
|
||||
${ikoka_stick_nrf_baseboard.build_flags}
|
||||
-D MAX_CONTACTS=100
|
||||
-D MAX_GROUP_CHANNELS=8
|
||||
-I examples/companion_radio/ui-new
|
||||
; -D MESH_PACKET_LOGGING=1
|
||||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${ikoka_stick_nrf.build_src_filter}
|
||||
build_src_filter = ${ikoka_stick_nrf_baseboard.build_src_filter}
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
${ikoka_stick_nrf.lib_deps}
|
||||
${ikoka_stick_nrf_baseboard.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
[env:ikoka_stick_nrf_repeater]
|
||||
extends = ikoka_stick_nrf
|
||||
[ikoka_stick_nrf_repeater]
|
||||
extends = ikoka_stick_nrf_baseboard
|
||||
build_flags =
|
||||
${ikoka_stick_nrf.build_flags}
|
||||
${ikoka_stick_nrf_baseboard.build_flags}
|
||||
-D ADVERT_NAME='"Ikoka Stick Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
|
|
@ -109,19 +147,161 @@ build_flags =
|
|||
-D MAX_NEIGHBOURS=8
|
||||
; -D MESH_PACKET_LOGGING=1
|
||||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${ikoka_stick_nrf.build_src_filter}
|
||||
build_src_filter = ${ikoka_stick_nrf_baseboard.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<../examples/simple_repeater/*.cpp>
|
||||
|
||||
[env:ikoka_stick_nrf_room_server]
|
||||
extends = ikoka_stick_nrf
|
||||
[ikoka_stick_nrf_room_server]
|
||||
extends = ikoka_stick_nrf_baseboard
|
||||
build_flags =
|
||||
${ikoka_stick_nrf.build_flags}
|
||||
${ikoka_stick_nrf_baseboard.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}
|
||||
build_src_filter = ${ikoka_stick_nrf_baseboard.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}
|
||||
|
|
|
|||
|
|
@ -1,39 +1,40 @@
|
|||
#pragma once
|
||||
|
||||
#include <MeshCore.h>
|
||||
#include "variant.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <MeshCore.h>
|
||||
|
||||
// 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 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
|
||||
#define SX126X_POWER_EN 37
|
||||
|
||||
// buttons
|
||||
#define PIN_BUTTON1 (32 + 6)
|
||||
#define BUTTON_PIN PIN_BUTTON1
|
||||
#define PIN_USER_BTN BUTTON_PIN
|
||||
#define PIN_BUTTON1 (32 + 6)
|
||||
#define BUTTON_PIN PIN_BUTTON1
|
||||
#define PIN_USER_BTN BUTTON_PIN
|
||||
|
||||
// GPS
|
||||
#define GPS_EN PIN_GPS_STANDBY
|
||||
#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_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 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)
|
||||
#define PIN_VBAT_READ (0 + 2)
|
||||
#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)
|
||||
|
||||
class NanoG2Ultra : public mesh::MainBoard
|
||||
{
|
||||
class NanoG2Ultra : public mesh::MainBoard {
|
||||
protected:
|
||||
uint8_t startup_reason;
|
||||
|
||||
|
|
@ -42,18 +43,21 @@ public:
|
|||
uint16_t getBattMilliVolts() override;
|
||||
bool startOTAUpdate(const char *id, char reply[]) override;
|
||||
|
||||
uint8_t getStartupReason() const override
|
||||
{
|
||||
return startup_reason;
|
||||
}
|
||||
uint8_t getStartupReason() const override { return startup_reason; }
|
||||
|
||||
const char *getManufacturerName() const override
|
||||
{
|
||||
return "Nano G2 Ultra";
|
||||
}
|
||||
const char *getManufacturerName() const override { return "Nano G2 Ultra"; }
|
||||
|
||||
void reboot() override
|
||||
{
|
||||
NVIC_SystemReset();
|
||||
void reboot() override { NVIC_SystemReset(); }
|
||||
|
||||
void powerOff() override {
|
||||
// put GPS chip to sleep
|
||||
digitalWrite(PIN_GPS_STANDBY, LOW);
|
||||
// unset buzzer to prevent notification circuit activating on hibernate
|
||||
#undef PIN_BUZZER
|
||||
|
||||
nrf_gpio_cfg_sense_input(digitalPinToInterrupt(PIN_USER_BTN), NRF_GPIO_PIN_NOPULL,
|
||||
NRF_GPIO_PIN_SENSE_LOW);
|
||||
|
||||
sd_power_system_off();
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ build_flags = ${nrf52_base.build_flags}
|
|||
build_src_filter = ${nrf52_base.build_src_filter}
|
||||
+<../variants/rak4631>
|
||||
+<helpers/sensors>
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
lib_deps =
|
||||
${nrf52_base.lib_deps}
|
||||
${sensor_base.lib_deps}
|
||||
|
|
@ -73,8 +75,6 @@ build_flags =
|
|||
; NOTE: DO NOT ENABLE --> -D MESH_PACKET_LOGGING=1
|
||||
; NOTE: DO NOT ENABLE --> -D MESH_DEBUG=1
|
||||
build_src_filter = ${rak4631.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
|
|
@ -97,9 +97,7 @@ build_flags =
|
|||
; -D MESH_PACKET_LOGGING=1
|
||||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${rak4631.build_src_filter}
|
||||
+<helpers/ui/SSD1306Display.cpp>
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
RAK4631Board 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);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ build_flags =
|
|||
build_src_filter = ${esp32_base.build_src_filter}
|
||||
+<../variants/station_g2>
|
||||
+<helpers/ui/SH1106Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
adafruit/Adafruit SH110X @ ~2.1.13
|
||||
|
|
@ -44,6 +45,25 @@ lib_deps =
|
|||
${Station_G2.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:Station_G2_logging_repeater]
|
||||
extends = Station_G2
|
||||
build_flags =
|
||||
${Station_G2.build_flags}
|
||||
-D ADVERT_NAME='"Station G2 Logging Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D MAX_NEIGHBOURS=8
|
||||
-D MESH_PACKET_LOGGING=1
|
||||
-D SX126X_RX_BOOSTED_GAIN=1
|
||||
; https://wiki.uniteng.com/en/meshtastic/station-g2#impact-of-lora-node-dense-areashigh-noise-environments-on-rf-performance
|
||||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${Station_G2.build_src_filter}
|
||||
+<../examples/simple_repeater>
|
||||
lib_deps =
|
||||
${Station_G2.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:Station_G2_room_server]
|
||||
extends = Station_G2
|
||||
build_src_filter = ${Station_G2.build_src_filter}
|
||||
|
|
@ -65,14 +85,16 @@ lib_deps =
|
|||
extends = Station_G2
|
||||
build_flags =
|
||||
${Station_G2.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-D DISPLAY_CLASS=SH1106Display
|
||||
-D MAX_CONTACTS=100
|
||||
-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 = ${Station_G2.build_src_filter}
|
||||
+<helpers/ui/SH1106Display.cpp>
|
||||
+<../examples/companion_radio>
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
${Station_G2.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
|
@ -81,6 +103,7 @@ lib_deps =
|
|||
extends = Station_G2
|
||||
build_flags =
|
||||
${Station_G2.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-D DISPLAY_CLASS=SH1106Display
|
||||
-D MAX_CONTACTS=100
|
||||
-D MAX_GROUP_CHANNELS=8
|
||||
|
|
@ -91,8 +114,8 @@ build_flags =
|
|||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${Station_G2.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/ui/SH1106Display.cpp>
|
||||
+<../examples/companion_radio>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
${Station_G2.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
|
|
|||
|
|
@ -18,10 +18,7 @@ SensorManager sensors;
|
|||
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
#endif
|
||||
|
||||
#ifndef LORA_CR
|
||||
#define LORA_CR 5
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/SH1106Display.h>
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#endif
|
||||
|
||||
extern StationG2Board board;
|
||||
|
|
@ -19,6 +20,7 @@ extern SensorManager sensors;
|
|||
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
|
|
|||
|
|
@ -84,12 +84,21 @@ public:
|
|||
digitalWrite(PIN_3V3_EN, LOW);
|
||||
#endif
|
||||
|
||||
// set led on and wait for button release before poweroff
|
||||
#ifdef LED_PIN
|
||||
digitalWrite(LED_PIN, HIGH);
|
||||
#endif
|
||||
#ifdef BUTTON_PIN
|
||||
while(digitalRead(BUTTON_PIN));
|
||||
#endif
|
||||
#ifdef LED_PIN
|
||||
digitalWrite(LED_PIN, LOW);
|
||||
#endif
|
||||
|
||||
#ifdef BUTTON_PIN
|
||||
nrf_gpio_cfg_sense_input(digitalPinToInterrupt(BUTTON_PIN), NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_HIGH);
|
||||
#endif
|
||||
|
||||
sd_power_system_off();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,65 @@ build_src_filter = ${nrf52840_t1000e.build_src_filter}
|
|||
debug_tool = jlink
|
||||
upload_protocol = nrfutil
|
||||
|
||||
[env:t1000e_repeater]
|
||||
extends = t1000-e
|
||||
build_flags = ${t1000-e.build_flags}
|
||||
-I examples/companion_radio/ui-orig
|
||||
-D ADVERT_NAME='"t1000-e Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D MAX_NEIGHBOURS=8
|
||||
; -D MESH_PACKET_LOGGING=1
|
||||
; -D MESH_DEBUG=1
|
||||
-D RX_BOOSTED_GAIN=true
|
||||
-D RF_SWITCH_TABLE
|
||||
build_src_filter = ${t1000-e.build_src_filter}
|
||||
+<../examples/simple_repeater>
|
||||
lib_deps = ${t1000-e.lib_deps}
|
||||
stevemarple/MicroNMEA @ ^2.0.6
|
||||
|
||||
[env:t1000e_room_server]
|
||||
extends = t1000-e
|
||||
build_flags = ${t1000-e.build_flags}
|
||||
-I examples/companion_radio/ui-orig
|
||||
-D ADVERT_NAME='"t1000-e 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
|
||||
-D RX_BOOSTED_GAIN=true
|
||||
-D RF_SWITCH_TABLE
|
||||
build_src_filter = ${t1000-e.build_src_filter}
|
||||
+<../examples/simple_room_server>
|
||||
lib_deps = ${t1000-e.lib_deps}
|
||||
stevemarple/MicroNMEA @ ^2.0.6
|
||||
|
||||
[env:t1000e_companion_radio_usb]
|
||||
extends = t1000-e
|
||||
build_flags = ${t1000-e.build_flags}
|
||||
-I examples/companion_radio/ui-orig
|
||||
-D MAX_CONTACTS=100
|
||||
-D MAX_GROUP_CHANNELS=8
|
||||
; -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 ; P1/5 - required for T1000-E
|
||||
build_src_filter = ${t1000-e.build_src_filter}
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-orig/*.cpp>
|
||||
lib_deps = ${t1000-e.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
stevemarple/MicroNMEA @ ^2.0.6
|
||||
end2endzone/NonBlockingRTTTL@^1.3.0
|
||||
|
||||
[env:t1000e_companion_radio_ble]
|
||||
extends = t1000-e
|
||||
build_flags = ${t1000-e.build_flags}
|
||||
|
|
@ -58,4 +117,4 @@ build_src_filter = ${t1000-e.build_src_filter}
|
|||
lib_deps = ${t1000-e.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
stevemarple/MicroNMEA @ ^2.0.6
|
||||
end2endzone/NonBlockingRTTTL@^1.3.0
|
||||
end2endzone/NonBlockingRTTTL@^1.3.0
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ build_flags = ${nrf52840_techo.build_flags}
|
|||
-D LORA_TX_POWER=22
|
||||
-D SX126X_CURRENT_LIMIT=140
|
||||
-D SX126X_RX_BOOSTED_GAIN=1
|
||||
-D P_LORA_TX_LED=LED_GREEN
|
||||
build_src_filter = ${nrf52840_techo.build_src_filter}
|
||||
+<helpers/*.cpp>
|
||||
+<helpers/nrf52/TechoBoard.cpp>
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ void initVariant() {
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -61,19 +61,15 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Builtin LEDs
|
||||
|
||||
#define LED_RED (34)
|
||||
#define LED_GREEN (33)
|
||||
#define LED_RED (13)
|
||||
#define LED_BLUE (14)
|
||||
#define LED_GREEN (15)
|
||||
|
||||
#define PIN_STATUS_LED LED_GREEN
|
||||
#define LED_BUILTIN LED_GREEN
|
||||
#define PIN_LED LED_BUILTIN
|
||||
//#define PIN_STATUS_LED LED_BLUE
|
||||
#define LED_BUILTIN (-1)
|
||||
#define LED_PIN LED_BUILTIN
|
||||
#define LED_STATE_ON LOW
|
||||
|
||||
#define PIN_NEOPIXEL (14)
|
||||
#define NEOPIXEL_NUM (2)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Builtin buttons
|
||||
|
||||
|
|
|
|||
|
|
@ -38,5 +38,9 @@ public:
|
|||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
void powerOff() override {
|
||||
sd_power_system_off();
|
||||
}
|
||||
|
||||
bool startOTAUpdate(const char* id, char reply[]) override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ WioTrackerL1SensorManager sensors = WioTrackerL1SensorManager(nmea);
|
|||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
MomentaryButton user_btn(PIN_USER_BTN, 1000, true);
|
||||
MomentaryButton joystick_left(JOYSTICK_LEFT, 1000, true);
|
||||
MomentaryButton joystick_right(JOYSTICK_RIGHT, 1000, true);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ extern WioTrackerL1SensorManager sensors;
|
|||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
extern MomentaryButton joystick_left;
|
||||
extern MomentaryButton joystick_right;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
|
|
|
|||
|
|
@ -121,3 +121,65 @@ build_src_filter = ${Meshimi.build_src_filter}
|
|||
lib_deps =
|
||||
${Meshimi.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
; WHY2025 badge variant
|
||||
; requires soldering 2 pins between the esp32-C6 and the lora chip as shown here: https://wiki.why2025.org/Project:Meshtastic_on_the_WHY2025_badge
|
||||
; also requires wiping the esp32-P4
|
||||
[WHY2025_badge]
|
||||
extends = Xiao_C6
|
||||
board_build.partitions = default_8MB.csv
|
||||
board_upload.flash_size = 8MB
|
||||
board_upload.maximum_size = 8388608
|
||||
build_flags =
|
||||
${Xiao_C6.build_flags}
|
||||
-D P_LORA_SCLK=6
|
||||
-D P_LORA_MISO=2
|
||||
-D P_LORA_MOSI=7
|
||||
-D P_LORA_NSS=4
|
||||
-D P_LORA_DIO_1=5
|
||||
-D P_LORA_BUSY=11
|
||||
-D P_LORA_RESET=1
|
||||
-D SX126X_TXEN=3
|
||||
-UPIN_BOARD_SDA
|
||||
-UPIN_BOARD_SCL
|
||||
-UP_LORA_TX_LED
|
||||
-USX126X_RXEN
|
||||
-USX126X_DIO2_AS_RF_SWITCH
|
||||
-USX126X_DIO3_TCXO_VOLTAGE
|
||||
|
||||
[env:WHY2025_badge_Repeater]
|
||||
extends = WHY2025_badge
|
||||
build_src_filter = ${WHY2025_badge.build_src_filter}
|
||||
+<../examples/simple_repeater/main.cpp>
|
||||
build_flags =
|
||||
${WHY2025_badge.build_flags}
|
||||
-D ADVERT_NAME='"WHY2025 Badge Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D MAX_NEIGHBOURS=8
|
||||
; -D MESH_PACKET_LOGGING=1
|
||||
; -D MESH_DEBUG=1
|
||||
lib_deps =
|
||||
${WHY2025_badge.lib_deps}
|
||||
; ${esp32_ota.lib_deps}
|
||||
|
||||
[env:WHY2025_badge_companion_radio_ble]
|
||||
extends = WHY2025_badge
|
||||
build_flags = ${WHY2025_badge.build_flags}
|
||||
-D MAX_CONTACTS=100
|
||||
-D MAX_GROUP_CHANNELS=8
|
||||
-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 = ${WHY2025_badge.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
-<helpers/esp32/ESPNOWRadio.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
lib_deps =
|
||||
${WHY2025_badge.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue