59
ARK-5420 User Manual
Chapter 6
G
PIO Programming
outportb(SMBU 2, 0x48);// Write SMBUS command to
SM 2. 0x48 means starting byte data transmission.
moredelay();//longer delay
moredelay();//longer delay
for (i = 0; i <= 0x100; i++)
{
newiodelay();//longer delay
}
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 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 timesoutportb(SMBUS_PORT, data);//?Write
back
SMBUS status value which will clear status value (Write 1 to
the corresponding bit means clearing status)
if (data & 0x02)
{
//If bit 1 is set (which means the command is
completed), SMBUS is ready
result = 0;//SMBUS ready
break;
}
if (!(data & 0xBF))
{
//If all bits are 0 except bit 2 (which means
error occurs on SMBUS), SMBUS is ready
result = 0;//SMBUS ready
break;
}
Содержание ARK-5420 Series
Страница 8: ...ARK 5420 User Manual viii ...
Страница 12: ...ARK 5420 User Manual xii ...
Страница 18: ...ARK 5420 User Manual 6 ...
Страница 19: ...Chapter 2 2 Hardware installation Sections include Introduction Jumpers and Connectors I O Connectors ...
Страница 35: ...Chapter 4 4 BIOS Setting ...
Страница 64: ...ARK 5420 User Manual 52 ...
Страница 65: ...Chapter 6 6 GPIO Programming This chapter introduces GPIO pro gramming Guide ...
Страница 74: ...ARK 5420 User Manual 62 ...
Страница 75: ...Appendix A A Programming the Watchdog Timer ...
Страница 79: ...67 ARK 5420 User Manual Appendix A Programming the Watchdog Timer ...