System Installation
WADE-8078 User’s Manual
3-6
outportb
(EC_CMD,
&IBF_status);
} while (IBF_status & 0x02);
return
1;
}
static int OBF_Check ()
{
unsigned char OBF_status;
do
{
pw_udelay (20); // delay 20 us
OBP_status = inportb (EC_CMD);
} while (!(OBF_status & 0x01));
return
1;
}
static void Write_EC (unsigned char index, unsigned char data)
{
IBF_Check
();
outportb (EC_CMD, EC_CMD_WRITE);
IBF_Check
();
outportb (EC_DATA, index);
IBF_Check
();
outportb (EC_DATA, data);
}
static unsigned char Read_EC (unsigned char address)
{
unsigned char data;
IBF_Check
();
outportb (EC_CMD, EC_CMD_READ);
IBF_Check
();
outportb (EC_DATA, address);
OBF_Check();
data = inportb (EC_DATA);
return
data;
}
int main ()
{
unsigned char d2;
printf("\n\n");
printf("WADE-8078 GPIO TEST Program v1.0\n");
printf("Please short the following pins with 2.54mm-pitched jumper on
JP8\n");
printf("PIN 1,3,5,7 is output ; PIN 2,4,6,8 is input\n");