MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
I2C_EDMA: EDMA based I2C Driver

Read Guidance

The I2C_EDMA module provide a method for I2C transfer operation based on EDMA.

Data Structures

struct  i2c_master_edma_transfer_handle_t
 I2C master eDMA transfer structure. More...
 

Typedefs

typedef void(* i2c_master_edma_transfer_callback_t )(i2c_master_edma_transfer_handle_t *handle)
 I2C master eDMA transfer callback typedef. More...
 

Driver version

#define FSL_I2C_EDMA_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 

I2C Block eDMA Transfer Operation

void I2C_MasterCreateEDMAHandle (I2C_Type *base, i2c_master_edma_transfer_handle_t *psHandle, i2c_master_edma_transfer_callback_t pfCallback, void *pUserData, DMA_Type *edmaBase, edma_channel_t eEdmaChannel)
 Initializes the I2C handle which is used in transactional functions. More...
 
status_t I2C_MasterTransferEDMA (i2c_master_edma_transfer_handle_t *psHandle, i2c_master_transfer_t *psTransfer)
 Performs a master eDMA non-blocking transfer on the I2C bus. More...
 
status_t I2C_MasterTransferGetCountEDMA (i2c_master_edma_transfer_handle_t *psHandle, uint16_t *pu16Count)
 Gets a master transfer status during the eDMA non-blocking transfer. More...
 
void I2C_MasterTransferAbortEDMA (i2c_master_edma_transfer_handle_t *psHandle)
 Aborts a master eDMA non-blocking transfer early. More...
 

Data Structure Documentation

struct _i2c_master_edma_transfer_handle

Retry times for waiting flag.

I2C master eDMA handle typedef.

Data Fields

I2C_Type * base
 I2C base pointer to the I2C instance that assigned to this handle. More...
 
i2c_master_transfer_t sTransfer
 I2C master transfer structure. More...
 
uint16_t u16TransferSize
 Total bytes to be transferred. More...
 
uint8_t u8State
 I2C master transfer status. More...
 
edma_handle_t sEdmaHandle
 The eDMA handler used. More...
 
status_t completionStatus
 I2C master transfer complete status, indicating how the transfer ends. More...
 
i2c_master_edma_transfer_callback_t pfCallback
 A callback function called after the eDMA transfer is finished. More...
 
void * pUserData
 
     User configurable pointer to any data, function, structure etc that user wish to use in the

callback

 

Field Documentation

I2C_Type* i2c_master_edma_transfer_handle_t::base
i2c_master_transfer_t i2c_master_edma_transfer_handle_t::sTransfer
uint16_t i2c_master_edma_transfer_handle_t::u16TransferSize
uint8_t i2c_master_edma_transfer_handle_t::u8State
edma_handle_t i2c_master_edma_transfer_handle_t::sEdmaHandle
status_t i2c_master_edma_transfer_handle_t::completionStatus
i2c_master_edma_transfer_callback_t i2c_master_edma_transfer_handle_t::pfCallback

Typedef Documentation

typedef void(* i2c_master_edma_transfer_callback_t)(i2c_master_edma_transfer_handle_t *handle)

Function Documentation

void I2C_MasterCreateEDMAHandle ( I2C_Type *  base,
i2c_master_edma_transfer_handle_t *  psHandle,
i2c_master_edma_transfer_callback_t  pfCallback,
void *  pUserData,
DMA_Type *  edmaBase,
edma_channel_t  eEdmaChannel 
)
Parameters
baseI2C peripheral base address.
psHandleA pointer to the i2c_master_edma_transfer_handle_t structure.
pfCallbackA pointer to the user callback function.
pUserDataA user parameter passed to the callback function.
edmaBaseEdma base address.
eEdmaChanneleDMA channel for master transfer.
status_t I2C_MasterTransferEDMA ( i2c_master_edma_transfer_handle_t *  psHandle,
i2c_master_transfer_t psTransfer 
)
Parameters
psHandleA pointer to the i2c_master_edma_transfer_handle_t structure.
psTransferA pointer to the transfer structure of i2c_master_transfer_t.
Return values
kStatus_SuccessSuccessfully completed the data transmission.
kStatus_I2C_BusyA previous transmission is still not finished.
kStatus_I2C_TimeoutTransfer error, waits for a signal timeout.
kStatus_I2C_ArbitrationLostTransfer error, arbitration lost.
kStataus_I2C_NakTransfer error, receive NAK during transfer.
status_t I2C_MasterTransferGetCountEDMA ( i2c_master_edma_transfer_handle_t *  psHandle,
uint16_t *  pu16Count 
)
Parameters
psHandleA pointer to the i2c_master_edma_transfer_handle_t structure.
pu16CountA number of bytes transferred by the non-blocking transaction.
void I2C_MasterTransferAbortEDMA ( i2c_master_edma_transfer_handle_t *  psHandle)
Parameters
psHandleA pointer to the i2c_master_edma_transfer_handle_t structure.