template<uint8_t DATA_PIN, uint8_t CLOCK_PIN, fl::u32 SPI_SPEED>
class AVRSoftwareSPIOutput< DATA_PIN, CLOCK_PIN, SPI_SPEED >
Software SPI (aka bit-banging) support Includes aggressive optimizations for when the clock and data pin are on the same port.
- Template Parameters
-
| DATA_PIN | pin number of the SPI data pin. |
| CLOCK_PIN | pin number of the SPI clock pin. |
| SPI_SPEED | speed of the bus. Determines the delay times between pin writes. |
- Note
- Although this is named with the "AVR" prefix, this will work on any platform. Theoretically.
- Todo
- Replace the select pin definition with a set of pins, to allow using mux hardware for routing in the future.
Definition at line 27 of file fastspi_bitbang.h.
|
| static void | stop () |
| | Stop the SPI output.
|
| |
| static void | wait () |
| | Wait until the SPI subsystem is ready for more data to write.
|
| |
| static void | waitFully () |
| | Wait until the SPI subsystem is ready for more data to write.
|
| |
| template<uint8_t BIT> |
| static void | writeBit (uint8_t b) |
| | Write the BIT'th bit out via SPI, setting the data pin then strobing the clock.
|
| |
| static void | writeByte (uint8_t b) |
| | Write a single byte over SPI.
|
| |
| static void | writeByteNoWait (uint8_t b) |
| | Write a single byte over SPI without waiting.
|
| |
| static void | writeBytePostWait (uint8_t b) |
| | Write a single byte over SPI and wait afterwards.
|
| |
| static void | writeBytesValueRaw (uint8_t value, int len) |
| | Write multiple bytes of the given value over SPI, without selecting the interface.
|
| |
| static void | writeWord (fl::u16 w) |
| | Write a word (two bytes) over SPI.
|
| |
|
| template<uint8_t BIT> |
| static FASTLED_FORCE_INLINE void | writeBit (uint8_t b, clock_ptr_t clockpin, data_ptr_t datapin) |
| | Write the BIT'th bit out via SPI, setting the data pin then strobing the clock, using the passed in pin registers to accelerate access if needed.
|
| |
| template<uint8_t BIT> |
| static FASTLED_FORCE_INLINE void | writeBit (uint8_t b, clock_ptr_t clockpin, data_ptr_t datapin, data_t hival, data_t loval, clock_t hiclock, clock_t loclock) |
| | The version of writeBit() to use when clock and data are on separate pins with precomputed values for setting the clock and data pins.
|
| |
| template<uint8_t BIT> |
| static FASTLED_FORCE_INLINE void | writeBit (uint8_t b, data_ptr_t clockdatapin, data_t datahiclockhi, data_t dataloclockhi, data_t datahiclocklo, data_t dataloclocklo) |
| | The version of writeBit() to use when clock and data are on the same port with precomputed values for the various combinations.
|
| |
| static void | writeByte (uint8_t b, clock_ptr_t clockpin, data_ptr_t datapin) |
| | writeByte() implementation with data/clock registers passed in.
|
| |
| static void | writeByte (uint8_t b, clock_ptr_t clockpin, data_ptr_t datapin, data_t hival, data_t loval, clock_t hiclock, clock_t loclock) |
| | writeByte() implementation with not just registers passed in, but pre-baked values for said registers for data hi/lo and clock hi/lo values.
|
| |
| static void | writeByte (uint8_t b, data_ptr_t datapin, data_t hival, data_t loval, clock_t hiclock, clock_t loclock) |
| | writeByte() implementation with the data register passed in and prebaked values for data hi w/clock hi and low and data lo w/clock hi and lo.
|
| |