B: gpio p, Ppendix, Rogramming – NEXCOM NEX 608 User Manual
Page 66: Ample
Advertising
Copyright © 2011 NEXCOM International Co., Ltd. All Rights Reserved.
53
NEX 608 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 ));
}
Advertising