001 /**
002 \file NiRioConstants.h
003 \author Erik Hons <erik.hons@ni.com>
004 \date 12/14/2004
005
006 \brief Public constants for the RIO services
007
008 � Copyright 2004. National Instruments. All rights reserved.
009 */
010
011 package com.ni.rio;
012
013 public interface NiRioConstants
014 {
015
016 // defines...
017 // type declarations (typedefs)...
018
019 //
020 // Basic constants.
021 //
022 public static final int kRioInvalid = 0xffffffff;
023 public static final int kRioMaxLen = 256;
024 public static final int kRioInvalidHandle = 0;
025
026 //
027 // Device Access
028 //
029
030 public static final byte kRioDeviceAccessDeny = '-';
031 public static final byte kRioDeviceAccessAllow = '+';
032
033 /**
034 DevUserData registered data structure for non R-series devices that
035 utilize RIO technology.
036 */
037
038 public static final int kRIODevUserDataKey = 0x4352; /// 'CR' for CompactRio
039
040 // constants...
041
042 // Timeouts
043 public static final int kRioTimeoutZero = 0;
044 public static final int kRioTimeoutInfinite = 0xFFFFFFFF;
045
046 //
047 // Device attribute identifiers
048 //
049 // NOTE: *** Maintain the enum ordering for client compatibility. (e.g.: the
050 // RIO attribute ring control in the FPGA plug-in code. ***
051 //
052
053 // 32-bit attributes
054 // Name = X, // AddedVersion: Comments
055 public static final int kRioInitialized = 0; // 200
056 public static final int kRioInterfaceNum = 1; // 200
057 public static final int kRioProductNum = 2; // 200
058 public static final int kRioVendorNum = 3; // 200
059 public static final int kRioSerialNum = 4; // 200
060 public static final int kRioSignature = 5; // 200
061 public static final int kRioRsrcType = 6; // 200
062 public static final int kRioDeviceMgr = 7; // 200: Obsolete in 230
063 public static final int kRioDefaultTimeout = 8; // 200
064 public static final int kRioLocalFifoRatio = 9; // 200: Obsolete in 230
065
066 // HACK HACK: PCI-SPECIFIC.
067 public static final int kRioBusNum = 10; // 200
068 public static final int kRioDeviceNum = 11; // 200
069 public static final int kRioFuncNum = 12; // 200
070
071 public static final int kRioRestrictedAccess = 13; // 220: Obsolete in 230
072 public static final int kRioCurrentVersion = 14; // 220
073 public static final int kRioOldestCompatibleVersion = 15; // 220
074 public static final int kRioClientIsBigEndian = 16; // 220: kFalse means little-endian
075 public static final int kRioFpgaInterruptControlOffset = 17; // 220
076
077 public static final int kRioNumMemWindows = 18; // 230
078
079 // ------------- HACK HACK: Keep in sequential order Until IO Mgr ---
080 // HACK HACK until we have the IO Manager. DO NOT INCLUDE INTO THE
081 // RING CONTROL!!!
082 public static final int kRioMemBaseBar0 = 19; // 230
083 public static final int kRioMemBaseBar1 = 20; // 230
084 public static final int kRioMemSizeBar0 = 21; // 230
085 public static final int kRioMemSizeBar1 = 22; // 230
086 // --------------- End HACK HACK ------------------------------------
087
088 public static final int kRioSessionState = 23; // 230
089 public static final int kRioPersonalityLockTimeout = 24; // 230
090 public static final int kRioAddressSpace = 25; // 230
091
092 public static final int kRioChassisNum = 27; // 230
093 public static final int kRioSlotNum = 28; // 230
094 public static final int kRioLocalFifoDefaultDepth = 29; // 230
095
096 public static final int kRioTriggerBusNum = 30; // 230
097 public static final int kRioTriggerReserveLine = 31; // 230
098 public static final int kRioTriggerUnreserveLine = 32; // 230
099 public static final int kRioTriggerReservedLines = 33; // 230
100
101 public static final int kRioIrqNodeReserve = 34; // 230
102 public static final int kRioFpgaInterruptEnable = 35; // 230
103
104 public static final int kRioIsItOkToDownload = 36; // 230
105
106 public static final int kRioFpgaResetOffset = 37; // 230
107 public static final int kRioFpgaResetWidthInBits = 38; // 230
108 public static final int kRioFpgaControlOffset = 39; // 230
109
110 public static final int kRioResetIfLastSession = 40; // 230
111
112 public static final int kRioHasDeviceAccess = 41; // 230
113
114 public static final int kRioBusInterfaceType = 42; // 240
115
116 // String attributes
117 public static final int kRioProductName = 0;
118 public static final int kRioWhatFpgaIsDoing = 1; // 230
119 public static final int kRioResourceName = 2; // 230
120
121 // Host attributes
122 public static final int kRioHostCurrentVersion = 0;
123 public static final int kRioHostOldestCompatibleVersion = 1;
124 public static final int kRioHostRpcServerPort = 2;
125 public static final int kRioHostRpcTimeout = 3; // seconds
126 public static final int kRioHostDeviceDiscoveryTimeout = 4;
127 public static final int kRioHostHasDeviceAccess = 5;
128 public static final int kRioHostRpcSessionTimeout = 6; // seconds
129
130 public static final int kRioHostAliases = 0;
131 public static final int kRioHostAlias = 1;
132 public static final int kRioHostDeviceAccess = 2;
133 public static final int kRioHostRecentDevices = 3;
134
135 public static final int kRioDynamicRpcServerPort = 0;
136
137 //
138 // IO Window types
139 //
140
141 public static final int kRioAddressSpaceMite = 1;
142 public static final int kRioAddressSpaceFpga = 2;
143
144 //
145 // Device block[Read|Write] attributes
146 //
147
148 public static final int kRioIoAttributeAccessByteWidthMask = 0x0F;
149 public static final int kRioIoAttributeFpgaIncrement = 0x10;
150 public static final int kRioIoAttributeDustMiteNtFlashBitstream = 0x20;
151
152 //
153 // Event types
154 //
155
156 public static final int kRioEventInvalidEvent = -1;
157 public static final int kRioEventFirstEvent = 0;
158 public static final int kRioEventPCIInterrupt = 0;
159 public static final int kRioEventRemoval = 1;
160 public static final int kRioEventMaxNumberOfEvents = 2; // Add all other events before this one
161
162 //
163 // Session states
164 //
165
166 public static final int kRioSSNothing = 1;
167 public static final int kRioSSExclusive = 2;
168 public static final int kRioSSInvariant = 4;
169 public static final int kRioSSOverride = 6;
170
171
172 /// Device signature information.
173
174 // The lower 32 bits are divided by:
175 // bits 28-31 busType , see nRioBusType
176 // bits 16-27 TBD
177 // bits 8-15 bus (0 - 255 ),
178 // bits 3-7 device number (0-31),
179 // bits 0-2 function number (0-7)
180 //
181 /// RIO Bus types.
182 public static final int kRioBusTypePci = 0x00000001;
183
184 public static final int kRioBusTypeShift = 28;
185 public static final int kRioBusTypeMask = 0xF; // bus type range: 0 - 15 (4 bits)
186
187 /// Signature bus number shift
188 public static final int kRioBusNumShift = 8;
189 public static final int kRioBusNumMask = 0xFF; // range: 0 - 255 (8 bits)
190
191 /// Signature device number shift
192 public static final int kRioSocketNumShift = 3;
193 public static final int kRioSocketNumMask = 0x1F; // range: 0 - 31 (5 bits)
194
195 /// Signature function number shift
196 public static final int kRioFunctionNumShift = 0;
197 public static final int kRioFunctionNumMask = 0x7; // range: 0 - 7 (3 bits)
198
199 /// RIO Device categories.
200 public static final int kRioDeviceCRio = 0x00000001; //!< compactRIO device
201 public static final int kRioDevicePxi = 0x00000002; //!< PXI device
202 public static final int kRioDeviceFW = 0x00000004; //!< FireWire (1394) device
203 public static final int kRioDeviceBB = 0x00000008; //!< BlueBonnet device
204 public static final int kRioDeviceSync = 0x73796E63; //!< 'sync' (NI-PAL ID)
205 public static final int kRioDeviceDaq = 0x20646171; //!< 'daq ' (NI-PAL ID for new sync)
206 public static final int kRioDeviceIMAQ = 0x696D6171; //!< 'imaq' (NI-PAL ID)
207
208 public static final int kRioDustMite = 0x00000001;
209 public static final int kRioDustMiteNT = 0x00000002;
210 public static final int kRioSTC2 = 0x00000003;
211
212 // declarations for globally-scoped globals...
213 // prototypes...
214 // inline methods and function macros...
215 }