System Installation
WADE-8079 User’s Manual
3-5
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
#define GPIO_DATA 0x2C
static void Write_EC (unsigned char index, unsigned char data)
{
sleep(1);
outportb (EC_CMD, EC_CMD_WRITE);
sleep(1);
outportb (EC_DATA, index);
sleep(1);
outportb (EC_DATA, data);
}
static unsigned char Read_EC (unsigned char address)
{
unsigned char data;
sleep(1);
outportb (EC_CMD, EC_CMD_READ);
sleep(1);
outportb (EC_DATA, address);