Jump to main content

##

# 1.1.2.4 Library Interface

I2C driver library provides the following interfaces:

Functions

Name | Description | Asynchronous Mode | Synchronous Mode
--- | --- | --- | ---
DRV_I2C_Initialize | Initializes the I2C instance for the specified driver index | Yes | Yes
DRV_I2C_Status | Gets the current status of the I2C driver module | Yes | Yes
DRV_I2C_Open | Opens the specified I2C driver instance and returns a handle to it | Yes | Yes
DRV_I2C_Close | Closes an opened-instance of the I2C driver | Yes | Yes
DRV_I2C_TransferSetup | Sets the dynamic transfer setup of the driver | Yes | Yes
DRV_I2C_ErrorGet | Gets the I2C hardware errors associated with the the transfer request | Yes | Yes
DRV_I2C_WriteTransferAdd | Queues a write operation | Yes | No
DRV_I2C_ForcedWriteTransferAdd | Queues a write operation | Yes | No
DRV_I2C_ReadTransferAdd | Queues a read operation | Yes | No
DRV_I2C_WriteReadTransferAdd | Queues a write followed by read operation | Yes | No
DRV_I2C_TransferEventHandlerSet | Allows a client to identify a transfer event handling function for the driver to call back when queued transfers have finished | Yes | No
DRV_I2C_TransferStatusGet | Returns the status of the write/read/write-read transfer request | Yes | No
DRV_I2C_WriteTransfer | This is a blocking function that performs a I2C write operation | No | Yes
DRV_I2C_ForcedWriteTransfer | This is a blocking function that performs a I2C write operation | No | Yes
DRV_I2C_ReadTransfer | This is a blocking function that performs a I2C read operation | No | Yes
DRV_I2C_WriteReadTransfer | This is a blocking function that performs a I2C write followed by a I2C read operation | No | Yes

Data types and constants

Name | Type | Description
--- | --- | ---
DRV_I2C_TRANSFER_HANDLE | Typedef | Handle identifying a read, write or write followed by read transfer passed to the driver
DRV_I2C_TRANSFER_HANDLE_INVALID | Macro | Definition of an invalid transfer handle
DRV_I2C_TRANSFER_EVENT | Enum | Identifies the possible events that can result from a buffer add request
DRV_I2C_TRANSFER_EVENT_HANDLER | Typedef | Pointer to a I2C Driver Transfer Event handler function
DRV_I2C_ERROR | Enum | Defines the I2C error values