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

Overview

Data Structures

struct  _i2c_master_dma_handle
 I2C master dma transfer structure. More...
 

Macros

#define I2C_MAX_DMA_TRANSFER_COUNT   1024
 Maximum lenght of single DMA transfer (determined by capability of the DMA engine)
 

Typedefs

typedef struct
_i2c_master_dma_handle 
i2c_master_dma_handle_t
 I2C master dma handle typedef. More...
 
typedef void(* i2c_master_dma_transfer_callback_t )(I2C_Type *base, i2c_master_dma_handle_t *handle, status_t status, void *userData)
 I2C master dma transfer callback typedef. More...
 
typedef void(* flexcomm_i2c_dma_master_irq_handler_t )(I2C_Type *base, i2c_master_dma_handle_t *handle)
 Typedef for master dma handler. More...
 

Driver version

#define FSL_I2C_DMA_DRIVER_VERSION   (MAKE_VERSION(2, 3, 1))
 I2C DMA driver version. More...
 

I2C Block DMA Transfer Operation

void I2C_MasterTransferCreateHandleDMA (I2C_Type *base, i2c_master_dma_handle_t *handle, i2c_master_dma_transfer_callback_t callback, void *userData, dma_handle_t *dmaHandle)
 Init the I2C handle which is used in transactional functions. More...
 
status_t I2C_MasterTransferDMA (I2C_Type *base, i2c_master_dma_handle_t *handle, i2c_master_transfer_t *xfer)
 Performs a master dma non-blocking transfer on the I2C bus. More...
 
status_t I2C_MasterTransferGetCountDMA (I2C_Type *base, i2c_master_dma_handle_t *handle, size_t *count)
 Get master transfer status during a dma non-blocking transfer. More...
 
void I2C_MasterTransferAbortDMA (I2C_Type *base, i2c_master_dma_handle_t *handle)
 Abort a master dma non-blocking transfer in a early time. More...
 

Data Structure Documentation

struct _i2c_master_dma_handle

Data Fields

uint8_t state
 Transfer state machine current state. More...
 
uint32_t transferCount
 Indicates progress of the transfer.
 
uint32_t remainingBytesDMA
 Remaining byte count to be transferred using DMA. More...
 
uint8_t * buf
 Buffer pointer for current state. More...
 
bool checkAddrNack
 Whether to check the nack signal is detected during addressing. More...
 
dma_handle_tdmaHandle
 The DMA handler used. More...
 
i2c_master_transfer_t transfer
 Copy of the current transfer info. More...
 
i2c_master_dma_transfer_callback_t completionCallback
 Callback function called after dma transfer finished. More...
 
void * userData
 Callback parameter passed to callback function. More...
 

Field Documentation

uint8_t _i2c_master_dma_handle::state
uint32_t _i2c_master_dma_handle::remainingBytesDMA
uint8_t* _i2c_master_dma_handle::buf
bool _i2c_master_dma_handle::checkAddrNack
dma_handle_t* _i2c_master_dma_handle::dmaHandle
i2c_master_transfer_t _i2c_master_dma_handle::transfer
i2c_master_dma_transfer_callback_t _i2c_master_dma_handle::completionCallback
void* _i2c_master_dma_handle::userData

Macro Definition Documentation

#define FSL_I2C_DMA_DRIVER_VERSION   (MAKE_VERSION(2, 3, 1))

Typedef Documentation

typedef void(* i2c_master_dma_transfer_callback_t)(I2C_Type *base, i2c_master_dma_handle_t *handle, status_t status, void *userData)
typedef void(* flexcomm_i2c_dma_master_irq_handler_t)(I2C_Type *base, i2c_master_dma_handle_t *handle)

Function Documentation

void I2C_MasterTransferCreateHandleDMA ( I2C_Type *  base,
i2c_master_dma_handle_t handle,
i2c_master_dma_transfer_callback_t  callback,
void *  userData,
dma_handle_t dmaHandle 
)
Parameters
baseI2C peripheral base address
handlepointer to i2c_master_dma_handle_t structure
callbackpointer to user callback function
userDatauser param passed to the callback function
dmaHandleDMA handle pointer
status_t I2C_MasterTransferDMA ( I2C_Type *  base,
i2c_master_dma_handle_t handle,
i2c_master_transfer_t xfer 
)
Parameters
baseI2C peripheral base address
handlepointer to i2c_master_dma_handle_t structure
xferpointer to transfer structure of i2c_master_transfer_t
Return values
kStatus_SuccessSucessully complete the data transmission.
kStatus_I2C_BusyPrevious transmission still not finished.
kStatus_I2C_TimeoutTransfer error, wait signal timeout.
kStatus_I2C_ArbitrationLostTransfer error, arbitration lost.
kStataus_I2C_NakTransfer error, receive Nak during transfer.
status_t I2C_MasterTransferGetCountDMA ( I2C_Type *  base,
i2c_master_dma_handle_t handle,
size_t *  count 
)
Parameters
baseI2C peripheral base address
handlepointer to i2c_master_dma_handle_t structure
countNumber of bytes transferred so far by the non-blocking transaction.
void I2C_MasterTransferAbortDMA ( I2C_Type *  base,
i2c_master_dma_handle_t handle 
)
Parameters
baseI2C peripheral base address
handlepointer to i2c_master_dma_handle_t structure