mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Merge pull request #587 from alexbegoon/feature/xiao-c6-external-antenna-support
[Feature] Add external antenna support for XIAO ESP32C6
This commit is contained in:
commit
e47a1df67f
4 changed files with 35 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
|
|
||||||
ESP32Board board;
|
XiaoC6Board board;
|
||||||
|
|
||||||
#if defined(P_LORA_SCLK)
|
#if defined(P_LORA_SCLK)
|
||||||
static SPIClass spi(0);
|
static SPIClass spi(0);
|
||||||
|
|
@ -47,3 +47,5 @@ mesh::LocalIdentity radio_new_identity() {
|
||||||
RadioNoiseListener rng(radio);
|
RadioNoiseListener rng(radio);
|
||||||
return mesh::LocalIdentity(&rng); // create new random identity
|
return mesh::LocalIdentity(&rng); // create new random identity
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
28
variants/xiao_c6/XiaoC6Board.h
Normal file
28
variants/xiao_c6/XiaoC6Board.h
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <Arduino.h>
|
||||||
|
#include <helpers/ESP32Board.h>
|
||||||
|
|
||||||
|
class XiaoC6Board : public ESP32Board {
|
||||||
|
public:
|
||||||
|
void begin() {
|
||||||
|
ESP32Board::begin();
|
||||||
|
|
||||||
|
#ifdef USE_XIAO_ESP32C6_EXTERNAL_ANTENNA
|
||||||
|
// Connect an external antenna to your XIAO ESP32C6 otherwise, it may be damaged!
|
||||||
|
pinMode(3, OUTPUT);
|
||||||
|
digitalWrite(3, LOW); // Activate RF switch control
|
||||||
|
|
||||||
|
delay(100);
|
||||||
|
|
||||||
|
pinMode(14, OUTPUT);
|
||||||
|
digitalWrite(14, HIGH); // Use external antenna
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* getManufacturerName() const override {
|
||||||
|
return "Xiao C6";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -28,6 +28,7 @@ build_flags =
|
||||||
-D DISABLE_WIFI_OTA=1
|
-D DISABLE_WIFI_OTA=1
|
||||||
build_src_filter = ${esp32c6_base.build_src_filter}
|
build_src_filter = ${esp32c6_base.build_src_filter}
|
||||||
+<../variants/xiao_c6>
|
+<../variants/xiao_c6>
|
||||||
|
+<XiaoC6Board.cpp>
|
||||||
|
|
||||||
[env:Xiao_C6_Repeater]
|
[env:Xiao_C6_Repeater]
|
||||||
extends = Xiao_C6
|
extends = Xiao_C6
|
||||||
|
|
@ -87,6 +88,7 @@ build_flags =
|
||||||
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
|
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
|
||||||
-D SX126X_CURRENT_LIMIT=140
|
-D SX126X_CURRENT_LIMIT=140
|
||||||
-D SX126X_RX_BOOSTED_GAIN=1
|
-D SX126X_RX_BOOSTED_GAIN=1
|
||||||
|
-D USE_XIAO_ESP32C6_EXTERNAL_ANTENNA=1
|
||||||
|
|
||||||
[env:Meshimi_Repeater]
|
[env:Meshimi_Repeater]
|
||||||
extends = Meshimi
|
extends = Meshimi
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,14 @@
|
||||||
|
|
||||||
#define RADIOLIB_STATIC_ONLY 1
|
#define RADIOLIB_STATIC_ONLY 1
|
||||||
#include <RadioLib.h>
|
#include <RadioLib.h>
|
||||||
|
#include <XiaoC6Board.h>
|
||||||
#include <helpers/radiolib/RadioLibWrappers.h>
|
#include <helpers/radiolib/RadioLibWrappers.h>
|
||||||
#include <helpers/ESP32Board.h>
|
#include <helpers/ESP32Board.h>
|
||||||
#include <helpers/radiolib/CustomSX1262Wrapper.h>
|
#include <helpers/radiolib/CustomSX1262Wrapper.h>
|
||||||
#include <helpers/AutoDiscoverRTCClock.h>
|
#include <helpers/AutoDiscoverRTCClock.h>
|
||||||
#include <helpers/SensorManager.h>
|
#include <helpers/SensorManager.h>
|
||||||
|
|
||||||
extern ESP32Board board;
|
extern XiaoC6Board board;
|
||||||
extern WRAPPER_CLASS radio_driver;
|
extern WRAPPER_CLASS radio_driver;
|
||||||
extern AutoDiscoverRTCClock rtc_clock;
|
extern AutoDiscoverRTCClock rtc_clock;
|
||||||
extern SensorManager sensors;
|
extern SensorManager sensors;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue