![Portwell NANO-6060 User Manual Download Page 27](http://html1.mh-extra.com/html/portwell/nano-6060/nano-6060_user-manual_1581827027.webp)
System Installation
NANO-6060 User’s Manual
3-7
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("NANO-6060 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");
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