seeed_xiao_nrf52840_kit improvements (#6930)

* feat: seeed_xiao_nrf52840_kit improvements
- LEDs:
  - Change RGB LED to be active low as it is common anode
  - Remove re-definition of LED_PIN
  - Use red LED to indicate flash writes
  - Use blue LED as user LED (External Notification module)
- GPIO: Re-word unused BUTTON_PIN comment
- Wire: Set I2C pins to match XIAO nRF52840 Sense's LSM6DS3TR IMU
- Battery:
  - Use charge LED to detect charging state
  - Move voltage divider boilerplate out of src/main.cpp and into initVariant()
  - Fix dependencies for above in related XIAO BLE DIY variants

Build tested variants:
- seeed_xiao_nrf52840_kit
- xiao_ble
- seeed-xiao-nrf52840-wio-sx1262

Flashed to and tested on hardware:
- seeed_xiao_nrf52840_kit

Signed-off-by: Andrew Yong <me@ndoo.sg>

* chore(seeed_xiao_nrf52840_kit): Re-order generic GPIO definitions

Signed-off-by: Andrew Yong <me@ndoo.sg>

* chore: Use ADC_CTRL for XIAO nRF52840

Signed-off-by: Andrew Yong <me@ndoo.sg>

---------

Signed-off-by: Andrew Yong <me@ndoo.sg>
This commit is contained in:
Andrew Yong
2025-06-05 19:45:43 +08:00
committed by GitHub
parent 76f7207463
commit 070deb290f
7 changed files with 88 additions and 80 deletions

View File

@@ -34,9 +34,9 @@ const uint32_t g_ADigitalPinMap[] = {
11, // D18 is P0.11 (6D_INT1)
// MIC
42, // 17,//42, // D19 is P1.10 (MIC_PWR)
32, // 26,//32, // D20 is P1.00 (PDM_CLK)
16, // 25,//16, // D21 is P0.16 (PDM_DATA)
42, // D19 is P1.10 (MIC_PWR)
32, // D20 is P1.00 (PDM_CLK)
16, // D21 is P0.16 (PDM_DATA)
// BQ25100
13, // D22 is P0.13 (HICHG)
@@ -80,13 +80,17 @@ const uint32_t g_ADigitalPinMap[] = {
void initVariant()
{
// LED1 & LED2
pinMode(21, OUTPUT);
digitalWrite(21, LOW);
// LED1 & LED2
pinMode(22, OUTPUT);
digitalWrite(22, LOW);
// Set BQ25101 ISET to 100mA instead of 50mA
pinMode(HICHG, OUTPUT);
digitalWrite(HICHG, LOW);
pinMode(PIN_WIRE_SDA, INPUT_PULLUP);
pinMode(PIN_WIRE_SCL, INPUT_PULLUP);
}
// LEDs
pinMode(PIN_LED1, OUTPUT);
ledOff(PIN_LED1);
pinMode(PIN_LED2, OUTPUT);
ledOff(PIN_LED2);
pinMode(PIN_LED3, OUTPUT);
ledOff(PIN_LED3);
}