Acrosser AR-B1631ET User Manual
Page 27
AR-B1631ET User’s Guide
Show_Byte=Show_Byte|0x40; else Show_Byte=Show_Byte&0xBF;
if(Read_Byte&0x80) //GPI17
Show_Byte=Show_Byte|0x80; else Show_Byte=Show_Byte&0x7F;
if(Show_Byte==0x00)
printf("\nGPI Pins input value ==> 0x%002X",Show_Byte);
else
{ printf("\nGPI Pins input value ==> 0x%002X (should be 0x00)",Show_Byte);
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 ||*/
27/30
/*[]=====================================================================[]*/