AceSPI
0.4
Unified interface for selecting hardware or software SPI implementations on Arduino platforms
|
This class is functionally identical to HardSpiInterface except that the GPIO pins are controlled by digitalWriteFast() and pinModeFast() methods. More...
#include <HardSpiFastInterface.h>
Public Member Functions | |
HardSpiFastInterface (T_SPI &spi) | |
Constructor. More... | |
void | begin () const |
Initialize the HardSpiFastInterface. More... | |
void | end () const |
Clean up the object. | |
void | beginTransaction () const |
Begin SPI transaction. More... | |
void | endTransaction () const |
End SPI transaction. More... | |
void | transfer (uint8_t value) const |
Transfer 8 bits. | |
void | transfer16 (uint16_t value) const |
Transfer 16 bits. | |
void | send8 (uint8_t value) const |
Convenience method to send 8 bits a single transaction. | |
void | send16 (uint16_t value) const |
Convenience method to send 16 bits a single transaction. | |
void | send16 (uint8_t msb, uint8_t lsb) const |
Convenience method to send 16 bits a single transaction. | |
HardSpiFastInterface (const HardSpiFastInterface &)=default | |
HardSpiFastInterface & | operator= (const HardSpiFastInterface &)=default |
This class is functionally identical to HardSpiInterface except that the GPIO pins are controlled by digitalWriteFast() and pinModeFast() methods.
This decreases flash memory consumption by 70 bytes (AceSegment/HybridModule) to 250 (AceSegment/Max7219Module, AceSegment/Hc595Module) bytes.
If more than 2-3 or LED modules are used, each using different LatchPins, the HardSpiInterface class might consume less flash memory than this one because HardSpiInterface avoids generating different template instantiations of the HybridModule, Max7219Module, or Hc595Module classes. If flash memory size is a problem, users should experiment with both and compare the difference.
T_SPI | the class of the hardware SPI instance, usually SPIClass |
T_LATCH_PIN | the CS/SS pin that controls the SPI peripheral |
T_CLOCK_SPEED | the SPI clock speed, default 8000000 (8 MHz) |
Definition at line 55 of file HardSpiFastInterface.h.
|
inlineexplicit |
Constructor.
spi | instance of the T_SPI class. If the pre-installed <SPI.h> is used, T_SPI is SPIClass and spi will be the pre-defined SPI object. |
Definition at line 78 of file HardSpiFastInterface.h.
|
inline |
Initialize the HardSpiFastInterface.
The hardware SPI object must be initialized using SPI.begin()
as well.
Definition at line 84 of file HardSpiFastInterface.h.
|
inline |
|
inline |