Appendix A
66
KEMB-8100 & ATX-KLS0 Series User’s Manual
return Result;
}
int main()
{
int RetVal;
int i;
int Temp;
//Set Unlock SIO
outportb(INDEX_PORT, 0x87);
outportb(INDEX_PORT, 0x87);
//Set GPIO LDN7
Set_SIO_Reg(0x07, 0x07);
//Set DIO_0~15 as Input
Set_SIO_Reg(0xEC, 0xFF);
Set_SIO_Reg(0xF0, 0xFF);
//Read DIO_0~15 value
RetVal = Get_SIO_Reg(0xED);
printf("Read DIO_0~15 value\n");
for (i=0; i<8; i++)
{
Temp = (RetVal>>i) & 0x01;
printf("DIO_%d = %d\n",i ,Temp);
}
RetVal = Get_SIO_Reg(0xF1);
for (i=0; i<8; i++)
{
Temp = (RetVal>>i) & 0x01;
printf("DIO_%d = %d\n",8+i ,Temp);
}