CO
-
100/P1001
Series | User Manual
75
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(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 (0xFF)= GP74 ~77 as High.
Summary of Contents for CO-100/P1001 Series
Page 11: ...CO 100 P1001 Series User Manual 11 Chapter 1 Product Introductions ...
Page 17: ...CO 100 P1001 Series User Manual 17 Dimension CO W121C P1001 Unit mm CO W121C P1001E Unit mm ...
Page 20: ...CO 100 P1001 Series User Manual 20 Chapter 2 Jumpers Switches Connectors ...
Page 22: ...CO 100 P1001 Series User Manual 22 2 2 2 Bottom View ...
Page 31: ...CO 100 P1001 Series User Manual 31 Chapter 3 System Setup ...
Page 53: ...CO 100 P1001 Series User Manual 53 Chapter 4 BIOS Setup ...
Page 72: ...CO 100 P1001 Series User Manual 72 Chapter 5 Product Application ...
Page 80: ...CO 100 P1001 Series User Manual 80 ...
Page 81: ...CO 100 P1001 Series User Manual 81 Chapter 6 Optional Accessories ...