FastLED 3.9.15
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 209 of file pins.cpp.hpp.

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

References applyNibble(), mClrHi, mClrLo, mSetHi, mSetLo, and fl::span< T, Extent >::size().

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

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