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

◆ write()

void fl::DigitalMultiWrite16::write ( fl::span< const u16 > pin_data) const

Write pre-transposed 16-bit data to the 16 pins.

Each u16 in pin_data is a bitmask where bit N → pin N. 1 = HIGH, 0 = LOW. Pins set to -1 during init() are skipped.

Definition at line 328 of file pins.cpp.hpp.

328 {
329 for (fl::size i = 0; i < pin_data.size(); ++i) {
330 const u16 word = pin_data[i];
331 for (u8 n = 0; n < 4; ++n) {
332 const u8 nib = (word >> (n * 4)) & 0x0F;
333 applyNibble(mSetNib[n][nib], mClrNib[n][nib]);
334 }
335 }
336}
PinList mSetNib[4][16]
Definition pins.h:123
static void applyNibble(const PinList &set, const PinList &clr)
Definition pins.cpp.hpp:376
PinList mClrNib[4][16]
Definition pins.h:124
constexpr fl::size size() const FL_NOEXCEPT
Definition span.h:458
unsigned char u8
Definition stdint.h:131

References applyNibble(), mClrNib, mSetNib, and fl::span< T, Extent >::size().

Referenced by DigitalMultiWrite16(), and fl::digitalMultiWrite16().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: