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

Encapsulate the Arduino hardware SPI interface. More...

#include <HardwareSPI.h>

Inheritance diagram for HardwareSPIClass:
GenericSPIClass

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 ( )
inlinevirtual

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 ( )
inlinevirtual

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 ( )
inlinevirtual

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

Reimplemented from GenericSPIClass.

void HardwareSPIClass::end ( )
inlinevirtual

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)
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 HardwareSPIClass::setClockDivider ( uint8_t  rate)
inlinevirtual

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]rateThe data rate to use: one of SPI_CLOCK_

Reimplemented from GenericSPIClass.

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

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