mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-14 12:26:34 +00:00
initial port of M5Stack Unit C6L, update pioarduino to newer bugfix release
This commit is contained in:
@@ -68,10 +68,10 @@ lib_deps =
|
||||
file://arch/esp32/AsyncElegantOTA
|
||||
|
||||
; esp32c6 uses arduino framework 3.x
|
||||
; WARNING: experimental. pioarduino on esp32c6 needs work - it's not considered stable and has issues.
|
||||
; WARNING: experimental. May not work as stable as other platforms.
|
||||
[esp32c6_base]
|
||||
extends = esp32_base
|
||||
platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.12/platform-espressif32.zip
|
||||
platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.13-1/platform-espressif32.zip
|
||||
|
||||
; ----------------- NRF52 ---------------------
|
||||
|
||||
@@ -80,7 +80,7 @@ extends = arduino_base
|
||||
platform = nordicnrf52
|
||||
platform_packages =
|
||||
framework-arduinoadafruitnrf52 @ 1.10700.0
|
||||
extra_scripts =
|
||||
extra_scripts =
|
||||
create-uf2.py
|
||||
arch/nrf52/extra_scripts/patch_bluefruit.py
|
||||
build_flags = ${arduino_base.build_flags}
|
||||
|
||||
49
variants/m5stack_unit_c6l/UnitC6LBoard.cpp
Normal file
49
variants/m5stack_unit_c6l/UnitC6LBoard.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
#include <Arduino.h>
|
||||
#include "target.h"
|
||||
|
||||
UnitC6LBoard board;
|
||||
|
||||
#if defined(P_LORA_SCLK)
|
||||
static SPIClass spi(0);
|
||||
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi);
|
||||
#else
|
||||
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY);
|
||||
#endif
|
||||
|
||||
WRAPPER_CLASS radio_driver(radio, board);
|
||||
|
||||
ESP32RTCClock fallback_clock;
|
||||
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||
SensorManager sensors;
|
||||
|
||||
bool radio_init() {
|
||||
fallback_clock.begin();
|
||||
rtc_clock.begin(Wire);
|
||||
|
||||
#if defined(P_LORA_SCLK)
|
||||
spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI);
|
||||
return radio.std_init(&spi);
|
||||
#else
|
||||
return radio.std_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
uint32_t radio_get_rng_seed() {
|
||||
return radio.random(0x7FFFFFFF);
|
||||
}
|
||||
|
||||
void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) {
|
||||
radio.setFrequency(freq);
|
||||
radio.setSpreadingFactor(sf);
|
||||
radio.setBandwidth(bw);
|
||||
radio.setCodingRate(cr);
|
||||
}
|
||||
|
||||
void radio_set_tx_power(uint8_t dbm) {
|
||||
radio.setOutputPower(dbm);
|
||||
}
|
||||
|
||||
mesh::LocalIdentity radio_new_identity() {
|
||||
RadioNoiseListener rng(radio);
|
||||
return mesh::LocalIdentity(&rng); // create new random identity
|
||||
}
|
||||
15
variants/m5stack_unit_c6l/UnitC6LBoard.h
Normal file
15
variants/m5stack_unit_c6l/UnitC6LBoard.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <helpers/ESP32Board.h>
|
||||
|
||||
class UnitC6LBoard : public ESP32Board {
|
||||
public:
|
||||
void begin() {
|
||||
ESP32Board::begin();
|
||||
}
|
||||
|
||||
const char* getManufacturerName() const override {
|
||||
return "Unit C6L";
|
||||
}
|
||||
};
|
||||
104
variants/m5stack_unit_c6l/platformio.ini
Normal file
104
variants/m5stack_unit_c6l/platformio.ini
Normal file
@@ -0,0 +1,104 @@
|
||||
[M5Stack_Unit_C6L]
|
||||
extends = esp32c6_base
|
||||
board = esp32-c6-devkitm-1
|
||||
board_build.partitions = min_spiffs.csv ; get around 4mb flash limit
|
||||
build_flags =
|
||||
${esp32c6_base.build_flags}
|
||||
${sensor_base.build_flags}
|
||||
-I variants/M5Stack_Unit_C6L
|
||||
-D P_LORA_TX_LED=15
|
||||
-D P_LORA_SCLK=20
|
||||
-D P_LORA_MISO=22
|
||||
-D P_LORA_MOSI=21
|
||||
-D P_LORA_NSS=23
|
||||
-D P_LORA_DIO_1=7
|
||||
-D P_LORA_BUSY=19
|
||||
-D P_LORA_RESET=-1
|
||||
-D PIN_BUZZER=11
|
||||
-D PIN_BOARD_SDA=16
|
||||
-D PIN_BOARD_SCL=17
|
||||
-D SX126X_RXEN=5
|
||||
-D SX126X_DIO2_AS_RF_SWITCH=true
|
||||
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
|
||||
-D SX126X_CURRENT_LIMIT=140
|
||||
-D SX126X_RX_BOOSTED_GAIN=1
|
||||
-D RADIO_CLASS=CustomSX1262
|
||||
-D WRAPPER_CLASS=CustomSX1262Wrapper
|
||||
-D LORA_TX_POWER=22
|
||||
-D DISABLE_WIFI_OTA=1
|
||||
-D GPS_RX=4
|
||||
-D GPS_TX=5
|
||||
build_src_filter = ${esp32c6_base.build_src_filter}
|
||||
+<../variants/m5stack_unit_c6l>
|
||||
+<UnitC6LBoard.cpp>
|
||||
lib_deps =
|
||||
${esp32c6_base.lib_deps}
|
||||
${sensor_base.lib_deps}
|
||||
|
||||
[env:M5Stack_Unit_C6L_repeater]
|
||||
extends = M5Stack_Unit_C6L
|
||||
build_src_filter = ${M5Stack_Unit_C6L.build_src_filter}
|
||||
+<../examples/simple_repeater/*.cpp>
|
||||
build_flags =
|
||||
${M5Stack_Unit_C6L.build_flags}
|
||||
-D ADVERT_NAME='"Unit C6L Repeater"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D MAX_NEIGHBOURS=50
|
||||
; -D MESH_PACKET_LOGGING=1
|
||||
; -D MESH_DEBUG=1
|
||||
lib_deps =
|
||||
${M5Stack_Unit_C6L.lib_deps}
|
||||
; ${esp32_ota.lib_deps}
|
||||
|
||||
[env:M5Stack_Unit_C6L_room_server]
|
||||
extends = M5Stack_Unit_C6L
|
||||
build_src_filter = ${M5Stack_Unit_C6L.build_src_filter}
|
||||
+<../examples/simple_room_server>
|
||||
build_flags =
|
||||
${M5Stack_Unit_C6L.build_flags}
|
||||
-D ADVERT_NAME='"Unit C6L Room"'
|
||||
-D ADVERT_LAT=0.0
|
||||
-D ADVERT_LON=0.0
|
||||
-D ADMIN_PASSWORD='"password"'
|
||||
-D ROOM_PASSWORD='"hello"'
|
||||
; -D MESH_PACKET_LOGGING=1
|
||||
; -D MESH_DEBUG=1
|
||||
lib_deps =
|
||||
${M5Stack_Unit_C6L.lib_deps}
|
||||
; ${esp32_ota.lib_deps}
|
||||
|
||||
[env:M5Stack_Unit_C6L_companion_radio_ble]
|
||||
extends = M5Stack_Unit_C6L
|
||||
build_flags = ${M5Stack_Unit_C6L.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 = ${M5Stack_Unit_C6L.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
-<helpers/esp32/ESPNOWRadio.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
lib_deps =
|
||||
${M5Stack_Unit_C6L.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
end2endzone/NonBlockingRTTTL@^1.3.0
|
||||
|
||||
[env:M5Stack_Unit_C6L_companion_radio_usb]
|
||||
extends = M5Stack_Unit_C6L
|
||||
build_flags = ${M5Stack_Unit_C6L.build_flags}
|
||||
-D MAX_CONTACTS=350
|
||||
-D MAX_GROUP_CHANNELS=40
|
||||
-D OFFLINE_QUEUE_SIZE=256
|
||||
build_src_filter = ${M5Stack_Unit_C6L.build_src_filter}
|
||||
+<helpers/esp32/*.cpp>
|
||||
-<helpers/esp32/ESPNOWRadio.cpp>
|
||||
+<../examples/companion_radio/*.cpp>
|
||||
lib_deps =
|
||||
${M5Stack_Unit_C6L.lib_deps}
|
||||
densaugeo/base64 @ ~1.4.0
|
||||
end2endzone/NonBlockingRTTTL@^1.3.0
|
||||
21
variants/m5stack_unit_c6l/target.h
Normal file
21
variants/m5stack_unit_c6l/target.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#define RADIOLIB_STATIC_ONLY 1
|
||||
#include <RadioLib.h>
|
||||
#include <UnitC6LBoard.h>
|
||||
#include <helpers/radiolib/RadioLibWrappers.h>
|
||||
#include <helpers/ESP32Board.h>
|
||||
#include <helpers/radiolib/CustomSX1262Wrapper.h>
|
||||
#include <helpers/AutoDiscoverRTCClock.h>
|
||||
#include <helpers/SensorManager.h>
|
||||
|
||||
extern UnitC6LBoard board;
|
||||
extern WRAPPER_CLASS radio_driver;
|
||||
extern AutoDiscoverRTCClock rtc_clock;
|
||||
extern SensorManager sensors;
|
||||
|
||||
bool radio_init();
|
||||
uint32_t radio_get_rng_seed();
|
||||
void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr);
|
||||
void radio_set_tx_power(uint8_t dbm);
|
||||
mesh::LocalIdentity radio_new_identity();
|
||||
Reference in New Issue
Block a user