NEXCOM EBC 355 User Manual

Page 63

Advertising
background image

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

49

EBC 355 User Manual

Appendix B: GPI/O Programming Guide

GPIO programming sample code

#define GPIO_PORT1

0xA03

#define GPIO_PORT2

0xA02

#define GPIO_PORT3

0xA07

#define GPO0

(0x01 << 6)

#define GPO1

(0x01 << 5)

#define GPO2

(0x01 << 0)

#define GPO3

(0x01 << 1)

#define GPO0_HI

outportb(GPIO_PORT1, GPO0)

#define GPO0_LO

outportb(GPIO_PORT1, 0x00)

#define GPO1_HI

outportb(GPIO_PORT2, GPO1)

#define GPO1_LO

outportb(GPIO_PORT2, 0x00)

#define GPO2_HI

outportb(GPIO_PORT3, GPO2)

#define GPO2_LO

outportb(GPIO_PORT3, 0x00)

#define GPO3_HI

outportb(GPIO_PORT3, GPO3)

#define GPO3_LO

outportb(GPIO_PORT3, 0x00)

void main(void)
{
GPO0_HI;
GPO1_LO;
GPO2_HI;
GPO3_LO;
}

Advertising