53
ITA-1611 User Manual
Chapter 6
G
PIO Programming
Guide
chk_smbus_ready();
//Determine if SMBUS is ready
outportb(SMBU 3, offset);
//write register offset to SM 3
moredelay();
//long time delay
moredelay();
//long time delay
outportb(SMBU 5, value);
//Write data value to SM 5
moredelay();
//long time delay
moredelay();
//long time delay
outportb(SMBU 2, 0x48);
//Write SMBUS command to SM
2, 0x48 means starting Byte data transmission
moredelay();
//long time delay
moredelay();
//long time delay
for (i = 0; i <= 0x100; i++)
{
newiodelay();
//long time delay
}
chk_smbus_ready();
//Determine if SMBUS is ready
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/
int chk_smbus_ready()
//Determine if SMBUS is ready or finished. Basically, it will wait for a long time to
see whether SMBUS has finished the transmission command because errors
hardly occur. So, in SMBUS byte read and write, BIOS Code does not determine
the return value of this function
{
int i, result = 1;
BYTE data;
for (i = 0; i <= 0x800; i++)
{
//SM 0 is SMBUS status value
data = inportb(SMBUS_PORT);
//Read SMBUS status value once
data = check_data(SMBUS_PORT);
//Read SMBUS status value several
times
outportb(SMBUS_PORT, data);//Write back SMBUS status value which
means clear status value(Write 1 to the corresponding bit will clear status)
if (data & 0x02)
{
//If bit 1 is set to 1 (this means the command is finished), then
SMBUS is ready
result = 0;
//SMBUS ready
break;
}
if (!(data & 0xBF))
{
//If each bit except bit 2 is set to 0, this means SMBUS error , then
SMBUS is ready
result = 0;
//SMBUS ready
break;
Summary of Contents for ITA-1611 Series
Page 1: ...User Manual ITA 1611 Series Fanless Embedded Celeron Dual Core Compact Industrial Computer...
Page 11: ...Chapter 1 1 Overview This chapter provides general Information about the ITA 1611...
Page 15: ...Chapter 2 2 H W Installation This chapter provides H W Instal lation about the ITA 1611...
Page 27: ...Chapter 3 3 System Setup This chapter introduces the instal lation process of ITA 1611...
Page 33: ...Chapter 4 4 AMI BIOS This chapter introduces how to configure AMI BIOS...
Page 52: ...ITA 1611 User Manual 42...
Page 53: ...Chapter 5 5 Driver Installation This chapter describes how to Install drivers...
Page 57: ...Chapter 6 6 GPIO Programming Guide This chapter introduces GPIO pro gramming guide...
Page 66: ...ITA 1611 User Manual 56...