
VDX-6318 Windows Embedded Compact 7 - Getting Started Guide
Windows Embedded Compact 7 Getting Started Rev 2.00
Page 111
Configure GPIO to Output Mode
The GPIO can be used to light up or blink LEDs to function as visual status indicator, to trigger
relay or send reset signal to another controller.
Each of the 8-bits on Port-0 and Port-1 can be configured independently to input or output
mode, by writing the appropriate value to the direction register at 98H for Port-0 and 99H for
Port-1, as follow:
To configure all 8-bits on Port-0 to output mode:
Outportb(0x98, 0xff);
To configure all 8-bits on Port-1 to output mode:
Outportb(0x99, 0xff);
To configure only bit-0, bit-1, bit-2 and bit-3 on Port-0 to output mode:
Outportb(0x98, 0x0f);
To configure only bit-0, bit-1, bit-2 and bit-3 on Port-1 to output mode:
Outportb(0x99, 0x0f);
To configure bit-4, bit-5, bit-6 and bit-7 on Port-0 to output mode:
Outportb(0x98, 0xf0);
To configure bit-4, bit-5, bit-6 and bit-7 on Port-1 to output mode:
Outportb(0x99, 0xf0);
To configure bit-0 and bit-3 on Port-0 to output mode:
Outportb(0x98, 0x05);
To configure bit-0 and bit-3 on Port-1 to output mode:
Outportb(0x99, 0x05);
After the GPIO port is configured to output mode, each GPIO bit can be toggle to high or low by
writing appropriate value to the data register at 78H for Port-0 and 79H for Port-1, as follow:
To set all 8 GPIO bits on Port-0 to high:
Outportb(0x78, 0xff);
To set all 8 GPIO bits on Port-1 to high:
Outportb(0x79, 0xff);
To set only bit-0, bit-1, bit-2 and bit-3 on Port-0 to high:
Outportb(0x78, 0x0f);
To set only bit-0, bit-1, bit-2 and bit-3 on Port-1 to high:
Outportb(0x79, 0x0f);
To set only bit-4, bit-5, bit-6 and bit-7 on Port-0 to high:
Outportb(0x78, 0xf0);
To set only bit-4, bit-5, bit-6 and bit-7 on Port-1 to high:
Outportb(0x79, 0xf0);
To set only bit-0 and bit-3 on Port-0 to high: