Advantech ITA-5231 Series User Manual page 81

Fanless embedded industrial computer with 6th gen intel core i processor for railway applications
Hide thumbs Also See for ITA-5231 Series:
Table of Contents

Advertisement

for (i = 0; i < 20; i++)
{
outportb(0xeb, 0); // IO port 0xeb No real device occu-
pies. Write a value to this port can realize delay function. You can
also choose other method according to the real situation.
}
}
*********************************************************************
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.
71
ITA-5231 User Manual

Advertisement

Table of Contents
loading

Table of Contents