Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
SPISoft Class Reference
Inheritance diagram for SPISoft:
SPIBase

Public Member Functions

 SPISoft (uint16_t miso, uint16_t mosi, uint16_t sck, uint8_t delay)
 
void begin () override
 begin(): Initializes the SPI bus by setting SCK, MOSI, and SS to outputs, pulling SCK and MOSI low, and SS high. More...
 
void end () override
 end(): Disables the SPI bus (leaving pin modes unchanged). More...
 
void beginTransaction (SPISettings mySettings) override
 beginTransaction(): Initializes the SPI bus using the defined SPISettings. More...
 
void endTransaction () override
 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...
 
void transfer (uint8 *buffer, size_t size) override
 
unsigned char transfer (unsigned char val) override
 transfer(), transfer16() More...
 
unsigned short transfer16 (unsigned short val) override
 
void setDelay (uint8_t dly)
 Set microsecond delay for the SCK signal. Impacts SPI speed. More...
 

Public Attributes

SPISettings SPIDefaultSettings
 Default settings used by the SPI bus until reset by beginTransaction(SPISettings) More...
 

Member Function Documentation

void SPISoft::begin ( )
overridevirtual

begin(): Initializes the SPI bus by setting SCK, MOSI, and SS to outputs, pulling SCK and MOSI low, and SS high.

Implements SPIBase.

void SPISoft::beginTransaction ( SPISettings  mySettings)
inlineoverridevirtual

beginTransaction(): Initializes the SPI bus using the defined SPISettings.

Implements SPIBase.

void SPISoft::end ( )
inlineoverridevirtual

end(): Disables the SPI bus (leaving pin modes unchanged).

Implements SPIBase.

void SPISoft::endTransaction ( )
inlineoverridevirtual

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.

Implements SPIBase.

void SPISoft::setDelay ( uint8_t  dly)
inline

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

unsigned char SPISoft::transfer ( unsigned char  val)
inlineoverridevirtual

transfer(), transfer16()

SPI transfer is based on a simultaneous send and receive: the received data is returned in receivedVal (or receivedVal16). In case of buffer transfers the received data is stored in the buffer in-place (the old data is replaced with the data received).

    receivedVal = SPI.transfer(val)
    receivedVal16 = SPI.transfer16(val16)
    SPI.transfer(buffer, size)

Implements SPIBase.