Acrosser AR-B8170 User Manual
Page 33
AR-B8170 User Manual
int result=0;
if ( argc >1 )
{ Show_Help(); return 1; }
clrscr();
textcolor(WHITE);
gotoxy(1, 1);
cprintf("<>==========================================================================<>");
gotoxy(1, 2); cprintf("|| Vortex86DX GPIO Test Utility v1.0 Acrosser Technology Co., Ltd. ||");
gotoxy(1, 3);
cprintf("<>==========================================================================<>");
gotoxy(1, 4);
cprintf("<>==========================================================================<>");
gotoxy(1, 5); cprintf("|| Model Name : ||");
gotoxy(1, 6); cprintf("|| SIO IO Base : ||");
gotoxy(1, 7);
cprintf("<>==========================================================================<>");
// Show Got Parameter Informat
textcolor(LIGHTGRAY);
gotoxy(18,5); cprintf("%s",Model_Name);
gotoxy(18,6); cprintf("%X",IO_PORT_BASE);
// Set GPIO00~07 to Output
outportb(IO_PORT_BASE,0x4E);
outportb(IO_PORT_BASE+1,0xFF);
// bit=1 , output
// Set GPIO10~GPIO17 to Input
outportb(IO_PORT_BASE,0x4F);
outportb(IO_PORT_BASE+1,0x00); // bit=0 , input
// Set GPIO00~07 to AA
outportb(IO_PORT_BASE,0x47);
outportb(IO_PORT_BASE+1,0xAA);
// Read GPIO10~17 Status, if not AA error.
outportb(IO_PORT_BASE,0x4C);
if(inportb(IO_PORT_BASE+1)!=0xAA)
result=1;
// Set GPIO00~07 to 55
outportb(IO_PORT_BASE,0x47);
outportb(IO_PORT_BASE+1,0x55);
// Read GPIO10~17 Status, if not 55 error.
outportb(IO_PORT_BASE,0x4C);
if(inportb(IO_PORT_BASE+1)!=0x55)
result=2;
// Set GPIO10~GPIO17 to Output
outportb(IO_PORT_BASE,0x4F);
outportb(IO_PORT_BASE+1,0xFF);
// bit=1 , output
// Set GPIO00~07 to Input
outportb(IO_PORT_BASE,0x4E);
outportb(IO_PORT_BASE+1,0x00); // bit=0 , input
// Set GPIO10~17 to AA
outportb(IO_PORT_BASE,0x4D);
outportb(IO_PORT_BASE+1,0xAA);
// Read GPIO00~07 Status, if not AA error.
outportb(IO_PORT_BASE,0x46);
33