Copyright © 2016 NEXCOM International Co., Ltd. All Rights Reserved.
84
NIFE 300 Series User Manual
Appendix C: GPI/O Programming Guide
GPIO programming sample code
#define GPIO_PORT
0xA00
#define GPO4_HI
outportb(GP7, 0x10)
#define GPO4_LO
outportb(GP7, 0x00)
#define GPO6_HI
outportb(GP7, 0x20)
#define GPO6_LO
outportb(GP7, 0x00)
#define GPO8_HI
outportb(GP7, 0x40)
#define GPO8_LO
outportb(GP7, 0x00)
#define GPO10_HI
outportb(GP7, 0x80)
#define GPO10_LO
outportb(GP7, 0x00)
#define GPOA4_HI
outportb(GPIO_PORT, 0x40)
#define GPOA4_LO
outportb(GPIO_PORT, 0x00)
#define GPOA3_HI
outportb(GPIO_PORT, 0x20)
#define GPOA3_LO
outportb(GPIO_PORT, 0x00)
#define GPOA2_HI
outportb(GP2, 0x80)
#define GPOA2_LO
outportb(GP2, 0x00)
#define GPOA1_HI
outportb(GP2, 0x40)
#define GPOA1_LO
outportb(GP2, 0x00)
void main(void)
{
GPO4_HI;
GPO6_LO;
GPO8_HI;
GPO10_LO;
GPOA4_HI;
GPOA3_LO;
GPOA2_HI;
GPOA1_LO;
}