AAEON CES-CV101 User Manual

Page 88

Advertising
background image

E m b e d d e d C o n t r o l l e r

C E S - C V 1 0 1

Appendix A Programming the Watchdog Timer A-6

WDTSetBit(

TimerReg, PSWidthBit, PSWidthVal

);

// Watchdog WDTRST# Enable

WDTSetBit(

DevReg, WDTRstBit, WDTRstVal

);

}

VOID

WDTClearTimeoutStatus()

{

WDTSetBit(

TimerReg, StatusBit, 1

);

}

*******************************************************************************

*******************************************************************************

VOID

WDTWriteByte(byte Register, byte Value)

{

IOWriteByte(WDTAddr+Register, Value);

}

byte

WDTReadByte(byte Register)

{

return IOReadByte(WDTAddr+Register);

}

VOID

WDTSetBit(byte Register, byte Bit, byte Val)

{

byte TmpValue;

TmpValue = WDTReadByte(Register);

TmpValue &= ~(1 << Bit);

TmpValue |= Val << Bit;

WDTWriteByte(Register, TmpValue);

}

*******************************************************************************

Advertising