User`s guide

AR-B1631ET User’s Guide
26/30
/////// Input High Test ///////////////////////////////////////////////////
printf("\nConnect GPI Pins to High ? [Y/N] ....... ");
if(YES_NO_Confirm() =='n')
{ printf("\n>>>>> GPI Test Error <<<<<\n"); return 1; } // return fail
Show_Byte=0x00;
// Read W83627HF GPIO10~17 Status
outportb(IO_PORT_BASE,0xF1);
Read_Byte=inportb(IO_PORT_BASE+1);
if(Read_Byte&0x01) //GPI10
Show_Byte=Show_Byte|0x01; else Show_Byte=Show_Byte&0xFE;
if(Read_Byte&0x02) //GPI11
Show_Byte=Show_Byte|0x02; else Show_Byte=Show_Byte&0xFD;
if(Read_Byte&0x04) //GPI12
Show_Byte=Show_Byte|0x04; else Show_Byte=Show_Byte&0xFB;
if(Read_Byte&0x08) //GPI13
Show_Byte=Show_Byte|0x08; else Show_Byte=Show_Byte&0xF7;
if(Read_Byte&0x10) //GPI14
Show_Byte=Show_Byte|0x10; else Show_Byte=Show_Byte&0xEF;
if(Read_Byte&0x20) //GPI15
Show_Byte=Show_Byte|0x20; else Show_Byte=Show_Byte&0xDF;
if(Read_Byte&0x40) //GPI16
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==0xFF)
printf("\nGPI Pins input value ==> 0x%002X",Show_Byte);
else
{ printf("\nGPI Pins input value ==> 0x%002X (should be 0xFF)",Show_Byte);
printf("\n>>>>> GPI Test Error <<<<<\n"); return 1; } // return fail
/////// Input Low Test ////////////////////////////////////////////////////
printf("\nConnect GPI Pins to Low ? [Y/N] ........ ");
if(YES_NO_Confirm() =='n')
{ printf("\n>>>>> GPI Test Error <<<<<\n"); return 1; } // return fail
Show_Byte=0x00;
// Read W83627HF GPIO10~17 Status
outportb(IO_PORT_BASE,0xF1);
Read_Byte=inportb(IO_PORT_BASE+1);
if(Read_Byte&0x01) //GPI10
Show_Byte=Show_Byte|0x01; else Show_Byte=Show_Byte&0xFE;
if(Read_Byte&0x02) //GPI11
Show_Byte=Show_Byte|0x02; else Show_Byte=Show_Byte&0xFD;
if(Read_Byte&0x04) //GPI12