AceSPI
0.2.0
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 | send8 (uint8_t value) const |
Send 8 bits, including latching LOW and HIGH. | |
void | send16 (uint16_t value) const |
Send 16 bits, including latching LOW and HIGH. | |
void | send16 (uint8_t msb, uint8_t lsb) const |
Send 2 bytes as 16-bit stream, including latching LOW and HIGH. | |
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 79 of file HardSpiFastInterface.h.
|
inline |
Initialize the HardSpiFastInterface.
The hardware SPI object must be initialized using SPI.begin()
as well.
Definition at line 85 of file HardSpiFastInterface.h.