Appendix b, Digital input/output control – Lanner LEC-7105 User Manual

Page 31

Advertising
background image

31

Digital Input/Output Control

Appendix B

Embedded and Industrial Computing

Execute

Once build completed, application (and driver) is available

in bin sub-directory.
Just run “dio_tst” for Digital IO test. This program will drive

output pin with specific value and read status of input

pin. If you have external loopback which connects input

to output pins directly, the input value should be identical

with output value.
screen capture of the execution result:

Note: For more details, refer to the README file

contained within the program

For example

Setting GPO 60-63 all low.

1.
outportb(0x2e, 0x07); LDN8
outportb(0x2f, 0x08);

outportb(0x2e, 0x30); Setting GPIO6.
outportb(0x2f, 0x04);

outportb(0x2e, 0xE4); GP0 60-63
outportb(0x2f, 0x?0); ?:GP0 64-67 Unuse.

outportb(0x2e, 0xE6); GP0 60-63 Uninvert
outportb(0x2f, 0x?0); ?:GP0 64-67 Unuse.

outportb(0x2e, 0xE5); GP0 60-63 1:high
outportb(0x2f, 0x?0); 0:low

Setting GPI 24-27.

2.

outportb(0x2e, 0x07); LDN9
outportb(0x2f, 0x09);

outportb(0x2e, 0x30); Setting GPIO6.
outportb(0x2f, 0x04);

outportb(0x2e, 0xE4); GPI 24-27
outportb(0x2f, 0x?F); ?:GPI 20-23 Unuse.

outportb(0x2e, 0xE6); GPI 24-27 Uninvert
outportb(0x2f, 0x?0); ?:GPI 20-23 Unuse.

Advertising