Acura Embedded AcuPanel 19 User Manual

Page 85

Advertising
background image

Appendix B: Digital I/O Programming Guide

GPIO programming sample code

#define DIO_PORT
#define DIO_PORTI

#define DO9

#define DO10

#define DO11

#define DO12

#define DO9_HI

#define DO9_LO

#define DO10_HI

#define DO10_LO

#define DO11_HI

#define DO11_LO

#define DO12_HI

#define DO12_LO

void main(void)

{

DO9_HI;

DO10_LO;

DO11_HI;

DO12_LO;

}

0xA05
0xA01

(0x01 <<4)

(0x01 <<5)

(0x01 <<6)

(0x01 <<7)

outportb(GPIO_PORT, 0x10)

outportb(GPIO_PORT, 0x00)

outportb(GPIO_PORT, 0x20)

outportb(GPIO_PORT, 0x00)

outportb(GPIO_PORT, 0x40)

outportb(GPIO_PORT, 0x00)

outportb(GPIO_PORTI, 0x80)

outportb(GPIO_PORTI, 0x00)

80

Advertising