Skip to main content

Module sk6812

Module sk6812 

Source
Expand description

SK6812 addressable-RGB LED-strip driver (M5GO Battery Bottom light bars).

The M5GO/FIRE Battery Bottom carries 10 SK6812 3535 RGB LEDs (two bars of five) on a single one-wire data line. SK6812 uses the same NRZ bit encoding as WS2812 — 24 bits per LED in G,R,B order, MSB first — so this is driven by the RMT peripheral, one [PulseCode] per bit, like the 1-Wire driver.

§Pin (this is the subtle part across boards)

The bottom’s LED data line is wired to a fixed physical M-Bus pin (pin 23, the classic I2S_OUT position). That physical pin maps to a different GPIO per core, so pass the right one:

  • Fire27 (ESP32): GPIO15 (M-Bus pin 23)
  • CoreS3 (ESP32-S3): GPIO13 (M-Bus pin 23)

On CoreS3 the bars are also unpowered until the M-Bus 5 V rail is enabled via the AW9523 — call crate::driver::aw9523b::Aw9523bDriver::enable_bus_5v first (see its guard notes). On the Fire that rail is always present.

§Timing

RMT source clock 80 MHz, clk_divider = 1 → 12.5 ns/tick. SK6812 nominal: T0H 0.3 µs / T0L 0.9 µs, T1H 0.6 µs / T1L 0.6 µs, reset ≥ 80 µs low.

Refs: SK6812 datasheet; https://docs.m5stack.com/en/base/m5go_bottom

Structs§

Rgb
A single LED colour (8 bits per channel).
Sk6812Driver

Enums§

Sk6812Error

Constants§

MAX_LEDS
Max LEDs this driver will drive in one frame (M5GO bottom uses 10). Sets the size of the per-frame pulse buffer; bump if you chain more.