Advantech ITA-5831 Series User Manual page 78

Intel the 6rd generation core i processor fanless system for railway applications
Hide thumbs Also See for ITA-5831 Series:
Table of Contents

Advertisement

*********************************************************************
GPIO Simcodes
(take GPIO 00 and GPIO 07 as an example)
Output High to GPIO 00:
data = smbus_read_byte(0x40, 0x03); //Read slave 0x40 register 3 byte
data &= 0xfe;//Set bit 0 as 0
smbus_write_byte(0x40, 0x03, data)//write, set GPIO 00 as Output
data = smbus_read_byte(0x40, 0x01) //Read slave 0x40 register 1
data |= 0x01; //Set bit 0 as 1, High
smbus_write_byte(0x40, 0x01, data) //Write, Output High value
Read Input Value from GPIO 07:
data = smbus_read_byte(0x40, 0x03); //Read slave 0x40 register 3 byte
data |= 0x80; //Set bit 7 as 1
smbus_write_byte(0x40, 0x03,data) //Write, set GPIO 07 as Input
data = smbus_read_byte(0x40, 0x00) //Read slave 0x40 register
0. Then, the response value of bit 7 should know whether the input is
low or high
ITA-5831 User Manual
68

Advertisement

Table of Contents
loading

Table of Contents