mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Add LilyGo T-ETH-Elite support (SX1262 and SX1276)
This commit is contained in:
parent
dee3e26ac0
commit
de00cebbbb
10 changed files with 895 additions and 0 deletions
177
variants/lilygo_t_eth_elite_sx1262/platformio.ini
Normal file
177
variants/lilygo_t_eth_elite_sx1262/platformio.ini
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
[LilyGo_T_ETH_Elite_SX1262]
|
||||
extends = esp32_base
|
||||
board = t_eth_elite
|
||||
upload_protocol = esptool
|
||||
board_build.partitions = default_16MB.csv
|
||||
board_upload.flash_size = 16MB
|
||||
board_upload.maximum_size = 16777216
|
||||
build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-I variants/lilygo_t_eth_elite_sx1262
|
||||
-D T_ETH_ELITE_SX1262
|
||||
-D RADIO_CLASS=CustomSX1262
|
||||
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
||||
-D SX126X_CURRENT_LIMIT=140
|
||||
-D SX126X_RX_BOOSTED_GAIN=1
|
||||
-D LORA_TX_POWER=22
|
||||
-D ENV_INCLUDE_GPS=1
|
||||
-D PIN_GPS_RX=39
|
||||
-D PIN_GPS_TX=42
|
||||
-D PIN_GPS_EN=-1
|
||||
build_src_filter = ${esp32_base.build_src_filter}
|
||||
+<../variants/lilygo_t_eth_elite_sx1262>
|
||||
+<helpers/esp32/TEthEliteBoard.cpp>
|
||||
+<helpers/sensors>
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
lewisxhe/XPowersLib @ ^0.2.7
|
||||
stevemarple/MicroNMEA @ ^2.0.6
|
||||
adafruit/Adafruit BME280 Library @ ^2.3.0
|
||||
|
||||
; === LilyGo T-ETH-Elite with SX1262 environments ===
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1262_repeater]
|
||||
extends = LilyGo_T_ETH_Elite_SX1262
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_SX1262.build_flags}
|
||||
-D ADVERT_NAME='"T-ETH Elite SX1262 Repeater"'
|
||||
-D ADVERT_LAT=0
|
||||
-D ADVERT_LON=0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D MAX_NEIGHBOURS=50
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1262.build_src_filter}
|
||||
+<../examples/simple_repeater>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1262.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1262_repeater_eth]
|
||||
extends = LilyGo_T_ETH_Elite_SX1262
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_SX1262.build_flags}
|
||||
-D ADVERT_NAME='"T-ETH Elite SX1262 Repeater"'
|
||||
-D ADVERT_LAT=0
|
||||
-D ADVERT_LON=0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D MAX_NEIGHBOURS=50
|
||||
-D USE_ETHERNET
|
||||
-D ETH_STATIC_IP=192,168,254,20
|
||||
-D ETH_GATEWAY=192,168,254,254
|
||||
-D ETH_SUBNET=255,255,255,0
|
||||
-D ETH_DNS=8,8,8,8
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1262.build_src_filter}
|
||||
+<../examples/simple_repeater>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1262.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1262_repeater_bridge_espnow]
|
||||
extends = LilyGo_T_ETH_Elite_SX1262
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_SX1262.build_flags}
|
||||
-D ADVERT_NAME='"T-ETH Elite SX1262 ESPNow Bridge"'
|
||||
-D ADVERT_LAT=0
|
||||
-D ADVERT_LON=0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D MAX_NEIGHBOURS=50
|
||||
-D WITH_ESPNOW_BRIDGE=1
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1262.build_src_filter}
|
||||
+<helpers/bridges/ESPNowBridge.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1262.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1262_room_server]
|
||||
extends = LilyGo_T_ETH_Elite_SX1262
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_SX1262.build_flags}
|
||||
-D ADVERT_NAME='"T-ETH Elite SX1262 Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D ROOM_PASSWORD='"hello"'
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1262.build_src_filter}
|
||||
+<../examples/simple_room_server>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1262.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1262_room_server_eth]
|
||||
extends = LilyGo_T_ETH_Elite_SX1262
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_SX1262.build_flags}
|
||||
-D ADVERT_NAME='"T-ETH Elite SX1262 Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D ROOM_PASSWORD='"hello"'
|
||||
-D USE_ETHERNET
|
||||
-D ETH_STATIC_IP=192,168,254,20
|
||||
-D ETH_GATEWAY=192,168,254,254
|
||||
-D ETH_SUBNET=255,255,255,0
|
||||
-D ETH_DNS=8,8,8,8
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1262.build_src_filter}
|
||||
+<../examples/simple_room_server>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1262.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1262_companion_radio_eth]
|
||||
extends = LilyGo_T_ETH_Elite_SX1262
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_SX1262.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D OFFLINE_QUEUE_SIZE=256
|
||||
-D USE_ETHERNET
|
||||
-D ETH_STATIC_IP=192,168,254,20
|
||||
-D ETH_GATEWAY=192,168,254,254
|
||||
-D ETH_SUBNET=255,255,255,0
|
||||
-D ETH_DNS=8,8,8,8
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1262.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1262.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1262_companion_radio_wifi]
|
||||
extends = LilyGo_T_ETH_Elite_SX1262
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_SX1262.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D OFFLINE_QUEUE_SIZE=256
|
||||
-D WIFI_SSID='"WIFI_SSID"'
|
||||
-D WIFI_PWD='"Password"'
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1262.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1262.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1262_companion_radio_ble]
|
||||
extends = LilyGo_T_ETH_Elite_SX1262
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_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
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1262.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1262.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
53
variants/lilygo_t_eth_elite_sx1262/target.cpp
Normal file
53
variants/lilygo_t_eth_elite_sx1262/target.cpp
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
#include <Arduino.h>
|
||||
#include "helpers/ui/MomentaryButton.h"
|
||||
#include "target.h"
|
||||
|
||||
TEthEliteBoard board;
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
#endif
|
||||
|
||||
MomentaryButton user_btn(PIN_USER_BTN_ANA, 1000, true);
|
||||
|
||||
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 <helpers/sensors/MicroNMEALocationProvider.h>
|
||||
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(int8_t dbm) {
|
||||
radio.setOutputPower(dbm);
|
||||
}
|
||||
|
||||
mesh::LocalIdentity radio_new_identity() {
|
||||
RadioNoiseListener rng(radio);
|
||||
return mesh::LocalIdentity(&rng);
|
||||
}
|
||||
30
variants/lilygo_t_eth_elite_sx1262/target.h
Normal file
30
variants/lilygo_t_eth_elite_sx1262/target.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#define HAS_ETHERNET 1
|
||||
|
||||
#define RADIOLIB_STATIC_ONLY 1
|
||||
#include <RadioLib.h>
|
||||
#include <helpers/radiolib/RadioLibWrappers.h>
|
||||
#include <helpers/esp32/TEthEliteBoard.h>
|
||||
#include <helpers/radiolib/CustomSX1262Wrapper.h>
|
||||
#include <helpers/AutoDiscoverRTCClock.h>
|
||||
#include <helpers/sensors/EnvironmentSensorManager.h>
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
|
||||
extern MomentaryButton user_btn;
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/SH1106Display.h>
|
||||
extern DISPLAY_CLASS display;
|
||||
#endif
|
||||
|
||||
extern TEthEliteBoard 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(int8_t dbm);
|
||||
mesh::LocalIdentity radio_new_identity();
|
||||
176
variants/lilygo_t_eth_elite_sx1276/platformio.ini
Normal file
176
variants/lilygo_t_eth_elite_sx1276/platformio.ini
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
[LilyGo_T_ETH_Elite_SX1276]
|
||||
extends = esp32_base
|
||||
board = t_eth_elite
|
||||
upload_protocol = esptool
|
||||
board_build.partitions = default_16MB.csv
|
||||
board_upload.flash_size = 16MB
|
||||
board_upload.maximum_size = 16777216
|
||||
build_flags =
|
||||
${esp32_base.build_flags}
|
||||
-I variants/lilygo_t_eth_elite_sx1276
|
||||
-D T_ETH_ELITE_SX1276
|
||||
-D RADIO_CLASS=CustomSX1276
|
||||
-D WRAPPER_CLASS=CustomSX1276Wrapper
|
||||
-D SX127X_CURRENT_LIMIT=120
|
||||
-D LORA_TX_POWER=20
|
||||
-D ENV_INCLUDE_GPS=1
|
||||
-D PIN_GPS_RX=39
|
||||
-D PIN_GPS_TX=42
|
||||
-D PIN_GPS_EN=-1
|
||||
build_src_filter = ${esp32_base.build_src_filter}
|
||||
+<../variants/lilygo_t_eth_elite_sx1276>
|
||||
+<helpers/esp32/TEthEliteBoard.cpp>
|
||||
+<helpers/sensors>
|
||||
lib_deps =
|
||||
${esp32_base.lib_deps}
|
||||
lewisxhe/XPowersLib @ ^0.2.7
|
||||
stevemarple/MicroNMEA @ ^2.0.6
|
||||
adafruit/Adafruit BME280 Library @ ^2.3.0
|
||||
|
||||
; === LilyGo T-ETH-Elite with SX1276 environments ===
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1276_repeater]
|
||||
extends = LilyGo_T_ETH_Elite_SX1276
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_SX1276.build_flags}
|
||||
-D ADVERT_NAME='"T-ETH Elite SX1276 Repeater"'
|
||||
-D ADVERT_LAT=0
|
||||
-D ADVERT_LON=0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D MAX_NEIGHBOURS=50
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1276.build_src_filter}
|
||||
+<../examples/simple_repeater>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1276.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1276_repeater_eth]
|
||||
extends = LilyGo_T_ETH_Elite_SX1276
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_SX1276.build_flags}
|
||||
-D ADVERT_NAME='"T-ETH Elite SX1276 Repeater"'
|
||||
-D ADVERT_LAT=0
|
||||
-D ADVERT_LON=0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D MAX_NEIGHBOURS=50
|
||||
-D USE_ETHERNET
|
||||
-D ETH_STATIC_IP=192,168,254,20
|
||||
-D ETH_GATEWAY=192,168,254,254
|
||||
-D ETH_SUBNET=255,255,255,0
|
||||
-D ETH_DNS=8,8,8,8
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1276.build_src_filter}
|
||||
+<../examples/simple_repeater>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1276.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1276_repeater_bridge_espnow]
|
||||
extends = LilyGo_T_ETH_Elite_SX1276
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_SX1276.build_flags}
|
||||
-D ADVERT_NAME='"T-ETH Elite SX1276 ESPNow Bridge"'
|
||||
-D ADVERT_LAT=0
|
||||
-D ADVERT_LON=0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D MAX_NEIGHBOURS=50
|
||||
-D WITH_ESPNOW_BRIDGE=1
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1276.build_src_filter}
|
||||
+<helpers/bridges/ESPNowBridge.cpp>
|
||||
+<../examples/simple_repeater>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1276.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1276_room_server]
|
||||
extends = LilyGo_T_ETH_Elite_SX1276
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_SX1276.build_flags}
|
||||
-D ADVERT_NAME='"T-ETH Elite SX1276 Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D ROOM_PASSWORD='"hello"'
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1276.build_src_filter}
|
||||
+<../examples/simple_room_server>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1276.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1276_room_server_eth]
|
||||
extends = LilyGo_T_ETH_Elite_SX1276
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_SX1276.build_flags}
|
||||
-D ADVERT_NAME='"T-ETH Elite SX1276 Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D ROOM_PASSWORD='"hello"'
|
||||
-D USE_ETHERNET
|
||||
-D ETH_STATIC_IP=192,168,254,20
|
||||
-D ETH_GATEWAY=192,168,254,254
|
||||
-D ETH_SUBNET=255,255,255,0
|
||||
-D ETH_DNS=8,8,8,8
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1276.build_src_filter}
|
||||
+<../examples/simple_room_server>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1276.lib_deps}
|
||||
${esp32_ota.lib_deps}
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1276_companion_radio_eth]
|
||||
extends = LilyGo_T_ETH_Elite_SX1276
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_SX1276.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D OFFLINE_QUEUE_SIZE=256
|
||||
-D USE_ETHERNET
|
||||
-D ETH_STATIC_IP=192,168,254,20
|
||||
-D ETH_GATEWAY=192,168,254,254
|
||||
-D ETH_SUBNET=255,255,255,0
|
||||
-D ETH_DNS=8,8,8,8
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1276.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1276.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1276_companion_radio_wifi]
|
||||
extends = LilyGo_T_ETH_Elite_SX1276
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_SX1276.build_flags}
|
||||
-I examples/companion_radio/ui-new
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D OFFLINE_QUEUE_SIZE=256
|
||||
-D WIFI_SSID='"WIFI_SSID"'
|
||||
-D WIFI_PWD='"Password"'
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1276.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1276.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
|
||||
[env:LilyGo_T_ETH_Elite_SX1276_companion_radio_ble]
|
||||
extends = LilyGo_T_ETH_Elite_SX1276
|
||||
build_flags =
|
||||
${LilyGo_T_ETH_Elite_SX1276.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
|
||||
build_src_filter = ${LilyGo_T_ETH_Elite_SX1276.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
+<helpers/ui/MomentaryButton.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
+<../examples/companion_radio/ui-new/*.cpp>
|
||||
lib_deps =
|
||||
${LilyGo_T_ETH_Elite_SX1276.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
56
variants/lilygo_t_eth_elite_sx1276/target.cpp
Normal file
56
variants/lilygo_t_eth_elite_sx1276/target.cpp
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
#include <Arduino.h>
|
||||
#include "helpers/ui/MomentaryButton.h"
|
||||
#include "target.h"
|
||||
|
||||
TEthEliteBoard board;
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
DISPLAY_CLASS display;
|
||||
#endif
|
||||
|
||||
MomentaryButton user_btn(PIN_USER_BTN_ANA, 1000, true);
|
||||
|
||||
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);
|
||||
|
||||
#if ENV_INCLUDE_GPS
|
||||
#include <helpers/sensors/MicroNMEALocationProvider.h>
|
||||
MicroNMEALocationProvider nmea = MicroNMEALocationProvider(Serial1);
|
||||
EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea);
|
||||
#else
|
||||
EnvironmentSensorManager sensors;
|
||||
#endif
|
||||
|
||||
bool radio_init() {
|
||||
fallback_clock.begin();
|
||||
rtc_clock.begin(Wire1);
|
||||
spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI);
|
||||
bool ok = radio.std_init(&spi);
|
||||
delay(100); // allow SX1276 to stabilize after init
|
||||
return ok;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
30
variants/lilygo_t_eth_elite_sx1276/target.h
Normal file
30
variants/lilygo_t_eth_elite_sx1276/target.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#define HAS_ETHERNET 1
|
||||
|
||||
#define RADIOLIB_STATIC_ONLY 1
|
||||
#include <RadioLib.h>
|
||||
#include <helpers/radiolib/RadioLibWrappers.h>
|
||||
#include <helpers/esp32/TEthEliteBoard.h>
|
||||
#include <helpers/radiolib/CustomSX1276Wrapper.h>
|
||||
#include <helpers/AutoDiscoverRTCClock.h>
|
||||
#include <helpers/sensors/EnvironmentSensorManager.h>
|
||||
#include <helpers/ui/MomentaryButton.h>
|
||||
|
||||
extern MomentaryButton user_btn;
|
||||
|
||||
#ifdef DISPLAY_CLASS
|
||||
#include <helpers/ui/SH1106Display.h>
|
||||
extern DISPLAY_CLASS display;
|
||||
#endif
|
||||
|
||||
extern TEthEliteBoard 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(int8_t dbm);
|
||||
mesh::LocalIdentity radio_new_identity();
|
||||
Loading…
Add table
Add a link
Reference in a new issue