RF22
Public Member Functions | List of all members
SoftwareSPIClass Class Reference

Encapsulate a software SPI interface. More...

#include <SoftwareSPI.h>

Inheritance diagram for SoftwareSPIClass:
GenericSPIClass

Public Member Functions

uint8_t transfer (uint8_t data)
 
void attachInterrupt ()
 Not implemented.
 
void detachInterrupt ()
 Not implemented.
 
void begin ()
 Initialise the SPI library.
 
void end ()
 there is no hardware controller to disable. More...
 
void setPins (uint8_t miso, uint8_t mosi, uint8_t sck)
 
void setBitOrder (uint8_t bitOrder)
 
void setDataMode (uint8_t mode)
 
void setClockDivider (uint8_t rate)
 

Detailed Description

Encapsulate a software SPI interface.

This concrete subclass of GenericSPIClass enapsulates the SPI interface

Examples:
rf22_client_softwarespi.ino, and rf22_server_softwarespi.ino.

Member Function Documentation

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]bitOrderBit 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]rateThe 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]modeThe 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

Sets the pins used by this SoftwareSPIClass instance.

Parameters
[in]misomaster in slave out pin used
[in]mosimaster out slave in pin used
[in]sckclock pin used
Examples:
rf22_client_softwarespi.ino, and rf22_server_softwarespi.ino.
uint8_t SoftwareSPIClass::transfer ( uint8_t  data)
inlinevirtual

Transfer a single octet to and from the SPI interface

Parameters
[in]dataThe 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: