00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158 #ifndef _ACQ32IOCTL_H_
00159 #define _ACQ32IOCTL_H_
00160
00161 #include <asm/ioctl.h>
00162 #include <asm/types.h>
00163
00164
00165
00166
00167
00168 #define SEEK_TRIG (SEEK_END+1)
00169
00170
00171
00172
00173
00174 #define ACQ32_IOC_MAGIC 'a'
00175
00176 #define ACQ32_IOCRESET _IO(ACQ32_IOC_MAGIC, 0)
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187 #define ACQ32_IOCGMEM _IOR(ACQ32_IOC_MAGIC, 1, void*)
00188 #define ACQ32_IOSLIMIT _IO (ACQ32_IOC_MAGIC, 2 ) // set readout limit
00189
00190
00191
00192 #define ACQ32_IOSFORMAT _IO (ACQ32_IOC_MAGIC, 3 ) // set output format
00193
00194 #define ACQ32_IOARMSPIN _IO(ACQ32_IOC_MAGIC, 4 ) // make ARM spin
00195 #define ACQ32_IOARMRESET _IO(ACQ32_IOC_MAGIC, 5 ) // reset ARM
00196
00197 #define ACQ32_IOSDEBUG _IOW(ACQ32_IOC_MAGIC, 6, int) // set debug level
00198
00199
00200 enum ChannelMode {
00201 CM_BINARY,
00202 CM_HEX,
00203 CM_DEC,
00204 CM_VOLTS,
00205 CM_BIGEND,
00206
00207 CM_EXCLUSIVE_OPTS = 0xf,
00208
00209 CM_LINENUMS = 0x40,
00210 CM_DOS_LINES = 0x80
00211 };
00212
00213
00214
00215
00216
00217 #define ACQ32_IO_MBX_NR 10
00218
00219 #define ACQ32_IOSMBX( ix ) \
00220 _IO (ACQ32_IOC_MAGIC, ACQ32_IO_MBX_NR+(ix) )
00221
00222 #define ACQ32_IOGMBX( ix ) \
00223 _IOR(ACQ32_IOC_MAGIC, ACQ32_IO_MBX_NR +(ix), unsigned*)
00224
00225 #define ACQ32_IOSROM_WORD_A01 _IO( ACQ32_IOC_MAGIC, 14 )
00226 #define ACQ32_IOCHARDRESET _IO (ACQ32_IOC_MAGIC, 15 )
00227 #define ACQ32_IOSENDI2O _IO (ACQ32_IOC_MAGIC, 16 )
00228 #define ACQ32_IOREAD_LOCALBUF _IO (ACQ32_IOC_MAGIC, 17 )
00229 #define ACQ32_IOREAD_GETPHYSICAL _IO (ACQ32_IOC_MAGIC, 18 )
00230 #define ACQ32_IOG_PCIREGS_OFFSET _IOR(ACQ32_IOC_MAGIC, 19, unsigned* )
00231
00232
00233
00234
00235
00236 struct ACQ32_RW_DEF {
00237 unsigned offset;
00238 union {
00239 __u16 w;
00240 __u32 l;
00241 }
00242 data;
00243 };
00244
00245 #define ACQ32_IOG_READ32 _IO (ACQ32_IOC_MAGIC, 20 )
00246 #define ACQ32_IOS_WRITE32 _IO (ACQ32_IOC_MAGIC, 21 )
00247 #define ACQ32_IOG_READ16 _IO (ACQ32_IOC_MAGIC, 22 )
00248 #define ACQ32_IOS_WRITE16 _IO (ACQ32_IOC_MAGIC, 23 )
00249
00250
00251
00252
00253 struct ACQ32_WAIT_DEF {
00254 unsigned event_mask;
00255 unsigned timeout;
00256 };
00257
00258 #define ACQ32_IOS_WAIT_EVENT _IO (ACQ32_IOC_MAGIC, 24 )
00259
00260
00261
00262
00263
00264
00265 #define ACQ32_IOS_INTS_ENABLE _IOW(ACQ32_IOC_MAGIC, 25, unsigned )
00266 #define ACQ32_IOS_INTS_DISABLE _IOW(ACQ32_IOC_MAGIC, 26, unsigned )
00267
00268
00269
00270
00271
00272
00273
00274
00275 #define ACQ32_IOS_SWALLOW_KMEM _IOW(ACQ32_IOC_MAGIC, 27, unsigned )
00276 #define ACQ32_IOS_VALIDATE_BIGBUF _IOW(ACQ32_IOC_MAGIC, 28, unsigned )
00277
00278 #define ACQ32_IOC_MAXNR 29
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290 #define CC_FORMAT "format"
00291 #define CC_FORMAT_BIN "bin"
00292 #define CC_FORMAT_BIGEND "bigendian"
00293 #define CC_FORMAT_HEX "hex"
00294 #define CC_FORMAT_DEC "dec"
00295 #define CC_FORMAT_VOLTS "volts"
00296 #define CC_FORMAT_LINENUMS "lines"
00297 #define CC_FORMAT_DOS "dos"
00298
00299 #define CC_LIMIT "limit" // limit n - limit output to n samples
00300
00301 #define CC_SEEK "seek" // seek {whence} n
00302 #define CC_SEEK_BEGIN "start"
00303 #define CC_SEEK_END "end"
00304 #define CC_SEEK_CURRENT "current"
00305 #define CC_SEEK_TRIG "trig"
00306
00307 #define CC_STREAM "stream" // stream [stride [, mean]]
00308
00309
00310
00311
00312
00313 #define MC_GET_HELP "help"
00314 #define MC_GET_NUMCHANNELS "getNumChannels"
00315 #define MC_GET_NUMSAMPLES "getNumSamples"
00316 #define MC_GET_SETSAMPLES "getSetNumSamples"
00317 #define MC_GET_STATE "getState"
00318
00319 #define MC_SET_CHANNEL_MASK "setChannelMask" // <mask> {0|1}*N
00320 #define MC_GET_CHANNEL_MASK "getChannelMask"
00321
00322 #define MC_GET_MEMORY_DEPTH "getMemoryDepth" // <channel>
00323 #define MC_SET_MODE "setMode" // <mode> <samples> [RUN_BLOCK]
00324 #define MC_GET_MODE "getMode" // <mode> <samples>
00325 #define MC_SET_ARM "setArm"
00326 #define MC_SET_ABORT "setAbort"
00327
00328 #define MC_SET_DATA_ROUTE "setDataRoute" // raw, row, channel
00329
00330 #define MC_SET_DISTRIBUTOR "setDistributor" // 0..n
00331
00332
00333 #define MC_MODE_GATED_TRANSIENT "GATED_TRANSIENT"
00334 #define MC_MODE_GATED_CONTINUOUS "GATED_CONTINUOUS"
00335 #define MC_MODE_SOFT_TRANSIENT "SOFT_TRANSIENT"
00336 #define MC_MODE_SOFT_CONTINUOUS "SOFT_CONTINUOUS"
00337 #define MC_MODE_TRIGGERED_CONTINUOUS "TRIGGERED_CONTINUOUS"
00338
00339 #define MC_SET_MODE_GC "setModeGatedContinuous" // <pre> <post>
00340 #define MC_SET_MODE_TRC "setModeTriggeredContinuous" // <pre> <post> [DIx]
00341
00342 #define DIX_DEFAULT 4 // for reference - this is the default DIx trigger line
00343
00344
00345 #define MC_STATE_STOP "ST_STOP"
00346 #define MC_STATE_ARM "ST_ARM"
00347 #define MC_STATE_RUN "ST_RUN"
00348 #define MC_STATE_TRIGGER "ST_TRIGGER"
00349 #define MC_STATE_POSTPROCESS "ST_POSTPROCESS"
00350 #define MC_STATE_CAPDONE "ST_CAPDONE"
00351
00352 #define MC_MODE_RUN_BLOCK "RUN_BLOCK"
00353
00354 #define MC_SET_ARMED "setArmed"
00355 #define MC_SET_ABORT "setAbort"
00356
00357 #define MC_GET_NUMSAMPLES "getNumSamples"
00358
00359 #define MC_SET_INTERNAL_CLOCK "setInternalClock" // <hz> [DOx]
00360 #define MC_GET_INTERNAL_CLOCK "getInternalClock"
00361 #define MC_SET_SAMPLE_TAGGING "setSampleTagging"
00362 #define MC_SET_EXTERNAL_CLOCK "setExternalClock" // <DIx> [DOx <div>]
00363
00364 #define MC_BIGDUMP "bigdump"
00365 #define MC_GET_FWREV "getFwrev"
00366 #define MC_GET_CONFIG "getConfig"
00367 #define MC_GET_CALINFO "getCalinfo"
00368 #define MC_GET_CAPTURESTATS "getCaptureStats"
00369 #define MC_GET_DEBUG "getDebug"
00370
00371 #define MC_GET_MAX_CHANNELS "getAvailableChannels"
00372 #define MC_GET_VRANGE "getVoltsRange"
00373
00374
00375 #define MC_SET_CAL "setCal" // setCal <cal-image>
00376 #define MC_WAIT_STATE "waitState" // waitState <STATE> <timeout>
00377
00378 #define MC_RESERVE_AO "reserveAO" // reserveAO <nsamples>
00379 #define MC_GET_RESERVED_AO "getReservedAO" // get reservation size
00380
00381
00382
00383
00384
00385 #define MC_TH_CLEAR_ALL "clearThresholds"
00386 #define MC_TH_SELECT "selectThresholdDistributor" // select threshold [option]
00387 #define MC_TH_SELECT1 "selectThresholdDetector" // ditto, preferred
00388
00389 #define MC_TH_BILEVEL "BILEVEL" // two levels, single board
00390 #define MC_TH_BILEVEL_MULTI "BILEVEL_MULTI" // two levels, multi board
00391 #define MC_TH_EDGE "EDGE" // edge trigger, single board
00392 #define MC_TH_EDGE_MULTI "EDGE_MULTI" // edge trigger, multi board
00393 #define MC_TH_FAST_MULTI "FAST_MULTI" // multi board sink, trigger source defined eleswhere
00394
00395 #define MC_TH_CHANNEL_SET "setChannelThreshold" // BILEVEL: <channel> <above> <below>
00396
00397
00398
00399
00400
00401
00402 #define MC_SET_SYNC_ROUTE "setSyncRoute" // <func> <dest-mask>
00403 #define MC_GET_SYNC_ROUTE "getSyncRoute" // no-args - prints all routes
00404
00405 #define MC_SET_USER_LED "setUserLed" // setUserLed <led-num> <mode>
00406
00407
00408 #define MC_SET_USER_LED_ON "ON"
00409 #define MC_SET_USER_LED_OFF "OFF"
00410 #define MC_SET_USER_LED_FLASH "FLASH"
00411
00412
00413
00414
00415
00416
00417
00418 #define SC_SET_DIO "setDIO" // setDIO <dio-mask>
00419 #define SC_GET_DIO "getDIO" // getDIO
00420 #define SC_SET_CHANNEL "setChannel" // setChannel <ch>,<g1>,<g2>,<v_ex>
00421 #define SC_SET_STREAMING "stream" // stream <stride> <mean>
00422 #define DIO_MASK_INPUT '-'
00423 #define DIO_MASK_OUTPUT1 '1'
00424 #define DIO_MASK_OUTPUT0 '0'
00425 #define DIO_MASK_INPUT0 'L'
00426 #define DIO_MASK_INPUT1 'H'
00427 #define DIO_CT_ACTIVE 'A'
00428 #define DIO_CT_INACTIVE 'x'
00429
00430
00431
00432
00433 #define ACQ32_ACK "ACQ32:"
00434 #define ACQ32_ACK_FAIL "ERROR"
00435 #define SIGCOND_ACK "SIGCOND:"
00436
00437
00438
00439
00440
00441 enum {
00442 EACQ32_NO_INCOMING_I2O = 3200,
00443 EACQ32_NO_MAPPING,
00444 EACQ32_OUT_OF_MAPPING_RANGE,
00445 EACQ32_OFFSET_NOT_ON_WHOLE_BUFFER_BOUNDARY
00446 };
00447
00448
00449
00450
00451
00452 struct READ_LOCALBUF_DESCR {
00453 short* buffer;
00454 int nsamples;
00455 int istart;
00456 int istride;
00457 int flags;
00458 };
00459
00460 #define READ_LOCALBUF_DESCR_FLAGS_NOWAIT 0x80000000
00461
00462 #define READ_LOCALBUF_MAXCHUNK 0x200000 // MAXCHUNKSIZE
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472 #define MI( n ) "MI"#n // n= { 0..5 }
00473 #define MO( n ) "MO"#n // n= { 0..5 }
00474 #define J5( n ) "J5"#n // n= { 0..3 }
00475 #define J3( n ) "J3"#n // n= { 4, 5 }
00476 #define PXI_TRIG( n ) "PXI_TRIG"#n // n= { 0..7 }
00477 #define PXI_STAR "PXI_STAR"
00478 #define PXI_CLOCK10 "PXI_CLOCK10"
00479
00480
00481 #define DI( n ) "DI"#n // n = { 0..5 }
00482 #define AICLK "AICLK"
00483 #define AITRIG "AITRIG"
00484 #define AOCLK "AOCLK"
00485 #define AOTRIG "AOTRIG"
00486 #define DOCLK "DOCLK"
00487 #define DOTRIG "DOTRIG"
00488
00489
00490
00491 #define DO( n ) "DO"#n // n = { 0..5 }
00492
00493
00494
00495
00496 #define GUT_FXN_AO "AO"
00497 #define GUT_FXN_AI "AI"
00498 #define GUT_FXN_DO "DO"
00499
00500 #define GUT_PHASE( p ) "P"#p // p { 1, 2 }
00501 #define GUT_EVENT( e ) "E"#e // e { 1, 2, 3 }
00502
00503 #define GUT_SETPHASE "setPhase" // setPhase [f] <p> <n> { p = 1, 2 }
00504 #define GUT_GETPHASE "getPhase" // getPhase [f] <p> <key> { p = 1, 2 }
00505
00506
00507 #define GUT_GETPHASE_KEY_REQUESTED_SAMPLES "requested-samples"
00508 #define GUT_GETPHASE_KEY_ACTUAL_SAMPLES "actual-samples"
00509 #define GUT_GETPHASE_KEY_STATE "state"
00510
00511 #define GUT_SETEVENT "setEvent" // setEvent [f] <e> <or conditions> { e = 1, 2, 3 }
00512 #define GUT_GETEVENT "getEvent" // getEvent [f] <e> { e = 1, 2, 3 }
00513 #define GUT_FIRE_EVENT "fireEvent" // fireEvent [f] <e> { e = 1, 2, 3 }
00514
00515 #define SOFT_CLOCK "SOFT_CLOCK"
00516 #define INTERNAL_CLOCK "INTERNAL_CLOCK"
00517
00518 #define GUT_SET_CLOCK "setClock" // setClock [f] { <d>, SOFT_CLOCK INTERNAL_CLOCK }
00519
00520 #define GUT_FIRE_CLOCK "clockNow"
00521
00522 #define GUT_RESET "resetGUT"
00523
00524
00525
00526
00527 #define EV_TRUE "EV_TRUE" // - the event fires immediately
00528 #define EV_SOFT "EV_SOFT" //- the event is fired "fireEvent"
00529 #define EV_TRIGGER_RISING "EV_TRIGGER_RISING" // <d> - the event is a rising edge of the external trigger signal
00530 #define EV_TRIGGER_FALLING "EV_TRIGGER_FALLING" // <d> - the event is a falling edge of the external trigger signal
00531 #define EV_NONE "EV_NONE" // - clears all for this event
00532 #define EV_DATA_EXCEEDS "EV_DATA_EXCEEDS" // <channel> <value>
00533 #define EV_DATA_BELOW "EV_DATA_BELOW" // <channel> <value>
00534
00535
00536 #endif // _ACQ32IOCTL_H_
00537