Encapsulate a software SPI interface.
More...
#include <SoftwareSPI.h>
Encapsulate a software SPI interface.
This concrete subclass of GenericSPIClass enapsulates the SPI interface
- Examples:
- rf22_client_softwarespi.ino, and rf22_server_softwarespi.ino.
void SoftwareSPIClass::end |
( |
| ) |
|
|
inlinevirtual |
there is no hardware controller to disable.
Disables the SPI bus usually, in this case
Reimplemented from GenericSPIClass.
void SoftwareSPIClass::setBitOrder |
( |
uint8_t |
bitOrder | ) |
|
|
inlinevirtual |
Sets the bit order the SPI interface will use Sets the order of the bits shifted out of and into the SPI bus, either LSBFIRST (least-significant bit first) or MSBFIRST (most-significant bit first).
- Parameters
-
[in] | bitOrder | Bit order to be used: LSBFIRST or MSBFIRST |
Reimplemented from GenericSPIClass.
void SoftwareSPIClass::setClockDivider |
( |
uint8_t |
rate | ) |
|
|
inlinevirtual |
Sets the SPI clock divider relative to the system clock. In this case, the software SPI does a basic delay in a loop for whatever rate is set too. The default setting is SPI_CLOCK_DIV4,
- Parameters
-
[in] | rate | The data rate to use: one of SPI_CLOCK_ |
Reimplemented from GenericSPIClass.
void SoftwareSPIClass::setDataMode |
( |
uint8_t |
mode | ) |
|
|
inlinevirtual |
Sets the SPI data mode: that is, clock polarity and phase. See the Wikipedia article on SPI for details.
- Parameters
-
[in] | mode | The mode to use: SPI_MODE0 SPI_MODE1 SPI_MODE2 SPI_MODE3 |
Reimplemented from GenericSPIClass.
void SoftwareSPIClass::setPins |
( |
uint8_t |
miso, |
|
|
uint8_t |
mosi, |
|
|
uint8_t |
sck |
|
) |
| |
|
inline |
uint8_t SoftwareSPIClass::transfer |
( |
uint8_t |
data | ) |
|
|
inlinevirtual |
Transfer a single octet to and from the SPI interface
- Parameters
-
[in] | data | The octet to send |
- Returns
- The octet read from SPI while the data octet was sent
Implements GenericSPIClass.
The documentation for this class was generated from the following file: