beautypg.com

Appendix a - watchdog timer, Wdt sample code, Appendix a, watchdog timer – ADLINK MI-220 User Manual

Page 79: A appendix: watchdog timer

background image

Watchdog Timer

67

MI-220

Appendix A - Watchdog Timer

Watchdog Timer sample code for the MI-220 is as follows.

WDT Sample Code

void SIOConfigEnter ()

{

IoWrite8 (NCT6776F_CONFIG_INDEX ,

NCT6776F_CONFIG_MODE_ENTER_VALUE);

IoWrite8 (NCT6776F_CONFIG_INDEX ,

NCT6776F_CONFIG_MODE_ENTER_VALUE);

}

void SIOConfigExit ()

{

IoWrite8 (NCT6776F_CONFIG_INDEX ,

NCT6776F_CONFIG_MODE_EXIT_VALUE);

}

void Oem_WDT_Init (

IN SETUP_DATA *SetupData

)

{

UINT8 Data8;

SIOConfigEnter();

IoWrite8 (NCT6776F_CONFIG_INDEX , 0x2C); //

Pin113 function selection to TSIC

Data8 = IoRead8(NCT6776F_CONFIG_DATA) | 0x01;

IoWrite8 (NCT6776F_CONFIG_DATA , Data8);

IoWrite8 (NCT6776F_CONFIG_INDEX ,

NCT6776F_LDN_SEL_REGISTER);

IoWrite8 (NCT6776F_CONFIG_DATA , NCT6776F_LDN_GPIO2);

IoWrite8 (NCT6776F_CONFIG_INDEX ,

NCT6776F_ACTIVATE_REGISTER);

Data8 = IoRead8(NCT6776F_CONFIG_DATA) | 0x04;

IoWrite8 (NCT6776F_CONFIG_DATA , Data8);

IoWrite8 (NCT6776F_CONFIG_INDEX ,

NCT6776F_LDN_SEL_REGISTER);