This section describes the programming interface of the DSPI peripheral driver. The DSPI driver configures DSPI module and provides functional and transactional interfaces to build the DSPI application.
|
| void | DSPI_MasterTransferCreateHandleEDMA (SPI_Type *base, dspi_master_edma_handle_t *handle, dspi_master_edma_transfer_callback_t callback, void *userData, edma_handle_t *edmaRxRegToRxDataHandle, edma_handle_t *edmaTxDataToIntermediaryHandle, edma_handle_t *edmaIntermediaryToTxRegHandle) |
| | Initializes the DSPI master eDMA handle. More...
|
| |
| status_t | DSPI_MasterTransferEDMA (SPI_Type *base, dspi_master_edma_handle_t *handle, dspi_transfer_t *transfer) |
| | DSPI master transfer data using eDMA. More...
|
| |
| status_t | DSPI_MasterHalfDuplexTransferEDMA (SPI_Type *base, dspi_master_edma_handle_t *handle, dspi_half_duplex_transfer_t *xfer) |
| | Transfers a block of data using a eDMA method. More...
|
| |
| void | DSPI_MasterTransferAbortEDMA (SPI_Type *base, dspi_master_edma_handle_t *handle) |
| | DSPI master aborts a transfer which is using eDMA. More...
|
| |
| status_t | DSPI_MasterTransferGetCountEDMA (SPI_Type *base, dspi_master_edma_handle_t *handle, size_t *count) |
| | Gets the master eDMA transfer count. More...
|
| |
| void | DSPI_SlaveTransferCreateHandleEDMA (SPI_Type *base, dspi_slave_edma_handle_t *handle, dspi_slave_edma_transfer_callback_t callback, void *userData, edma_handle_t *edmaRxRegToRxDataHandle, edma_handle_t *edmaTxDataToTxRegHandle) |
| | Initializes the DSPI slave eDMA handle. More...
|
| |
| status_t | DSPI_SlaveTransferEDMA (SPI_Type *base, dspi_slave_edma_handle_t *handle, dspi_transfer_t *transfer) |
| | DSPI slave transfer data using eDMA. More...
|
| |
| void | DSPI_SlaveTransferAbortEDMA (SPI_Type *base, dspi_slave_edma_handle_t *handle) |
| | DSPI slave aborts a transfer which is using eDMA. More...
|
| |
| status_t | DSPI_SlaveTransferGetCountEDMA (SPI_Type *base, dspi_slave_edma_handle_t *handle, size_t *count) |
| | Gets the slave eDMA transfer count. More...
|
| |
| struct _dspi_master_edma_handle |
| uint32_t _dspi_master_edma_handle::bitsPerFrame |
| volatile uint32_t _dspi_master_edma_handle::command |
| volatile uint32_t _dspi_master_edma_handle::lastCommand |
| uint8_t _dspi_master_edma_handle::fifoSize |
| volatile bool _dspi_master_edma_handle::isPcsActiveAfterTransfer |
| uint8_t _dspi_master_edma_handle::nbytes |
| volatile uint8_t _dspi_master_edma_handle::state |
| const uint8_t* volatile _dspi_master_edma_handle::txData |
| uint8_t* volatile _dspi_master_edma_handle::rxData |
| volatile size_t _dspi_master_edma_handle::remainingSendByteCount |
| volatile size_t _dspi_master_edma_handle::remainingReceiveByteCount |
| uint32_t _dspi_master_edma_handle::rxBuffIfNull |
| uint32_t _dspi_master_edma_handle::txBuffIfNull |
| void* _dspi_master_edma_handle::userData |
| struct _dspi_slave_edma_handle |
| uint32_t _dspi_slave_edma_handle::bitsPerFrame |
| const uint8_t* volatile _dspi_slave_edma_handle::txData |
| uint8_t* volatile _dspi_slave_edma_handle::rxData |
| volatile size_t _dspi_slave_edma_handle::remainingSendByteCount |
| volatile size_t _dspi_slave_edma_handle::remainingReceiveByteCount |
| uint32_t _dspi_slave_edma_handle::rxBuffIfNull |
| uint32_t _dspi_slave_edma_handle::txBuffIfNull |
| uint32_t _dspi_slave_edma_handle::txLastData |
| uint8_t _dspi_slave_edma_handle::nbytes |
| volatile uint8_t _dspi_slave_edma_handle::state |
| void* _dspi_slave_edma_handle::userData |
| #define DSPI_EDMA_MAX_TRANSFER_SIZE |
( |
|
base, |
|
|
|
width |
|
) |
| |
Value:((1 == FSL_FEATURE_DSPI_HAS_SEPARATE_DMA_RX_TX_REQn(base)) ? ((width > 8U) ? 65534U : 32767U) : \
((width > 8U) ? 1022U : 511U))
- Parameters
-
| base | DSPI peripheral base address. |
| width | Transfer width |
- Parameters
-
| base | DSPI peripheral base address. |
| handle | A pointer to the handle for the DSPI master. |
| status | Success or error code describing whether the transfer completed. |
| userData | An arbitrary pointer-dataSized value passed from the application. |
- Parameters
-
| base | DSPI peripheral base address. |
| handle | A pointer to the handle for the DSPI slave. |
| status | Success or error code describing whether the transfer completed. |
| userData | An arbitrary pointer-dataSized value passed from the application. |
This function initializes the DSPI eDMA handle which can be used for other DSPI transactional APIs. Usually, for a specified DSPI instance, call this API once to get the initialized handle.
- Note
- DSPI eDMA has separated (RX and TX as two sources) or shared (RX and TX are the same source) DMA request source.
- For the separated DMA request source, enable and set the RX DMAMUX source for edmaRxRegToRxDataHandle and TX DMAMUX source for edmaIntermediaryToTxRegHandle.
- For the shared DMA request source, enable and set the RX/RX DMAMUX source for the edmaRxRegToRxDataHandle.
- Parameters
-
| base | DSPI peripheral base address. |
| handle | DSPI handle pointer to _dspi_master_edma_handle. |
| callback | DSPI callback. |
| userData | A callback function parameter. |
| edmaRxRegToRxDataHandle | edmaRxRegToRxDataHandle pointer to edma_handle_t. |
| edmaTxDataToIntermediaryHandle | edmaTxDataToIntermediaryHandle pointer to edma_handle_t. |
| edmaIntermediaryToTxRegHandle | edmaIntermediaryToTxRegHandle pointer to edma_handle_t. |
This function transfers data using eDMA. This is a non-blocking function, which returns right away. When all data is transferred, the callback function is called.
- Note
- The max transfer size of each transfer depends on whether the instance's Tx/Rx shares the same DMA request. If FSL_FEATURE_DSPI_HAS_SEPARATE_DMA_RX_TX_REQn(x) is true, then the max transfer size is 32767 datawidth of data, otherwise is 511.
- Parameters
-
- Returns
- status of status_t.
This function transfers data using eDNA, the transfer mechanism is half-duplex. This is a non-blocking function, which returns right away. When all data is transferred, the callback function is called.
- Parameters
-
- Returns
- status of status_t.
This function aborts a transfer which is using eDMA.
- Parameters
-
| base | DSPI peripheral base address. |
| handle | A pointer to the _dspi_master_edma_handle structure which stores the transfer state. |
This function gets the master eDMA transfer count.
- Parameters
-
| base | DSPI peripheral base address. |
| handle | A pointer to the _dspi_master_edma_handle structure which stores the transfer state. |
| count | A number of bytes transferred by the non-blocking transaction. |
- Returns
- status of status_t.
This function initializes the DSPI eDMA handle which can be used for other DSPI transactional APIs. Usually, for a specified DSPI instance, call this API once to get the initialized handle.
- Note
- DSPI eDMA has separated (RN and TX in 2 sources) or shared (RX and TX are the same source) DMA request source.
- For the separated DMA request source, enable and set the RX DMAMUX source for edmaRxRegToRxDataHandle and TX DMAMUX source for edmaTxDataToTxRegHandle.
- For the shared DMA request source, enable and set the RX/RX DMAMUX source for the edmaRxRegToRxDataHandle.
- Parameters
-
| base | DSPI peripheral base address. |
| handle | DSPI handle pointer to _dspi_slave_edma_handle. |
| callback | DSPI callback. |
| userData | A callback function parameter. |
| edmaRxRegToRxDataHandle | edmaRxRegToRxDataHandle pointer to edma_handle_t. |
| edmaTxDataToTxRegHandle | edmaTxDataToTxRegHandle pointer to edma_handle_t. |
This function transfers data using eDMA. This is a non-blocking function, which returns right away. When all data is transferred, the callback function is called. Note that the slave eDMA transfer doesn't support transfer_size is 1 when the bitsPerFrame is greater than eight.
- Note
- The max transfer size of each transfer depends on whether the instance's Tx/Rx shares the same DMA request. If FSL_FEATURE_DSPI_HAS_SEPARATE_DMA_RX_TX_REQn(x) is true, then the max transfer size is 32767 datawidth of data, otherwise is 511.
- Parameters
-
- Returns
- status of status_t.
This function aborts a transfer which is using eDMA.
- Parameters
-
| base | DSPI peripheral base address. |
| handle | A pointer to the _dspi_slave_edma_handle structure which stores the transfer state. |
This function gets the slave eDMA transfer count.
- Parameters
-
| base | DSPI peripheral base address. |
| handle | A pointer to the _dspi_slave_edma_handle structure which stores the transfer state. |
| count | A number of bytes transferred so far by the non-blocking transaction. |
- Returns
- status of status_t.