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

Overview

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...
 

Enumerations

enum  dmic_bitwidth_t {
  kDMICBitWidth16Bits = 2U,
  kDMICBitWidth32Bits = 4U
}
 DMIC transfer structure. More...
 

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...
 
static void DMIC_TransferSetBitWidthDMA (DMIC_Type *base, dmic_dma_handle_t *handle, dmic_bitwidth_t width)
 Configure the transfer data width. More...
 
status_t DMIC_TransferReceiveDMA (DMIC_Type *base, dmic_dma_handle_t *handle, dmic_transfer_t *xfer, uint32_t dmic_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...
 

Data Structure Documentation

struct dmic_transfer_t

Data Fields

uint16_t * data
 The buffer of data to be transfer. More...
 
size_t dataSize
 The byte count to be transfer. More...
 

Field Documentation

uint16_t* 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...
 
uint8_t dataWidth
 Data bit width.
 
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.
 

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)

Enumeration Type Documentation

Enumerator
kDMICBitWidth16Bits 

16 bits mode.

kDMICBitWidth32Bits 

32 bits mode.

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.
static void DMIC_TransferSetBitWidthDMA ( DMIC_Type *  base,
dmic_dma_handle_t *  handle,
dmic_bitwidth_t  width 
)
inlinestatic

This function is optional to users, the default data width is set to 16 bits if not call this fuction. DMIC only support 16 bits and 32 bits setting. As DMA cannot support 24 bits directly, please set to 32 bits while need a 24 bits data. In 32 bit mode, the MSB 8 bits always 0, as the register can only have 24 bits valid bits.

Parameters
baseDMIC peripheral base address.
handlePointer to usart_dma_handle_t structure.
widthDMIC width. See dmic_bitwidth_t.
Return values
kStatus_Success
status_t DMIC_TransferReceiveDMA ( DMIC_Type *  base,
dmic_dma_handle_t *  handle,
dmic_transfer_t xfer,
uint32_t  dmic_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
baseDMIC peripheral base address.
handlePointer to usart_dma_handle_t structure.
xferDMIC DMA transfer structure. See dmic_transfer_t.
dmic_channelDMIC channel
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;