BIOS Setup Information
NANO-6040/NANO-6040L User’s Manual
3-5
J22: GPIO Header
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 GND
10 VCC
Reference Intel Topcliff IOH Spec page 58. The GPIO memory base address from
PCI[D0:F2] register 14-17h.
GPIO Control Command Example
// GPIO_BAR: GPIO Base address
#define GPIO_OUTPUT 0x18
#define GPIO_INPUT
0x1C
#define GPIO_MODE
0x20
The basic function :
a. GP GPIO_OUTPUT -> GPIO port output register
b. GP GPIO_INPUT -> GPIO port input register
c. GP GPIO_MODE -> GPIO port mode register
The GPIO pin define
GPIO1 (J22 PIN 1) ---- GPIO5 (J22 PIN 2)
GPIO2 (J22 PIN 3) ---- GPIO6 (J22 PIN 4)
GPIO3 (J22 PIN 5) ---- GPIO7 (J22 PIN 6)
GPIO4 (J22 PIN 7) ---- GPIO8 (J22 PIN 8)
GND xxxx VCC
Below are some example codes, which demonstrate the use of GPIO.
// 1 -> out, 0 -> in
// Set GPIO 1~8 are input mode
writeb (0x00, GP GPIO_MODE);
// Set GPIO 1~8 are output mode
writeb (0xFF, GP GPIO_MODE);
unsigned char data;
// Store input state