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

Overview

Data Structures

struct  i3c_slave_dma_transfer_t
 I3C slave transfer structure. More...
 
struct  i3c_slave_dma_handle_t
 I3C slave dma handle structure. More...
 

Typedefs

typedef void(* i3c_slave_dma_callback_t )(I3C_Type *base, i3c_slave_dma_transfer_t *transfer, void *userData)
 Slave event callback function pointer type. More...
 

Slave DMA

void I3C_SlaveTransferCreateHandleDMA (I3C_Type *base, i3c_slave_dma_handle_t *handle, i3c_slave_dma_callback_t callback, void *userData, dma_handle_t *rxDmaHandle, dma_handle_t *txDmaHandle)
 Create a new handle for the I3C slave DMA APIs. More...
 
status_t I3C_SlaveTransferDMA (I3C_Type *base, i3c_slave_dma_handle_t *handle, i3c_slave_dma_transfer_t *transfer, uint32_t eventMask)
 Prepares for a non-blocking DMA-based transaction on the I3C bus. More...
 
void I3C_SlaveTransferAbortDMA (I3C_Type *base, i3c_slave_dma_handle_t *handle)
 Abort a slave dma non-blocking transfer in a early time. More...
 
void I3C_SlaveTransferDMAHandleIRQ (I3C_Type *base, void *i3cHandle)
 Reusable routine to handle slave interrupts. More...
 

Data Structure Documentation

struct i3c_slave_dma_transfer_t

Data Fields

uint32_t event
 Reason the callback is being invoked. More...
 
uint8_t * txData
 Transfer buffer.
 
size_t txDataSize
 Transfer size.
 
uint8_t * rxData
 Transfer buffer.
 
size_t rxDataSize
 Transfer size.
 
status_t completionStatus
 Success or error code describing how the transfer completed. More...
 

Field Documentation

uint32_t i3c_slave_dma_transfer_t::event
status_t i3c_slave_dma_transfer_t::completionStatus

Only applies for kI3C_SlaveCompletionEvent.

struct _i3c_slave_dma_handle
Note
The contents of this structure are private and subject to change.

Data Fields

I3C_Type * base
 I3C base pointer. More...
 
i3c_slave_dma_transfer_t transfer
 I3C slave transfer copy. More...
 
bool isBusy
 Whether transfer is busy. More...
 
bool wasTransmit
 Whether the last transfer was a transmit. More...
 
uint32_t eventMask
 Mask of enabled events. More...
 
i3c_slave_dma_callback_t callback
 Callback function called at transfer event. More...
 
dma_handle_t * rxDmaHandle
 Handle for receive DMA channel. More...
 
dma_handle_t * txDmaHandle
 Handle for transmit DMA channel. More...
 
void * userData
 Callback parameter passed to callback. More...
 

Field Documentation

I3C_Type* i3c_slave_dma_handle_t::base
i3c_slave_dma_transfer_t i3c_slave_dma_handle_t::transfer
bool i3c_slave_dma_handle_t::isBusy
bool i3c_slave_dma_handle_t::wasTransmit
uint32_t i3c_slave_dma_handle_t::eventMask
i3c_slave_dma_callback_t i3c_slave_dma_handle_t::callback
dma_handle_t* i3c_slave_dma_handle_t::rxDmaHandle
dma_handle_t* i3c_slave_dma_handle_t::txDmaHandle
void* i3c_slave_dma_handle_t::userData

Typedef Documentation

typedef void(* i3c_slave_dma_callback_t)(I3C_Type *base, i3c_slave_dma_transfer_t *transfer, void *userData)

This callback is used only for the slave DMA transfer API.

Parameters
baseBase address for the I3C instance on which the event occurred.
handlePointer to slave DMA transfer handle.
transferPointer to transfer descriptor containing values passed to and/or from the callback.
userDataArbitrary pointer-sized value passed from the application.

Function Documentation

void I3C_SlaveTransferCreateHandleDMA ( I3C_Type *  base,
i3c_slave_dma_handle_t *  handle,
i3c_slave_dma_callback_t  callback,
void *  userData,
dma_handle_t *  rxDmaHandle,
dma_handle_t *  txDmaHandle 
)

The creation of a handle is for use with the DMA APIs. Once a handle is created, there is not a corresponding destroy handle. If the user wants to terminate a transfer, the I3C_SlaveTransferAbortDMA() API shall be called.

For devices where the I3C send and receive DMA requests are OR'd together, the txDmaHandle parameter is ignored and may be set to NULL.

Parameters
baseThe I3C peripheral base address.
handlePointer to the I3C slave driver handle.
callbackUser provided pointer to the asynchronous callback function.
userDataUser provided pointer to the application callback data.
rxDmaHandleHandle for the DMA receive channel. Created by the user prior to calling this function.
txDmaHandleHandle for the DMA transmit channel. Created by the user prior to calling this function.
status_t I3C_SlaveTransferDMA ( I3C_Type *  base,
i3c_slave_dma_handle_t *  handle,
i3c_slave_dma_transfer_t transfer,
uint32_t  eventMask 
)

The API will do DMA configuration according to the input transfer descriptor, and the data will be transferred when there's bus master requesting transfer from/to this slave. So the timing of call to this API need be aligned with master application to ensure the transfer is executed as expected. Callback specified when the handle was created is invoked when the transaction has completed.

Parameters
baseThe I3C peripheral base address.
handlePointer to the I3C slave driver handle.
transferThe pointer to the transfer descriptor.
eventMaskBit mask formed by OR'ing together i3c_slave_transfer_event_t enumerators to specify which events to send to the callback. The transmit and receive events is not allowed to be enabled.
Return values
kStatus_SuccessThe transaction was started successfully.
kStatus_I3C_BusyEither another master is currently utilizing the bus, or another DMA transaction is already in progress.
void I3C_SlaveTransferAbortDMA ( I3C_Type *  base,
i3c_slave_dma_handle_t *  handle 
)
Parameters
baseI3C peripheral base address
handlepointer to i3c_slave_dma_handle_t structure
void I3C_SlaveTransferDMAHandleIRQ ( I3C_Type *  base,
void *  i3cHandle 
)
Note
This function does not need to be called unless you are reimplementing the nonblocking API's interrupt handler routines to add special functionality.
Parameters
baseThe I3C peripheral base address.
handlePointer to the I3C slave DMA driver handle.