Typical use case
More...
The SDMA multi fifo script support transfer data between multi peripheral fifos and memory, a typical user case is that receiving multi PDM channel data and put it into memory as
| channel 0 | channel 1 | channel 2 | channel 3 | channel 4 | ......... |
Multi fifo script is target to implement above feature, it can supports 1.configurable fifo watermark range from 1~(2^12-1), it is a value of fifo_watermark * channel_numbers 2.configurable fifo numbers, support up to 15 continuous fifos 3.configurable fifo address offset, support address offset up to 64
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/pdm/pdm_sai_sdma
|
void | PDM_TransferCreateHandleSDMA (PDM_Type *base, pdm_sdma_handle_t *handle, pdm_sdma_callback_t callback, void *userData, sdma_handle_t *dmaHandle, uint32_t eventSource) |
| Initializes the PDM eDMA handle. More...
|
|
status_t | PDM_TransferReceiveSDMA (PDM_Type *base, pdm_sdma_handle_t *handle, pdm_transfer_t *xfer) |
| Performs a non-blocking PDM receive using eDMA. More...
|
|
void | PDM_TransferAbortReceiveSDMA (PDM_Type *base, pdm_sdma_handle_t *handle) |
| Aborts a PDM receive using eDMA. More...
|
|
void | PDM_SetChannelConfigSDMA (PDM_Type *base, pdm_sdma_handle_t *handle, uint32_t channel, const pdm_channel_config_t *config) |
| PDM channel configurations. More...
|
|
void | PDM_TransferTerminateReceiveSDMA (PDM_Type *base, pdm_sdma_handle_t *handle) |
| Terminate all the PDM sdma receive transfer. More...
|
|
uint8_t _pdm_sdma_handle::nbytes |
volatile uint8_t _pdm_sdma_handle::queueUser |
This function initializes the PDM 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.
- Parameters
-
base | PDM base pointer. |
handle | PDM eDMA handle pointer. |
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. |
eventSource | PDM event source number. |
- Note
- This interface returns immediately after the transfer initiates. Call the PDM_GetReceiveRemainingBytes to poll the transfer status and check whether the PDM transfer is finished.
- Parameters
-
base | PDM base pointer |
handle | PDM eDMA handle pointer. |
xfer | Pointer to DMA transfer structure. |
- Return values
-
kStatus_Success | Start a PDM eDMA receive successfully. |
kStatus_InvalidArgument | The input argument is invalid. |
kStatus_RxBusy | PDM is busy receiving data. |
- Parameters
-
base | PDM base pointer |
handle | PDM eDMA handle pointer. |
- Parameters
-
base | PDM base pointer. |
handle | PDM eDMA handle pointer. |
channel | channel number. |
config | channel configurations. |
void PDM_TransferTerminateReceiveSDMA |
( |
PDM_Type * |
base, |
|
|
pdm_sdma_handle_t * |
handle |
|
) |
| |
- Parameters
-
base | PDM base pointer. |
handle | PDM SDMA handle pointer. |