feat: RGB LED support — blinks green on RX, red on TX

- Added RgbLed trait with impl on () for boards without LED
- Added WS2812 driver (driver/ws2812.rs) using ESP32-S3 RMT peripheral
  - 80MHz clock, 12.5ns resolution, 24-bit GRB encoding
  - Zero extra crate dependencies
- Heltec V3/V3-UART/V4: WS2812B on GPIO38 via RMT channel 0
- RAK WisBlock/Wio Tracker: type LedDriver = (), led = None (no-op)
- Display task: green blink on RX packet, red blink on TX packet
- LED auto-off on timer tick (~1s), off when display is off/reset
- LoRaBoard trait gains type LedDriver: RgbLed associated type
- BoardParts gains led: Option<L> field
This commit is contained in:
swaits committed 2026-04-07 11:18:30 -06:00
1 parent 2b9e236f32
commit 5ac4b73739
11 files changed
+157 -20

No files matched your search

+4 -1
View File
@@ -20,6 +20,7 @@ type RadioSpiDevice = SpiDevice<'static, NoopRawMutex, mcu::SpiBus, Nss>;
pub type RadioDriver = Sx126x<RadioSpiDevice, Iv, Sx1262>;
pub type UsbDriver = mcu::UsbNrfDriver;
pub type DisplayI2c = mcu::I2cBus;
pub type LedDriver = ();
pub type DisplayDriver = crate::driver::sh1106::Sh1106<DisplayI2c>;
@@ -66,6 +67,7 @@ impl LoRaBoard for Board {
type CommParts = UsbParts;
type DisplayParts = DisplayParts;
type DisplayDriver = DisplayDriver;
type LedDriver = ();
fn init() -> Self {
let mut config = embassy_nrf::config::Config::default();
@@ -79,7 +81,7 @@ impl LoRaBoard for Board {
mcu::mac_address()
}
fn into_parts(self) -> BoardParts<RadioParts, UsbParts, DisplayParts> {
fn into_parts(self) -> BoardParts<RadioParts, UsbParts, DisplayParts, ()> {
let p = self.p;
// ── SPI bus for SX1262 ──────────────────────────────────
@@ -133,6 +135,7 @@ impl LoRaBoard for Board {
radio,
host,
display,
led: None,
mac: Self::mac_address(),
}
}