![]() |
MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
Data Structures | |
| struct | pdm_edma_transfer_t |
| PDM edma transfer. More... | |
| struct | pdm_edma_handle_t |
| PDM DMA transfer handle, users should not touch the content of the handle. More... | |
Typedefs | |
| typedef void(* | pdm_edma_callback_t )(PDM_Type *base, pdm_edma_handle_t *handle, status_t status, void *userData) |
| PDM eDMA transfer callback function for finish and error. | |
Driver version | |
| #define | FSL_PDM_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
| Version 2.0.0. | |
PDM eDMA Transactional | |
| void | PDM_TransferInstallEDMATCDMemory (pdm_edma_handle_t *handle, void *tcdAddr, size_t tcdNum) |
| Install EDMA descriptor memory. More... | |
| void | PDM_TransferCreateHandleEDMA (PDM_Type *base, pdm_edma_handle_t *handle, pdm_edma_callback_t callback, void *userData, edma_handle_t *dmaHandle) |
| Initializes the PDM Rx eDMA handle. More... | |
| void | PDM_TransferSetChannelConfigEDMA (PDM_Type *base, pdm_edma_handle_t *handle, uint32_t channel, const pdm_channel_config_t *config) |
| Configures the PDM channel. More... | |
| status_t | PDM_TransferReceiveEDMA (PDM_Type *base, pdm_edma_handle_t *handle, pdm_edma_transfer_t *xfer) |
| Performs a non-blocking PDM receive using eDMA. More... | |
| void | PDM_TransferTerminateReceiveEDMA (PDM_Type *base, pdm_edma_handle_t *handle) |
| Terminate all PDM receive. More... | |
| void | PDM_TransferAbortReceiveEDMA (PDM_Type *base, pdm_edma_handle_t *handle) |
| Aborts a PDM receive using eDMA. More... | |
| status_t | PDM_TransferGetReceiveCountEDMA (PDM_Type *base, pdm_edma_handle_t *handle, size_t *count) |
| Gets byte count received by PDM. More... | |
| struct pdm_edma_transfer_t |
Data Fields | |
| volatile uint8_t * | data |
| Data start address to transfer. More... | |
| volatile size_t | dataSize |
| Total Transfer bytes size. More... | |
| struct _pdm_edma_transfer * | linkTransfer |
| linked transfer configurations | |
| volatile uint8_t* pdm_edma_transfer_t::data |
| volatile size_t pdm_edma_transfer_t::dataSize |
| struct _pdm_edma_handle |
PDM edma handler.
Data Fields | |
| edma_handle_t * | dmaHandle |
| DMA handler for PDM send. | |
| uint8_t | count |
| The transfer data count in a DMA request. | |
| uint32_t | receivedBytes |
| total transfer count | |
| uint32_t | state |
| Internal state for PDM eDMA transfer. | |
| pdm_edma_callback_t | callback |
| Callback for users while transfer finish or error occurs. | |
| bool | isLoopTransfer |
| loop transfer | |
| void * | userData |
| User callback parameter. | |
| edma_tcd_t * | tcd |
| TCD pool for eDMA transfer. More... | |
| uint32_t | tcdNum |
| TCD number. | |
| uint32_t | tcdUser |
| Index for user to queue transfer. More... | |
| uint32_t | tcdDriver |
| Index for driver to get the transfer data and size. | |
| volatile uint32_t | tcdUsedNum |
| Index for user to queue transfer. More... | |
| uint8_t | endChannel |
| The last enabled channel. | |
| uint8_t | channelNums |
| total channel numbers | |
| edma_tcd_t* pdm_edma_handle_t::tcd |
| uint32_t pdm_edma_handle_t::tcdUser |
| volatile uint32_t pdm_edma_handle_t::tcdUsedNum |
| void PDM_TransferInstallEDMATCDMemory | ( | pdm_edma_handle_t * | handle, |
| void * | tcdAddr, | ||
| size_t | tcdNum | ||
| ) |
| handle | Pointer to EDMA channel transfer handle. |
| tcdAddr | EDMA head descriptor address. |
| tcdNum | EDMA link descriptor address. |
| void PDM_TransferCreateHandleEDMA | ( | PDM_Type * | base, |
| pdm_edma_handle_t * | handle, | ||
| pdm_edma_callback_t | callback, | ||
| void * | userData, | ||
| edma_handle_t * | dmaHandle | ||
| ) |
This function initializes the PDM slave DMA handle, which can be used for other PDM master transactional APIs. Usually, for a specified PDM instance, call this API once to get the initialized handle.
| base | PDM base pointer. |
| handle | PDM eDMA handle pointer. |
| base | PDM peripheral base address. |
| callback | Pointer to user callback function. |
| userData | User parameter passed to the callback function. |
| dmaHandle | eDMA handle pointer, this handle shall be static allocated by users. |
| void PDM_TransferSetChannelConfigEDMA | ( | PDM_Type * | base, |
| pdm_edma_handle_t * | handle, | ||
| uint32_t | channel, | ||
| const pdm_channel_config_t * | config | ||
| ) |
| base | PDM base pointer. |
| handle | PDM eDMA handle pointer. |
| channel | channel index. |
| config | pdm channel configurations. |
| status_t PDM_TransferReceiveEDMA | ( | PDM_Type * | base, |
| pdm_edma_handle_t * | handle, | ||
| pdm_edma_transfer_t * | xfer | ||
| ) |
| base | PDM base pointer |
| handle | PDM eDMA handle pointer. |
| xfer | Pointer to DMA transfer structure. |
| kStatus_Success | Start a PDM eDMA receive successfully. |
| kStatus_InvalidArgument | The input argument is invalid. |
| kStatus_RxBusy | PDM is busy receiving data. |
| void PDM_TransferTerminateReceiveEDMA | ( | PDM_Type * | base, |
| pdm_edma_handle_t * | handle | ||
| ) |
This function will clear all transfer slots buffered in the pdm queue. If users only want to abort the current transfer slot, please call PDM_TransferAbortReceiveEDMA.
| base | PDM base pointer. |
| handle | PDM eDMA handle pointer. |
| void PDM_TransferAbortReceiveEDMA | ( | PDM_Type * | base, |
| pdm_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 PDM_TransferTerminateReceiveEDMA.
| base | PDM base pointer |
| handle | PDM eDMA handle pointer. |
| status_t PDM_TransferGetReceiveCountEDMA | ( | PDM_Type * | base, |
| pdm_edma_handle_t * | handle, | ||
| size_t * | count | ||
| ) |
| base | PDM base pointer |
| handle | PDM eDMA handle pointer. |
| count | Bytes count received by PDM. |
| kStatus_Success | Succeed get the transfer count. |
| kStatus_NoTransferInProgress | There is no non-blocking transaction in progress. |