User`s manual

122 Reference Manual
GPIO.
1. IAccessFunc::I2C_WriteRegister
The I2C_WriteRegister method writes a single I2C register.
Syntax
HRESULT I2C_WriteRegister(
unsigned char DevAddr,
int AddrWidth,
unsigned short RegAddr,
unsigned char RegValue,
int I2CMode
);
Parameters
DevAddr: [In] Device address.
AddrWidth: [In] Length of register address, in bits. Typical val-
ues can either be 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.
RegValue: [In] Value to be written to 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