beautypg.com

ADLINK NuPRO-E330 User Manual

Page 90

background image

76

Watchdog Timer

}

void Get_IT8783_ID(unsigned int &ID1, unsigned int &ID2)

{

outportb(IT8783_ioPort, 0x20);

ID1 = inportb(IT8783_ioPort+1);

outportb(IT8783_ioPort, 0x21);

ID2 = inportb(IT8783_ioPort+1);

}

void IT8783_WDTRun(unsigned int count_value, unsigned int

PLEDflag) //for NuPRO-E330

{

unsigned long tempCount;

unsigned int registerValue;

outportb(IT8783_ioPort, 0x07);

outportb(IT8783_ioPort+1, 0x07);// Device 7

outportb(IT8783_ioPort, 0xf8);

outportb(IT8783_ioPort+1, 0x00);// PLED mapping to

nothing, disable PLED function

if(PLEDflag == 1)

{

outportb(IT8783_ioPort, 0x27);

registerValue = inportb(IT8783_ioPort + 1);

registerValue |= 0x80; // set Pin09 is GPIO

function GP37

outportb(IT8783_ioPort+1, registerValue);

outportb(IT8783_ioPort, 0xc2);

registerValue = inportb(IT8783_ioPort + 1);

registerValue &= 0x7fb; // set GP37 is alternate

function

outportb(IT8783_ioPort+1, registerValue);

outportb(IT8783_ioPort, 0xca);

registerValue = inportb(IT8783_ioPort + 1);

registerValue |= 0x80; // set GP42 is output

outportb(IT8783_ioPort+1, registerValue);