Ar-b5890 user manual – Acrosser AR-B5890 User Manual

Page 17

Advertising
background image

AR-B5890 User Manual

17

// Get Simple I/O Base Address
outportb(IO_PORT_BASE,0x62);

// Simple I/O Base address MSB

SIMPLE_IO_BASE=inportb(IO_PORT_BASE);
SIMPLE_IO_BASE=SIMPLE_IO_BASE<<8;
outportb(IO_PORT_BASE,0x63);

// Simple I/O Base address LSB

SIMPLE_IO_BASE=SIMPLE_IO_BASE|inportb(IO_PORT_BASE);

// Show Got Parameter Informat
textcolor(LIGHTGRAY);
gotoxy(18,5);

cprintf("%s",Model_Name);

gotoxy(18,6);

cprintf("%X",IO_PORT_BASE);

gotoxy(22,7);

cprintf("%X",SIMPLE_IO_BASE);


// Set GPIO30~33 to Output, GPIO34~GPIO37 to Input
outportb(IO_PORT_BASE,0xCA);

outportb(IO_PORT_BASE+1,0x0F);

// bit=1 , output


// Set GPIO30~33 to High
outportb(SIMPLE_IO_BASE+2,0x0F);
// Read GPIO34~37 Status, if not High error.
data=inportb(SIMPLE_IO_BASE+2)&0xF0;
if(data!=0xF0)
result=1;

// Set GPIO30~33 to Low
outportb(SIMPLE_IO_BASE+2,0x00);
// Read GPIO34~37 Status, if not Low error.
data=inportb(SIMPLE_IO_BASE+2)&0xF0;
if(data!=0x00)
result=1;

// Set GPIO30~33 to Input, GPIO34~GPIO37 to Output
outportb(IO_PORT_BASE,0xCA);

outportb(IO_PORT_BASE+1,0xF0);

// bit=1 , output


// Set GPIO34~37 to High
outportb(SIMPLE_IO_BASE+2,0xF0);
// Read GPIO30~33 Status, if not High error.
data=inportb(SIMPLE_IO_BASE+2)&0x0F;
if(data!=0x0F)
result=1;

// Set GPIO34~37 to Low
outportb(SIMPLE_IO_BASE+2,0x00);
// Read GPIO30~33 Status, if not Low error.
data=inportb(SIMPLE_IO_BASE+2)&0x0F;
if(data!=0x00)
result=1;

// Exit ITE8712F Config
outportb(IO_PORT_BASE,0x02);
outportb(IO_PORT_BASE+1,0x02);

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

return result;
}

void Show_Help()
{
clrscr();
printf("GPIO Test utility for ITE8712F\n\n");





printf("Vcc GND \n");

 

printf("GP30

迋迋迋迋 

?

GP34\n");

 

printf("GP31

迋迋迋迋 

?

GP35\n");

 

printf("GP32

迋迋迋迋 

?

GP36\n");

 

printf("GP33

迋迋迋迋 

?

GP37\n");

}


//===========================================================================
// Function

: Show_Fail()

//

Input :

-

Advertising