System Installation
WADE-8013/WADE-8014 User’s Manual
3-10
{
unsigned char data;
write_io_byte(0X2E,
Addr);
read_io_byte(0X2E + 1, &data);
return
data;
}
enter_ite_superio_cfg ();
// initial register state
set_ite_cfg (0x07, 0x03); // Select LDN = 0x03h
set_ite_cfg (0x30, 0x00);
set_ite_cfg (0x07, 0x07); // Select LDN = 0x07h
#if GPIO_SEL_13
data = get_ite_cfg (0xE9);
data = data | 0x20; // bit 5 set 1
set_ite_cfg (0xE9, data);
#else
data = get_ite_cfg (0x2C);
data = data | 0x80; // bit 7 set 1
set_ite_cfg (0x2C, data);
#endif
// read GPIO base address
bar_msb = get_ite_cfg (0x62);
bar_lsb = get_ite_cfg (0x63);
BASE = (bar_msb << 8) | bar_lsb;
// 1 -> out, 0 -> in
// GPIO 1~4 is out, 5~8 is in
set_ite_cfg (GPIO_MODE, 0xF0); // 7~4:PIN 1~4, 3~0: PIN 5~8
#if GPIO_SEL_13
// Set GP70~73 Low, 74~77 High
write_io_byte (BASE + 6, 0x0F); // GPIO13
read_io_byte (BASE + 6, &data); // BASE + 6 = GPIO13
#else
// Set GP80~83 Low, 84~87 High
write_io_byte (BASE + 7, 0x0F); // GPIO14
read_io_byte (BASE + 7, &data); // BASE + 6 = GPIO14
#endif