System Installation
PEB-2770/2780VG2A User’s Manual
3-8
GPIO Control Command Example (C Language)
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#define Superio2_Addr 0x2E
/* #define DEBUG
1 */
void enter_Superio2_CFG(void)
{
outportb(Superio2_Addr, 0x87);
outportb(Superio2_Addr, 0x87);
}
void exit_Superio2_CFG(void)
{
outportb(Superio2_Addr, 0xAA);
}
void Set_CFG2(unsigned char Addr2,unsigned char Value2)
{
unsigned char d2;
outportb(Superio2_Addr, Addr2);
delay(2);
outportb(Superio1, Value2);
#ifdef DEBUG
d2 = inportb(Superi1);
printf("\nWrite %x to CR%x, read back is:%x",Value2,Addr2,d2);
#endif /*DEBUG*/
delay(2);
}
unsigned char Get_CFG2(unsigned char Addr2)
{