System Installation
PEB-2739I User’s Manual
3-5
outp (0x2f,inp(0x2f)&0xfe);//Enable WDT function
outp
(0x2e,0x07);
outp (0x2f,0x08); //entry device 8
outp
(0x2e,0xF5);
outp (0x2f,inp(0x2f)|(mode*0x08)); //bit3 0:second,1 Minute
outp
(0x2e,0xf6);
outp (0x2f,time);// Set time (sec/min)
outp
(0x2e,0xf7);
outp (0x2f,inp(0x2f)|0xc0);//enable reset time by mouse/keyboard
interrupt
}
void WDT_Disable(){
outp
(0x2e,0x2d);
outp (0x2f,inp(0x2f)|0x01);//Disable WDT function
}
//bit 0~7=GPIO 30~37, mode 0=output 1=input
void GPIO_Set_Mode(int bit,int mode){
int
tmp=1<<bit;
outp
(0x2e,0x07);
outp (0x2f,0x09);// entry device 9
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);