Advantech ITA-2231 Series User Manual page 80

2u fanless embedded computer core i dual core rackmount ipc
Hide thumbs Also See for ITA-2231 Series:
Table of Contents

Advertisement

for (i = 0; i <= 0x100; i++)
{
}
chk_smbus_ready();//?Whether SMBUS is ready
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
int
chk_smbus_ready()
//To decide whether SMBUS is ready or has completed the action, you should wait for
a long time to check whether SMBUS has successfully transmitted the command.
Since error may rarely occurs, BIOS code does not make judgement on the return
value of this function in read and write of SUMBUS byte.
{
int
BYTE data;
for (i = 0; i <= 0x800; i++)
{
eral timesoutportb(SMBUS_PORT, data);//?Write back SMBUS status value which
will clear status value (Write 1 to the corresponding bit means clearing status)
SMBUS is ready
SMBUS), SMBUS is ready
occurs on SMBUS which is rarely the case
ITA-2231 User Manual
newiodelay();//longer delay
i, result = 1;
//SMB_BASE + 0 is SMBUS status value
data = inportb(SMBUS_PORT);//Read SMBUS status value once
data = check_data(SMBUS_PORT);//Read SMBUS status value sev-
if (data & 0x02)
{
//If bit 1 is set (which means the command is completed),
result = 0;//SMBUS ready
break;
}
if (!(data & 0xBF))
{
//If all bits are 0 except bit 2 (which means error occurs on
result = 0;//SMBUS ready
break;
}
if (data & 0x04)
{
//If bit 2 is set (which means error occurs on SMBUS), error
result = 1;//SMBUS error
break;
}
68

Advertisement

Table of Contents
loading

Table of Contents