This section describes the programming interface of the FlexIO SPI peripheral driver. The FlexIO SPI peripheral driver provides functions for device to send and receive data.
FlexIO SPI device structures
The driver uses an instantiation of the flexio_spi_state_t structure to maintain the current state of a particular FlexIO-simulated SPI module driver. This structures holds data that is used by the FlexIO simulated SPI Peripheral driver to communicate between the transmit and receive transfer functions and the interrupt handler. The interrupt handler also uses this information to keep track of its progress. Because the driver itself does not statically allocate memory, the caller provides memory for the driver state structure during initialization by providing a structure.
FlexIO SPI user configuration structures
The FlexIO-simulated SPI driver uses instances of the user configuration structure flexio_spi_userconfig_t for the FlexIO-simulated SPI driver. This enables configuration of the most common settings of the SPI with a single function call. The FlexIO-simulated SPI does not support CPOL = 1. The user settings include: SPI mode(master or slave), baud rate, clock phase(first edge or second edge), data size(8-bit or 16-bit), bit direction (MSB or LSB) and the associated FlexIO timers, shifters and pins for CSn, SCK, SDI, and SDO.
FlexIO SPI Initialization
-
To initialize the FlexIO SPI driver, call the FLEXIO_SPI_DRV_Init() function and pass the instance number of the FlexIO peripheral, memory for the run-time state structure, and a pointer to the user configuration structure. For example, to use FlexIO0 pass a value of 0 to the initialization function.
-
Then, pass the memory for the run-time state structure.
-
Finally, pass a user configuration structure of the type flexio_spi_userconfig_t as shown here:
typedef struct flexio_spi_userconfig{
uint32_t baudRate;
The flexio_spi_userconfig instantiation can be easily modified to configure the FlexIO SPI peripheral driver either to a different baud rate, character transfer features or using different FlexIO hardware resource. This is an example code to set up a user FlexIO SPI configuration instantiation:
This example shows how to call the FLEXIO_SPI_DRV_Init() given the user configuration structure and the FlexIO instance 0.
uint32_t flexioInstance = 0;
FlexIO SPI Data Transactions
The driver is separated into two implementations: interrupt-driven and DMA-driven. The driver implements transmit, receive and transfer functions to transfer buffers of data in blocking and non-blocking modes.
The non-blocking transmit and receive functions include the FLEXIO_SPI_DRV_SendData(), FLEXIO_SPI_DRV_ReceiveData(), and FLEXIO_SPI_DRV_TransferData() functions for interrupt driven, FLEXIO_SPI_DRV_DmaSendData()/FLEXIO_SPI_DRV_EdmaSendData(), FLEXIO_SPI_DRV_DmaReceiveData()/FLEXIO_SPI_DRV_EdmaReceiveData() and FLEXIO_SPI_DRV_DmaTransferData()/FLEXIO_SPI_DRV_EdmaTransferData() functions for DMA-driven.
The blocking (async) transmit and receive functions include the FLEXIO_SPI_DRV_SendDataBlocking(), FLEXIO_SPI_DRV_ReceiveDataBlocking() and FLEXIO_SPI_DRV_TransferDataBlocking() functions for interrupt-driven, FLEXIO_SPI_DRV_DmaSendDataBlocking()/FLEXIO_SPI_DRV_EdmaSendDataBlocking(), FLEXIO_SPI_DRV_DmaReceiveDataBlocking()/FLEXIO_SPI_DRV_EdmaReceiveDataBlocking() and FLEXIO_SPI_DRV_DmaTransferDataBlocking()/ FLEXIO_SPI_DRV_EdmaTransferDataBlocking() functions for DMA-driven.
Ensure that data is consistent when there is cache in memory and when using DMA to transfer data. In other words, when reading the data from memory, ensure that data from or to the memory device is not cached.
This code example shows how to use the functions, assuming that the FlexIO-simulated SPI module has been initialized as described previously in the Initialization Section. For blocking transfer functions transmit and receive:
uint8_t sourceBuff[26] ={0};
uint8_t readBuffer[26] = {0};
uint32_t byteCount = sizeof(sourceBuff);
uint32_t rxRemainingSize = sizeof(readBuffer);
For non-blocking (async) transfer functions transmit and receive:
uint8_t *pTxBuff;
uint8_t rxBuff[10];
uint32_t txBytesRemaining, rxBytesRemaining;
|
flexio_spi_status_t | FLEXIO_SPI_DRV_Init (uint32_t instance, flexio_spi_state_t *spiState, const flexio_spi_userconfig_t *spiConfig) |
| Initializes a FlexIO-simulated SPI device. More...
|
|
void | FLEXIO_SPI_DRV_Deinit (flexio_spi_state_t *spiState) |
| Shuts down the FlexIO SPI. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_SendDataBlocking (flexio_spi_state_t *spiState, const uint8_t *txBuff, uint32_t txSize, uint32_t timeout) |
| Sends (transmits) data out through the FlexIO-simulated SPI module using a blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_SendData (flexio_spi_state_t *spiState, const uint8_t *txBuff, uint32_t txSize) |
| Sends (transmits) data through the FlexIO-simulated SPI module using a non-blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_GetTransmitStatus (flexio_spi_state_t *spiState, uint32_t *bytesRemaining) |
| Returns whether the previous FlexIO-simulated SPI transmit has finished. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_AbortSendingData (flexio_spi_state_t *spiState) |
| Terminates a non-blocking FlexIO-simulated SPI transmission early. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_ReceiveDataBlocking (flexio_spi_state_t *spiState, uint8_t *rxBuff, uint32_t rxSize, uint32_t timeout) |
| Gets (receives) data from the FlexIO-simulated SPI module using a blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_ReceiveData (flexio_spi_state_t *spiState, uint8_t *rxBuff, uint32_t rxSize) |
| Gets (receives) data from the FlexIO-simulated SPI module using a non-blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_GetReceiveStatus (flexio_spi_state_t *spiState, uint32_t *bytesRemaining) |
| Returns whether the previous FlexIO-simulated SPI receive is complete. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_AbortReceivingData (flexio_spi_state_t *spiState) |
| Terminates a non-blocking FlexIO-simulated SPI receive early. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_TransferDataBlocking (flexio_spi_state_t *spiState, const uint8_t *txBuff, uint8_t *rxBuff, uint32_t xSize, uint32_t timeout) |
| Transfers data through the FlexIO-simulated SPI module using a blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_TransferData (flexio_spi_state_t *spiState, const uint8_t *txBuff, uint8_t *rxBuff, uint32_t xSize) |
| Transfers data through the FlexIO-simulated SPI module using a non-blocking method. More...
|
|
void | FLEXIO_SPI_DRV_TX_IRQHandler (void *param) |
| Interrupt handler for the FlexIO-simulated SPI transmit. More...
|
|
void | FLEXIO_SPI_DRV_RX_IRQHandler (void *param) |
| Interrupt handler for the FlexIO-simulated SPI receive. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_EdmaSendDataBlocking (flexio_spi_state_t *spiState, const uint8_t *txBuff, uint32_t txSize, uint32_t timeout) |
| Sends (transmits) data out through the FlexIO-simulated SPI module using an eDMA blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_EdmaSendData (flexio_spi_state_t *spiState, const uint8_t *txBuff, uint32_t txSize) |
| Sends (transmits) data through the FlexIO-simulated SPI module using a eDMA non-blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_EdmaGetTransmitStatus (flexio_spi_state_t *spiState, uint32_t *bytesRemaining) |
| Returns whether the previous FlexIO-simulated SPI eDMA transmit is complete. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_EdmaAbortSendingData (flexio_spi_state_t *spiState) |
| Terminates a non-blocking FlexIO-simulated SPI eDMA transmission early. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_EdmaReceiveDataBlocking (flexio_spi_state_t *spiState, uint8_t *rxBuff, uint32_t rxSize, uint32_t timeout) |
| Gets (receives) data from the FlexIO-simulated SPI module using an eDMA blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_EdmaReceiveData (flexio_spi_state_t *spiState, uint8_t *rxBuff, uint32_t rxSize) |
| Gets (receives) data from the FlexIO-simulated SPI module using an eDMA non-blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_EdmaGetReceiveStatus (flexio_spi_state_t *spiState, uint32_t *bytesRemaining) |
| Returns whether the previous FlexIO-simulated SPI eDMA receive is complete. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_EdmaAbortReceivingData (flexio_spi_state_t *spiState) |
| Terminates a non-blocking FlexIO-simulated SPI eDMA receive early. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_EdmaTransferDataBlocking (flexio_spi_state_t *spiState, const uint8_t *txBuff, uint8_t *rxBuff, uint32_t xSize, uint32_t timeout) |
| Transfers data through the FlexIO-simulated SPI module using an eDMA blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_EdmaTransferData (flexio_spi_state_t *spiState, const uint8_t *txBuff, uint8_t *rxBuff, uint32_t xSize) |
| Transfers data through the FlexIO-simulated SPI module using an eDMA non-blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_DmaSendDataBlocking (flexio_spi_state_t *spiState, const uint8_t *txBuff, uint32_t txSize, uint32_t timeout) |
| Sends (transmits) data out through the FlexIO-simulated SPI module using a DMA blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_DmaSendData (flexio_spi_state_t *spiState, const uint8_t *txBuff, uint32_t txSize) |
| Sends (transmits) data through the FlexIO-simulated SPI module using a DMA non-blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_DmaGetTransmitStatus (flexio_spi_state_t *spiState, uint32_t *bytesRemaining) |
| Returns whether the previous FlexIO-simulated SPI DMA transmit has finished. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_DmaAbortSendingData (flexio_spi_state_t *spiState) |
| Terminates a non-blocking FlexIO-simulated SPI DMA transmission early. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_DmaReceiveDataBlocking (flexio_spi_state_t *spiState, uint8_t *rxBuff, uint32_t rxSize, uint32_t timeout) |
| Gets (receives) data from the FlexIO-simulated SPI module using a DMA blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_DmaReceiveData (flexio_spi_state_t *spiState, uint8_t *rxBuff, uint32_t rxSize) |
| Gets (receives) data from the FlexIO-simulated SPI module using a DMA non-blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_DmaGetReceiveStatus (flexio_spi_state_t *spiState, uint32_t *bytesRemaining) |
| Returns whether the previous FlexIO-simulated SPI DMA receive is complete. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_AbortDmaReceivingData (flexio_spi_state_t *spiState) |
| Terminates a non-blocking FlexIO-simulated SPI DMA receive early. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_DmaTransferDataBlocking (flexio_spi_state_t *spiState, const uint8_t *txBuff, uint8_t *rxBuff, uint32_t xSize, uint32_t timeout) |
| Transfers data through the FlexIO-simulated SPI module using a DMA blocking method. More...
|
|
flexio_spi_status_t | FLEXIO_SPI_DRV_DmaTransferData (flexio_spi_state_t *spiState, const uint8_t *txBuff, uint8_t *rxBuff, uint32_t xSize) |
| Transfers data through the FlexIO-simulated SPI module using a DMA non-blocking method. More...
|
|
struct flexio_spi_state_t |
volatile bool flexio_spi_state_t::isTxBusy |
volatile bool flexio_spi_state_t::isRxBusy |
volatile bool flexio_spi_state_t::isXBusy |
volatile bool flexio_spi_state_t::isTxBlocking |
volatile bool flexio_spi_state_t::isRxBlocking |
volatile bool flexio_spi_state_t::isXBlocking |
void* flexio_spi_state_t::rxCallbackParam |
volatile bool flexio_spi_state_t::isTxUseDma |
volatile bool flexio_spi_state_t::isRxUseDma |
struct flexio_spi_hwconfig_t |
These constants define the hardware resource used by the FlexIO SPI master/slave device and includes the external pin and the internal shifter and timer.
uint32_t flexio_spi_hwconfig_t::sclkPinIdx |
Output for master, input for slave.
uint32_t flexio_spi_hwconfig_t::csnPinIdx |
Output for master, input for slave.
uint32_t flexio_spi_hwconfig_t::timerIdx[2] |
timer 1 would be only available for master and not used in slave mode.
struct flexio_spi_userconfig_t |
Use an instance of this structure with the FLEXIO_SPI_DRV_Init()function. This enables configuration of the settings of the FlexIO SPI peripheral with a single function call. Settings include: SPI baud rate, data size, FlexIO SPI mode and FlexIO hardware resource resource.
Enumerator |
---|
kFlexIOSpiMaster |
SPI peripheral operates in master mode.
|
kFlexIOSpiSlave |
SPI peripheral operates in slave mode.
|
Enumerator |
---|
kFlexIOSpiMsbFirst |
Data transfers start with most significant bit.
|
kFlexIOSpiLsbFirst |
Data transfers start with least significant bit.
|
Enumerator |
---|
kFlexIOSpiClockPhase_FirstEdge |
First edge on SPSCK occurs at the middle of the first cycle of a data transfer.
|
kFlexIOSpiClockPhase_SecondEdge |
First edge on SPSCK occurs at the start of the first cycle of a data transfer.
|
Enumerator |
---|
kFlexIOSpi8BitMode |
8-bit data transmission mode
|
kFlexIOSpi16BitMode |
16-bit data transmission mode
|
This function initializes the run-time state structure to keep track of the ongoing transfers and the module to user-defined settings and default settings. It also configures the underlying FlexIO pin, shifter, and timer. This is an example to set up the flexio_spi_state_t and the flexio_spi_userconfig_t parameters and to call the FLEXIO_SPI_DRV_Init function
flexio_spi_userconif_t spiConfig;
spiConfig.baudRate = 100000;
spiConfig.spiHwConfig.sdoPinIdx = 0;
spiConfig.spiHwConfig.sdiPinIdx = 1;
spiConfig.spiHwConfig.sclkPinIdx = 2;
spiConfig.spiHwConfig.csnPinIdx = 3;
spiConfig.spiHwConfig.shifterIdx = {0,1};
spiConfig.spiHwConfig.timerIdx = {0,1};
- Parameters
-
instance | The FlexIO instance number. |
spiState | A pointer to the global FlexIO SPI driver state structure memory. The user passes in the memory for the run-time state structure. The FlexIO SPI driver populates the members. This run-time state structure keeps track of the current transfer in progress. |
spiConfig | The user configuration structure of type flexio_spi_userconfig_t. The user populates the members of this structure and passes the pointer of this structure to this function. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
This function disables the FlexIO-simulated SPI trigger.
- Parameters
-
spiState | The run-time structure of the FlexIO-simulated SPI. |
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
txBuff | A pointer to the source buffer containing 8-bit data characters to send. |
txSize | The number of bytes to send. |
timeout | A timeout value for RTOS abstraction sync control in milliseconds (ms). |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
txBuff | A pointer to the source buffer containing 8-bit data chars to send. |
txSize | The number of bytes to send. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of the FlexIO-simulated SPI. |
bytesRemaining | A pointer to a value that is populated with the number of bytes that are remaining in the active transfer. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Return values
-
kStatus_FlexIO_SPI_Success | The transmit has completed successfully. |
kStatus_FlexIO_SPI_TxBusy | The transmit is still in progress. bytesTransmitted is filled with the number of bytes which are transmitted up to that point. |
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Return values
-
kStatus_FlexIO_SPI_Success | The transmit was successful. |
kStatus_FlexIO_SPI_NoTransmitInProgress | No transmission is currently in progress. |
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
rxBuff | A pointer to the buffer containing 8-bit read data characters received. |
rxSize | The number of bytes to receive. |
timeout | A timeout value for RTOS abstraction sync control in milliseconds (ms). |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of the FlexIO-simulated SPI. |
rxBuff | A pointer to the buffer containing 8-bit read data characters received. |
rxSize | The number of bytes to receive. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
bytesRemaining | A pointer to a value that is populated with the number of bytes which still need to be received in the active transfer. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Return values
-
kStatus_FlexIO_SPI_Success | The receive has completed successfully. |
kStatus_FlexIO_SPI_RxBusy | The receive is still in progress. bytesReceived is filled with the number of bytes which are received up to that point. |
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
- Returns
- An error code or kStatus_SPI_Success.
- Return values
-
kStatus_FlexIO_SPI_Success | The receive was successful. |
kStatus_FlexIO_SPI_NoTransmitInProgress | No receive is currently in progress. |
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
txBuff | A pointer to the source buffer containing 8-bit data characters to send. |
rxBuff | A pointer to the buffer containing 8-bit read data characters received. |
xSize | The number of bytes to send and receive. |
timeout | A timeout value for RTOS abstraction sync control in milliseconds (ms). |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
txBuff | A pointer to the source buffer containing 8-bit data characters to send. |
rxBuff | A pointer to the buffer containing 8-bit read data characters received. |
xSize | The number of bytes to send. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
void FLEXIO_SPI_DRV_TX_IRQHandler |
( |
void * |
param | ) |
|
- Parameters
-
param | The run-time structure of FlexIO-simulated SPI. |
void FLEXIO_SPI_DRV_RX_IRQHandler |
( |
void * |
param | ) |
|
- Parameters
-
param | The run-time structure of the FlexIO-simulated SPI. |
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
txBuff | A pointer to the source buffer containing 8-bit data chars to send. |
txSize | The number of bytes to send. |
timeout | A timeout value for RTOS abstraction sync control in milliseconds (ms). |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of the FlexIO-simulated SPI. |
txBuff | A pointer to the source buffer containing 8-bit data chars to send. |
txSize | The number of bytes to send. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of the FlexIO-simulated SPI. |
bytesRemaining | A pointer to a value that is populated with the number of bytes that are remaining in the active transfer. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Return values
-
kStatus_FlexIO_SPI_Success | The transmit has completed successfully. |
kStatus_FlexIO_SPI_TxBusy | The transmit is still in progress. bytesTransmitted is filled with the number of bytes which are transmitted up to that point. |
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Return values
-
kStatus_FlexIO_SPI_Success | The transmit was successful. |
kStatus_FlexIO_SPI_NoTransmitInProgress | No transmission is currently in progress. |
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
rxBuff | A pointer to the buffer containing 8-bit read data chars received. |
rxSize | The number of bytes to receive. |
timeout | A timeout value for RTOS abstraction sync control in milliseconds (ms). |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
rxBuff | A pointer to the buffer containing 8-bit read data characters received. |
rxSize | The number of bytes to receive. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
bytesRemaining | A pointer to a value that is populated with the number of bytes which still need to be received in the active transfer. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Return values
-
kStatus_FlexIO_SPI_Success | The receive has completed successfully. |
kStatus_FlexIO_SPI_RxBusy | The receive is still in progress. bytesReceived is filled with the number of bytes which are received up to that point. |
- Parameters
-
spiState | The run-time structure of the FlexIO-simulated SPI. |
- Returns
- An error code or kStatus_SPI_Success.
- Return values
-
kStatus_FlexIO_SPI_Success | The receive was successful. |
kStatus_FlexIO_SPI_NoTransmitInProgress | No receive is currently in progress. |
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
txBuff | A pointer to the source buffer containing 8-bit data characters to send. |
rxBuff | A pointer to the buffer containing 8-bit read data characters received. |
xSize | The number of bytes to send&receive. |
timeout | A timeout value for RTOS abstraction sync control in milliseconds (ms). |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
txBuff | A pointer to the source buffer containing 8-bit data characters to send. |
rxBuff | A pointer to the buffer containing 8-bit read data chars received. |
xSize | The number of bytes to send. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
txBuff | A pointer to the source buffer containing 8-bit data characters to send. |
txSize | The number of bytes to send. |
timeout | A timeout value for RTOS abstraction sync control in milliseconds (ms). |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
txBuff | A pointer to the source buffer containing 8-bit data chars to send. |
txSize | The number of bytes to send. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
bytesRemaining | A pointer to a value that is populated with the number of bytes that are remaining in the active transfer. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Return values
-
kStatus_FlexIO_SPI_Success | The transmit has completed successfully. |
kStatus_FlexIO_SPI_TxBusy | The transmit is still in progress. bytesTransmitted is filled with the number of bytes which are transmitted up to that point. |
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Return values
-
kStatus_FlexIO_SPI_Success | The transmit was successful. |
kStatus_FlexIO_SPI_NoTransmitInProgress | No transmission is currently in progress. |
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
rxBuff | A pointer to the buffer containing 8-bit read data characters received. |
rxSize | The number of bytes to receive. |
timeout | A timeout value for RTOS abstraction sync control in milliseconds (ms). |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
rxBuff | A pointer to the buffer containing 8-bit read data characters received. |
rxSize | The number of bytes to receive. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
bytesRemaining | A pointer to a value that is populated with the number of bytes which still need to be received in the active transfer. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Return values
-
kStatus_FlexIO_SPI_Success | The receive has completed successfully. |
kStatus_FlexIO_SPI_RxBusy | The receive is still in progress. bytesReceived is filled with the number of bytes which are received up to that point. |
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
- Returns
- An error code or kStatus_SPI_Success.
- Return values
-
kStatus_FlexIO_SPI_Success | The receive was successful. |
kStatus_FlexIO_SPI_NoTransmitInProgress | No receive is currently in progress. |
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
txBuff | A pointer to the source buffer containing 8-bit data characters to send. |
rxBuff | A pointer to the buffer containing 8-bit read data characters received. |
xSize | The number of bytes to send&receive. |
timeout | A timeout value for RTOS abstraction sync control in milliseconds (ms). |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.
- Parameters
-
spiState | The run-time structure of FlexIO-simulated SPI. |
txBuff | A pointer to the source buffer containing 8-bit data characters to send. |
rxBuff | A pointer to the buffer containing 8-bit read data characters received. |
xSize | The number of bytes to send. |
- Returns
- An error code or kStatus_FlexIO_SPI_Success.