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

◆ write()

void fl::spi::Lane::write ( const u8 * data,
size_t size )

Write data to this lane's buffer.

Parameters
dataData to transmit (copied into internal buffer)
sizeNumber of bytes
Note
Data is buffered, not transmitted until parent device's flush() is called

Definition at line 14 of file lane.cpp.hpp.

14 {
15 if (!data || size == 0) {
16 FL_WARN("Lane " << mLaneId << ": Invalid data or size");
17 return;
18 }
19
20 // Resize buffer to fit new data
21 mBuffer.resize(size);
22
23 // Copy data into buffer
24 for (size_t i = 0; i < size; i++) {
25 mBuffer[i] = data[i];
26 }
27
28 FL_DBG("Lane " << mLaneId << ": Buffered " << size << " bytes");
29}
fl::span< const u8 > data() const FL_NO_EXCEPT
Get const access to buffer data.
Definition lane.cpp.hpp:39
size_t mLaneId
Definition lane.h:62
fl::vector< u8 > mBuffer
Definition lane.h:63
#define FL_WARN(...)
Definition log.h:437
#define FL_DBG
Definition log.h:553

References data(), FL_DBG, fl::FL_NO_EXCEPT, FL_WARN, mBuffer, and mLaneId.

+ Here is the call graph for this function: