#include <SPISoft.h>

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

Public Member Functions

 SPISoft (uint16_t miso, uint16_t mosi, uint16_t sck, uint8_t delay)
 
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 size) override
 Send/receive a variable-length block of data. More...
 
void setDelay (uint8_t dly)
 Set microsecond delay for the SCK signal. Impacts SPI speed. 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...
 
virtual uint8_t read8 ()
 Read one byte from SPI without setting up registers. 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...
 
virtual uint32_t transfer32 (uint32_t val, uint8_t bits=32)
 Send/receive a word of variable size. More...
 

Protected Member Functions

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

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ SPISoft()

SPISoft::SPISoft ( uint16_t  miso,
uint16_t  mosi,
uint16_t  sck,
uint8_t  delay 
)
inline

Member Function Documentation

◆ begin()

bool SPISoft::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()

void SPISoft::end ( )
inlineoverridevirtual

Disable the SPI bus (leaving pin modes unchanged).

Implements SPIBase.

◆ prepare()

void SPISoft::prepare ( SPISettings settings)
inlineoverrideprotectedvirtual

Prepare/configure with settings.

Parameters
settingsinclude frequency, byte order and SPI mode

Implements SPIBase.

◆ setDelay()

void SPISoft::setDelay ( uint8_t  dly)
inline

Set microsecond delay for the SCK signal. Impacts SPI speed.

◆ transfer()

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


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