|
| HardwareSPI (SPI_HandleTypeDef &hspi) |
| Constructor. More...
|
|
| ~HardwareSPI () |
| Destructor. More...
|
|
bool | begin (SPI_InitTypeDef &initStruct) |
| Initialize SPI periphery and it's pins. More...
|
|
bool | begin () |
| Initialize SPI periphery and it's pins. More...
|
|
bool | end () |
| Deinitialization and disabling SPI periphery, it can be used for "sleep mode". More...
|
|
bool | isSending () |
| Checks if data are sending or transferring right now using DMA or IT and if periphery is busy. More...
|
|
bool | isReceiving () |
| Checks if data are receiving or transferring right now using DMA or IT and if periphery is busy. More...
|
|
bool | isTransfering () |
| Checks if data are transferring right now using DMA or IT and if periphery is busy. More...
|
|
bool | isTransacting () |
| Checks if data are sending, receiving, transferring right now using DMA or IT and if periphery is busy. More...
|
|
bool | instanceExists (void) |
| Checks if SPI instance exists. More...
|
|
bool | connectDMAtoRx (DMA_HandleTypeDef &DMA_handle) |
| Use this method to connect DMA channel to SPI Rx programmatically. More...
|
|
bool | connectDMAtoTx (DMA_HandleTypeDef &DMA_handle) |
| Use this method to connect DMA channel to SPI Tx programmatically. More...
|
|
bool | disconnectDMAfromRx () |
| Disconnects DMA channel from SPI Rx. More...
|
|
bool | disconnectDMAfromTx () |
| Disconnects DMA channel from SPI Tx. More...
|
|
bool | isDMAconnectedToRx (void) |
| Checks if DMA channel is connected to SPI Rx and can be used for data receiving/transferring. More...
|
|
bool | isDMAconnectedToTx (void) |
| Checks if DMA channel is connected to SPI Tx and can be used for data writing/transferring. More...
|
|
uint32_t | getSPIClockFreq (void) |
| Gets periphery SPI Clock Frequency in Hz. More...
|
|
bool | setMode (uint32_t mode) |
| Sets Master or Slave mode. More...
|
|
uint32_t | getMode () |
| Gets, if periphery mode is Master or Slave. More...
|
|
bool | setHwCS (bool HardwareCS, bool OutputCS=true) |
| Sets if Chip Select pin is handled by hardware or by software (calling digitalWrite()). More...
|
|
bool | isHwCS () |
| Gets, if Chip Select is handled by hardware. More...
|
|
bool | isHwOutputCS () |
| Gets, if Chip Select handled by hardware is set to output mode. More...
|
|
bool | setBitOrder (uint8_t bitOrder) |
| Sets bit order to LSB or MSB. More...
|
|
uint8_t | getBitOrder () |
| Gets, if bit order is set to LSB or MSB. More...
|
|
bool | setDataMode (uint8_t dataMode) |
| Sets data mode. More...
|
|
uint8_t | getDataMode () |
| Gets, what data mode is set. More...
|
|
bool | setFrequency (uint32_t freq) |
| Calculates SPI clock divider from frequency and sets it. More...
|
|
uint32_t | getFrequency () |
| Calculates SPI frequency from APB frequency and Clock Divider. More...
|
|
bool | setClockDivider (uint32_t clockDiv) |
| Sets SPI clock divider. More...
|
|
uint32_t | getClockDivider () |
| Gets clock divider. More...
|
|
bool | setDataBits (uint16_t bits) |
| Sets SPI data width in bits. More...
|
|
uint16_t | getDataBits () |
| Gets set data width in bits. More...
|
|
bool | enableTImode (bool enable) |
| Enables or disabled TI mode. More...
|
|
bool | isTImodeEnabled () |
| Gets if TI mode is enabled. More...
|
|
bool | enableCRC (bool enable) |
| Enables CRC. More...
|
|
bool | isCRCenabled () |
| Gets if CRC is enabled. More...
|
|
bool | setCRClength (SPI_CRCLength length) |
| Sets CRC length. More...
|
|
SPI_CRCLength | getCRClength () |
| Gets CRC length. More...
|
|
bool | setCRCPolynomial (uint32_t polynomial) |
| Sets CRC polynomial. More...
|
|
uint32_t | getCRCPolynomial () |
| Gets CRC polynomial. More...
|
|
void | setTimeout (uint32_t Timeout) |
| Sets timeout in milliseconds. More...
|
|
uint32_t | getTimeout () |
| Gets timeout in milliseconds. More...
|
|
virtual SPI_Status | beginTransaction (SPISettings settings) |
| Sets some settings to SPI periphery before transaction. More...
|
|
void | flushRX () |
| Clears RX FIFO buffer. More...
|
|
bool | flush () |
| Waits until DMA or IT (nonblocking transaction methods) are timed out and then aborts them. More...
|
|
virtual uint16_t | transfer (uint16_t data, bool lastByte=false) |
| SPI transfer is based on a simultaneous send and receive data. More...
|
|
virtual uint16_t | transfer16 (uint16_t data, bool lastByte=false) |
| SPI transfer is based on a simultaneous send and receive data. More...
|
|
virtual uint32_t | transfer32 (uint32_t data, bool lastByte=false) |
| SPI transfer is based on a simultaneous send and receive data. More...
|
|
virtual bool | transfer (void *buf, uint16_t count, bool lastByte=false) |
| SPI transfer is based on a simultaneous send and receive data. More...
|
|
virtual bool | write (uint16_t data, bool lastByte=false) |
| Sends data using SPI periphery. More...
|
|
virtual bool | write16 (uint16_t data, bool lastByte=false) |
| Sends data using SPI periphery. More...
|
|
virtual bool | write32 (uint32_t data, bool lastByte=false) |
| Sends data using SPI periphery. More...
|
|
virtual uint16_t | receive (bool lastByte=false) |
| Receives data from SPI periphery. More...
|
|
virtual uint16_t | receive16 (bool lastByte=false) |
| Receives data from SPI periphery. More...
|
|
virtual uint32_t | receive32 (bool lastByte=false) |
| Receives data from SPI periphery. More...
|
|
virtual bool | writeBytes (const uint8_t *data, uint32_t size, bool lastByte=false) |
| Sends data using SPI periphery in blocking mode. More...
|
|
virtual bool | writeBytesNonBlocking (const uint8_t *data, uint32_t size, bool lastByte=false) |
| Sends data using SPI periphery using DMA or IT (interrupt) mode. More...
|
|
virtual bool | transferBytes (const uint8_t *out, uint8_t *in, uint32_t size, bool lastByte=false) |
| Transfers data using SPI periphery in blocking mode, it is sending and receiving data simultaneously. More...
|
|
virtual bool | transferBytesNonBlocking (const uint8_t *out, uint8_t *in, uint32_t size, bool lastByte=false) |
| Transfers data using SPI periphery using DMA or IT (interrupt) mode, it is sending and receiving data simultaneously. More...
|
|
virtual bool | receiveBytes (uint8_t *data, uint32_t size, bool lastByte=false) |
| Receives data from SPI periphery in blocking mode. More...
|
|
virtual bool | receiveBytesNonBlocking (uint8_t *data, uint32_t size, bool lastByte=false) |
| Receives data from SPI periphery in non-blocking mode using DMA or IT (interrupt) mode. More...
|
|
virtual SPI_Status | 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...
|
|
bool | isFullDuplex () |
| Check, if full duplex mode is enabled for this periphery. More...
|
|
bool | isRxEnabled () |
| Checks, if SPI periphery can receive data. More...
|
|
bool | isTxEnabled () |
| Checks, if SPI periphery can transmit data. More...
|
|
| operator bool () const |
| Checks if SPI instance exists. More...
|
|
bool | available () |
| Checks if any data are available in RX FIFO buffer. More...
|
|
bool | hasError (void) |
| Checks if instance has error. More...
|
|
SPI_ErrorCode | getError (void) |
| Gets error, that happens during begin, end or transaction. More...
|
|
void | clearError (uint32_t clearMask=0xFFFFFFFFUL) |
| Gets error, that happens during begin, end or transaction. More...
|
|
virtual SPI_Status | lastTransactionStatus () |
| Checks last transaction status. More...
|
|
void | setWriteDoneCallback (void(*WriteDoneCallback_)()) |
| Sets callback function, that will be called when all data using writeBytesNonBlocking() method were send. More...
|
|
void | setTransferDoneCallback (void(*TransferDoneCallback_)()) |
| Sets callback function, that will be called when all data using transferBytesNonBlocking() method were transfered. More...
|
|
void | setReceiveDoneCallback (void(*ReceiveDoneCallback_)()) |
| Sets callback function, that will be called when all data using receiveBytesNonBlocking() method were received. More...
|
|
void | setWriteHalfCallback (void(*WriteHalfCallback_)()) |
| Sets callback function, that will be called when half of data using writeBytesNonBlocking() method were send. More...
|
|
void | setTransferHalfCallback (void(*TransferHalfCallback_)()) |
| Sets callback function, that will be called when half of data using transferBytesNonBlocking() method were transfered. More...
|
|
void | setReceiveHalfCallback (void(*ReceiveHalfCallback_)()) |
| Sets callback function, that will be called when half of data using receiveBytesNonBlocking() method were received. More...
|
|
void | setErrorCallback (void(*ErrorCallback_)(SPI_ErrorCode)) |
| Sets callback function, that will be called when an error has occurred. More...
|
|
SPI_HandleTypeDef & | getHAL_SPI_Struct () |
| Returns SPI structure, that is used for handling SPI. More...
|
|