FastLED 3.9.15
Loading...
Searching...
No Matches

◆ spiEncoderForChipset()

static SpiEncoder fl::SpiEncoder::spiEncoderForChipset ( SpiChipset chipset,
u32 speed_hz_override = 0 )
inlinestatic

Look up the default SpiEncoder for a given chipset.

Parameters
chipsetThe SPI chipset enum value
speed_hz_overrideIf nonzero, overrides the chipset's default clock speed
Returns
SpiEncoder with correct chipset and clock speed

Definition at line 151 of file spi.h.

151 {
152 SpiEncoder enc = {chipset, 6000000}; // fallback
153 switch (chipset) {
154 case SpiChipset::APA102: enc = apa102(); break;
155 case SpiChipset::APA102HD: enc = apa102HD(); break;
156 case SpiChipset::DOTSTAR: enc = dotstar(); break;
157 case SpiChipset::DOTSTARHD: enc = dotstarHD(); break;
158 case SpiChipset::SK9822: enc = sk9822(); break;
159 case SpiChipset::SK9822HD: enc = sk9822HD(); break;
160 case SpiChipset::HD107: enc = hd107(); break;
161 case SpiChipset::HD107HD: enc = hd107HD(); break;
162 case SpiChipset::HD108: enc = hd108(); break;
163 case SpiChipset::WS2801: enc = ws2801(); break;
164 case SpiChipset::WS2803: enc = ws2803(); break;
165 case SpiChipset::P9813: enc = p9813(); break;
166 case SpiChipset::LPD8806: enc = lpd8806(); break;
167 case SpiChipset::LPD6803: enc = lpd6803(); break;
168 case SpiChipset::SM16716: enc = sm16716(); break;
169 default: break; // unknown chipset: keep fallback
170 }
171 if (speed_hz_override != 0) {
172 enc.clock_hz = speed_hz_override;
173 }
174 return enc;
175 }
@ SM16716
SM16716 LED chipset.
@ LPD6803
LPD6803 LED chipset.
@ APA102HD
APA102 LED chipset with 5-bit gamma correction.
@ HD107
Same as APA102, but in turbo 40-mhz mode.
@ DOTSTARHD
APA102HD LED chipset alias.
@ SK9822HD
SK9822 LED chipset with 5-bit gamma correction.
@ SK9822
SK9822 LED chipset.
@ DOTSTAR
APA102 LED chipset alias.
@ P9813
P9813 LED chipset.
@ APA102
APA102 LED chipset.
@ HD108
16-bit variant of HD107, always gamma corrected. No SD (standard definition) option available - all H...
@ LPD8806
LPD8806 LED chipset.
@ WS2803
WS2803 LED chipset.
@ WS2801
WS2801 LED chipset.
@ HD107HD
Same as APA102HD, but in turbo 40-mhz mode.
static SpiEncoder hd108(u32 clock_hz=25000000) FL_NOEXCEPT
Create HD108 encoder configuration.
Definition spi.h:100
static SpiEncoder ws2803(u32 clock_hz=25000000) FL_NOEXCEPT
Create WS2803 encoder configuration.
Definition spi.h:114
static SpiEncoder lpd8806(u32 clock_hz=12000000) FL_NOEXCEPT
Create LPD8806 encoder configuration.
Definition spi.h:128
SpiChipset chipset
LED chipset type (determines all encoding behavior)
Definition spi.h:39
static SpiEncoder apa102(u32 clock_hz=6000000) FL_NOEXCEPT
Create APA102 encoder configuration.
Definition spi.h:44
static SpiEncoder lpd6803(u32 clock_hz=12000000) FL_NOEXCEPT
Create LPD6803 encoder configuration.
Definition spi.h:135
static SpiEncoder hd107HD(u32 clock_hz=40000000) FL_NOEXCEPT
Create HD107HD encoder configuration.
Definition spi.h:93
static SpiEncoder dotstarHD(u32 clock_hz=6000000) FL_NOEXCEPT
Create DOTSTARHD encoder configuration (alias for APA102HD)
Definition spi.h:79
static SpiEncoder sk9822(u32 clock_hz=12000000) FL_NOEXCEPT
Create SK9822 encoder configuration.
Definition spi.h:58
static SpiEncoder sm16716(u32 clock_hz=16000000) FL_NOEXCEPT
Create SM16716 encoder configuration.
Definition spi.h:142
static SpiEncoder sk9822HD(u32 clock_hz=12000000) FL_NOEXCEPT
Create SK9822HD encoder configuration.
Definition spi.h:65
static SpiEncoder dotstar(u32 clock_hz=6000000) FL_NOEXCEPT
Create DOTSTAR encoder configuration (alias for APA102)
Definition spi.h:72
static SpiEncoder p9813(u32 clock_hz=10000000) FL_NOEXCEPT
Create P9813 encoder configuration.
Definition spi.h:121
static SpiEncoder ws2801(u32 clock_hz=1000000) FL_NOEXCEPT
Create WS2801 encoder configuration.
Definition spi.h:107
static SpiEncoder hd107(u32 clock_hz=40000000) FL_NOEXCEPT
Create HD107 encoder configuration.
Definition spi.h:86
static SpiEncoder apa102HD(u32 clock_hz=6000000) FL_NOEXCEPT
Create APA102HD encoder configuration (per-LED brightness via HD gamma)
Definition spi.h:51

References fl::APA102, apa102(), fl::APA102HD, apa102HD(), chipset, clock_hz, fl::DOTSTAR, dotstar(), fl::DOTSTARHD, dotstarHD(), FL_NOEXCEPT, fl::HD107, hd107(), fl::HD107HD, hd107HD(), fl::HD108, hd108(), fl::LPD6803, lpd6803(), fl::LPD8806, lpd8806(), fl::P9813, p9813(), fl::SK9822, sk9822(), fl::SK9822HD, sk9822HD(), fl::SM16716, sm16716(), fl::WS2801, ws2801(), fl::WS2803, and ws2803().

+ Here is the call graph for this function: