beautypg.com

B: gpio p, Ppendix, Rogramming – NEXCOM NEX 880 User Manual

Page 58: Ample

background image

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

45

NEX 880/890 User Manual

Appendix B: GPIO Programming Sample Code

A

ppendix

B: GpiO p

rOGrAmminG

S

Ample

C

Ode

GPIO Programming Sample Code

#define GPIO_PORT

0x50F

#define GPO1

(1<<3)

#define GPO2

(1<<4)

void main(void)
{
#Set GPO to be low

outportb(GPIO_PORT, (inportb(GPIO_PORT) & (~GPO1) & (~GPO2) ));

# Set GPO to be high

outportb(GPIO_PORT, (inportb(GPIO_PORT) | GPO1 |GPO2 ));

}

This manual is related to the following products: