beautypg.com

D.2 wdt with dos/linux, Wdt with dos/linux – ADLINK MXC-6300 Series User Manual

Page 106

background image

94

Watchdog Timer (WDT) Function Library

D.2 WDT with DOS/Linux

Under Linux, please program WDT function using the same LPC
IO registers according to the sample program as follows.

#include

#include

#include

/* Config LPC IO ITE8783 to enter config mode */

EnterConfig(void)

{

outp(0x2E, 0x87);

outp(0x2E, 0x01);

outp(0x2E, 0x55);

outp(0x2E, 0x55);}

/* Config LPC IO to exit config mode */

ExitConfig(void)

{

outp(0x2E, 0x02);

outp(0x2F, 0x02);

}

/* Read byte from LPC IO register */

unsigned char r_reg(unsigned char regoffset)

{

outp(0x2E, regoffset);

return inp(0x2F);

}

/* Write byte to LPC IO register */