Arduino Core for STM32  1.0
SPI state checking methods

Methods for checking current state of periphery. More...

Functions

bool HardwareSPI::isSending ()
 Checks if data are sending or transferring right now using DMA or IT and if periphery is busy. More...
 
bool HardwareSPI::isReceiving ()
 Checks if data are receiving or transferring right now using DMA or IT and if periphery is busy. More...
 
bool HardwareSPI::isTransfering ()
 Checks if data are transferring right now using DMA or IT and if periphery is busy. More...
 
bool HardwareSPI::isTransacting ()
 Checks if data are sending, receiving, transferring right now using DMA or IT and if periphery is busy. More...
 
bool HardwareSPI::instanceExists (void)
 Checks if SPI instance exists. More...
 
bool HardwareSPI::isFullDuplex ()
 Check, if full duplex mode is enabled for this periphery. More...
 
bool HardwareSPI::isRxEnabled ()
 Checks, if SPI periphery can receive data. More...
 
bool HardwareSPI::isTxEnabled ()
 Checks, if SPI periphery can transmit data. More...
 
 HardwareSPI::operator bool () const
 Checks if SPI instance exists. More...
 
bool HardwareSPI::available ()
 Checks if any data are available in RX FIFO buffer. More...
 
bool HardwareSPI::hasError (void)
 Checks if instance has error. More...
 
SPI_ErrorCode HardwareSPI::getError (void)
 Gets error, that happens during begin, end or transaction. More...
 
void HardwareSPI::clearError (uint32_t clearMask=0xFFFFFFFFUL)
 Gets error, that happens during begin, end or transaction. More...
 
virtual SPI_Status HardwareSPI::lastTransactionStatus ()
 Checks last transaction status. More...
 

Detailed Description

Methods for checking current state of periphery.

Function Documentation

◆ isSending()

bool HardwareSPI::isSending ( )
inline

Checks if data are sending or transferring right now using DMA or IT and if periphery is busy.

Returns
True if data are sending or transferring right now.

◆ isReceiving()

bool HardwareSPI::isReceiving ( )
inline

Checks if data are receiving or transferring right now using DMA or IT and if periphery is busy.

Returns
True if data are receiving or transferring right now.

◆ isTransfering()

bool HardwareSPI::isTransfering ( )
inline

Checks if data are transferring right now using DMA or IT and if periphery is busy.

Returns
True if data are transferring right now.

◆ isTransacting()

bool HardwareSPI::isTransacting ( )
inline

Checks if data are sending, receiving, transferring right now using DMA or IT and if periphery is busy.

Returns
True if data are sending, receiving, transferring right now.

◆ instanceExists()

bool HardwareSPI::instanceExists ( void  )
inline

Checks if SPI instance exists.

Returns
Returns true if SPI instance exists.

◆ isFullDuplex()

bool HardwareSPI::isFullDuplex ( )

Check, if full duplex mode is enabled for this periphery.

You can set it in .ioc file settings.

Returns
Returns true when this SPI can be used in full duplex mode, else it is not allowed to use transfer methods.
Here is the call graph for this function:

◆ isRxEnabled()

bool HardwareSPI::isRxEnabled ( )

Checks, if SPI periphery can receive data.

Returns
Returns true, if SPI periphery can receive data.
Here is the call graph for this function:

◆ isTxEnabled()

bool HardwareSPI::isTxEnabled ( )

Checks, if SPI periphery can transmit data.

Returns
Returns true, if SPI periphery can transmit data.
Here is the call graph for this function:

◆ operator bool()

HardwareSPI::operator bool ( ) const
inline

Checks if SPI instance exists.

◆ available()

bool HardwareSPI::available ( )
inline

Checks if any data are available in RX FIFO buffer.

Returns
Returns true when any data are available in RX FIFO buffer.

◆ hasError()

bool HardwareSPI::hasError ( void  )
inline

Checks if instance has error.

Returns
Returns true if instance has any error.

◆ getError()

SPI_ErrorCode HardwareSPI::getError ( void  )
inline

Gets error, that happens during begin, end or transaction.

To remove error

Returns
Returns error of instance.
See also
SPI_ErrorCode

◆ clearError()

void HardwareSPI::clearError ( uint32_t  clearMask = 0xFFFFFFFFUL)
inline

Gets error, that happens during begin, end or transaction.

To remove error

Returns
Returns error of instance.
See also
SPI_ErrorCode

◆ lastTransactionStatus()

virtual SPI_Status HardwareSPI::lastTransactionStatus ( )
inlinevirtual

Checks last transaction status.

When using HardwareSPI, only the last status is returned, but when using HardwareSPI_O and any error occurred, that error is will be returned until re-enabling transaction using endTransaction() and beginTransaction().