
Spectra GmbH & Co. KG
User Manual
[email protected] Spectra PowerBox 310 72
5.1.1.4 Sample Code in C Language
5.1.1.4.1 Control of GP30 to GP37 (DI1 ~ DI8)
#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
<Output/Input Mode Selection>
// Set GP30 to GP37 input Mode
WriteByte(AddrPort,
0xC0)
// Select configuration register C0h
WriteByte(DataPort, 0x00)
// Set (bit 0~7) = 0 to select GP 30~37 as Input mode.
<Input Value>
WriteByte(AddrPort, 0xC2)
// Select configuration register C2h
ReadByte(DataPort, Value)
// Assume read (bit 0~7) to Value is FFh , thus GP30 ~37 are all high.
// Assume read (bit 0~7) to Value is 00h , thus GP30 ~37 are all low.
// Read Value range: 00h~FFh
<Leave the Extended Function Mode>
WriteByte(AddrPort, 0xAA)
Summary of Contents for PowerBox 310 Series
Page 1: ...Spectra PowerBox 310 Series USER MANUAL Version 1 00 December 2021 ...
Page 13: ...Spectra GmbH Co KG User Manual sales spectra de Spectra PowerBox 310 13 ...
Page 44: ...Spectra GmbH Co KG User Manual sales spectra de Spectra PowerBox 310 44 ...
Page 47: ...Spectra GmbH Co KG User Manual sales spectra de Spectra PowerBox 310 47 Chapter 4 BIOS Setup ...
Page 70: ...Spectra GmbH Co KG User Manual sales spectra de Spectra PowerBox 310 70 ...
Page 71: ...Spectra GmbH Co KG User Manual sales spectra de Spectra PowerBox 310 71 ...