Arduino Core for STM32  1.0
SPI transaction initializers

Methods for initializing transaction and flushing buffers. More...

Functions

virtual SPI_Status HardwareSPI::beginTransaction (SPISettings settings)
 Sets some settings to SPI periphery before transaction. More...
 
void HardwareSPI::flushRX ()
 Clears RX FIFO buffer. More...
 
bool HardwareSPI::flush ()
 Waits until DMA or IT (nonblocking transaction methods) are timed out and then aborts them. More...
 
virtual SPI_Status HardwareSPI::endTransaction (void)
 This method don't have to be called at the end of the transaction when using HardwareSPI class, but be careful, HardwareSPI_O class requres to call this at the end of transaction. More...
 

Detailed Description

Methods for initializing transaction and flushing buffers.

Note
In class HardwareSPI, methods beginTransaction() and endTransaction() don't even have to be called, because beginTransaction() just set some settings and endTransaction() is there only for compatibility with arduino SPI class and optimized HardwareSPI_O class.
See also
Optimized transaction initializers

Function Documentation

◆ beginTransaction()

SPI_Status HardwareSPI::beginTransaction ( SPISettings  settings)
virtual

Sets some settings to SPI periphery before transaction.

Note
When using HardwareSPI (not HardwareSPI_O), it don't have to be called before transaction.
Parameters
settingsClass, that contains basic SPI settings.
Returns
Returns status. See SPI_Status enum.

Reimplemented in HardwareSPI_O.

Here is the call graph for this function:

◆ flushRX()

void HardwareSPI::flushRX ( )

Clears RX FIFO buffer.

All received messages will be discarded.

Note
This function cannot abort DMA or IT transaction. When any nonblocking transaction is running, this method will do nothing.
Here is the call graph for this function:

◆ flush()

bool HardwareSPI::flush ( )

Waits until DMA or IT (nonblocking transaction methods) are timed out and then aborts them.

This method also flushes RX and TX by calling flushRX() and flushTX() methods.

Returns
Returns true when transaction was aborted.
Here is the call graph for this function:

◆ endTransaction()

SPI_Status HardwareSPI::endTransaction ( void  )
virtual

This method don't have to be called at the end of the transaction when using HardwareSPI class, but be careful, HardwareSPI_O class requres to call this at the end of transaction.

Returns
Returns only the last transaction status, see: lastTransactionStatus().

Reimplemented in HardwareSPI_O.

Here is the call graph for this function: