beautypg.com

NEXCOM APPC 1220T User Manual

Page 109

background image

Copyright © 2011 NEXCOM International Co., Ltd. All Rights Reserved.

94

Appendix B: GPI/O Programming Guide

APPC 1220T/1221T/1520T/1521T/1720T/1721T User Manual

GPIO Programming Sample Code

#define GPIO_PORT

0x284

#define GPO3

(0x01 << 4)

#define GPO5

(0x01 << 5)

#define GPO7

(0x01 << 6)

#define GPO9

(0x01 << 7)

#define GPO3_HI

outportb(GPIO_PORT, 0x10)

#define GPO3_LO

outportb(GPIO_PORT, 0x00)

#define GPO5_HI

outportb(GPIO_PORT, 0x20)

#define GPO5_LO

outportb(GPIO_PORT, 0x00)

#define GPO7_HI

outportb(GPIO_PORT, 0x40)

#define GPO7_LO

outportb(GPIO_PORT, 0x00)

#define GPO9_HI

outportb(GPIO_PORT, 0x80)

#define GPO9_LO

outportb(GPIO_PORT, 0x00)

void main(void)
{
GPO3_HI;
GPO5_LO;
GPO7_HI;
GPO9_LO;
}

This manual is related to the following products: