Advantech ITA-5831 Series User Manual page 82

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

Advertisement

Example Program
//Wait IBF Empty
unsigned char ECWaitIBFEmpty()
{
unsigned char Status;
do{
} while (Status & 0x02); //If IBF Set?
return Status;
}
//Write non-data command (no data) to EC
void EcWriteCmd (unsigned char cmd)
{
ECWaitIBFEmpty();//Wait IBF Empty outpor tb(0x29A, (unsigned
char)cmd);
}
//Write standard command (include data) to EC
void IT8528ECSetData (
unsigned char
unsigned char
unsigned char
)
{
ECWaitIBFEmpty();
outportb (IT8528E_HWM_CMD_PORT, Cmd);
ECWaitIBFEmpty();
outportb (IT8528E_HWM_DATA_PORT, Addr); //Write address
ECWaitIBFEmpty();
outportb (IT8528E_HWM_DATA_PORT, Value);
}
//Stop watchdog
void disable_wdt()
{
EcWriteCmd(0x29);
}
ITA-5831 User Manual
Status = inportb(0x29A);
//Write command
Cmd, //command
Addr,//write address
Value,//data
//Read back Status
//Write command 0x29 to stop watch dog
72
//Wait IBF Empty
//Write command
//Wait IBF Empty
//Wait IBF Empty
//Write data

Advertisement

Table of Contents
loading

Table of Contents