FWA8206 Series User’s Manual
31
//Select inversion mode
outb(0xf2,0x4e);
i = inb(0x4f);
i &= 0xdf;
outb(i,0x4f);
/* Value of Inversion Register :
Only high nibble is available for this function.
When set to a 1, the incoming/outgoing port value is inverted.
When set to a 0, the incoming/outgoing port value is the same as in Data Register.
Value of I/O Selection Register :
Only high nibble is available for this function.
When set to a 1, respective GPIO port is programmed as an input port.
When set to a 0, respective GPIO port is programmed as an output port.
Value of Output Data / Input Data :
Only high nibble is available for this function.
If a port is assigned to be an output port,then its respective bit can be read/written.
If a port is assigned to be an input port, then its respective bit can be read only.
*/
outb(0xf1,0x4e);
i = inb(0x4f);
i
>>=
5;
return
i;
}
int main( int argc , char **argv )
{
int
status,i=0;
setuid(0); /* if we're setuid, force it on */
if ( iopl(3) ) {
fprintf(stderr, "iopl(): %s\n", strerror(errno));
return -1;
}
for(;;) {
usleep(10000);
status = fd_polling();
if ( status == 0 ) { // Check the Factory Default button
i++;
printf("### MB893 Load Default Setting (%d) ###\n",i);
usleep(500000);
//You could call your function here to load the
//software default value.
}
}
return
0;
}