![]() |
MCUXpresso SDK API Reference Manual
Rev 2.11.0
NXP Semiconductors
|
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.
Data Structures | |
| struct | dspi_master_edma_handle_t |
| DSPI master eDMA transfer handle structure used for the transactional API. More... | |
| struct | dspi_slave_edma_handle_t |
| DSPI slave eDMA transfer handle structure used for the transactional API. More... | |
Macros | |
| #define | DSPI_EDMA_MAX_TRANSFER_SIZE(base, width) |
| DSPI EDMA max transfer data size calculate. More... | |
Typedefs | |
| typedef void(* | dspi_master_edma_transfer_callback_t )(SPI_Type *base, dspi_master_edma_handle_t *handle, status_t status, void *userData) |
| Completion callback function pointer type. More... | |
| typedef void(* | dspi_slave_edma_transfer_callback_t )(SPI_Type *base, dspi_slave_edma_handle_t *handle, status_t status, void *userData) |
| Completion callback function pointer type. More... | |
Driver version | |
| #define | FSL_DSPI_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 2, 4)) |
| DSPI EDMA driver version 2.2.4. | |
Transactional APIs | |
| 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 |
Forward declaration of the DSPI eDMA master handle typedefs.
Data Fields | |
| uint32_t | bitsPerFrame |
| The desired number of bits per frame. More... | |
| volatile uint32_t | command |
| The desired data command. More... | |
| volatile uint32_t | lastCommand |
| The desired last data command. More... | |
| uint8_t | fifoSize |
| FIFO dataSize. More... | |
| volatile bool | isPcsActiveAfterTransfer |
| Indicates whether the PCS signal keeps active after the last frame transfer. More... | |
| uint8_t | nbytes |
| eDMA minor byte transfer count initially configured. More... | |
| volatile uint8_t | state |
| DSPI transfer state, see _dspi_transfer_state. More... | |
| uint8_t *volatile | txData |
| Send buffer. More... | |
| uint8_t *volatile | rxData |
| Receive buffer. More... | |
| volatile size_t | remainingSendByteCount |
| A number of bytes remaining to send. More... | |
| volatile size_t | remainingReceiveByteCount |
| A number of bytes remaining to receive. More... | |
| size_t | totalByteCount |
| A number of transfer bytes. | |
| uint32_t | rxBuffIfNull |
| Used if there is not rxData for DMA purpose. More... | |
| uint32_t | txBuffIfNull |
| Used if there is not txData for DMA purpose. More... | |
| dspi_master_edma_transfer_callback_t | callback |
| Completion callback. More... | |
| void * | userData |
| Callback user data. More... | |
| edma_handle_t * | edmaRxRegToRxDataHandle |
| edma_handle_t handle point used for RxReg to RxData buff | |
| edma_handle_t * | edmaTxDataToIntermediaryHandle |
| edma_handle_t handle point used for TxData to Intermediary | |
| edma_handle_t * | edmaIntermediaryToTxRegHandle |
| edma_handle_t handle point used for Intermediary to TxReg | |
| edma_tcd_t | dspiSoftwareTCD [2] |
| SoftwareTCD , internal used. | |
| uint32_t dspi_master_edma_handle_t::bitsPerFrame |
| volatile uint32_t dspi_master_edma_handle_t::command |
| volatile uint32_t dspi_master_edma_handle_t::lastCommand |
| uint8_t dspi_master_edma_handle_t::fifoSize |
| volatile bool dspi_master_edma_handle_t::isPcsActiveAfterTransfer |
| uint8_t dspi_master_edma_handle_t::nbytes |
| volatile uint8_t dspi_master_edma_handle_t::state |
| uint8_t* volatile dspi_master_edma_handle_t::txData |
| uint8_t* volatile dspi_master_edma_handle_t::rxData |
| volatile size_t dspi_master_edma_handle_t::remainingSendByteCount |
| volatile size_t dspi_master_edma_handle_t::remainingReceiveByteCount |
| uint32_t dspi_master_edma_handle_t::rxBuffIfNull |
| uint32_t dspi_master_edma_handle_t::txBuffIfNull |
| dspi_master_edma_transfer_callback_t dspi_master_edma_handle_t::callback |
| void* dspi_master_edma_handle_t::userData |
| struct _dspi_slave_edma_handle |
Forward declaration of the DSPI eDMA slave handle typedefs.
Data Fields | |
| uint32_t | bitsPerFrame |
| The desired number of bits per frame. More... | |
| uint8_t *volatile | txData |
| Send buffer. More... | |
| uint8_t *volatile | rxData |
| Receive buffer. More... | |
| volatile size_t | remainingSendByteCount |
| A number of bytes remaining to send. More... | |
| volatile size_t | remainingReceiveByteCount |
| A number of bytes remaining to receive. More... | |
| size_t | totalByteCount |
| A number of transfer bytes. | |
| uint32_t | rxBuffIfNull |
| Used if there is not rxData for DMA purpose. More... | |
| uint32_t | txBuffIfNull |
| Used if there is not txData for DMA purpose. More... | |
| uint32_t | txLastData |
| Used if there is an extra byte when 16bits per frame for DMA purpose. More... | |
| uint8_t | nbytes |
| eDMA minor byte transfer count initially configured. More... | |
| volatile uint8_t | state |
| DSPI transfer state. More... | |
| dspi_slave_edma_transfer_callback_t | callback |
| Completion callback. More... | |
| void * | userData |
| Callback user data. More... | |
| edma_handle_t * | edmaRxRegToRxDataHandle |
| edma_handle_t handle point used for RxReg to RxData buff | |
| edma_handle_t * | edmaTxDataToTxRegHandle |
| edma_handle_t handle point used for TxData to TxReg | |
| uint32_t dspi_slave_edma_handle_t::bitsPerFrame |
| uint8_t* volatile dspi_slave_edma_handle_t::txData |
| uint8_t* volatile dspi_slave_edma_handle_t::rxData |
| volatile size_t dspi_slave_edma_handle_t::remainingSendByteCount |
| volatile size_t dspi_slave_edma_handle_t::remainingReceiveByteCount |
| uint32_t dspi_slave_edma_handle_t::rxBuffIfNull |
| uint32_t dspi_slave_edma_handle_t::txBuffIfNull |
| uint32_t dspi_slave_edma_handle_t::txLastData |
| uint8_t dspi_slave_edma_handle_t::nbytes |
| volatile uint8_t dspi_slave_edma_handle_t::state |
| dspi_slave_edma_transfer_callback_t dspi_slave_edma_handle_t::callback |
| void* dspi_slave_edma_handle_t::userData |
| #define DSPI_EDMA_MAX_TRANSFER_SIZE | ( | base, | |
| width | |||
| ) |
| base | DSPI peripheral base address. |
| width | Transfer width |
| typedef void(* dspi_master_edma_transfer_callback_t)(SPI_Type *base, dspi_master_edma_handle_t *handle, status_t status, void *userData) |
| 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. |
| typedef void(* dspi_slave_edma_transfer_callback_t)(SPI_Type *base, dspi_slave_edma_handle_t *handle, status_t status, void *userData) |
| 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. |
| 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 | ||
| ) |
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.
| 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. |
| status_t DSPI_MasterTransferEDMA | ( | SPI_Type * | base, |
| dspi_master_edma_handle_t * | handle, | ||
| dspi_transfer_t * | transfer | ||
| ) |
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.
| base | DSPI peripheral base address. |
| handle | A pointer to the _dspi_master_edma_handle structure which stores the transfer state. |
| transfer | A pointer to the dspi_transfer_t structure. |
| status_t DSPI_MasterHalfDuplexTransferEDMA | ( | SPI_Type * | base, |
| dspi_master_edma_handle_t * | handle, | ||
| dspi_half_duplex_transfer_t * | xfer | ||
| ) |
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.
| base | DSPI base pointer |
| handle | A pointer to the _dspi_master_edma_handle structure which stores the transfer state. |
| xfer | A pointer to the dspi_half_duplex_transfer_t structure. |
| void DSPI_MasterTransferAbortEDMA | ( | SPI_Type * | base, |
| dspi_master_edma_handle_t * | handle | ||
| ) |
This function aborts a transfer which is using eDMA.
| base | DSPI peripheral base address. |
| handle | A pointer to the _dspi_master_edma_handle structure which stores the transfer state. |
| status_t DSPI_MasterTransferGetCountEDMA | ( | SPI_Type * | base, |
| dspi_master_edma_handle_t * | handle, | ||
| size_t * | count | ||
| ) |
This function gets the master eDMA transfer count.
| 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. |
| 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 | ||
| ) |
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.
| 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. |
| status_t DSPI_SlaveTransferEDMA | ( | SPI_Type * | base, |
| dspi_slave_edma_handle_t * | handle, | ||
| dspi_transfer_t * | transfer | ||
| ) |
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.
| base | DSPI peripheral base address. |
| handle | A pointer to the _dspi_slave_edma_handle structure which stores the transfer state. |
| transfer | A pointer to the dspi_transfer_t structure. |
| void DSPI_SlaveTransferAbortEDMA | ( | SPI_Type * | base, |
| dspi_slave_edma_handle_t * | handle | ||
| ) |
This function aborts a transfer which is using eDMA.
| base | DSPI peripheral base address. |
| handle | A pointer to the _dspi_slave_edma_handle structure which stores the transfer state. |
| status_t DSPI_SlaveTransferGetCountEDMA | ( | SPI_Type * | base, |
| dspi_slave_edma_handle_t * | handle, | ||
| size_t * | count | ||
| ) |
This function gets the slave eDMA transfer count.
| 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. |