System Installation
WADE-8041 User’s Manual
3-11
// GP10 - GP17 I/O select
printf("\nSet Port10 To Port17 input or output :");
scanf("%x",&x);
outport(0x2e,0xf0);
printf("\n x= %x",x);
outport(0x2f,x);
//GP10 - GP17 output
printf("\n Set output data :");
scanf("%x",&x);
// set GP10-GP13 Output data
outport(0x2e,0xf1);
outport(0x2f,x);
indata=inport(0x2f);
printf("\n Get the Port input data =%x \n",indata);
printf("Enter to test Port LED ....\n");
getch();
printf("LED test Now...");
outdata=0x01;
for (x=0;x<20;x++)
{
printf(".");
outport(0x2e,0xf1);
outport(0x2f,outdata);
delay(300);
outport(0x2e,0xf1);
outdata=outdata<<1;
if (outdata==0x10) outdata=0x01;
}
//Exit the extended function mode
outport(0x2e,0xaa);
return 0;
}