FWA8206 Series User’s Manual
33
/* 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.
*/
switch (pos) {
case 1:
outb(0xf1,0x4e);//GP10 , LED1
led = inb(0x4f);
led &= 0xff;
led = ( flag==1 ?(led | 1) :(led & 0xfe));
outb(0xf1,0x4e);
outb(led,0x4f);
break;
case 2:
outb(0xf1,0x4e);//GP11 , LED2
led = inb(0x4f);
led &= 0xff;
led = ( flag==1 ?(led | 2) :(led & 0xfd));
outb(0xf1,0x4e);
outb(led,0x4f);
break;
case 3:
outb(0xf1,0x4e);//GP12 , LED3
led = inb(0x4f);
led &= 0xff;
led = ( flag==1 ?(led | 4) :(led & 0xfb));
outb(0xf1,0x4e);
outb(led,0x4f);
break;
case 4:
outb(0xf1,0x4e);//GP13 , LED4
led = inb(0x4f);
led &= 0xff;
led = ( flag==1 ?(led | 8) :(led & 0xf7));
outb(0xf1,0x4e);
outb(led,0x4f);
break;
case 5:
outb(0xf1,0x4e);//GP14 , LED5
led = inb(0x4f);
led &= 0xff;
led = ( flag==1 ?(led | 0x10) :(led & 0xef));
outb(0xf1,0x4e);
outb(led,0x4f);
break;