1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! `no_std` driver for single-wire addressable LED strips (WS2812, SK6812, WS2811, WS2816).
//!
//! # Architecture
//!
//! ```text
//! LedStrip --> WireCodec (pixels => transport words) --> TransportBackend (transmit)
//! | |
//! +-- SpiCodec (SPI bit-banging) +-- SpiBackend (SPI)
//! ```
//!
//! The [`WireCodec`] / [`TransportBackend`] traits are intentionally generic:
//! [`SpiCodec`] / [`SpiBackend`] are the current production implementation,
//! but the trait design accommodates future backends (RMT, PIO, etc.) without
//! API changes.
//!
//! # Features
//!
//! | Feature | Default | Description |
//! |---------|---------|-------------|
//! | `spi` | Yes | SPI backend, requires `embedded-hal` |
//!
//! # Quick start
//!
//! ```ignore
//! use led_strip::{LedStrip, SpiCodec, SpiBackend, SpiEncodingPlan, Rgb, RgbOrder, Ws2812B};
//!
//! let codec = SpiCodec::<Rgb, Ws2812B>::for_protocol(
//! SpiEncodingPlan::ws2812_3bit(), false
//! )?;
//! let backend = SpiBackend::new(spi_peripheral);
//! let mut strip: LedStrip<Rgb, Ws2812B, _, _, 256> =
//! LedStrip::new(RgbOrder::Grb, codec, backend);
//!
//! let pixels = [Rgb::new(255, 0, 0); 60];
//! strip.write(&pixels)?;
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;