ITA-2231 User Manual 66Example:Here take ITA-2231 as an example. Assume GPIO 00 is set as output and GPIO 7 isset as Input, with two pins interconnected, how to set the corresponding register?GPIO 00 corresponds to PCA9554 0x40 IO0, while GPIO 07 corresponds toPCA9554 0x40 IO7.Set GPIO 00 as Output:1. Read SMBUS slave 0x40 register 3 byte value;2. Set bit 0 of the value read in step 1 as 0 and write it to SMBUS slave 0x40 regis-ter 3;3. Read SMBUS slave 0x40 register 1 byte value;4. Set bit 0 of the value read in step 3 as 0 or 1 according to low or high of the out-put value, then write it back to SMBUS slave 0x40 register 1.Set GPIO 07 as Input:1. Read SMBUS slave 0x40 register 3 byte value;2. Set bit 7 of the value read in step 1 as 1 and write it to SMBUS slave 0x40 regis-ter 3;3. Read SMBUS slave 0x40 register 0 byte value;4. Decide low or high of the input value through bit7 value read in step3.6.3 Function call for referenceICH SMBUS Access Code(The following code is realized by simulating the access of BIOS to SMBUS. It usesBorand C++ 3.1 for compiling and is successfully tested under DOS (So far, it is nottested under other OSs).#define SMBUS_PORT 0xF040//SMB_BASE?0xF040typedef unsigned char BYTE;/////////////////////////////////////////////////////////////////////////////////////////////////////BYTE smbus_read_byte(BYTE addr, BYTE offset)// Read SMBUS Register byte value. Read one byte value each time. addr is slaveaddress (such as 0x40), and offset is register offset.{int i;BYTE data;outportb(SMBUS_PORT + 4, (addr | 1));// Write slave address toSMB_BASE + 4 (When reading, bit 0 of slave address should be set as 1, so hereaddr|1 is available)newiodelay();//delaynewiodelay();//delaychk_smbus_ready();// Whether SMBUS is ready