System Installation
NANO-6060 User’s Manual
3-4
3.5 WDT
Function
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <dos.h>
#define EC_DATA
0x62
#define EC_CMD
0x66
#define EC_CMD_READ 0x80
#define EC_CMD_WRITE 0x81
#define WDT_MODE 0x06 // WDT Select mode.
#define WDT_MIN
0x07 // Minute mode counter
#define WDT_SEC
0x08 // Second mode counter
// Use port 62 and port 66 to access EC command / data.
static int IBF_Check()
{
unsigned char IBF_status;
do
{
pw_udelay (20); // delay 20 us
outportb
(EC_CMD,
&IBF_status);
} while (IBF_status & 0x02);
return
1;
}
static int OBF_Check ()
{
unsigned char OBF_status;
do
{
pw_udelay (20); // delay 20 us
OBP_status = inportb (EC_CMD);
} while (!(OBF_status & 0x01));
return
1;
}
static void Write_EC (unsigned char index, unsigned char data)
{
IBF_Check
();
outportb (EC_CMD, EC_CMD_WRITE);
IBF_Check
();
outportb (EC_DATA, index);