beautypg.com

Main – AAEON GENE-HD05 User Manual

Page 93

background image

S u b C o m p a c t B o a r d

G E N E - H D 0 5

Appendix A Programming the Watchdog Timer A-5

A.2 F81866 Watchdog Timer Initial Program

Main

(){ 

aaeonSuperIOOpen(); 

aaeonWdtSetCountMode(BOOL bMinute); // Set wdt count mode 

aaeonWdtSetTimeoutCount(BYTE tTimeout); // Set wdt timer 

aaeonWdtSetEnable(BOOL bEnable); // Enable wdt 

aaeonSuperIOClose(); 

 

Void aaeonSuperIOOpen(){  // Config F81866 Entry key 

 

aaeonioWritePortByte(F81866_INDEX, 0x87); 

 

aaeonioWritePortByte(F81866_INDEX, 0x87); 

 

Void aaeonWdtSetCountMode(BOOL bMinute){ 

BYTE WDT_CONTROL = f81866ReadByte(F81866_WDT_CONTROL_REG); 

if(bMinute) 

f81866WriteByte(F81866_WDT_CONTROL_REG, WDT_CONTROL | 0x08); 

else 

f81866WriteByte(F81866_WDT_CONTROL_REG, WDT_CONTROL & 0xF7);