附录
- 44 -
104-1649CLD2NA 系列
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; /*此处得到变量lev_val的值,为1表示输入引
脚为高电平,为0表示输入引脚为低电平*/
return lev_val ;
}
欲获更多信息请访问研祥网