MIO-5850 User Manual
68
D.1
EC Watchdog Timer sample code
Display source code fixed width font for easy reading.
The sample code can be compiled by Open Watcom C++ compiler running on DOS.
#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <stdint.h>
#include <i86.h>
#define CMD_PORT (0x2F6)
#define STS_PORT CMD_PORT
#define DAT_PORT (0x2F2)
#define EC_RETRIES (65535)
#define EC_STS_IBF 0x02
#define EC_STS_OBF 0x01
#define EC_CMD_MASK 0x01 // 1=read command, 0=write command
#define EC_CMD_READ EC_CMD_MASK
#define WDT_CMD_WRITE 0x2A
#define WDT_CMD_READ 0x2B
#define WDT_CTL 0x02
#define WDT_CTL_CLEAR 0x02
#define WDT_CTL_START 0x01
#define WDT_CTL_STOP 0x00
#define WDT_TYPE_DELAY 0x11 // add delay time before watchdog starting
#define WDT_TYPE_PWRCYC 0x12 // power cycle
#define WDT_TYPE_IRQ 0x13 // issue IRQ
#define WDT_TYPE_RESET 0x14 // reset
#define WDT_TYPE_PIN 0x15 // set watchdog pin
#define WDT_TYPE_SCI 0x16 // issue SCI in ACPI OS
#define inb(p) inp(p)
#define outb(p, v) outp(p, v)
//
================================================================
=============
// ec_wait_ibe
//
================================================================
=============
Summary of Contents for MIO-5850
Page 1: ...User Manual MIO 5850 ...
Page 6: ...MIO 5850 User Manual vi ...
Page 20: ...MIO 5850 User Manual 12 ...
Page 21: ...Chapter 3 3 AMI BIOS Setup ...
Page 47: ...Chapter 4 4 Installation ...
Page 65: ...Appendix B B How to install Win7 64 bit ...
Page 75: ...Appendix D D EC Watchdog Timer Sample Code ...
Page 81: ...73 MIO 5850 User Manual Appendix D EC Watchdog Timer Sample Code ...