User`s manual
Reference Manual 123
2. IAccessFunc::I2C_ReadRegister
The I2C_ReadRegister method reads a single I2C register.
Syntax
HRESULT I2C_ReadRegister(
Unsigned char DevAddr,
int AddrWidth,
unsigned short RegAddr,
unsigned char *pRegValue,
int I2CMode
);
Parameters
DevAddr: [In] Device address.
AddrWidth: [In] Length of register address, in bits. Typical val-
ues can be either 8 or 16.
RegAddr: [In] Register address. If its higher byte is 0, the reg-
ister is considered to have an 8-bit address; otherwise, the
address length is 16 bits.
pRegValue: [Out] Value read from the I
2
C register.
I2CMode: [In] I
2
C mode. The value can be set at:
X 0x0000: Use I
2
C protocol via on chip I
2
C controller.
X 0x0001: Use SCCB protocol via on chip I
2
C controller.
X 0x8000: Use I
2
C protocol via Cypress I
2
C controller.
Return Value
HRESULT