System Installation
96M4321o User’s Manual
3-11
3.8.3 Example
The example of program for GPIO test as following is based on J46 1-2, 3-4, 5-6,7-8
short.
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#define Superio_Addr
0x2e
/* #define DEBUG
1 */
void enter_Superio_CFG(void)
{
outportb(Superio_Addr, 0x87);
outportb(Superio_Addr, 0x87);
}
void exit_Superio_CFG(void)
{
outportb(Superio_Addr, 0xAA);
}
void Set_CFG(unsigned char Addr,unsigned char Value)
{
unsigned char d;
outportb(Superio_Addr, Addr);
delay(2);
outportb(Superi1, Value);
#ifdef DEBUG
d = inportb(Super1);
printf("\nWrite %x to CR%x, read back is:%x",Value,Addr,d);
#endif /*DEBUG*/
delay(2);
}