RTEMS 6.1-rc1
fsl_pdm_edma.h
1/*
2 * Copyright 2019 - 2020, NXP
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7#ifndef _FSL_PDM_EDMA_H_
8#define _FSL_PDM_EDMA_H_
9
10#include "fsl_edma.h"
11#include "fsl_pdm.h"
12
19/*******************************************************************************
20 * Definitions
21 ******************************************************************************/
22
25#define FSL_PDM_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 6, 1))
27
30
33{
35 0U,
41 1U,
48
50typedef struct _pdm_edma_transfer
51{
52 volatile uint8_t *data;
53 volatile size_t dataSize;
56
58typedef void (*pdm_edma_callback_t)(PDM_Type *base, pdm_edma_handle_t *handle, status_t status, void *userData);
59
62{
64 uint8_t count;
65 uint32_t receivedBytes;
66 uint32_t state;
69 void *userData;
71 uint32_t tcdNum;
72 uint32_t tcdUser;
73 uint32_t tcdDriver;
74 volatile uint32_t tcdUsedNum;
78 uint8_t endChannel;
79 uint8_t channelNums;
80};
81
82/*******************************************************************************
83 * APIs
84 ******************************************************************************/
85#if defined(__cplusplus)
86extern "C" {
87#endif
88
101void PDM_TransferInstallEDMATCDMemory(pdm_edma_handle_t *handle, void *tcdAddr, size_t tcdNum);
102
116 PDM_Type *base, pdm_edma_handle_t *handle, pdm_edma_callback_t callback, void *userData, edma_handle_t *dmaHandle);
117
129 pdm_edma_multi_channel_interleave_t multiChannelInterleaveType);
130
140 pdm_edma_handle_t *handle,
141 uint32_t channel,
143
211
222
233
244
247#if defined(__cplusplus)
248}
249#endif
250
254#endif
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:225
void PDM_TransferSetChannelConfigEDMA(PDM_Type *base, pdm_edma_handle_t *handle, uint32_t channel, const pdm_channel_config_t *config)
Configures the PDM channel.
Definition: fsl_pdm_edma.c:194
status_t PDM_TransferGetReceiveCountEDMA(PDM_Type *base, pdm_edma_handle_t *handle, size_t *count)
Gets byte count received by PDM.
Definition: fsl_pdm_edma.c:452
void PDM_TransferInstallEDMATCDMemory(pdm_edma_handle_t *handle, void *tcdAddr, size_t tcdNum)
Install EDMA descriptor memory.
Definition: fsl_pdm_edma.c:178
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.
Definition: fsl_pdm_edma.c:130
enum _pdm_edma_multi_channel_interleave pdm_edma_multi_channel_interleave_t
pdm multi channel interleave type
_pdm_edma_multi_channel_interleave
pdm multi channel interleave type
Definition: fsl_pdm_edma.h:33
struct _pdm_edma_transfer pdm_edma_transfer_t
PDM edma transfer.
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.
Definition: fsl_pdm_edma.c:278
void PDM_TransferAbortReceiveEDMA(PDM_Type *base, pdm_edma_handle_t *handle)
Aborts a PDM receive using eDMA.
Definition: fsl_pdm_edma.c:401
void PDM_TransferSetMultiChannelInterleaveType(pdm_edma_handle_t *handle, pdm_edma_multi_channel_interleave_t multiChannelInterleaveType)
Initializes the multi PDM channel interleave type.
Definition: fsl_pdm_edma.c:165
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.
Definition: fsl_pdm_edma.h:58
void PDM_TransferTerminateReceiveEDMA(PDM_Type *base, pdm_edma_handle_t *handle)
Terminate all PDM receive.
Definition: fsl_pdm_edma.c:430
@ kPDM_EDMAMultiChannelInterleavePerChannelBlock
Definition: fsl_pdm_edma.h:40
@ kPDM_EDMAMultiChannelInterleavePerChannelSample
Definition: fsl_pdm_edma.h:34
Definition: MIMXRT1166_cm4.h:65557
eDMA transfer handle structure
Definition: fsl_edma.h:244
eDMA TCD.
Definition: fsl_edma.h:205
PDM channel configurations.
Definition: fsl_pdm.h:250
PDM DMA transfer handle, users should not touch the content of the handle.
Definition: fsl_pdm_edma.h:62
bool isLoopTransfer
Definition: fsl_pdm_edma.h:68
edma_handle_t * dmaHandle
Definition: fsl_pdm_edma.h:63
uint8_t channelNums
Definition: fsl_pdm_edma.h:79
uint32_t tcdNum
Definition: fsl_pdm_edma.h:71
uint8_t count
Definition: fsl_pdm_edma.h:64
void * userData
Definition: fsl_pdm_edma.h:69
pdm_edma_callback_t callback
Definition: fsl_pdm_edma.h:67
pdm_edma_multi_channel_interleave_t interleaveType
Definition: fsl_pdm_edma.h:76
volatile uint32_t tcdUsedNum
Definition: fsl_pdm_edma.h:74
uint32_t tcdUser
Definition: fsl_pdm_edma.h:72
uint32_t receivedBytes
Definition: fsl_pdm_edma.h:65
edma_tcd_t * tcd
Definition: fsl_pdm_edma.h:70
uint8_t endChannel
Definition: fsl_pdm_edma.h:78
uint32_t tcdDriver
Definition: fsl_pdm_edma.h:73
uint32_t state
Definition: fsl_pdm_edma.h:66
PDM edma transfer.
Definition: fsl_pdm_edma.h:51
volatile uint8_t * data
Definition: fsl_pdm_edma.h:52
struct _pdm_edma_transfer * linkTransfer
Definition: fsl_pdm_edma.h:54
volatile size_t dataSize
Definition: fsl_pdm_edma.h:53
Definition: deflate.c:114