System Installation
PEB-2738I User’s Manual
3-7
outp
(0x2e,0xf0);
outp
(0x2f,(inp(0x2f)&~tmp)|(tmp*mode));//0 for output,1 for intput
}
//data 0 for low, 1 for high
void GPIO_Write(int bit,int data){
int
tmp=1<<bit;
outp
(0x2e,0x07);
outp (0x2f,0x09);// entry device 9
outp
(0x2e,0xf1);
outp (0x2f,(inp(0x2f)&~tmp)|(tmp*data));//0 for low,1 for high
}
//high return 1, low return 0
int GPIO_Read(int bit){
int
tmp=1<<bit;
int
data;
outp
(0x2e,0x07);
outp (0x2f,0x09);// entry device 9
outp
(0x2e,0xf1);
data=inp(0x2f)&~tmp;//read
bit
if
(data==0)
return
0;
else
return
1;