Skip to content

Commit ce4e559

Browse files
committed
Add support for Xiao ESP32C6 with external antenna configuration
1 parent a310a5c commit ce4e559

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

src/helpers/esp32/XiaoC6Board.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#pragma once
2+
3+
#include <Arduino.h>
4+
#include <helpers/ESP32Board.h>
5+
6+
class XiaoC6Board : public ESP32Board {
7+
public:
8+
void begin() {
9+
ESP32Board::begin();
10+
11+
#ifdef USE_XIAO_ESP32C6_EXTERNAL_ANTENNA
12+
// Connect an external antenna to your XIAO ESP32C6 otherwise, it may be damaged!
13+
pinMode(3, OUTPUT);
14+
digitalWrite(3, LOW); // Activate RF switch control
15+
16+
delay(100);
17+
18+
pinMode(14, OUTPUT);
19+
digitalWrite(14, HIGH); // Use external antenna
20+
#endif
21+
}
22+
23+
const char* getManufacturerName() const override {
24+
return "Xiao C6";
25+
}
26+
};
27+
28+

variants/xiao_c6/platformio.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ build_flags =
8787
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
8888
-D SX126X_CURRENT_LIMIT=140
8989
-D SX126X_RX_BOOSTED_GAIN=1
90+
-D USE_XIAO_ESP32C6_EXTERNAL_ANTENNA=1
9091

9192
[env:Meshimi_Repeater]
9293
extends = Meshimi

variants/xiao_c6/target.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <Arduino.h>
22
#include "target.h"
33

4-
ESP32Board board;
4+
XiaoC6Board board;
55

66
#if defined(P_LORA_SCLK)
77
static SPIClass spi(0);

variants/xiao_c6/target.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
#include <RadioLib.h>
55
#include <helpers/radiolib/RadioLibWrappers.h>
66
#include <helpers/ESP32Board.h>
7+
#include <helpers/esp32/XiaoC6Board.h>
78
#include <helpers/radiolib/CustomSX1262Wrapper.h>
89
#include <helpers/AutoDiscoverRTCClock.h>
910
#include <helpers/SensorManager.h>
1011

11-
extern ESP32Board board;
12+
extern XiaoC6Board board;
1213
extern WRAPPER_CLASS radio_driver;
1314
extern AutoDiscoverRTCClock rtc_clock;
1415
extern SensorManager sensors;

0 commit comments

Comments
 (0)