Appendix 54, Ib945 user’s manual – IBASE IB945 User Manual
Page 58
APPENDIX
54
IB945 User’s Manual
{
unsigned char bBuf;
bBuf = Get_W627DHG_Reg(0x2D);
bBuf &= (~0x01);
Set_W627DHG_Reg(0x2D,
bBuf);
//Enable
WDTO
}
//---------------------------------------------------------------------------
void WDTEnable(unsigned char NewInterval)
{
unsigned char bBuf;
Set_W627DHG_LD(0x08);
//switch
to
logic
device
8
Set_W627DHG_Reg(0x30,
0x01);
//enable
timer
bBuf = Get_W627DHG_Reg(0xF5);
bBuf &= (~0x08);
Set_W627DHG_Reg(0xF5, bBuf);
//count mode is second
Set_W627DHG_Reg(0xF6, NewInterval);
//set timer
}
//---------------------------------------------------------------------------
void WDTDisable(void)
{
Set_W627DHG_LD(0x08);
//switch
to
logic
device
8
Set_W627DHG_Reg(0xF6,
0x00);
//clear watchdog timer
Set_W627DHG_Reg(0x30,
0x00);
//watchdog disabled
}
//---------------------------------------------------------------------------