45template <
int DATA_PIN, fl::u8 CLOCK_PIN, EOrder RGB_ORDER = RGB, fl::u32 SPI_SPEED = DATA_RATE_MHZ(1)>
68 for (
int i = 0; i < 16; ++i) {
70 data =
static_cast<fl::u16
>(data << 1);
86 for (
int i = 0; i < 4; ++i) {
97 ClockPin::setOutput();
110 while (pixels.
has(1)) {
119 for (
int led = 0; led < 4 && pixels.
has(1); ++led) {
130 for (
int out = 3; out >= 0; --out) {
131 sendLed(ch[out][0], ch[out][1], ch[out][2]);
CPixelLEDController(RegistrationMode mode)
virtual void showPixels(PixelController< RGB_ORDER > &pixels)
Send the LED data to the strip.
fl::FastPin< CLOCK_PIN > ClockPin
void sendWord(fl::u16 data)
Shift out one 16-bit word MSB-first, one clock edge per bit.
MY9221Controller() FL_NO_EXCEPT
static constexpr fl::u32 kLatchDelayUs
Datasheet latch: hold DCKI low for >220 us after last data, then pulse DI 4x.
FASTLED_FORCE_INLINE void writeBit(fl::u8 bit)
static constexpr fl::u16 kCommandWord
Command word: 8-bit grayscale (CMD[9:8]=00), APDM waveform (CMD[4]=1).
void sendLed(fl::u8 c0, fl::u8 c1, fl::u8 c2)
fl::FastPin< DATA_PIN > DataPin
virtual void init()
Initialize the LED controller.
#define FASTLED_FORCE_INLINE
Delay utilities for FastLED Includes nanosecond-precision delays, cycle counting, and microsecond del...
void delayMicroseconds(u32 us)
Delay for a given number of microseconds.
Includes defintions for RGB and HSV pixels.
FASTLED_FORCE_INLINE fl::u8 loadAndScale0(int lane, fl::u8 scale)
non-template alias of loadAndScale<0>()
FASTLED_FORCE_INLINE void advanceData()
Advance the data pointer forward, adjust position counter.
FASTLED_FORCE_INLINE fl::u8 loadAndScale1(int lane, fl::u8 scale)
non-template alias of loadAndScale<1>()
FASTLED_FORCE_INLINE bool has(int n)
Do we have n pixels left to process?
FASTLED_FORCE_INLINE void stepDithering()
Step the dithering forward - creates triangular wave that toggles between pixels.
FASTLED_FORCE_INLINE fl::u8 loadAndScale2(int lane, fl::u8 scale)
non-template alias of loadAndScale<2>()