MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Files

file  fsl_dmic_dma.h
 

Data Structures

struct  dmic_transfer_t
 DMIC transfer structure. More...
 
struct  dmic_dma_handle_t
 DMIC DMA handle. More...
 

Typedefs

typedef void(* dmic_dma_transfer_callback_t )(DMIC_Type *base, dmic_dma_handle_t *handle, status_t status, void *userData)
 DMIC transfer callback function. More...
 

DMIC DMA version

#define FSL_DMIC_DMA_DRIVER_VERSION   (MAKE_VERSION(2, 3, 0))
 DMIC DMA driver version 2.3.0.
 

DMA transactional

status_t DMIC_TransferCreateHandleDMA (DMIC_Type *base, dmic_dma_handle_t *handle, dmic_dma_transfer_callback_t callback, void *userData, dma_handle_t *rxDmaHandle)
 Initializes the DMIC handle which is used in transactional functions. More...
 
status_t DMIC_TransferReceiveDMA (DMIC_Type *base, dmic_dma_handle_t *handle, dmic_transfer_t *xfer, uint32_t channel)
 Receives data using DMA. More...
 
void DMIC_TransferAbortReceiveDMA (DMIC_Type *base, dmic_dma_handle_t *handle)
 Aborts the received data using DMA. More...
 
status_t DMIC_TransferGetReceiveCountDMA (DMIC_Type *base, dmic_dma_handle_t *handle, uint32_t *count)
 Get the number of bytes that have been received. More...
 
void DMIC_InstallDMADescriptorMemory (dmic_dma_handle_t *handle, void *linkAddr, size_t linkNum)
 Install DMA descriptor memory. More...
 

Detailed Description


Data Structure Documentation

struct dmic_transfer_t

Data Fields

void * data
 The buffer of data to be transfer. More...
 
uint8_t dataWidth
 DMIC support 16bit/32bit.
 
size_t dataSize
 The byte count to be transfer. More...
 
uint8_t dataAddrInterleaveSize
 destination address interleave size
 
struct _dmic_transfer * linkTransfer
 use to support link transfer
 

Field Documentation

void* dmic_transfer_t::data
size_t dmic_transfer_t::dataSize
struct _dmic_dma_handle

Data Fields

DMIC_Type * base
 DMIC peripheral base address. More...
 
dma_handle_trxDmaHandle
 The DMA RX channel used. More...
 
dmic_dma_transfer_callback_t callback
 Callback function. More...
 
void * userData
 DMIC callback function parameter. More...
 
size_t transferSize
 Size of the data to receive. More...
 
volatile uint8_t state
 Internal state of DMIC DMA transfer.
 
dma_descriptor_tdesLink
 descriptor pool pointer
 
size_t linkNum
 number of descriptor in descriptors pool
 

Field Documentation

DMIC_Type* dmic_dma_handle_t::base
dma_handle_t* dmic_dma_handle_t::rxDmaHandle
dmic_dma_transfer_callback_t dmic_dma_handle_t::callback
void* dmic_dma_handle_t::userData
size_t dmic_dma_handle_t::transferSize

Typedef Documentation

typedef void(* dmic_dma_transfer_callback_t)(DMIC_Type *base, dmic_dma_handle_t *handle, status_t status, void *userData)

Function Documentation

status_t DMIC_TransferCreateHandleDMA ( DMIC_Type *  base,
dmic_dma_handle_t *  handle,
dmic_dma_transfer_callback_t  callback,
void *  userData,
dma_handle_t rxDmaHandle 
)
Parameters
baseDMIC peripheral base address.
handlePointer to dmic_dma_handle_t structure.
callbackCallback function.
userDataUser data.
rxDmaHandleUser-requested DMA handle for RX DMA transfer.
status_t DMIC_TransferReceiveDMA ( DMIC_Type *  base,
dmic_dma_handle_t *  handle,
dmic_transfer_t xfer,
uint32_t  channel 
)

This function receives data using DMA. This is a non-blocking function, which returns right away. When all data is received, the receive callback function is called.

Parameters
baseUSART peripheral base address.
handlePointer to usart_dma_handle_t structure.
xferDMIC DMA transfer structure. See dmic_transfer_t.
dmic_channelDMIC start channel number.
Return values
kStatus_Success
void DMIC_TransferAbortReceiveDMA ( DMIC_Type *  base,
dmic_dma_handle_t *  handle 
)

This function aborts the received data using DMA.

Parameters
baseDMIC peripheral base address
handlePointer to dmic_dma_handle_t structure
status_t DMIC_TransferGetReceiveCountDMA ( DMIC_Type *  base,
dmic_dma_handle_t *  handle,
uint32_t *  count 
)

This function gets the number of bytes that have been received.

Parameters
baseDMIC peripheral base address.
handleDMIC handle pointer.
countReceive bytes count.
Return values
kStatus_NoTransferInProgressNo receive in progress.
kStatus_InvalidArgumentParameter is invalid.
kStatus_SuccessGet successfully through the parameter count;
void DMIC_InstallDMADescriptorMemory ( dmic_dma_handle_t *  handle,
void *  linkAddr,
size_t  linkNum 
)

This function used to register DMA descriptor memory for linked transfer, a typical case is ping pong transfer which will request more than one DMA descriptor memory space, it should be called after DMIC_TransferCreateHandleDMA. User should be take care about the address of DMA descriptor pool which required align with 16BYTE at least.

Parameters
handlePointer to DMA channel transfer handle.
linkAddrDMA link descriptor address.
numDMA link descriptor number.