System Installation
WADE-8078 User’s Manual
3-5
/* if use minute mode */
/* Write_EC (WDT_MIN, 0x05); */
/* 0x01 is second mode */
/* 0x03 is minute mode */
Write_EC (WDT_MODE, 0x01);
}
Write_EC ((b->wdt.ec.count_m_addr & 0xFF), b->wdt.ec.timeout);
Write_EC ((b->wdt.ec.cfg_addr & 0xFF), 0x03); //
WDTCFG[1:0]=11
int main ()
{
int i;
EC_WDT_Trigger
();
for (i = 0; i < 5; i++)
{
printf ("Reset counter ...................%d\n", 5 - i);
delay
(1000);
}
return
0;
}
3.6 GPIO
#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 GPIO_DIR 0x2B // GPIO Direction (Input/Output) Reg.
#define GPIO_DATA 0x2C // GPIO High/Low Reg.
// 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