RF22

- Main Page
- Classes
- Files
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
HardwareSPIClass Class Reference

Encapsulate the Arduino hardware SPI interface. More...

`#include <HardwareSPI.h>`

Inheritance diagram for HardwareSPIClass:

## Public Member Functions
uint8_t | transfer (uint8_t data)
void | attachInterrupt ()
void | detachInterrupt ()
void | begin ()
void | end ()
void | setBitOrder (uint8_t bitOrder)
void | setDataMode (uint8_t mode)
void | setClockDivider (uint8_t rate)

## Detailed Description

Encapsulate the Arduino hardware SPI interface.

This concrete subclass of GenericSPIClass ncapsulates the standard Arduino hardware SPI interface

## Member Function Documentation

void HardwareSPIClass::attachInterrupt | ( |  | ) |
| inline virtual

Enable SPI interrupts This can be used in an SPI slave to indicate when an SPI message has been received It will cause the SPI_STC_vect interrupt vectr to be executed

Reimplemented from GenericSPIClass.

void HardwareSPIClass::begin | ( |  | ) |
| inline virtual

Initialise the SPI library Initializes the SPI bus by setting SCK, MOSI, and SS to outputs, pulling SCK and MOSI low, and SS high.

Reimplemented from GenericSPIClass.

void HardwareSPIClass::detachInterrupt | ( |  | ) |
| inline virtual

Disable SPI interrupts This can be used to diable the SPI interrupt in slaves where that is supported.

Reimplemented from GenericSPIClass.

void HardwareSPIClass::end | ( |  | ) |
| inline virtual

Disables the SPI bus (leaving pin modes unchanged). Call this after you have finished using the SPI interface

Reimplemented from GenericSPIClass.

void HardwareSPIClass::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 HardwareSPIClass::setClockDivider | ( | uint8_t | rate | ) |
| inline virtual

Sets the SPI clock divider relative to the system clock. On AVR based boards, the dividers available are 2, 4, 8, 16, 32, 64 or 128. The default setting is SPI_CLOCK_DIV4, which sets the SPI clock to one-quarter the frequency of the system clock (4 Mhz for the boards at 16 MHz).

Parameters

  [in] | rate | The data rate to use: one of SPI_CLOCK_

Reimplemented from GenericSPIClass.

void HardwareSPIClass::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.

uint8_t HardwareSPIClass::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:

- HardwareSPI.h