FastLED 3.10.6
Loading...
Searching...
No Matches

◆ selectPixelEncoder()

Channel::PixelEncoder fl::Channel::selectPixelEncoder ( const ChipsetVariant & chipset)
staticprivate

The chipset is fixed when a Channel is constructed, so bind its pixel encoder once instead of switching over every supported chipset on every frame.

The encoder callbacks remain channel-side: drivers receive ChannelData only after it has been encoded.

Definition at line 230 of file channel.cpp.hpp.

230 {
231 if (const ClocklessChipset* clockless = chipset.ptr<ClocklessChipset>()) {
232 switch (clockless->encoder) {
234 return &Channel::encodeWS2812;
236 return &Channel::encodeTM1812RGBWW;
238 return &Channel::encodeTM1908;
239#if !defined(FASTLED_DISABLE_UCS7604) || !FASTLED_DISABLE_UCS7604
243 return &Channel::encodeUCS7604;
244#endif
245 }
246 } else if (const SpiChipsetConfig* spi = chipset.ptr<SpiChipsetConfig>()) {
247#if !defined(FASTLED_DISABLE_SPI_CHIPSETS) || !FASTLED_DISABLE_SPI_CHIPSETS
248 switch (spi->timing.chipset) {
255 return &Channel::encodeAPA102;
258 return &Channel::encodeSK9822;
260 return &Channel::encodeWS2801;
262 return &Channel::encodeWS2803;
264 return &Channel::encodeP9813;
266 return &Channel::encodeLPD8806;
268 return &Channel::encodeLPD6803;
270 return &Channel::encodeSM16716;
272 return &Channel::encodeMY9221;
274 return &Channel::encodeHD108;
275 }
276#endif // !FASTLED_DISABLE_SPI_CHIPSETS
277 }
278 return nullptr;
279}
@ CLOCKLESS_ENCODER_UCS7604_8BIT
UCS7604 8-bit 800KHz.
@ CLOCKLESS_ENCODER_TM1812_RGBWW
TM1812: two 5-byte RGBWW pixels in each 12-byte IC frame.
@ CLOCKLESS_ENCODER_UCS7604_16BIT
UCS7604 16-bit 800KHz.
@ CLOCKLESS_ENCODER_UCS7604_16BIT_1600
UCS7604 16-bit 1600KHz.
@ CLOCKLESS_ENCODER_WS2812
Default, no preamble (WS2812 and compatible)
@ CLOCKLESS_ENCODER_TM1908
TM1908: command prefix followed by RGB pixels.
@ 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.
@ MY9221
MY9221 12-channel LED driver (dual-edge clocked; 4 RGB LEDs per chip)
@ WS2801
WS2801 LED chipset.
@ HD107HD
Same as APA102HD, but in turbo 40-mhz mode.

References fl::APA102, fl::APA102HD, fl::CLOCKLESS_ENCODER_TM1812_RGBWW, fl::CLOCKLESS_ENCODER_TM1908, fl::CLOCKLESS_ENCODER_UCS7604_16BIT, fl::CLOCKLESS_ENCODER_UCS7604_16BIT_1600, fl::CLOCKLESS_ENCODER_UCS7604_8BIT, fl::CLOCKLESS_ENCODER_WS2812, fl::DOTSTAR, fl::DOTSTARHD, fl::FL_NO_EXCEPT, fl::HD107, fl::HD107HD, fl::HD108, fl::LPD6803, fl::LPD8806, fl::MY9221, fl::P9813, fl::SK9822, fl::SK9822HD, fl::SM16716, fl::WS2801, and fl::WS2803.

Referenced by Channel(), and Channel().

+ Here is the caller graph for this function: