DI-1000 Series
Rugged Embedded Computer
| User’s Manual
87
6.1.1.4 Sample Code in C Language
6.1.1.4.1 Control of GP74 to GP77 (DI1 ~ DI4)
#define AddrPort 0x4E
#define DataPort 0x4F
<Enter the Extended Function Mode>
WriteByte(AddrPort, 0x87)
WriteByte(AddrPort, 0x87) //Must write twice to entering Extended mode
<Select Logic Device>
WriteByte(AddrPort, 0x07)
WriteByte(dataPort, 0x06)
//Select logic device 06h
<Input Mode Selection> //Set GP74 to GP77 input Mode
WriteByte(AddrPort, 0x80) // Select configuration register 80h
WriteByte(DataPort, 0x0X)
//Set (bit 4~7) = 0 to select GP 74~77 as Input mode.
<input Value>
WriteByte(AddrPort, 0x82) // Select configuration register 82h
ReadByte(DataPort, Value) // Read bit 4~7(0xFx)= GP74 ~77 as High.
<Leave the Extended Function Mode>
WriteByte(AddrPort, 0xAA)
Содержание DI-1000 Series
Страница 11: ...Product Introductions Chapter 1 ...
Страница 17: ...DI 1000 Series Rugged Embedded Computer User s Manual Unit mm 17 1 7 Mechanical Dimension ...
Страница 18: ...System Pin Definitions and Settings Chapter 2 ...
Страница 20: ...DI 1000 Series Rugged Embedded Computer User s Manual 20 2 2 2 Bottom View ...
Страница 28: ...Optional Module Pin Definitions and Settings Chapter 3 ...
Страница 31: ...System Setup Chapter 4 ...
Страница 61: ...BIOS Setup Chapter 5 ...
Страница 84: ...Product Application For DIO only Chapter 6 ...