beautypg.com

Acrosser AR-B8172 User Manual

Page 34

background image

AR-B8172 User Manual

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);
if(inportb(IO_PORT_BASE+1)!=0xAA)
result=3;

// Set GPIO10~17 to 55
outportb(IO_PORT_BASE,0x4D);
outportb(IO_PORT_BASE+1,0x55);

// Read GPIO00~07 Status, if not 55 error.
outportb(IO_PORT_BASE,0x46);
if(inportb(IO_PORT_BASE+1)!=0x55)
result=4;

if(result)
Show_Fail();
else
Show_Pass();

return result;
}

//===========================================================================
// Function : Show_Help()

//

Input

:

-

//

Change

:

-

// Return : -

// Description : Show Title string.

//===========================================================================
void Show_Help()
{
clrscr();
printf("GPIO Test utility for Vortex86DX\n\n");

printf("GPIO00 迋

? VCC \n");

34