System Installation
WADE-8021 User’s Manual
3-3
outportb (0xa06, 0xF0);
delay (5);
d2 = inportb (0xa06);
#ifdef DEBUG
printf ("d2: %x\n", d2);
#endif
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");
printf("\n");
printf("Change: PIN 1,3,5,7 is output; PIN 2,4,6,8 is input\n");
printf("Test Begins...\n");
/* Set GPIO Port In/Out mode */
Set_CFG2 (0xCE, 0xF0); /* Port 70~73 In mode, 74~77 Out mode */
delay (5);
/* Set GP70~73 High, 74~77 Low, a+6 */
outportb (0xa06, 0x0F);
delay (5);
d2 = inportb (0xa06);
#ifdef DEBUG