P1001 / P1001E
Convertible Computer Modules
| User’s Manual
100
Chapter 5: Product application
5.1.1.4 Sample Code in C Language
5.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 enter Extended mode
<Select Logic Device>
WriteByte(AddrPort, 0x07)
WriteByte(
data
Port, 0x06)
//Select logic device 06h
<Input Mode Selection> //Set GP74 to GP77
input
Mode
WriteByte(AddrPort, 0x80)
// Select configuration register 80h
Write
Byte(DataPort,
0x0X
)
//Set (bit 4~7) = 0 to select GP 74~77 as Input mode.
<
input
Value>
WriteByte(AddrPort, 0x82)
// Select configuration register 82h
Read
Byte(DataPort, Value)
// Read bit 4~7(0xFx)= GP74 ~77
as High.
<Leave the Extended Function Mode>
WriteByte(AddrPort, 0xAA)
Summary of Contents for CV-108R-R10/P1001
Page 1: ......
Page 12: ...Product Introductions Chapter 1 ...
Page 51: ...Jumpers and Connectors Chapter 2 ...
Page 64: ...System Setup Chapter 3 ...
Page 77: ...BIOS Setup Chapter 4 ...
Page 97: ...Product Application Chapter 5 ...
Page 105: ...CV 100 P1000 Series Industrial Panel PC User s Manual 105 Chapter 2 Jumpers and Connectors ...
Page 106: ...Panel Mount Procedures Appendix ...