From bbfac7a594c702643a66839f1f82ab27206ea0de Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Mon, 12 May 2025 02:13:29 +0800 Subject: [PATCH] feat: variant seeed_xiao_nrf52840_wio-sx1262_v1_1: supports Wio-SX1262 PCB v1.1 Signed-off-by: Andrew Yong --- variants/diy/platformio.ini | 6 ++++ variants/seeed_xiao_nrf52840_kit/variant.h | 34 +++++++++++++++------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/variants/diy/platformio.ini b/variants/diy/platformio.ini index d94f2a9ad..b44fbf571 100644 --- a/variants/diy/platformio.ini +++ b/variants/diy/platformio.ini @@ -103,6 +103,12 @@ build_flags = ; XIAO nRF52840 & Wio-SX1262 Kit for Meshtastic - DIY builds ; Make changes to pin definition overrides in ../seeed_xiao_nrf52840_kit/variant.h +; XIAO nRF52840 & Wio-SX1262 v1.1 PCB (XIAO ESP32S3 & Wio-SX1262 Kit ships with this PCB) +; I2C defined for feature parity with removed diy/seeed-xiao-nrf52840-wio-sx1262 variant +[env:seeed_xiao_nrf52840_wio-sx1262_v1_1] +extends = env:seeed_xiao_nrf52840_kit +build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} -DSEEED_XIAO_WIO1_1 -DSEEED_XIAO_D6D7_I2C + ; XIAO nRF52840 & Wio-SX1262 Kit, with L76K GNSS Module for Seeed Studio XIAO ; Store page: https://www.seeedstudio.com/L76K-GNSS-Module-for-Seeed-Studio-XIAO-p-5864.html [env:seeed_xiao_nrf52840_kit_l76k] diff --git a/variants/seeed_xiao_nrf52840_kit/variant.h b/variants/seeed_xiao_nrf52840_kit/variant.h index d2bb58bf7..a64ba4e6a 100644 --- a/variants/seeed_xiao_nrf52840_kit/variant.h +++ b/variants/seeed_xiao_nrf52840_kit/variant.h @@ -64,12 +64,6 @@ extern "C" { #define D9 (9ul) #define D10 (10ul) -// Wio-SX1262 for XIAO -// Store page: https://www.seeedstudio.com/Wio-SX1262-for-XIAO-p-6379.html -// Schematic: https://files.seeedstudio.com/products/SenseCAP/Wio_SX1262/Wio-SX1262%20for%20XIAO%20V1.0_SCH.pdf -#define PIN_BUTTON1 D0 -#define BUTTON_NEED_PULLUP - /* * Analog pins */ @@ -119,16 +113,36 @@ static const uint8_t SCK = PIN_SPI_SCK; // supported modules list #define USE_SX1262 -// common pinouts for SX126X modules +#ifdef SEEED_XIAO_WIO1_1 +// Wio-SX1262 PCB v1.1 pinout +// XIAO ESP32S3 & Wio-SX1262 Kit ships with this PCB +#define SX126X_CS D3 +#define SX126X_DIO1 D0 +#define SX126X_BUSY D1 +#define SX126X_RESET D2 +#define SX126X_RXEN 38 +// Button on Wio-SX1262 +#define PIN_BUTTON1 D5 +#define BUTTON_NEED_PULLUP +#else +// Wio-SX1262 PCB v1.0 pinout +// XIAO nRF52840 & Wio-SX1262 Kit ships with this PCB #define SX126X_CS D4 #define SX126X_DIO1 D1 #define SX126X_BUSY D3 #define SX126X_RESET D2 +#define SX126X_RXEN D5 // This is used to control the RX side of the RF switch +// Button on Wio-SX1262, it conflicts with the L76K GPS enable pin +#ifdef SEEED_XIAO_D6D7_L76K +#define PIN_BUTTON1 D0 +#define BUTTON_NEED_PULLUP +#endif +#endif + +// RF switch strategy for Wio-SX1262 #define SX126X_TXEN RADIOLIB_NC - -#define SX126X_RXEN D5 // This is used to control the RX side of the RF switch #define SX126X_DIO2_AS_RF_SWITCH // DIO2 is used to control the TX side of the RF switch #define SX126X_DIO3_TCXO_VOLTAGE 1.8 @@ -162,8 +176,6 @@ static const uint8_t SCL = PIN_WIRE_SCL; #define GPS_BAUDRATE 9600 #define GPS_THREAD_INTERVAL 50 #define PIN_GPS_STANDBY D0 -#undef PIN_BUTTON1 // Overlapping assignment with Wio-SX1262 for XIAO user button -#define PIN_BUTTON1 (-1) #else #define HAS_GPS 0 #endif