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

◆ writePixels()

template<uint8_t _DATA_PIN, uint8_t _CLOCK_PIN, uint32_t _SPI_CLOCK_DIVIDER>
template<uint8_t FLAGS, class D, EOrder RGB_ORDER>
void REFHardwareSPIOutput< _DATA_PIN, _CLOCK_PIN, _SPI_CLOCK_DIVIDER >::writePixels ( PixelController< RGB_ORDER > pixels,
void * context = NULL )
inline

write a block of uint8_ts out in groups of three.

len is the total number of uint8_ts to write out. The template parameters indicate how many uint8_ts to skip at the beginning and/or end of each grouping

Definition at line 80 of file fastspi_ref.h.

80 {
81 select();
82 while(data != end) {
83 if(FLAGS & FLAG_START_BIT) {
84 writeBit<0>(1);
85 }
86 writeByte(D::adjust(pixels.loadAndScale0()));
87 writeByte(D::adjust(pixels.loadAndScale1()));
88 writeByte(D::adjust(pixels.loadAndScale2()));
89
90 pixels.advanceData();
91 pixels.stepDithering();
92 data += (3+skip);
93 }
95 release();
96 }
static void writeByte(uint8_t b)
write a byte out via SPI (returns immediately on writing register)
Definition fastspi_ref.h:44
static void writeBit(uint8_t b)
write a single bit out, which bit from the passed in byte is determined by template parameter
Definition fastspi_ref.h:76
void release()
release the CS select
Definition fastspi_ref.h:38
void select()
latch the CS select
Definition fastspi_ref.h:35
A skeletal implementation of hardware SPI support.
Definition fastspi_ref.h:18

References PixelController< RGB_ORDER, LANES, MASK >::advanceData(), FLAG_START_BIT, PixelController< RGB_ORDER, LANES, MASK >::loadAndScale0(), PixelController< RGB_ORDER, LANES, MASK >::loadAndScale1(), PixelController< RGB_ORDER, LANES, MASK >::loadAndScale2(), release(), select(), PixelController< RGB_ORDER, LANES, MASK >::stepDithering(), writeBit(), and writeByte().

+ Here is the call graph for this function: