mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-14 15:16:40 +00:00
Merge remote-tracking branch 'upstream/dev' into rak-ethernet
# Conflicts: # docs/faq.md # examples/companion_radio/main.cpp
This commit is contained in:
@@ -12,8 +12,9 @@ class LoRaFEMControl
|
||||
void setRxModeEnable(void);
|
||||
void setRxModeEnableWhenMCUSleep(void);
|
||||
void setLNAEnable(bool enabled);
|
||||
bool isLnaCanControl(void) { return lna_can_control; }
|
||||
bool isLnaCanControl(void) const { return lna_can_control; }
|
||||
void setLnaCanControl(bool can_control) { lna_can_control = can_control; }
|
||||
bool isLNAEnabled(void) const { return lna_enabled; }
|
||||
|
||||
private:
|
||||
bool lna_enabled = false;
|
||||
|
||||
@@ -123,4 +123,22 @@ void T096Board::powerOff() {
|
||||
|
||||
const char* T096Board::getManufacturerName() const {
|
||||
return "Heltec T096";
|
||||
}
|
||||
}
|
||||
|
||||
bool T096Board::setLoRaFemLnaEnabled(bool enable) {
|
||||
if (!loRaFEMControl.isLnaCanControl()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
loRaFEMControl.setLNAEnable(enable);
|
||||
loRaFEMControl.setRxModeEnable();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool T096Board::canControlLoRaFemLna() const {
|
||||
return loRaFEMControl.isLnaCanControl();
|
||||
}
|
||||
|
||||
bool T096Board::isLoRaFemLnaEnabled() const {
|
||||
return loRaFEMControl.isLNAEnabled();
|
||||
}
|
||||
|
||||
@@ -25,4 +25,7 @@ public:
|
||||
uint16_t getBattMilliVolts() override;
|
||||
const char* getManufacturerName() const override ;
|
||||
void powerOff() override;
|
||||
bool setLoRaFemLnaEnabled(bool enable) override;
|
||||
bool canControlLoRaFemLna() const override;
|
||||
bool isLoRaFemLnaEnabled() const override;
|
||||
};
|
||||
|
||||
@@ -103,6 +103,23 @@ build_flags =
|
||||
; -D MESH_PACKET_LOGGING=1
|
||||
; -D MESH_DEBUG=1
|
||||
|
||||
[env:Heltec_t096_sensor]
|
||||
extends = Heltec_t096
|
||||
build_flags =
|
||||
${Heltec_t096.build_flags}
|
||||
-D ADVERT_NAME='"Heltec_t096 Sensor"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D ENV_PIN_SDA=PIN_WIRE1_SDA
|
||||
-D ENV_PIN_SCL=PIN_WIRE1_SCL
|
||||
; -D MESH_PACKET_LOGGING=1
|
||||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${Heltec_t096.build_src_filter}
|
||||
+<../examples/simple_sensor>
|
||||
lib_deps =
|
||||
${Heltec_t096.lib_deps}
|
||||
|
||||
[env:Heltec_t096_companion_radio_ble]
|
||||
extends = Heltec_t096
|
||||
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
|
||||
@@ -82,3 +82,21 @@ void HeltecTrackerV2Board::begin() {
|
||||
const char* HeltecTrackerV2Board::getManufacturerName() const {
|
||||
return "Heltec Tracker V2";
|
||||
}
|
||||
|
||||
bool HeltecTrackerV2Board::setLoRaFemLnaEnabled(bool enable) {
|
||||
if (!loRaFEMControl.isLnaCanControl()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
loRaFEMControl.setLNAEnable(enable);
|
||||
loRaFEMControl.setRxModeEnable();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HeltecTrackerV2Board::canControlLoRaFemLna() const {
|
||||
return loRaFEMControl.isLnaCanControl();
|
||||
}
|
||||
|
||||
bool HeltecTrackerV2Board::isLoRaFemLnaEnabled() const {
|
||||
return loRaFEMControl.isLNAEnabled();
|
||||
}
|
||||
|
||||
@@ -21,5 +21,8 @@ public:
|
||||
void powerOff() override;
|
||||
uint16_t getBattMilliVolts() override;
|
||||
const char* getManufacturerName() const override ;
|
||||
bool setLoRaFemLnaEnabled(bool enable) override;
|
||||
bool canControlLoRaFemLna() const override;
|
||||
bool isLoRaFemLnaEnabled() const override;
|
||||
|
||||
};
|
||||
|
||||
@@ -12,8 +12,9 @@ class LoRaFEMControl
|
||||
void setRxModeEnable(void);
|
||||
void setRxModeEnableWhenMCUSleep(void);
|
||||
void setLNAEnable(bool enabled);
|
||||
bool isLnaCanControl(void) { return lna_can_control; }
|
||||
bool isLnaCanControl(void) const { return lna_can_control; }
|
||||
void setLnaCanControl(bool can_control) { lna_can_control = can_control; }
|
||||
bool isLNAEnabled(void) const { return lna_enabled; }
|
||||
|
||||
private:
|
||||
bool lna_enabled = false;
|
||||
|
||||
@@ -17,12 +17,12 @@ public:
|
||||
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)
|
||||
if (wakeup_source & (1 << P_LORA_DIO_0)) { // 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);
|
||||
rtc_gpio_deinit((gpio_num_t)P_LORA_DIO_0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,15 +30,15 @@ public:
|
||||
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_set_direction((gpio_num_t)P_LORA_DIO_0, RTC_GPIO_MODE_INPUT_ONLY);
|
||||
rtc_gpio_pulldown_en((gpio_num_t)P_LORA_DIO_0);
|
||||
|
||||
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
|
||||
esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_0), 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
|
||||
esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_0) | (1L << pin_wake_btn), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet OR wake btn
|
||||
}
|
||||
|
||||
if (secs > 0) {
|
||||
@@ -64,4 +64,8 @@ public:
|
||||
const char* getManufacturerName() const override {
|
||||
return "Heltec V2";
|
||||
}
|
||||
|
||||
uint32_t getIRQGpio() override {
|
||||
return P_LORA_DIO_0; // default for SX1276
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,10 +7,10 @@ build_flags =
|
||||
-D HELTEC_LORA_V2
|
||||
-D RADIO_CLASS=CustomSX1276
|
||||
-D WRAPPER_CLASS=CustomSX1276Wrapper
|
||||
-D P_LORA_DIO_1=26
|
||||
-D P_LORA_DIO_0=26
|
||||
-D P_LORA_DIO_1=35
|
||||
-D P_LORA_NSS=18
|
||||
-D P_LORA_RESET=RADIOLIB_NC
|
||||
-D P_LORA_BUSY=RADIOLIB_NC
|
||||
-D P_LORA_RESET=14
|
||||
-D P_LORA_SCLK=5
|
||||
-D P_LORA_MISO=19
|
||||
-D P_LORA_MOSI=27
|
||||
|
||||
@@ -5,9 +5,9 @@ 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);
|
||||
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_1, P_LORA_RESET, P_LORA_BUSY);
|
||||
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);
|
||||
|
||||
@@ -83,3 +83,21 @@ void HeltecV4Board::begin() {
|
||||
return loRaFEMControl.getFEMType() == KCT8103L_PA ? "Heltec V4.3 OLED" : "Heltec V4 OLED";
|
||||
#endif
|
||||
}
|
||||
|
||||
bool HeltecV4Board::setLoRaFemLnaEnabled(bool enable) {
|
||||
if (!loRaFEMControl.isLnaCanControl()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
loRaFEMControl.setLNAEnable(enable);
|
||||
loRaFEMControl.setRxModeEnable();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HeltecV4Board::canControlLoRaFemLna() const {
|
||||
return loRaFEMControl.isLnaCanControl();
|
||||
}
|
||||
|
||||
bool HeltecV4Board::isLoRaFemLnaEnabled() const {
|
||||
return loRaFEMControl.isLNAEnabled();
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ public:
|
||||
void onAfterTransmit(void) override;
|
||||
void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1);
|
||||
void powerOff() override;
|
||||
bool setLoRaFemLnaEnabled(bool enable) override;
|
||||
bool canControlLoRaFemLna() const override;
|
||||
bool isLoRaFemLnaEnabled() const override;
|
||||
uint16_t getBattMilliVolts() override;
|
||||
bool setAdcMultiplier(float multiplier) override {
|
||||
if (multiplier == 0.0f) {
|
||||
|
||||
@@ -18,8 +18,9 @@ class LoRaFEMControl
|
||||
void setRxModeEnable(void);
|
||||
void setRxModeEnableWhenMCUSleep(void);
|
||||
void setLNAEnable(bool enabled);
|
||||
bool isLnaCanControl(void) { return lna_can_control; }
|
||||
bool isLnaCanControl(void) const { return lna_can_control; }
|
||||
void setLnaCanControl(bool can_control) { lna_can_control = can_control; }
|
||||
bool isLNAEnabled(void) const { return lna_enabled; }
|
||||
LoRaFEMType getFEMType(void) const { return fem_type; }
|
||||
private:
|
||||
LoRaFEMType fem_type=OTHER_FEM_TYPES;
|
||||
|
||||
@@ -21,11 +21,11 @@ public:
|
||||
#endif
|
||||
|
||||
uint16_t getBattMilliVolts() override {
|
||||
// Please read befor going further ;)
|
||||
// Please read before 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 ...
|
||||
// as we don't know whether we are charging or not ...
|
||||
// this is a 3mA loss (4/1500)
|
||||
digitalWrite(VBAT_ENABLE, LOW);
|
||||
int adcvalue = 0;
|
||||
|
||||
@@ -29,11 +29,11 @@ public:
|
||||
#endif
|
||||
|
||||
uint16_t getBattMilliVolts() override {
|
||||
// Please read befor going further ;)
|
||||
// Please read before 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 ...
|
||||
// as we don't know whether we are charging or not ...
|
||||
// this is a 3mA loss (4/1500)
|
||||
digitalWrite(VBAT_ENABLE, LOW);
|
||||
int adcvalue = 0;
|
||||
|
||||
@@ -29,11 +29,11 @@ public:
|
||||
#endif
|
||||
|
||||
uint16_t getBattMilliVolts() override {
|
||||
// Please read befor going further ;)
|
||||
// Please read before 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 ...
|
||||
// as we don't know whether we are charging or not ...
|
||||
// this is a 3mA loss (4/1500)
|
||||
digitalWrite(VBAT_ENABLE, LOW);
|
||||
int adcvalue = 0;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <helpers/ESP32Board.h>
|
||||
|
||||
class LilygoT3S3SX1276Board : public ESP32Board {
|
||||
public:
|
||||
uint32_t getIRQGpio() override {
|
||||
return P_LORA_DIO_0; // default for SX1276
|
||||
}
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <Arduino.h>
|
||||
#include "target.h"
|
||||
|
||||
ESP32Board board;
|
||||
LilygoT3S3SX1276Board board;
|
||||
|
||||
#if defined(P_LORA_SCLK)
|
||||
static SPIClass spi;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#define RADIOLIB_STATIC_ONLY 1
|
||||
#include <RadioLib.h>
|
||||
#include <helpers/radiolib/RadioLibWrappers.h>
|
||||
#include <helpers/ESP32Board.h>
|
||||
#include <LilygoT3S3SX1276Board.h>
|
||||
#include <helpers/radiolib/CustomSX1276Wrapper.h>
|
||||
#include <helpers/AutoDiscoverRTCClock.h>
|
||||
#include <helpers/SensorManager.h>
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#endif
|
||||
|
||||
extern ESP32Board board;
|
||||
extern LilygoT3S3SX1276Board board;
|
||||
extern WRAPPER_CLASS radio_driver;
|
||||
extern AutoDiscoverRTCClock rtc_clock;
|
||||
extern SensorManager sensors;
|
||||
|
||||
@@ -5,6 +5,13 @@ build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-I variants/lilygo_tbeam_SX1262
|
||||
-D TBEAM_SX1262
|
||||
-D P_LORA_DIO_0=26
|
||||
-D P_LORA_DIO_1=33
|
||||
-D P_LORA_NSS=18
|
||||
-D P_LORA_RESET=23
|
||||
-D P_LORA_SCLK=5
|
||||
-D P_LORA_MISO=19
|
||||
-D P_LORA_MOSI=27
|
||||
-D SX126X_DIO2_AS_RF_SWITCH=true
|
||||
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
|
||||
-D SX126X_CURRENT_LIMIT=140
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <helpers/esp32/TBeamBoard.h>
|
||||
|
||||
class LilygoTBeamSX1276Board : public TBeamBoard {
|
||||
public:
|
||||
uint32_t getIRQGpio() override {
|
||||
return P_LORA_DIO_0; // default for SX1276
|
||||
}
|
||||
};
|
||||
@@ -5,6 +5,13 @@ build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-I variants/lilygo_tbeam_SX1276
|
||||
-D TBEAM_SX1276
|
||||
-D P_LORA_DIO_0=26
|
||||
-D P_LORA_DIO_1=33
|
||||
-D P_LORA_NSS=18
|
||||
-D P_LORA_RESET=23
|
||||
-D P_LORA_SCLK=5
|
||||
-D P_LORA_MISO=19
|
||||
-D P_LORA_MOSI=27
|
||||
-D SX127X_CURRENT_LIMIT=120
|
||||
-D RADIO_CLASS=CustomSX1276
|
||||
-D WRAPPER_CLASS=CustomSX1276Wrapper
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <Arduino.h>
|
||||
#include "target.h"
|
||||
|
||||
TBeamBoard board;
|
||||
LilygoTBeamSX1276Board board;
|
||||
|
||||
#if defined(P_LORA_SCLK)
|
||||
static SPIClass spi;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#define RADIOLIB_STATIC_ONLY 1
|
||||
//#include <RadioLib.h>
|
||||
#include <helpers/radiolib/RadioLibWrappers.h>
|
||||
#include <helpers/esp32/TBeamBoard.h>
|
||||
#include <LilygoTBeamSX1276Board.h>
|
||||
#include <helpers/radiolib/CustomSX1276Wrapper.h>
|
||||
#include <helpers/AutoDiscoverRTCClock.h>
|
||||
#include <helpers/sensors/EnvironmentSensorManager.h>
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#endif
|
||||
|
||||
extern TBeamBoard board;
|
||||
extern LilygoTBeamSX1276Board board;
|
||||
extern WRAPPER_CLASS radio_driver;
|
||||
extern AutoDiscoverRTCClock rtc_clock;
|
||||
extern EnvironmentSensorManager sensors;
|
||||
|
||||
@@ -5,6 +5,13 @@ build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-I variants/lilygo_tbeam_supreme_SX1262
|
||||
-D TBEAM_SUPREME_SX1262
|
||||
-D P_LORA_DIO_0=26
|
||||
-D P_LORA_DIO_1=33
|
||||
-D P_LORA_NSS=18
|
||||
-D P_LORA_RESET=23
|
||||
-D P_LORA_SCLK=5
|
||||
-D P_LORA_MISO=19
|
||||
-D P_LORA_MOSI=27
|
||||
-D SX126X_CURRENT_LIMIT=140
|
||||
-D SX126X_RX_BOOSTED_GAIN=1
|
||||
-D USE_SX1262
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
#include <Arduino.h>
|
||||
#include <Wire.h>
|
||||
|
||||
|
||||
#include "TechoCardBoard.h"
|
||||
|
||||
#ifdef LILYGO_TECHO_CARD
|
||||
|
||||
Adafruit_NeoPixel Led_A(1, WS2812_DATA_2, NEO_GRB + NEO_KHZ800);
|
||||
Adafruit_NeoPixel Led_B(1, WS2812_DATA_3, NEO_GRB + NEO_KHZ800);
|
||||
Adafruit_NeoPixel Led_C(1, WS2812_DATA_1, NEO_GRB + NEO_KHZ800);
|
||||
|
||||
Adafruit_NeoPixel *Led[] =
|
||||
{
|
||||
&Led_A,
|
||||
&Led_B,
|
||||
&Led_C,
|
||||
};
|
||||
|
||||
|
||||
void TechoCardBoard::begin() {
|
||||
NRF52BoardDCDC::begin();
|
||||
Wire.begin();
|
||||
|
||||
for (uint8_t i = 0; i < sizeof(Led) / sizeof(Led[0]); i++)
|
||||
{
|
||||
Led[i]->begin();
|
||||
delay(3); // allow the LEDs to initialise, otherwise they can get stuck
|
||||
Led[i]->setPixelColor(0, Led[i]->Color(0, 0, 0));
|
||||
Led[i]->show();
|
||||
}
|
||||
|
||||
// put IMU20948 to sleep
|
||||
// see https://product.tdk.com/system/files/dam/doc/product/sensor/mortion-inertial/imu/data_sheet/ds-000189-icm-20948-v1.5.pdf
|
||||
Wire.beginTransmission(0x68);
|
||||
Wire.write(0x06); // PWR_MGMT_1 register
|
||||
Wire.write(0x40); // set SLEEP bit
|
||||
Wire.endTransmission();
|
||||
|
||||
}
|
||||
|
||||
uint16_t TechoCardBoard::getBattMilliVolts() {
|
||||
int adcvalue = 0;
|
||||
|
||||
analogReference(AR_INTERNAL_3_0);
|
||||
analogReadResolution(12);
|
||||
|
||||
digitalWrite(PIN_BAT_CTL, HIGH); // enable vbat vdiv
|
||||
delay(10);
|
||||
|
||||
// ADC range is 0..3000mV and resolution is 12-bit (0..4095)
|
||||
adcvalue = analogRead(PIN_VBAT_READ);
|
||||
digitalWrite(PIN_BAT_CTL, LOW);
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
void TechoCardBoard::onBeforeTransmit() {
|
||||
Led_A.setPixelColor(0, 20, 20, 20); // turn TX LED on
|
||||
Led_A.show();
|
||||
}
|
||||
|
||||
void TechoCardBoard::onAfterTransmit() {
|
||||
Led_A.setPixelColor(0, 0, 0, 0); // turn TX LED off
|
||||
Led_A.show();
|
||||
}
|
||||
|
||||
void TechoCardBoard::toggleTorch() {
|
||||
if (!_torchStatus) {
|
||||
Led_C.setPixelColor(0, 255, 255, 255);
|
||||
Led_C.show();
|
||||
_torchStatus = true;
|
||||
} else {
|
||||
Led_C.setPixelColor(0, 0, 0, 0);
|
||||
Led_C.show();
|
||||
_torchStatus = false;
|
||||
}
|
||||
}
|
||||
|
||||
void TechoCardBoard::turnOffLeds() {
|
||||
for (uint8_t i = 0; i < sizeof(Led) / sizeof(*Led); i++)
|
||||
{
|
||||
Led[i]->setPixelColor(0, 0, 0, 0);
|
||||
Led[i]->show();
|
||||
}
|
||||
}
|
||||
|
||||
void TechoCardBoard::powerOff() {
|
||||
nrf_gpio_cfg_sense_input(BUTTON_PIN, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
|
||||
turnOffLeds();
|
||||
digitalWrite(PIN_PWR_EN, LOW);
|
||||
sd_power_system_off();
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include <MeshCore.h>
|
||||
#include <Arduino.h>
|
||||
#include <helpers/NRF52Board.h>
|
||||
#include <Adafruit_NeoPixel.h>
|
||||
|
||||
// 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) // Even voltage divider on VBAT
|
||||
#define VBAT_DIVIDER_COMP (2.0F) // Compensation factor for the VBAT divider
|
||||
|
||||
#define PIN_VBAT_READ (2)
|
||||
#define REAL_VBAT_MV_PER_LSB (VBAT_DIVIDER_COMP * VBAT_MV_PER_LSB)
|
||||
|
||||
class TechoCardBoard : public NRF52BoardDCDC {
|
||||
bool _torchStatus = false;
|
||||
public:
|
||||
TechoCardBoard() : NRF52Board("TECHO_OTA") {}
|
||||
void begin();
|
||||
uint16_t getBattMilliVolts() override;
|
||||
void onBeforeTransmit(void) override;
|
||||
void onAfterTransmit(void) override;
|
||||
|
||||
|
||||
const char* getManufacturerName() const override {
|
||||
return "LilyGo T-Echo Card";
|
||||
}
|
||||
|
||||
void powerOff() override;
|
||||
|
||||
void toggleTorch();
|
||||
void turnOffLeds();
|
||||
|
||||
};
|
||||
@@ -0,0 +1,120 @@
|
||||
[LilyGo_T-Echo_Card]
|
||||
extends = nrf52_base
|
||||
board = t-echo
|
||||
board_build.ldscript = boards/nrf52840_s140_v6.ld
|
||||
build_flags = ${nrf52_base.build_flags}
|
||||
-I variants/lilygo_techo_card
|
||||
-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_CARD
|
||||
-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 HAS_NEOPIXEL=1
|
||||
-D HAS_TORCH=1
|
||||
-D DISABLE_DIAGNOSTIC_OUTPUT
|
||||
-D ENV_INCLUDE_GPS=1
|
||||
-D DISPLAY_CLASS=U8g2Display
|
||||
-D PIN_OLED_RESET=-1
|
||||
build_src_filter = ${nrf52_base.build_src_filter}
|
||||
+<helpers/*.cpp>
|
||||
+<TechoCardBoard.cpp>
|
||||
+<helpers/sensors/EnvironmentSensorManager.cpp>
|
||||
+<helpers/ui/U8g2Display.h>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../variants/lilygo_techo_card>
|
||||
lib_deps =
|
||||
${nrf52_base.lib_deps}
|
||||
stevemarple/MicroNMEA @ ^2.0.6
|
||||
olikraus/U8g2 @ ^2.35.19
|
||||
adafruit/Adafruit NeoPixel@^1.10.0
|
||||
bakercp/CRC32 @ ^2.0.0
|
||||
debug_tool = jlink
|
||||
upload_protocol = nrfutil
|
||||
|
||||
[env:LilyGo_T-Echo_Card_repeater]
|
||||
extends = LilyGo_T-Echo_Card
|
||||
build_src_filter = ${LilyGo_T-Echo_Card.build_src_filter}
|
||||
+<../examples/simple_repeater>
|
||||
build_flags =
|
||||
${LilyGo_T-Echo_Card.build_flags}
|
||||
-D ADVERT_NAME='"T-Echo Card 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_Card_room_server]
|
||||
extends = LilyGo_T-Echo_Card
|
||||
build_src_filter = ${LilyGo_T-Echo_Card.build_src_filter}
|
||||
+<../examples/simple_room_server>
|
||||
build_flags =
|
||||
${LilyGo_T-Echo_Card.build_flags}
|
||||
-D ADVERT_NAME='"T-Echo Card 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_Card_companion_radio_ble]
|
||||
extends = LilyGo_T-Echo_Card
|
||||
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${LilyGo_T-Echo_Card.build_flags}
|
||||
-I src/helpers/ui
|
||||
-I examples/companion_radio/ui-tiny
|
||||
-D PIN_BUZZER=38
|
||||
-D QSPIFLASH=1
|
||||
-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 UI_RECENT_LIST_SIZE=3
|
||||
-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_Card.build_src_filter}
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-tiny/*.cpp>
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
lib_deps =
|
||||
${LilyGo_T-Echo_Card.lib_deps}
|
||||
end2endzone/NonBlockingRTTTL@^1.3.0
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
[env:LilyGo_T-Echo_Card_companion_radio_usb]
|
||||
extends = LilyGo_T-Echo_Card
|
||||
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||
board_upload.maximum_size = 712704
|
||||
build_flags =
|
||||
${LilyGo_T-Echo_Card.build_flags}
|
||||
-I src/helpers/ui
|
||||
-I examples/companion_radio/ui-tiny
|
||||
-D PIN_BUZZER=38
|
||||
-D QSPIFLASH=1
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D OFFLINE_QUEUE_SIZE=256
|
||||
-D UI_RECENT_LIST_SIZE=3
|
||||
-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_Card.build_src_filter}
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-tiny/*.cpp>
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
lib_deps =
|
||||
${LilyGo_T-Echo_Card.lib_deps}
|
||||
end2endzone/NonBlockingRTTTL@^1.3.0
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -0,0 +1,38 @@
|
||||
#include <Arduino.h>
|
||||
#include "target.h"
|
||||
#include <helpers/ArduinoHelpers.h>
|
||||
#include <helpers/sensors/MicroNMEALocationProvider.h>
|
||||
|
||||
TechoCardBoard 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);
|
||||
MomentaryButton back_btn(PIN_BUTTON2, 1000, true);
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
rtc_clock.begin(Wire);
|
||||
|
||||
return radio.std_init(&SPI);
|
||||
}
|
||||
|
||||
mesh::LocalIdentity radio_new_identity() {
|
||||
RadioNoiseListener rng(radio);
|
||||
return mesh::LocalIdentity(&rng); // create new random identity
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#define RADIOLIB_STATIC_ONLY 1
|
||||
#include <RadioLib.h>
|
||||
#include <helpers/radiolib/RadioLibWrappers.h>
|
||||
#include <TechoCardBoard.h>
|
||||
#include <helpers/radiolib/CustomSX1262Wrapper.h>
|
||||
#include <helpers/AutoDiscoverRTCClock.h>
|
||||
#include <helpers/SensorManager.h>
|
||||
#include <helpers/sensors/EnvironmentSensorManager.h>
|
||||
#include <helpers/sensors/LocationProvider.h>
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/U8g2Display.h>
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
#endif
|
||||
|
||||
extern TechoCardBoard board;
|
||||
extern WRAPPER_CLASS radio_driver;
|
||||
extern AutoDiscoverRTCClock rtc_clock;
|
||||
extern EnvironmentSensorManager sensors;
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
extern DISPLAY_CLASS display;
|
||||
extern MomentaryButton user_btn;
|
||||
extern MomentaryButton back_btn;
|
||||
#endif
|
||||
|
||||
bool radio_init();
|
||||
mesh::LocalIdentity radio_new_identity();
|
||||
@@ -0,0 +1,45 @@
|
||||
#include "variant.h"
|
||||
#include "wiring_constants.h"
|
||||
#include "wiring_digital.h"
|
||||
#include "Adafruit_NeoPixel.h"
|
||||
|
||||
const int MISO = PIN_SPI_MISO;
|
||||
const int MOSI = PIN_SPI_MOSI;
|
||||
const int SCK = PIN_SPI_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() {
|
||||
// turn on 3v3 rail
|
||||
pinMode(PIN_PWR_EN, OUTPUT);
|
||||
digitalWrite(PIN_PWR_EN, HIGH);
|
||||
|
||||
// VDIV enable
|
||||
pinMode(PIN_BAT_CTL, OUTPUT);
|
||||
|
||||
// buttons
|
||||
pinMode(PIN_BUTTON1, INPUT_PULLUP);
|
||||
pinMode(PIN_BUTTON2, INPUT_PULLUP);
|
||||
|
||||
// speaker
|
||||
pinMode(SPEAKER_EN, OUTPUT);
|
||||
digitalWrite(SPEAKER_EN, LOW);
|
||||
pinMode(SPEAKER_EN_2, OUTPUT);
|
||||
digitalWrite(SPEAKER_EN_2, LOW);
|
||||
|
||||
// gps
|
||||
pinMode(PIN_GPS_STANDBY, OUTPUT);
|
||||
digitalWrite(PIN_GPS_STANDBY, HIGH);
|
||||
pinMode(PIN_GPS_EN, OUTPUT);
|
||||
digitalWrite(PIN_GPS_EN, HIGH);
|
||||
pinMode(PIN_GPS_RESET, OUTPUT);
|
||||
digitalWrite(PIN_GPS_RESET, HIGH);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* 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)
|
||||
|
||||
#define WIRE_INTERFACES_COUNT (1)
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Power
|
||||
|
||||
#define PIN_PWR_EN (30) // RT9080 LDO enable pin for 3v3 rail
|
||||
|
||||
#define PIN_BAT_CTL (31) // vdiv enable
|
||||
#define PIN_VBAT_READ (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 PIN_GPS_TX
|
||||
#define PIN_SERIAL1_TX PIN_GPS_RX
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// I2C pin definition
|
||||
|
||||
#define PIN_WIRE_SDA (36) // P1.04
|
||||
#define PIN_WIRE_SCL (34) // P1.02
|
||||
#define I2C_NO_RESCAN
|
||||
#define DISABLE_DS3231_PROBE // DS3231 lives at 0x68 but this board has ICM20948 at that address, causing broken clock.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// SPI pin definition
|
||||
|
||||
#define SPI_INTERFACES_COUNT (1)
|
||||
|
||||
#define PIN_SPI_MISO (17)
|
||||
#define PIN_SPI_MOSI (15)
|
||||
#define PIN_SPI_SCK (13)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// QSPI FLASH
|
||||
|
||||
#define PIN_QSPI_SCK (4)
|
||||
#define PIN_QSPI_CS (12)
|
||||
#define PIN_QSPI_IO0 (6)
|
||||
#define PIN_QSPI_IO1 (8)
|
||||
#define PIN_QSPI_IO2 (41) // P1.09
|
||||
#define PIN_QSPI_IO3 (26)
|
||||
|
||||
#define EXTERNAL_FLASH_DEVICES ZD25WQ32CEIGR
|
||||
#define EXTERNAL_FLASH_USE_QSPI
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Builtin LEDs (only WS2812, no traditional LEDs available)
|
||||
|
||||
// WS1812 data lines
|
||||
#define WS2812_DATA_1 (39) // P1.07
|
||||
#define WS2812_DATA_2 (44) // P1.12
|
||||
#define WS2812_DATA_3 (28) // P0.28
|
||||
|
||||
#define LED_BLUE (-1)
|
||||
#define LED_BUILTIN (-1)
|
||||
#define LED_PIN LED_BUILTIN
|
||||
#define LED_STATE_ON LOW
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Builtin buttons
|
||||
|
||||
#define PIN_BUTTON1 (42) // P1.10
|
||||
#define BUTTON_PIN PIN_BUTTON1 // BUTTON A
|
||||
#define PIN_USER_BTN BUTTON_PIN
|
||||
|
||||
#define PIN_BUTTON2 (24)
|
||||
#define BUTTON_PIN2 PIN_BUTTON2 // BUTTON C
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Lora (Acsip S62F)
|
||||
|
||||
#define USE_SX1262
|
||||
#define P_LORA_SCLK PIN_SPI_SCK
|
||||
#define P_LORA_MISO PIN_SPI_MISO
|
||||
#define P_LORA_MOSI PIN_SPI_MOSI
|
||||
#define P_LORA_DIO_1 (40) // P1.08
|
||||
#define P_LORA_RESET (7) // P0.07
|
||||
#define P_LORA_BUSY (14) // P0.14
|
||||
#define P_LORA_NSS (11) // P0.11
|
||||
#define SX126X_RXEN (33) // P1.01
|
||||
#define SX126X_TXEN (27) // P0.27
|
||||
#define SX126X_DIO3_TCXO_VOLTAGE (1.8f)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// GPS
|
||||
|
||||
// NOTE: these pins are defined differently to how lilygo does them but they
|
||||
// seem to work properly for how EnvironmentSensorManager operates.
|
||||
// TODO: MAYBE? migrate to board based sensor manager / add GPS_WAKE_UP to ESM
|
||||
|
||||
#define PIN_GPS_RX (21) // GPS_UART_RX in lilygo pin defs
|
||||
#define PIN_GPS_TX (19) // GPS_UART_TX in lilygo pin defs
|
||||
#define PIN_GPS_EN (25) // GPS_WAKE_UP in lilygo pin defs
|
||||
#define PIN_GPS_RESET (47) // GPS_EN in lilygo pin defs
|
||||
#define PIN_GPS_STANDBY (29) // GPS_RF_EN in lilygo pin defs
|
||||
#define PIN_GPS_PPS (23) // GPS_1PPS in lilygo pin defs
|
||||
|
||||
// buzzer - enabled in platformio.ini so it can be easily turned off if not wanted.
|
||||
// #define PIN_BUZZER (38) // P1.06
|
||||
|
||||
// microphone
|
||||
#define MICROPHONE_SCLK (35) // P1.03
|
||||
#define MICROPHONE_DATA (37) // P1.05
|
||||
|
||||
// speaker
|
||||
#define SPEAKER_EN (43) // P1.11
|
||||
#define SPEAKER_EN_2 (3) // P0.03
|
||||
#define SPEAKER_BCLK (16) // P0.16
|
||||
#define SPEAKER_DATA (20) // P0.20
|
||||
#define SPEAKER_WS_LRCK (22) // P0.22
|
||||
|
||||
// ICM20948 9dof motion sensor (accelerometer and magnetometer)
|
||||
#define ICM20948_SDA PIN_WIRE_SDA // P1.4
|
||||
#define ICM20948_SCL PIN_WIRE_SCL // P1.2
|
||||
#define ICM20948_ADDRESS 0x68
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <helpers/ESP32Board.h>
|
||||
|
||||
class TETHEliteBoard : public ESP32Board {
|
||||
public:
|
||||
const char* getManufacturerName() const override {
|
||||
return "LilyGO T-ETH Elite";
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,99 @@
|
||||
[LilyGo_TETH_Elite_sx1262]
|
||||
extends = esp32_base
|
||||
board = esp32s3box
|
||||
board_build.partitions = default_16MB.csv
|
||||
board_upload.flash_size = 16MB
|
||||
build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-I variants/lilygo_teth_elite
|
||||
-D BOARD_HAS_PSRAM
|
||||
-D LILYGO_TETH_ELITE
|
||||
-D LILYGO_T_ETH_ELITE_ESP32S3
|
||||
-D ARDUINO_USB_CDC_ON_BOOT=1
|
||||
-D P_LORA_DIO_1=8
|
||||
-D P_LORA_NSS=40
|
||||
-D P_LORA_RESET=46
|
||||
-D P_LORA_BUSY=16
|
||||
-D P_LORA_SCLK=10
|
||||
-D P_LORA_MISO=9
|
||||
-D P_LORA_MOSI=11
|
||||
-D P_LORA_TX_LED=38
|
||||
-D SX126X_DIO2_AS_RF_SWITCH=true
|
||||
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
|
||||
-D SX126X_CURRENT_LIMIT=140
|
||||
-D USE_SX1262
|
||||
-D RADIO_CLASS=CustomSX1262
|
||||
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
||||
-D LORA_TX_POWER=8
|
||||
-D SX126X_RX_BOOSTED_GAIN=1
|
||||
build_src_filter = ${esp32_base.build_src_filter}
|
||||
+<../variants/lilygo_teth_elite>
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
|
||||
[env:LilyGo_TETH_Elite_sx1262_repeater]
|
||||
extends = LilyGo_TETH_Elite_sx1262
|
||||
build_flags =
|
||||
${LilyGo_TETH_Elite_sx1262.build_flags}
|
||||
-D ADVERT_NAME='"T-ETH Elite 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_TETH_Elite_sx1262.build_src_filter}
|
||||
+<../examples/simple_repeater>
|
||||
lib_deps =
|
||||
${LilyGo_TETH_Elite_sx1262.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:LilyGo_TETH_Elite_sx1262_room_server]
|
||||
extends = LilyGo_TETH_Elite_sx1262
|
||||
build_flags =
|
||||
${LilyGo_TETH_Elite_sx1262.build_flags}
|
||||
-D ADVERT_NAME='"T-ETH Elite 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_TETH_Elite_sx1262.build_src_filter}
|
||||
+<../examples/simple_room_server>
|
||||
lib_deps =
|
||||
${LilyGo_TETH_Elite_sx1262.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:LilyGo_TETH_Elite_sx1262_companion_radio_usb]
|
||||
extends = LilyGo_TETH_Elite_sx1262
|
||||
build_flags =
|
||||
${LilyGo_TETH_Elite_sx1262.build_flags}
|
||||
-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 = ${LilyGo_TETH_Elite_sx1262.build_src_filter}
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
lib_deps =
|
||||
${LilyGo_TETH_Elite_sx1262.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
[env:LilyGo_TETH_Elite_sx1262_companion_radio_ble]
|
||||
extends = LilyGo_TETH_Elite_sx1262
|
||||
build_flags =
|
||||
${LilyGo_TETH_Elite_sx1262.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 = ${LilyGo_TETH_Elite_sx1262.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
lib_deps =
|
||||
${LilyGo_TETH_Elite_sx1262.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
@@ -0,0 +1,43 @@
|
||||
#include <Arduino.h>
|
||||
#include "target.h"
|
||||
|
||||
TETHEliteBoard board;
|
||||
|
||||
static SPIClass spi(HSPI);
|
||||
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;
|
||||
|
||||
#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(int8_t dbm) {
|
||||
radio.setOutputPower(dbm);
|
||||
}
|
||||
|
||||
mesh::LocalIdentity radio_new_identity() {
|
||||
RadioNoiseListener rng(radio);
|
||||
return mesh::LocalIdentity(&rng);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#define RADIOLIB_STATIC_ONLY 1
|
||||
#include <RadioLib.h>
|
||||
#include <helpers/radiolib/RadioLibWrappers.h>
|
||||
#include <helpers/radiolib/CustomSX1262Wrapper.h>
|
||||
#include <helpers/AutoDiscoverRTCClock.h>
|
||||
#include <helpers/SensorManager.h>
|
||||
#include "TETHEliteBoard.h"
|
||||
|
||||
extern TETHEliteBoard 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(int8_t dbm);
|
||||
mesh::LocalIdentity radio_new_identity();
|
||||
@@ -21,4 +21,8 @@ public:
|
||||
|
||||
return (2 * raw);
|
||||
}
|
||||
|
||||
uint32_t getIRQGpio() override {
|
||||
return P_LORA_DIO_0; // default for SX1276
|
||||
}
|
||||
};
|
||||
@@ -18,7 +18,7 @@ build_flags =
|
||||
-D HAS_NEOPIXEL
|
||||
-D NEOPIXEL_COUNT=1
|
||||
-D NEOPIXEL_DATA=21
|
||||
-D NEOPIXEL_TYPE=(NEO_GRB+NEO_KHZ800)
|
||||
-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
|
||||
@@ -159,8 +159,8 @@ lib_deps =
|
||||
${nibble_screen_connect_base.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
|
||||
[env:nibble_screen_connect_kiss_modem]
|
||||
extends = nibble_screen_connect_base
|
||||
build_src_filter = ${nibble_screen_connect_base.build_src_filter}
|
||||
+<../examples/kiss_modem/>
|
||||
|
||||
[env:nibble_screen_connect_kiss_modem]
|
||||
extends = nibble_screen_connect_base
|
||||
build_src_filter = ${nibble_screen_connect_base.build_src_filter}
|
||||
+<../examples/kiss_modem/>
|
||||
|
||||
@@ -91,6 +91,7 @@ build_src_filter = ${rak11310.build_src_filter}
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
lib_deps = ${rak11310.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
lib_ignore = BLE
|
||||
|
||||
; [env:RAK_11310_companion_radio_ble]
|
||||
; extends = rak11310
|
||||
|
||||
@@ -12,6 +12,12 @@ VolatileRTCClock fallback_clock;
|
||||
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||
SensorManager sensors;
|
||||
|
||||
bool radio_init() {
|
||||
rtc_clock.begin(Wire);
|
||||
|
||||
return radio.std_init(&SPI1);
|
||||
}
|
||||
|
||||
void radio_set_tx_power(int8_t dbm) {
|
||||
radio.setOutputPower(dbm);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
Import('env')
|
||||
import os
|
||||
|
||||
# Bosch has a goof in their PlatformIO packaging making linking fail.
|
||||
# The BSEC library's extra_script.py selects cortex-m4/libalgobsec.a (soft-float ABI).
|
||||
# nRF52840 compiles with -mfloat-abi=hard, requiring the fpv4-sp-d16-hard blob.
|
||||
# Workaround to prepend the hard-float path so the linker finds it before the
|
||||
# soft-float one.
|
||||
bsec_hard = os.path.join(
|
||||
env.subst('$PROJECT_DIR'),
|
||||
'.pio', 'libdeps', env.subst('$PIOENV'),
|
||||
'BSEC Software Library', 'src',
|
||||
'cortex-m4', 'fpv4-sp-d16-hard'
|
||||
)
|
||||
env.Prepend(LIBPATH=[bsec_hard])
|
||||
@@ -2,6 +2,8 @@
|
||||
extends = nrf52_base
|
||||
board = rak4631
|
||||
board_check = true
|
||||
extra_scripts = ${nrf52_base.extra_scripts}
|
||||
post:variants/rak4631/fix_bsec_lib.py
|
||||
build_flags = ${nrf52_base.build_flags}
|
||||
${sensor_base.build_flags}
|
||||
-I variants/rak4631
|
||||
@@ -21,6 +23,8 @@ build_flags = ${nrf52_base.build_flags}
|
||||
-D SX126X_CURRENT_LIMIT=140
|
||||
-D SX126X_RX_BOOSTED_GAIN=1
|
||||
-D ENV_INCLUDE_RAK12035=1
|
||||
-UENV_INCLUDE_BME680
|
||||
-D ENV_INCLUDE_BME680_BSEC=1
|
||||
build_src_filter = ${nrf52_base.build_src_filter}
|
||||
+<../variants/rak4631>
|
||||
+<helpers/sensors>
|
||||
@@ -31,6 +35,7 @@ lib_deps =
|
||||
${sensor_base.lib_deps}
|
||||
adafruit/Adafruit SSD1306 @ ^2.5.13
|
||||
sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.27
|
||||
boschsensortec/BSEC Software Library @ ^1.8.1492
|
||||
|
||||
[env:RAK_4631_repeater]
|
||||
extends = rak4631
|
||||
|
||||
@@ -96,28 +96,28 @@ build_flags =
|
||||
-D OFFLINE_QUEUE_SIZE=256
|
||||
-D PIN_GPS_EN=34
|
||||
; -D MESH_PACKET_LOGGING=1
|
||||
-D MESH_DEBUG=1
|
||||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${rak_wismesh_tag.build_src_filter}
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-orig/*.cpp>
|
||||
lib_deps =
|
||||
${rak4631.lib_deps}
|
||||
${rak_wismesh_tag.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
end2endzone/NonBlockingRTTTL@^1.3.0
|
||||
|
||||
[env:RAK_WisMesh_Tag_sensor]
|
||||
extends = rak4631
|
||||
extends = rak_wismesh_tag
|
||||
build_flags =
|
||||
${rak4631.build_flags}
|
||||
${rak_wismesh_tag.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}
|
||||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${rak_wismesh_tag.build_src_filter}
|
||||
+<../examples/simple_sensor>
|
||||
|
||||
[env:RAK_WisMesh_Tag_kiss_modem]
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
[rpi_picow]
|
||||
extends = rp2040_base
|
||||
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
|
||||
board = rpipicow
|
||||
board_build.core = earlephilhower
|
||||
board_build.filesystem_size = 0.5m
|
||||
@@ -65,6 +64,7 @@ build_src_filter = ${rpi_picow.build_src_filter}
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
lib_deps = ${rpi_picow.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
lib_ignore = BLE
|
||||
|
||||
; [env:PicoW_companion_radio_ble]
|
||||
; extends = rpi_picow
|
||||
|
||||
@@ -13,6 +13,7 @@ build_flags = ${nrf52_base.build_flags}
|
||||
-D USER_BTN_PRESSED=HIGH
|
||||
-D PIN_STATUS_LED=24
|
||||
-D RADIO_CLASS=CustomLR1110
|
||||
-D USE_LR1110
|
||||
-D WRAPPER_CLASS=CustomLR1110Wrapper
|
||||
-D LORA_TX_POWER=22
|
||||
-D RF_SWITCH_TABLE
|
||||
|
||||
@@ -34,7 +34,6 @@ build_flags = ${esp32_base.build_flags}
|
||||
build_src_filter = ${esp32_base.build_src_filter}
|
||||
+<helpers/ui/SH1106Display.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
+<../variants/thinknode_m2>
|
||||
lib_deps = ${esp32_base.lib_deps}
|
||||
adafruit/Adafruit SH110X @ ~2.1.13
|
||||
@@ -144,6 +143,7 @@ build_flags =
|
||||
build_src_filter = ${ThinkNode_M2.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
@@ -162,6 +162,7 @@ build_flags =
|
||||
build_src_filter = ${ThinkNode_M2.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
@@ -183,6 +184,7 @@ build_flags =
|
||||
build_src_filter = ${ThinkNode_M2.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
@@ -197,18 +199,20 @@ build_flags =
|
||||
-I examples/companion_radio/ui-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D SERIAL_TX=D6
|
||||
-D SERIAL_RX=D7
|
||||
-D SERIAL_TX=43
|
||||
-D SERIAL_RX=44
|
||||
; -D MESH_PACKET_LOGGING=1
|
||||
; -D MESH_DEBUG=1
|
||||
build_src_filter = ${ThinkNode_M2.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<helpers/ui/buzzer.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
${ThinkNode_M2.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
end2endzone/NonBlockingRTTTL@^1.3.0
|
||||
|
||||
[env:ThinkNode_M2_kiss_modem]
|
||||
extends = ThinkNode_M2
|
||||
|
||||
@@ -90,6 +90,7 @@ build_src_filter = ${waveshare_rp2040_lora.build_src_filter}
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
lib_deps = ${waveshare_rp2040_lora.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
lib_ignore = BLE
|
||||
|
||||
; [env:waveshare_rp2040_lora_companion_radio_ble]
|
||||
; extends = waveshare_rp2040_lora
|
||||
|
||||
@@ -67,6 +67,7 @@ build_src_filter = ${Xiao_rp2040.build_src_filter}
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
lib_deps = ${Xiao_rp2040.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
lib_ignore = BLE
|
||||
|
||||
; [env:Xiao_rp2040_companion_radio_ble]
|
||||
; extends = Xiao_rp2040
|
||||
|
||||
@@ -151,4 +151,9 @@ build_flags =
|
||||
; -D MESH_DEBUG=1
|
||||
lib_deps =
|
||||
${Xiao_S3.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:Xiao_S3_kiss_modem]
|
||||
extends = Xiao_S3
|
||||
build_src_filter = ${Xiao_S3.build_src_filter}
|
||||
+<../examples/kiss_modem/>
|
||||
|
||||
Reference in New Issue
Block a user