NEXCOM NISE 103 User Manual

Page 80

Advertising
background image

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

67

Appendix B: GPI/O Programming Guide

NISE 103 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;

}

Advertising