1.1.2.4 Library Interface

I2C driver library provides the following interfaces:

Functions

NameDescriptionAsynchronous ModeSynchronous Mode
DRV_I2C_InitializeInitializes the I2C instance for the specified driver indexYesYes
DRV_I2C_StatusGets the current status of the I2C driver moduleYesYes
DRV_I2C_OpenOpens the specified I2C driver instance and returns a handle to itYesYes
DRV_I2C_CloseCloses an opened-instance of the I2C driverYesYes
DRV_I2C_TransferSetupSets the dynamic transfer setup of the driverYesYes
DRV_I2C_ErrorGetGets the I2C hardware errors associated with the the transfer requestYesYes
DRV_I2C_WriteTransferAddQueues a write operationYesNo
DRV_I2C_ForcedWriteTransferAddQueues a write operationYesNo
DRV_I2C_ReadTransferAddQueues a read operationYesNo
DRV_I2C_WriteReadTransferAddQueues a write followed by read operationYesNo
DRV_I2C_TransferEventHandlerSetAllows a client to identify a transfer event handling function for the driver to call back when queued transfers have finishedYesNo
DRV_I2C_TransferStatusGetReturns the status of the write/read/write-read transfer requestYesNo
DRV_I2C_WriteTransferThis is a blocking function that performs a I2C write operationNoYes
DRV_I2C_ForcedWriteTransferThis is a blocking function that performs a I2C write operationNoYes
DRV_I2C_ReadTransferThis is a blocking function that performs a I2C read operationNoYes
DRV_I2C_WriteReadTransferThis is a blocking function that performs a I2C write followed by a I2C read operationNoYes

Data types and constants

NameTypeDescription
DRV_I2C_TRANSFER_HANDLETypedefHandle identifying a read, write or write followed by read transfer passed to the driver
DRV_I2C_TRANSFER_HANDLE_INVALIDMacroDefinition of an invalid transfer handle
DRV_I2C_TRANSFER_EVENTEnumIdentifies the possible events that can result from a buffer add request
DRV_I2C_TRANSFER_EVENT_HANDLERTypedefPointer to a I2C Driver Transfer Event handler function
DRV_I2C_ERROREnumDefines the I2C error values