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

Overview

Data Structures

struct  i2s_dma_handle_t
 i2s dma handle More...
 

Typedefs

typedef void(* i2s_dma_transfer_callback_t )(I2S_Type *base, i2s_dma_handle_t *handle, status_t completionStatus, void *userData)
 Callback function invoked from DMA API on completion. More...
 

Driver version

#define FSL_I2S_DMA_DRIVER_VERSION   (MAKE_VERSION(2, 1, 0))
 I2S DMA driver version 2.1.0. More...
 

DMA API

void I2S_TxTransferCreateHandleDMA (I2S_Type *base, i2s_dma_handle_t *handle, dma_handle_t *dmaHandle, i2s_dma_transfer_callback_t callback, void *userData)
 Initializes handle for transfer of audio data. More...
 
status_t I2S_TxTransferSendDMA (I2S_Type *base, i2s_dma_handle_t *handle, i2s_transfer_t transfer)
 Begins or queue sending of the given data. More...
 
void I2S_TransferAbortDMA (I2S_Type *base, i2s_dma_handle_t *handle)
 Aborts transfer of data. More...
 
void I2S_RxTransferCreateHandleDMA (I2S_Type *base, i2s_dma_handle_t *handle, dma_handle_t *dmaHandle, i2s_dma_transfer_callback_t callback, void *userData)
 Initializes handle for reception of audio data. More...
 
status_t I2S_RxTransferReceiveDMA (I2S_Type *base, i2s_dma_handle_t *handle, i2s_transfer_t transfer)
 Begins or queue reception of data into given buffer. More...
 
void I2S_DMACallback (dma_handle_t *handle, void *userData, bool transferDone, uint32_t tcds)
 Invoked from DMA interrupt handler. More...
 

Data Structure Documentation

struct _i2s_dma_handle

Members not to be accessed / modified outside of the driver.

Data Fields

uint32_t state
 Internal state of I2S DMA transfer.
 
uint8_t bytesPerFrame
 bytes per frame
 
i2s_dma_transfer_callback_t completionCallback
 Callback function pointer.
 
void * userData
 Application data passed to callback.
 
dma_handle_tdmaHandle
 DMA handle.
 
volatile i2s_transfer_t i2sQueue [I2S_NUM_BUFFERS]
 Transfer queue storing transfer buffers.
 
volatile uint8_t queueUser
 Queue index where user's next transfer will be stored.
 
volatile uint8_t queueDriver
 Queue index of buffer actually used by the driver.
 

Macro Definition Documentation

#define FSL_I2S_DMA_DRIVER_VERSION   (MAKE_VERSION(2, 1, 0))

Typedef Documentation

typedef void(* i2s_dma_transfer_callback_t)(I2S_Type *base, i2s_dma_handle_t *handle, status_t completionStatus, void *userData)
Parameters
baseI2S base pointer.
handlepointer to I2S transaction.
completionStatusstatus of the transaction.
userDataoptional pointer to user arguments data.

Function Documentation

void I2S_TxTransferCreateHandleDMA ( I2S_Type *  base,
i2s_dma_handle_t *  handle,
dma_handle_t dmaHandle,
i2s_dma_transfer_callback_t  callback,
void *  userData 
)
Parameters
baseI2S base pointer.
handlepointer to handle structure.
dmaHandlepointer to dma handle structure.
callbackfunction to be called back when transfer is done or fails.
userDatapointer to data passed to callback.
status_t I2S_TxTransferSendDMA ( I2S_Type *  base,
i2s_dma_handle_t *  handle,
i2s_transfer_t  transfer 
)
Parameters
baseI2S base pointer.
handlepointer to handle structure.
transferdata buffer.
Return values
kStatus_Success
kStatus_I2S_Busyif all queue slots are occupied with unsent buffers.
void I2S_TransferAbortDMA ( I2S_Type *  base,
i2s_dma_handle_t *  handle 
)
Parameters
baseI2S base pointer.
handlepointer to handle structure.
void I2S_RxTransferCreateHandleDMA ( I2S_Type *  base,
i2s_dma_handle_t *  handle,
dma_handle_t dmaHandle,
i2s_dma_transfer_callback_t  callback,
void *  userData 
)
Parameters
baseI2S base pointer.
handlepointer to handle structure.
dmaHandlepointer to dma handle structure.
callbackfunction to be called back when transfer is done or fails.
userDatapointer to data passed to callback.
status_t I2S_RxTransferReceiveDMA ( I2S_Type *  base,
i2s_dma_handle_t *  handle,
i2s_transfer_t  transfer 
)
Parameters
baseI2S base pointer.
handlepointer to handle structure.
transferdata buffer.
Return values
kStatus_Success
kStatus_I2S_Busyif all queue slots are occupied with buffers which are not full.
void I2S_DMACallback ( dma_handle_t handle,
void *  userData,
bool  transferDone,
uint32_t  tcds 
)
Parameters
handlepointer to DMA handle structure.
userDataargument for user callback.
transferDoneif transfer was done.
tcds