|
FastLED 3.9.15
|
Pre-computed nibble LUT for fast 16-pin digital writes.
Call init() once with your 16 pin numbers (-1 to skip a position), then call write() in your hot loop. Each u16 in the data stream is split into four 4-bit nibbles; each nibble indexes into a 16-entry LUT that yields the pin indices to set HIGH or LOW — no per-bit branching.
#include <pins.h>
Collaboration diagram for fl::DigitalMultiWrite16:Classes | |
| struct | PinList |
Public Member Functions | |
| DigitalMultiWrite16 () FL_NOEXCEPT=default | |
| bool | allSamePort () const |
| Check whether all active pins (non -1) share the same GPIO port. | |
| void | init (const Pins16 &pins) |
| Initialize from 16 pin numbers. -1 means "skip this bit position". | |
| void | write (fl::span< const u16 > pin_data) const |
| Write pre-transposed 16-bit data to the 16 pins. | |
Private Member Functions | |
| void | buildNibbleLut (u8 bit_offset, PinList(&set_lut)[16], PinList(&clr_lut)[16]) |
Static Private Member Functions | |
| static void | applyNibble (const PinList &set, const PinList &clr) |
Private Attributes | |
| PinList | mClrNib [4][16] = {} |
| int | mPins [16] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1} |
| PinList | mSetNib [4][16] = {} |