System Installation
ROBO-8112VG2AR User’s Manual
3-10
3.6 GPIO
The ROBO-8112VG2AR provides 8 programmable input or output ports that can be
individually configured to perform a simple basic I/O function. Users can configure
each individual port to become an input or output port by programming register bit of
I/O Selection. To invert port value, the setting of Inversion Register has to be
made. Port values can be set to read or write through Data Register.
J17: General Purpose I/O Connector
PIN No.
Signal Description
PIN No. Signal Description
1 GPIO0
2 GPIO4
3 GPIO1
4 GPIO5
5 GPIO2
6 GPIO6
7 GPIO3
8 GPIO7
9 Ground
10
+5V
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#define SIO_Port 0x2E
#define SIO_Port2
0x4E
#define GPIO_LDN
0x07
#define GPIO_Base
0x0A00
//Enter SIO
void Enter_IT872x_SIO() {
outp(SIO_Port,
0x87);
outp(SIO_Port,
0x01);
outp(SIO_Port,
0x55);
outp(SIO_Port,
0x55);
}
//Select LDN
void Set_LDN(unsigned char LDN) {
outp(SIO_Port,
0x07);
outp(S1,
LDN);
//printf("LDN=%x\n",
LDN);
}
//Set register offset to Value
void Set_Register(unsigned char offset, unsigned char value) {
outp(SIO_Port,
offset);