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

◆ writePixels()

template<fl::u8 _DATA_PIN, fl::u8 _CLOCK_PIN, fl::u32 _SPI_CLOCK_DIVIDER>
template<fl::u8 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 81 of file fastspi_ref.h.

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

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: