beautypg.com

Acrosser AR-B1631 User Manual

Page 23

background image

AR-B1631 User’s Guide

printf("\n>>>>> GPI Test Error <<<<<\n"); return 1; } // return fail

printf("\n>>>>> GPI Test End <<<<<\n");
return 0;

// return pass

}

/*[]======================================================================[]*/
/*|| Function

: GPO_TEST()

||*/

/*|| Input : BYTE IO_PORT_BASE

||*/

/*||

Change :

-

||*/

/*|| Return : Pass return "0", Fail return "1".

||*/

/*|| Description: Test GPO Pins status.

||*/

/*[]======================================================================[]*/
int GPO_TEST(BYTE IO_PORT_BASE)
{
// Set W83627HF GPIO10~17 to Output
outportb(IO_PORT_BASE,0xF0);
outportb(IO_PORT_BASE+1,0x00);

printf(">>>>> GPO Test Start <<<<<");

/////// Output High Test /////////////////////////////////////////////////

printf("\nSet GPO Pins to High ...............");

// Set W83627HF GPIO10~17 to High
outportb(IO_PORT_BASE,0xF1);
outportb(IO_PORT_BASE+1,0xFF);

printf("\nGPO Pins is High ? [Y/N] ........... ");

if(YES_NO_Confirm() =='n')
{ printf("\n>>>>> GPO Test Error <<<<<\n"); return 1; } // return fail

/////// Output Low Test //////////////////////////////////////////////////

printf("\nSet GPO Pins to Low ................");

// Set W83627HF GPIO10~17 to Low
outportb(IO_PORT_BASE,0xF1);
outportb(IO_PORT_BASE+1,0x00);

printf("\nGPO Pins is Low ? [Y/N] ............ ");
if(YES_NO_Confirm() =='n')
{ printf("\n>>>>> GPO Test Error <<<<<\n"); return 1; } // return fail

printf("\n>>>>> GPI Test End <<<<<\n");
return 0;

// return pass

}

/*[]======================================================================[]*/
/*|| Main procedure ||*/
/*[]======================================================================[]*/
int main(int argc, char *argv[])
{
BYTE IO_PORT_BASE=0x2E; // DATA_PORT = IO_PORT_BASE + 1;
int result;

23