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

◆ writeBytes() [1/2]

template<uint8_t DATA_PIN, uint8_t CLOCK_PIN, uint32_t SPI_SPEED>
template<class D>
void AVRSoftwareSPIOutput< DATA_PIN, CLOCK_PIN, SPI_SPEED >::writeBytes ( FASTLED_REGISTER uint8_t * data,
int len )
inline

Write an array of data to the SPI interface.

Template Parameters
DPer-byte modifier class, e.g. DATA_NOP
Parameters
datapointer to data to write
lennumber of bytes to write
Todo
Need to type this better so that explicit casts into the call aren't required.

Definition at line 296 of file fastspi_bitbang.h.

296 {
297 select();
298#ifdef FAST_SPI_INTERRUPTS_WRITE_PINS
299 uint8_t *end = data + len;
300 while(data != end) {
302 }
303#else
306
308 // If data and clock are on different ports, then writing a bit will consist of writing the value foor
309 // the bit (hi or low) to the data pin port, and then two writes to the clock port to strobe the clock line
314 uint8_t *end = data + len;
315
316 while(data != end) {
318 }
319
320 } else {
321 // FastPin<CLOCK_PIN>::hi();
322 // If data and clock are on the same port then we can combine setting the data and clock pins
327
328 uint8_t *end = data + len;
329
330 while(data != end) {
332 }
333 // FastPin<CLOCK_PIN>::lo();
334 }
335#endif
337 release();
338 }
void select()
Select the SPI output (chip select)
static void writeByte(uint8_t b)
Write a single byte over SPI.
void release()
Release the SPI chip select line.
FastPin< CLOCK_PIN >::port_t clock_t
FastPin< DATA_PIN >::port_t data_t
FastPin< DATA_PIN >::port_ptr_t data_ptr_t
FastPin< CLOCK_PIN >::port_ptr_t clock_ptr_t
Software SPI (aka bit-banging) support Includes aggressive optimizations for when the clock and data ...
static port_t hival()
Gets the state of the port with this pin HIGH
Definition fastpin.h:260
static port_t loval()
Gets the state of the port with this pin LOW
Definition fastpin.h:262
static port_t mask()
Get the pin mask.
Definition fastpin.h:266
static port_ptr_t port()
Get the output state of the port.
Definition fastpin.h:264

References FASTLED_REGISTER, FastPin< PIN >::hival(), FastPin< PIN >::loval(), FastPin< PIN >::mask(), FastPin< PIN >::port(), release(), select(), and writeByte().

Referenced by writeBytes().

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