Appendix
- 44 -
104-1649CLD2NA Series
outportb(BAR+0x04,0x41);
outportb(BAR+0x03,0x00);
reg_val =(inportb(BAR+0x02)|0x08)&0xeb;
reg_val |= 0x40;
outportb(BAR+0x02, reg_val);
delay(30);
reg_val =inportb(BAR);
while((reg_val
&0x02)!=0x02)
{
reg_val
=inportb(BAR);
if((reg_val
&0x04)!=0)
{
printf("ERROR\n");
return 0;
}
}
lev_val = inportb(BAR+0x05) & (0x01<<(pin-1));
lev_val = lev_val ? 1:0; /*Get the value of the variable lev_val here, 1
means that the input pin is high while 0 means the input pin is low*/
return lev_val ;
}