5.1 I2C Interface Commands and Their Responses

The MCP2222 supports I2C functionality through vendor class, providing commands that allow the USB host to configure the I2C module, write data to an I2C client device, read data from an I2C client device, perform combined write/read transactions, check SCL/SDA line states, and attempt bus recovery.

The following endpoints are used for I2C communication:
  • Endpoint 0x03 (OUT) — Used to send I2C commands and transmit I2C data
  • Endpoint 0x83 (IN) — Used to read I2C command responses and received I2C data
Table 5-1. Supported I2C Interface Commands
CommandDescription
I2C_Config

Configures the I2C module with the following parameters:

1. Specified clock speed.

2. Specified clock-stretching timeout.

I2C_WriteInitiates an I2C_Write transaction of “wWrDtLen” bytes of “vDatPac” to the I2C client device addressed by “bAddress”
I2C_ReadInitiates an I2C_Read transaction of “wRdDtLen” of bytes from the I2C client device addressed by “bAddress”
I2C_WriteReadInitiates an I2C_Write transaction of “wWrDtLen” bytes of “vDatPac”, followed by an I2C_Read transaction of “wRdDtLen” bytes from the I2C client device addressed by “bAddress”
I2C_GetSCLSDAStatusReturns the current logic state of the SCL and SDA lines
I2C_BusRecoveryInitiates up to nine clock pulses on the SCL line and attempts to issue an I2C_Stop condition