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 78 of file fastspi_ref.h.

78 {
79 select();
80 while(data != end) {
81 if(FLAGS & FLAG_START_BIT) {
82 writeBit<0>(1);
83 }
84 writeByte(D::adjust(pixels.loadAndScale0()));
85 writeByte(D::adjust(pixels.loadAndScale1()));
86 writeByte(D::adjust(pixels.loadAndScale2()));
87
88 pixels.advanceData();
89 pixels.stepDithering();
90 data += (3+skip);
91 }
93 release();
94 }
static void writeByte(uint8_t b)
write a byte out via SPI (returns immediately on writing register)
Definition fastspi_ref.h:42
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:74
void release()
release the CS select
Definition fastspi_ref.h:36
void select()
latch the CS select
Definition fastspi_ref.h:33
A skeletal implementation of hardware SPI support.
Definition fastspi_ref.h:16

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: