System Installation
WADE-8078 User’s Manual
3-7
printf("GPIO1 ---- GPIO5\n");
printf("GPIO2 ---- GPIO6\n");
printf("GPIO3 ---- GPIO7\n");
printf("GPIO4 ---- GPIO8\n");
printf("GND xxxx Vcc <==PWR/GND pins, DO NOT short them!\n\n");
printf("Test
Begins...\n");
/* Set GPIO Port In/Out mode */
/* Port 1 ~ 4 Out mode, 5 ~ 8 In mode*/
Write_EC (GPIO_DIR, 0xF0);
delay
(5);
/* Set Port 1 ~ 4 Low, 5 ~ 8 High */
outportb (0x22E, 0xF0);
Write_EC (GPIO_DATA, 0xF0);
delay
(5);
d2 = Read_EC (GPIO_DIR);
if ((d2 & 0x10) == 0)
printf ("GPIO70->GPIO74 test ok !! (pull low)\n");
else
printf ("GPIO70->GPIO74 test fail (pull high) \n");
if ((d2 & 0x20) == 0)
printf ("GPIO71->GPIO75 test ok !! (pull low)\n");
else
printf ("GPIO71->GPIO75 test fail (pull high)\n");
if ((d2 & 0x40) == 0)
printf ("GPIO72->GPIO76 test ok !! (pull low)\n");
else
printf ("GPIO72->GPIO76 test fail (pull high)\n");
if ((d2 & 0x80) == 0)
printf ("GPIO73->GPIO77 test ok !! (pull low)\n");
else
printf ("GPIO73->GPIO77 test fail (pull high)\n");
return
0;
}