RF22

- Main Page
- Classes
- Files
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
SoftwareSPIClass Class Reference

Encapsulate a software SPI interface. More...

`#include <SoftwareSPI.h>`

Inheritance diagram for SoftwareSPIClass:

## 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 | ( |  | ) |
| inline virtual

there is no hardware controller to disable.

Disables the SPI bus usually, in this case

Reimplemented from GenericSPIClass.

void SoftwareSPIClass::setBitOrder | ( | uint8_t | bitOrder | ) |
| inline virtual

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 | ) |
| inline virtual

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 | ) |
| inline virtual

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

Sets the pins used by this SoftwareSPIClass instance.

Parameters

  [in] | miso | master in slave out pin used
  [in] | mosi | master out slave in pin used
  [in] | sck | clock pin used

Examples:
  rf22_client_softwarespi.ino, and rf22_server_softwarespi.ino.

uint8_t SoftwareSPIClass::transfer | ( | uint8_t | data | ) |
| inline virtual

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:

- SoftwareSPI.h