#include <SPI.h>

Inheritance diagram for SPIClass:
[legend]
Collaboration diagram for SPIClass:
[legend]

Public Member Functions

bool begin () override
 Initialize the SPI bus by setting SCK, MOSI, and SS to outputs, pulling SCK and MOSI low, and SS high. More...
 
void end () override
 Disable the SPI bus (leaving pin modes unchanged). More...
 
uint8_t read8 () override
 Read one byte from SPI without setting up registers. More...
 
uint32_t transfer32 (uint32_t val, uint8_t bits=32) override
 Send/receive a word of variable size. More...
 
void transfer (uint8_t *buffer, size_t numberBytes) override
 Send/receive a variable-length block of data. More...
 
bool begin () override
 Initialize the SPI bus by setting SCK, MOSI, and SS to outputs, pulling SCK and MOSI low, and SS high. More...
 
void end () override
 Disable the SPI bus (leaving pin modes unchanged). More...
 
void transfer (uint8_t *buffer, size_t numberBytes) override
 Send/receive a variable-length block of data. More...
 
 SPIClass (SpiBus id=SpiBus::VSPI)
 
 SPIClass (SpiBus id, SpiPins pins)
 
bool begin () override
 Initialize the SPI bus by setting SCK, MOSI, and SS to outputs, pulling SCK and MOSI low, and SS high. More...
 
void end () override
 Disable the SPI bus (leaving pin modes unchanged). More...
 
uint8_t read8 () override
 Read one byte from SPI without setting up registers. More...
 
uint32_t transfer32 (uint32_t val, uint8_t bits=32) override
 Send/receive a word of variable size. More...
 
void transfer (uint8_t *buffer, size_t numberBytes) override
 Send/receive a variable-length block of data. More...
 
- Public Member Functions inherited from SPIBase
virtual ~SPIBase ()
 
void beginTransaction (SPISettings &settings)
 Initialize the SPI bus using the defined SPISettings. More...
 
void beginTransaction (const SPISettings &settings)
 
virtual void endTransaction ()
 Stop using the SPI bus. Normally this is called after de-asserting the chip select, to allow other libraries to use the SPI bus. More...
 
uint8_t transfer (uint8_t val)
 Send/receive one bytes of data. More...
 
uint16_t transfer16 (uint16_t val)
 Send/receive one 16-bit word of data. More...
 

Protected Member Functions

void prepare (SPISettings &settings) override
 Prepare/configure with settings. More...
 
void prepare (SPISettings &settings) override
 Prepare/configure with settings. More...
 
void prepare (SPISettings &settings) override
 Prepare/configure with settings. More...
 
BusInfo & getBusInfo ()
 

Protected Attributes

SpiBus busId
 
SpiPins pins
 

Static Protected Attributes

static BusInfo busInfo []
 

Additional Inherited Members

- Public Attributes inherited from SPIBase
SPISettings SPIDefaultSettings
 Default settings used by the SPI bus until reset by beginTransaction(SPISettings) More...
 

Member Function Documentation

◆ begin() [1/2]

bool SPIClass::begin ( )
overridevirtual

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

Implements SPIBase.

◆ begin() [2/2]

bool SPIClass::begin ( )
overridevirtual

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

Implements SPIBase.

◆ end() [1/2]

void SPIClass::end ( )
inlineoverridevirtual

Disable the SPI bus (leaving pin modes unchanged).

Implements SPIBase.

◆ end() [2/2]

void SPIClass::end ( )
overridevirtual

Disable the SPI bus (leaving pin modes unchanged).

Implements SPIBase.

◆ prepare() [1/2]

void SPIClass::prepare ( SPISettings settings)
overrideprotectedvirtual

Prepare/configure with settings.

Parameters
settingsinclude frequency, byte order and SPI mode

Implements SPIBase.

◆ prepare() [2/2]

void SPIClass::prepare ( SPISettings settings)
overrideprotectedvirtual

Prepare/configure with settings.

Parameters
settingsinclude frequency, byte order and SPI mode

Implements SPIBase.

◆ read8()

uint8_t SPIClass::read8 ( )
overridevirtual

Read one byte from SPI without setting up registers.

Parameters
none
Return values
bytereceived

used for performance tuning when doing continuous reads this method does not reset the registers , so make sure that a regular transfer(data) call was performed

Note: this method is not found on the Arduino API

USE WITH CARE !!

Reimplemented from SPIBase.

◆ transfer() [1/2]

void SPIClass::transfer ( uint8_t *  buffer,
size_t  size 
)
overridevirtual

Send/receive a variable-length block of data.

Parameters
bufferIN: The data to send; OUT: The received data
sizeNumber of bytes to transfer

Implements SPIBase.

◆ transfer() [2/2]

void SPIClass::transfer ( uint8_t *  buffer,
size_t  size 
)
overridevirtual

Send/receive a variable-length block of data.

Parameters
bufferIN: The data to send; OUT: The received data
sizeNumber of bytes to transfer

Implements SPIBase.

◆ transfer32()

uint32_t SPIClass::transfer32 ( uint32_t  val,
uint8_t  bits = 32 
)
overridevirtual

Send/receive a word of variable size.

Parameters
valWord to send
bitsNumber of bits to send

SPI transfer is based on a simultaneous send and receive: the received data is returned in receivedVal (or receivedVal16).

    receivedVal = SPI.transfer(val)         : single byte
    receivedVal16 = SPI.transfer16(val16)   : single short

Reimplemented from SPIBase.


The documentation for this class was generated from the following file: