beautypg.com

NEXCOM NISE 3720E User Manual

Page 84

background image

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

70

NISE 3720E Series User Manual

Appendix B: GPI/O Programming Guide

Control the GPO pin (4/6/8/10) level from I/O port A07h bit (4/5/6/7).

Control the GPO pin (A4) level from I/O port A01h bit (3).

Control the GPO pin (A3/A2) level from I/O port A02h bit (6/7).

The bit is Set/Clear indicated output High/Low.

GPIO programming sample code

#define GPIO_PORT

0xA00

#define GPO4_HI

outportb(GPIO_PORT+7, 0x10)

#define GPO4_LO

outportb(GPIO_PORT+7, 0x00)

#define GPO6_HI

outportb(GPIO_PORT+7, 0x20)

#define GPO6_LO

outportb(GPIO_PORT+7, 0x00)

#define GPO8_HI

outportb(GPIO_PORT+7, 0x40)

#define GPO8_LO

outportb(GPIO_PORT+7, 0x00)

#define GPO10_HI

outportb(GPIO_PORT+7, 0x80)

#define GPO10_LO

outportb(GPIO_PORT+7, 0x00)

#define GPOA4_HI

outportb(GPIO_PORT+1, 0x08)

#define GPOA4_LO

outportb(GPIO_PORT+1, 0x00)

#define GPOA3_HI

outportb(GPIO_PORT+2, 0x40)

#define GPOA3_LO

outportb(GPIO_PORT+2, 0x00)

#define GPOA2_HI

outportb(GPIO_PORT+2, 0x80)

#define GPOA2_LO

outportb(GPIO_PORT+2, 0x00)

void main(void)

{

GPO4_HI;

GPO6_LO;

GPO8_HI;

GPO10_LO;

GPOA4_HI;

GPOA3_LO;

GPOA2_HI;

}

This manual is related to the following products: