FastLED 3.10.8
Loading...
Searching...
No Matches

◆ write()

void fl::DigitalMultiWrite8::write ( fl::span< const u8 > pin_data) const

Write pre-transposed byte data to the 8 pins.

Each byte 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 207 of file pins.cpp.hpp.

207 {
208 for (fl::size i = 0; i < pin_data.size(); ++i) {
209 const u8 byte = pin_data[i];
210 const u8 lo_nib = byte & 0x0F;
211 const u8 hi_nib = (byte >> 4) & 0x0F;
212 applyNibble(mSetLo[lo_nib], mClrLo[lo_nib]);
213 applyNibble(mSetHi[hi_nib], mClrHi[hi_nib]);
214 }
215}
PinList mClrLo[16]
Definition pins.h:71
PinList mSetHi[16]
Definition pins.h:72
static void applyNibble(const PinList &set, const PinList &clr) FL_NO_EXCEPT
Definition pins.cpp.hpp:254
PinList mSetLo[16]
Definition pins.h:70
PinList mClrHi[16]
Definition pins.h:73
constexpr fl::size size() const FL_NO_EXCEPT
Definition span.h:483
unsigned char u8
Definition stdint.h:131

References applyNibble(), fl::FL_NO_EXCEPT, mClrHi, mClrLo, mSetHi, and mSetLo.

Referenced by DigitalMultiWrite8(), and fl::digitalMultiWrite8().

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