![]() |
MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
Data Structures | |
| struct | asrc_p2p_edma_config_t |
| destination peripheral configuration More... | |
| struct | asrc_in_edma_handle_t |
| @ brief asrc in edma handler More... | |
| struct | asrc_out_edma_handle_t |
| @ brief asrc out edma handler More... | |
| struct | asrc_edma_handle_t |
| ASRC DMA transfer handle. More... | |
Macros | |
| #define | ASRC_XFER_IN_QUEUE_SIZE 4U |
| < More... | |
Typedefs | |
| typedef void(* | asrc_edma_callback_t )(ASRC_Type *base, asrc_edma_handle_t *handle, status_t status, void *userData) |
| ASRC eDMA transfer callback function for finish and error. | |
| typedef void(* | asrc_start_peripheral_t )(bool start) |
| ASRC trigger peripheral function pointer. | |
Driver version | |
| #define | FSL_ASRC_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
| Version 2.0.0. | |
eDMA Transactional | |
| void | ASRC_TransferInCreateHandleEDMA (ASRC_Type *base, asrc_edma_handle_t *handle, asrc_channel_pair_t channelPair, asrc_edma_callback_t callback, edma_handle_t *inDmaHandle, const asrc_p2p_edma_config_t *periphConfig, void *userData) |
| Initializes the ASRC IN eDMA handle. More... | |
| void | ASRC_TransferOutCreateHandleEDMA (ASRC_Type *base, asrc_edma_handle_t *handle, asrc_channel_pair_t channelPair, asrc_edma_callback_t callback, edma_handle_t *outDmaHandle, const asrc_p2p_edma_config_t *periphConfig, void *userData) |
| Initializes the ASRC OUT eDMA handle. More... | |
| status_t | ASRC_TransferSetChannelPairConfigEDMA (ASRC_Type *base, asrc_edma_handle_t *handle, asrc_channel_pair_config_t *asrcConfig, uint32_t inSampleRate, uint32_t outSampleRate) |
| Configures the ASRC P2P channel pair. More... | |
| uint32_t | ASRC_GetOutSamplesSizeEDMA (ASRC_Type *base, asrc_edma_handle_t *handle, uint32_t inSampleRate, uint32_t outSampleRate, uint32_t inSamplesize) |
| Get output sample buffer size can be transferred by edma. More... | |
| status_t | ASRC_TransferEDMA (ASRC_Type *base, asrc_edma_handle_t *handle, asrc_transfer_t *xfer) |
| Performs a non-blocking ASRC m2m convert using EDMA. More... | |
| void | ASRC_TransferInAbortEDMA (ASRC_Type *base, asrc_edma_handle_t *handle) |
| Aborts a ASRC IN transfer using eDMA. More... | |
| void | ASRC_TransferOutAbortEDMA (ASRC_Type *base, asrc_edma_handle_t *handle) |
| Aborts a ASRC OUT transfer using eDMA. More... | |
| void | ASRC_TransferInTerminalEDMA (ASRC_Type *base, asrc_edma_handle_t *handle) |
| Terminate In ASRC Convert. More... | |
| void | ASRC_TransferOutTerminalEDMA (ASRC_Type *base, asrc_edma_handle_t *handle) |
| Terminate Out ASRC Convert. More... | |
| struct asrc_p2p_edma_config_t |
Data Fields | |
| uint8_t | watermark |
| peripheral watermark | |
| uint8_t | channel |
| peripheral channel number | |
| asrc_start_peripheral_t | startPeripheral |
| trigger peripheral start | |
| struct asrc_in_edma_handle_t |
Data Fields | |
| edma_handle_t * | inDmaHandle |
| DMA handler for ASRC in. | |
| uint8_t | tcd [(ASRC_XFER_IN_QUEUE_SIZE+1U)*sizeof(edma_tcd_t)] |
| TCD pool for eDMA send. More... | |
| uint32_t | sampleWidth |
| input data width | |
| uint32_t | fifoThreshold |
| ASRC input fifo threshold. | |
| uint32_t * | asrcQueue [ASRC_XFER_IN_QUEUE_SIZE] |
| Transfer queue storing queued transfer. More... | |
| size_t | transferSize [ASRC_XFER_IN_QUEUE_SIZE] |
| Data bytes need to transfer. | |
| volatile uint8_t | queueUser |
| Index for user to queue transfer. More... | |
| volatile uint8_t | queueDriver |
| Index for driver to get the transfer data and size. | |
| uint32_t | state |
| Internal state for ASRC eDMA transfer. | |
| const asrc_p2p_edma_config_t * | peripheralConfig |
| peripheral configuration pointer | |
| uint8_t asrc_in_edma_handle_t::tcd[(ASRC_XFER_IN_QUEUE_SIZE+1U)*sizeof(edma_tcd_t)] |
| uint32_t* asrc_in_edma_handle_t::asrcQueue[ASRC_XFER_IN_QUEUE_SIZE] |
| volatile uint8_t asrc_in_edma_handle_t::queueUser |
| struct asrc_out_edma_handle_t |
Data Fields | |
| edma_handle_t * | outDmaHandle |
| DMA handler for ASRC out. | |
| uint8_t | tcd [(ASRC_XFER_OUT_QUEUE_SIZE+1U)*sizeof(edma_tcd_t)] |
| TCD pool for eDMA send. More... | |
| uint32_t | sampleWidth |
| output data width | |
| uint32_t | fifoThreshold |
| ASRC output fifo threshold. | |
| uint32_t * | asrcQueue [ASRC_XFER_OUT_QUEUE_SIZE] |
| Transfer queue storing queued transfer. More... | |
| size_t | transferSize [ASRC_XFER_OUT_QUEUE_SIZE] |
| Data bytes need to transfer. | |
| volatile uint8_t | queueUser |
| Index for user to queue transfer. More... | |
| volatile uint8_t | queueDriver |
| Index for driver to get the transfer data and size. | |
| uint32_t | state |
| Internal state for ASRC eDMA transfer. | |
| const asrc_p2p_edma_config_t * | peripheralConfig |
| peripheral configuration pointer | |
| uint8_t asrc_out_edma_handle_t::tcd[(ASRC_XFER_OUT_QUEUE_SIZE+1U)*sizeof(edma_tcd_t)] |
| uint32_t* asrc_out_edma_handle_t::asrcQueue[ASRC_XFER_OUT_QUEUE_SIZE] |
| volatile uint8_t asrc_out_edma_handle_t::queueUser |
| struct _asrc_edma_handle |
Data Fields | |
| asrc_in_edma_handle_t | in |
| asrc in handler | |
| asrc_out_edma_handle_t | out |
| asrc out handler | |
| asrc_channel_pair_t | channelPair |
| channel pair | |
| void * | userData |
| User callback parameter. | |
| asrc_edma_callback_t | callback |
| Callback for users while transfer finish or error occurs. | |
| #define ASRC_XFER_IN_QUEUE_SIZE 4U |
ASRC IN edma QUEUE size
| void ASRC_TransferInCreateHandleEDMA | ( | ASRC_Type * | base, |
| asrc_edma_handle_t * | handle, | ||
| asrc_channel_pair_t | channelPair, | ||
| asrc_edma_callback_t | callback, | ||
| edma_handle_t * | inDmaHandle, | ||
| const asrc_p2p_edma_config_t * | periphConfig, | ||
| void * | userData | ||
| ) |
This function initializes the ASRC DMA handle, which can be used for other ASRC transactional APIs. Usually, for a specified ASRC channel pair, call this API once to get the initialized handle.
| base | ASRC base pointer. |
| channelPair | ASRC channel pair |
| handle | ASRC eDMA handle pointer. |
| callback | Pointer to user callback function. |
| txDmaHandle | ASRC send edma handle pointer. |
| periphConfig | peripheral configuration. |
| userData | User parameter passed to the callback function. |
| void ASRC_TransferOutCreateHandleEDMA | ( | ASRC_Type * | base, |
| asrc_edma_handle_t * | handle, | ||
| asrc_channel_pair_t | channelPair, | ||
| asrc_edma_callback_t | callback, | ||
| edma_handle_t * | outDmaHandle, | ||
| const asrc_p2p_edma_config_t * | periphConfig, | ||
| void * | userData | ||
| ) |
This function initializes the ASRC DMA handle, which can be used for other ASRC transactional APIs. Usually, for a specified ASRC channel pair, call this API once to get the initialized handle.
| base | ASRC base pointer. |
| channelPair | ASRC channel pair |
| handle | ASRC eDMA handle pointer. |
| callback | Pointer to user callback function. |
| txDmaHandle | ASRC send edma handle pointer. |
| periphConfig | peripheral configuration. |
| userData | User parameter passed to the callback function. |
| status_t ASRC_TransferSetChannelPairConfigEDMA | ( | ASRC_Type * | base, |
| asrc_edma_handle_t * | handle, | ||
| asrc_channel_pair_config_t * | asrcConfig, | ||
| uint32_t | inSampleRate, | ||
| uint32_t | outSampleRate | ||
| ) |
| base | ASRC base pointer. |
| handle | ASRC eDMA handle pointer. |
| asrcConfig | asrc configurations. |
| inputSampleRate | ASRC input sample rate. |
| outputSampleRate | ASRC output sample rate. |
| uint32_t ASRC_GetOutSamplesSizeEDMA | ( | ASRC_Type * | base, |
| asrc_edma_handle_t * | handle, | ||
| uint32_t | inSampleRate, | ||
| uint32_t | outSampleRate, | ||
| uint32_t | inSamplesize | ||
| ) |
| base | asrc base pointer. |
| handle | ASRC channel pair edma handle. |
| inSampleRate | input sample rate. |
| outSampleRate | output sample rate. |
| inSamples | input sampleS size. |
| output | buffer size in byte. |
| status_t ASRC_TransferEDMA | ( | ASRC_Type * | base, |
| asrc_edma_handle_t * | handle, | ||
| asrc_transfer_t * | xfer | ||
| ) |
| base | ASRC base pointer. |
| handle | ASRC eDMA handle pointer. |
| xfer | Pointer to the DMA transfer structure. |
| kStatus_Success | Start a ASRC eDMA send successfully. |
| kStatus_InvalidArgument | The input argument is invalid. |
| kStatus_ASRCQueueFull | ASRC EDMA driver queue is full. |
| void ASRC_TransferInAbortEDMA | ( | ASRC_Type * | base, |
| asrc_edma_handle_t * | handle | ||
| ) |
This function only aborts the current transfer slots, the other transfer slots' information still kept in the handler. If users want to terminate all transfer slots, just call ASRC_TransferTerminalP2PEDMA.
| base | ASRC base pointer. |
| handle | ASRC eDMA handle pointer. |
| void ASRC_TransferOutAbortEDMA | ( | ASRC_Type * | base, |
| asrc_edma_handle_t * | handle | ||
| ) |
This function only aborts the current transfer slots, the other transfer slots' information still kept in the handler. If users want to terminate all transfer slots, just call ASRC_TransferTerminalP2PEDMA.
| base | ASRC base pointer. |
| handle | ASRC eDMA handle pointer. |
| void ASRC_TransferInTerminalEDMA | ( | ASRC_Type * | base, |
| asrc_edma_handle_t * | handle | ||
| ) |
This function will clear all transfer slots buffered in the asrc queue. If users only want to abort the current transfer slot, please call ASRC_TransferAbortPP2PEDMA.
| base | ASRC base pointer. |
| handle | ASRC eDMA handle pointer. |
| void ASRC_TransferOutTerminalEDMA | ( | ASRC_Type * | base, |
| asrc_edma_handle_t * | handle | ||
| ) |
This function will clear all transfer slots buffered in the asrc queue. If users only want to abort the current transfer slot, please call ASRC_TransferAbortPP2PEDMA.
| base | ASRC base pointer. |
| handle | ASRC eDMA handle pointer. |