Advantech ITA-1611 Series User Manual page 65

Fanless embedded celeron dual core compact industrial computer
Table of Contents

Advertisement

(Take GPIO 00 and GPIO 07 in Chapter 2 for example)
GPIO 00 output High:
data = smbus_read_byte(0x40,
data &=
0xfe;//Set bit 0 to 0
smbus_write_byte(0x40, 0x03,
data = smbus_read_byte(0x40,
data |=
0x01;//Set bit 0 to 1, which means High
smbus_write_byte(0x40, 0x01,
Read Input value from GPIO 07:
data = smbus_read_byte(0x40,
data |=
0x80;//Set bit 7 to 1
smbus_write_byte(0x40, 0x03,
data = smbus_read_byte(0x40,
Response value of bit 7 can determine whether Input is Low or High
0x03);//Read slave 0x40 register 3 byte
data)//Write back, GPIO 00 is set to Output
0x01)//Read slave 0x40 register 1
data)//Write back, output High value
0x03);//Read slave 0x40 register 3 byte
data)//Write back,GPIO 07 is set to Input
0x00)//Read slave 0x40 register 0.
55
ITA-1611 User Manual

Advertisement

Table of Contents
loading

Table of Contents