@@ -22,6 +22,14 @@ extern "C" {
2222#define NUM_ANALOG_INPUTS (8) // A6 is used for battery, A7 is analog reference
2323#define NUM_ANALOG_OUTPUTS (0)
2424
25+ #ifdef D6D7_OLED
26+ #define HAS_SCREEN 1
27+ #define USE_SSD1306
28+ #else
29+ // Breaks build:
30+ // #define HAS_SCREEN 0
31+ #endif
32+
2533// LEDs
2634
2735#define LED_RED 11
@@ -56,14 +64,11 @@ extern "C" {
5664#define D9 (9ul)
5765#define D10 (10ul)
5866
59- /*Due to the lack of pins,and have to make sure gps standby work well we have temporarily removed the button.
60- There are some technical solutions that can solve this problem,
61- and we are currently exploring and researching them*/
62-
63- // #define BUTTON_PIN D0 // This is the Program Button
64- // // #define BUTTON_NEED_PULLUP 1
65- // #define BUTTON_ACTIVE_LOW true
66- // #define BUTTON_ACTIVE_PULLUP false
67+ // Wio-SX1262 for XIAO
68+ // Store page: https://www.seeedstudio.com/Wio-SX1262-for-XIAO-p-6379.html
69+ // Schematic: https://files.seeedstudio.com/products/SenseCAP/Wio_SX1262/Wio-SX1262%20for%20XIAO%20V1.0_SCH.pdf
70+ #define PIN_BUTTON1 D0
71+ #define BUTTON_NEED_PULLUP
6772
6873/*
6974 * Analog pins
@@ -85,6 +90,15 @@ static const uint8_t A4 = PIN_A4;
8590static const uint8_t A5 = PIN_A5 ;
8691#define ADC_RESOLUTION 12
8792
93+ // RX and TX pins
94+ #if defined(D6D7_SERIAL1 ) || defined(D6D7_L76K )
95+ #define PIN_SERIAL1_RX D6
96+ #define PIN_SERIAL1_TX D7
97+ #else
98+ #define PIN_SERIAL1_RX (-1)
99+ #define PIN_SERIAL1_TX (-1)
100+ #endif
101+
88102#define PIN_SERIAL2_RX (-1)
89103#define PIN_SERIAL2_TX (-1)
90104
@@ -125,23 +139,32 @@ static const uint8_t SCK = PIN_SPI_SCK;
125139#define I2C_NO_RESCAN // I2C is a bit finicky, don't scan too much
126140#define WIRE_INTERFACES_COUNT 1 // 2
127141
128- #define PIN_WIRE_SDA (24) // change to use the correct pins if needed
129- #define PIN_WIRE_SCL (25) // change to use the correct pins if needed
142+ #if defined(D6D7_I2C ) || defined(USE_SSD1306 )
143+ #define PIN_WIRE_SDA D6
144+ #define PIN_WIRE_SCL D7
145+ #else
146+ #define PIN_WIRE_SDA (-1)
147+ #define PIN_WIRE_SCL (-1)
148+ #endif
130149
131150static const uint8_t SDA = PIN_WIRE_SDA ;
132151static const uint8_t SCL = PIN_WIRE_SCL ;
133152
134- // GPS L76KB
153+ // L76K GNSS Module for Seeed Studio XIAO
154+ // Store page: https://www.seeedstudio.com/L76K-GNSS-Module-for-Seeed-Studio-XIAO-p-5864.html
155+ // Schematic:
156+ // https://files.seeedstudio.com/wiki/Seeeduino-XIAO-Expansion-Board/GPS_Module/L76K/109100021-L76K-GNSS-Module-for-Seeed-Studio-XIAO-Schematic.pdf
157+ // -------------------
158+ #ifdef D6D7_L76K
135159#define GPS_L76K
136- #ifdef GPS_L76K
137- #define PIN_GPS_RX D6
138- #define PIN_GPS_TX D7
139160#define HAS_GPS 1
140161#define GPS_BAUDRATE 9600
141162#define GPS_THREAD_INTERVAL 50
142- #define PIN_SERIAL1_RX PIN_GPS_TX
143- #define PIN_SERIAL1_TX PIN_GPS_RX
144163#define PIN_GPS_STANDBY D0
164+ #undef PIN_BUTTON1 // Overlapping assignment with Wio-SX1262 for XIAO user button
165+ #define PIN_BUTTON1 (-1)
166+ #else
167+ #define HAS_GPS 0
145168#endif
146169
147170// Battery
0 commit comments