30 extern int intUnlock();
36 intLockKeya = intLock(); \ 40 intUnlock(intLockKeya); \ 53 volatile unsigned int fp[4];
54 volatile unsigned int GTP[8];
55 volatile unsigned int gen[8];
56 volatile unsigned int blank[(0x334-0x1D0)/4];
68 volatile unsigned int data;
74 unsigned int blank[(0x180-0x168)/4];
94 volatile unsigned int sync;
95 volatile unsigned int busy;
106 volatile unsigned int GTPprescale[4];
107 volatile unsigned int fpInputPrescale[4];
129 volatile unsigned int blockStatus[4];
134 volatile unsigned int hfbr_tiID[2];
142 volatile unsigned int fpDelay[11];
154 unsigned int blank3[(0x1080-0x934)/4];
155 volatile unsigned int GTPTriggerTable[(0x1090-0x1080)/4];
156 volatile unsigned int FPTriggerTable[(0x10A0-0x1090)/4];
158 unsigned int blank4[(0xFFFC-0x10C0)/4];
160 volatile unsigned int JTAGPROMBase[(0x20000-0x10000)/4];
161 volatile unsigned int JTAGFPGABase[(0x30000-0x20000)/4];
162 volatile unsigned int SWA[(0x40000-0x30000)/4];
163 volatile unsigned int SWB[(0x50000-0x40000)/4];
169 #define TS_READOUT_EXT_INT 0 170 #define TS_READOUT_EXT_POLL 2 173 #define TS_FIRMWARE_ID_MASK 0xFFFF0000 174 #define TS_FIRMWARE_TYPE_MASK 0x0000F000 175 #define TS_FIRMWARE_TYPE_PROD 1 176 #define TS_FIRMWARE_TYPE_P 3 177 #define TS_FIRMWARE_MAJOR_VERSION_MASK 0x00000FF0 178 #define TS_FIRWMARE_MINOR_VERSION_MASK 0x0000000F 180 #define TS_SUPPORTED_FIRMWARE 0x71 181 #define TS_SUPPORTED_TYPE TS_FIRMWARE_TYPE_P 186 #define TS_TRIGSRC_PULSER 5 187 #define TS_TRIGSRC_EXT 6 190 #define TS_BOARDID_TYPE_TIDS 0x71D5 191 #define TS_BOARDID_TYPE_TI 0x7100 192 #define TS_BOARDID_TYPE_TS 0x7500 193 #define TS_BOARDID_TYPE_TD 0x7D00 194 #define TS_BOARDID_TYPE_MASK 0xFF000000 195 #define TS_BOARDID_PROD_MASK 0x00FF0000 196 #define TS_BOARDID_GEOADR_MASK 0x00001F00 197 #define TS_BOARDID_CRATEID_MASK 0x000000FF 200 #define TS_FIBER_LOW_POWER (1<<1) 201 #define TS_FIBER_I2C_ACTIVE (1<<2) 202 #define TS_FIBER_RESET (1<<3) 203 #define TS_FIBER_ENABLE_P0 (1<<8) 207 #define TS_INTSETUP_VECTOR_MASK 0x000000FF 208 #define TS_INTSETUP_LEVEL_MASK 0x00000F00 209 #define TS_INTSETUP_ENABLE (1<<16) 212 #define TS_TRIGDELAY_TRIG1_DELAY_MASK 0x000000FF 213 #define TS_TRIGDELAY_TRIG1_WIDTH_MASK 0x0000FF00 214 #define TS_TRIGDELAY_TRIG2_DELAY_MASK 0x00FF0000 215 #define TS_TRIGDELAY_TRIG2_WIDTH_MASK 0xFF000000 218 #define TS_ADR32_MBLK_ADDR_MAX_MASK 0x000003FE 219 #define TS_ADR32_MBLK_ADDR_MIN_MASK 0x003FC000 220 #define TS_ADR32_BASE_MASK 0xFF800000 223 #define TS_BLOCKLEVEL_MASK 0x000000FF 224 #define TS_BLOCKLEVEL_CURRENT_MASK 0x00FF0000 225 #define TS_BLOCKLEVEL_RECEIVED_MASK 0xFF000000 228 #define TS_DATAFORMAT_TWOBLOCK_PLACEHOLDER (1<<0) 229 #define TS_DATAFORMAT_TIMING_WORD (1<<1) 230 #define TS_DATAFORMAT_HIGHERBITS_WORD (1<<2) 231 #define TS_DATAFORMAT_WORDS_MASK 0x00000007 232 #define TS_DATAFORMAT_GTPINPUT_READOUT (1<<3) 233 #define TS_DATAFORMAT_FPINPUT_READOUT (1<<4) 236 #define TS_VMECONTROL_BERR (1<<0) 237 #define TS_VMECONTROL_TOKEN (1<<1) 238 #define TS_VMECONTROL_MBLK (1<<2) 239 #define TS_VMECONTROL_A32M (1<<3) 240 #define TS_VMECONTROL_A32 (1<<4) 241 #define TS_VMECONTROL_INT (1<<7) 242 #define TS_VMECONTROL_I2CDEV_HACK (1<<8) 243 #define TS_VMECONTROL_TOKEN_HI (1<<9) 244 #define TS_VMECONTROL_FIRST_BOARD (1<<10) 245 #define TS_VMECONTROL_LAST_BOARD (1<<11) 246 #define TS_VMECONTROL_BUFFER_DISABLE (1<<12) 247 #define TS_VMECONTROL_DRIVE_TSIO_EN (1<<20) 248 #define TS_VMECONTROL_BLOCKLEVEL_UPDATE (1<<21) 249 #define TS_VMECONTROL_SLOWER_TRIGGER_RULES (1<<31) 252 #define TS_TRIGGER_SOURCEMASK 0x000003FF 253 #define TS_TRIGGER_P0 (1<<0) 254 #define TS_TRIGGER_HFBR1 (1<<1) 255 #define TS_TRIGGER_LOOPBACK (1<<2) 256 #define TS_TRIGGER_FPTRG (1<<3) 257 #define TS_TRIGGER_VME (1<<4) 258 #define TS_TRIGGER_TSINPUTS (1<<5) 259 #define TS_TRIGGER_TSREV2 (1<<6) 260 #define TS_TRIGGER_PULSER (1<<7) 261 #define TS_TRIGGER_ENABLE (1<<8) 262 #define TS_TRIGGER_P2BUSY (1<<9) 263 #define TS_TRIGGER_PART(pID) (1<<(pID+11)) 264 #define TS_TRIGGER_MONITOR_MASK 0xFFFF0000 267 #define TS_SYNC_SOURCEMASK 0x0000FFFF 268 #define TS_SYNC_P0 (1<<0) 269 #define TS_SYNC_HFBR1 (1<<1) 270 #define TS_SYNC_HFBR5 (1<<2) 271 #define TS_SYNC_FP (1<<3) 272 #define TS_SYNC_LOOPBACK (1<<4) 273 #define TS_SYNC_MONITOR_MASK 0xFFFF0000 277 #define TS_BUSY_SOURCEMASK 0x0000FFFF 278 #define TS_BUSY_SWA (1<<0) 279 #define TS_BUSY_SWB (1<<1) 280 #define TS_BUSY_P2 (1<<2) 281 #define TS_BUSY_FP_FTDC (1<<3) 282 #define TS_BUSY_FP_FADC (1<<4) 283 #define TS_BUSY_FP (1<<5) 284 #define TS_BUSY_P2_TRIGGER_INPUT (1<<6) 285 #define TS_BUSY_LOOPBACK (1<<7) 286 #define TS_BUSY_TI_A (1<<8) 287 #define TS_BUSY_TI_B (1<<9) 288 #define TS_BUSY_HFBR_MASK ((1<<9) | (1<<8)) 289 #define TS_BUSY_INT (1<<10) 290 #define TS_BUSY_ALL_BRANCHES (1<<11) 291 #define TS_BUSY_BRANCH1 (1<<12) 292 #define TS_BUSY_BRANCH2 (1<<13) 293 #define TS_BUSY_BRANCH3 (1<<14) 294 #define TS_BUSY_BRANCH4 (1<<15) 296 #define TS_BUSY_MONITOR_SWA (1<<16) 297 #define TS_BUSY_MONITOR_SWB (1<<17) 298 #define TS_BUSY_MONITOR_P2 (1<<18) 299 #define TS_BUSY_MONITOR_FP_FTDC (1<<19) 300 #define TS_BUSY_MONITOR_FP_FADC (1<<20) 301 #define TS_BUSY_MONITOR_FP (1<<21) 302 #define TS_BUSY_MONITOR_LOOPBACK (1<<23) 304 #define TS_BUSY_MONITOR_TS (1<<27) 306 #define TS_BUSY_MONITOR_TI_A (1<<28) 307 #define TS_BUSY_MONITOR_TI_B (1<<29) 308 #define TS_BUSY_MONITOR_FIBER_BUSY(x) (1<<(x+27)) 309 #define TS_BUSY_MONITOR_DUPL (1<<31) 310 #define TS_BUSY_MONITOR_MASK 0xFFFF0000 313 #define TS_CLOCK_INTERNAL (0) 314 #define TS_CLOCK_EXTERNAL (1) 315 #define TS_CLOCK_INPUT_MIX_CONTROL_MASK 0x00000030 316 #define TS_CLOCK_INPUT_MIX_ENABLE (1<<4) 319 #define TS_TRIG1PRESCALE_MASK 0x0000FFFF 322 #define TS_BLOCKBUFFER_BUFFERLEVEL_MASK 0x000000FF 323 #define TS_BLOCKBUFFER_BLOCKS_READY_MASK 0x0000FF00 324 #define TS_BLOCKBUFFER_TRIGGERS_IN_BLOCK 0x00FF0000 325 #define TS_BLOCKBUFFER_BLOCKS_NEEDACK_MASK 0x7F000000 326 #define TS_BLOCKBUFFER_BREADY_INT_MASK 0x0F000000 327 #define TS_BLOCKBUFFER_BUSY_ON_BLOCKLIMIT (1<<28) 328 #define TS_BLOCKBUFFER_SYNCRESET_REQUESTED (1<<30) 329 #define TS_BLOCKBUFFER_SYNCEVENT (1<<31) 332 #define TS_TRIGGERRULE_RULE1_MASK 0x000000FF 333 #define TS_TRIGGERRULE_RULE2_MASK 0x0000FF00 334 #define TS_TRIGGERRULE_RULE3_MASK 0x00FF0000 335 #define TS_TRIGGERRULE_RULE4_MASK 0xFF000000 338 #define TS_TRIGGERWINDOW_COINC_MASK 0x000000FF 339 #define TS_TRIGGERWINDOW_INHIBIT_MASK 0x0000FF00 340 #define TS_TRIGGERWINDOW_TRIG21_DELAY_MASK 0x00FF0000 343 #define TS_OUTPUT_FP_MASK 0x0000003F 344 #define TS_OUTPUT_FP_1 (1<<0) 345 #define TS_OUTPUT_FP_2 (1<<1) 346 #define TS_OUTPUT_FP_3 (1<<2) 347 #define TS_OUTPUT_FP_4 (1<<3) 348 #define TS_OUTPUT_FP_5 (1<<4) 349 #define TS_OUTPUT_FP_6 (1<<5) 350 #define TS_OUTPUT_BLOCKS_FOR_INT_MASK 0xFFFF0000 353 #define TS_FIBERSYNCDELAY_HFBR1_SYNCDELAY_MASK 0x0000FF00 354 #define TS_FIBERSYNCDELAY_LOOPBACK_SYNCDELAY_MASK 0x00FF0000 355 #define TS_FIBERSYNCDELAY_HFBR5_SYNCDELAY_MASK 0xFF000000 358 #define TS_DUPL_LOCAL_TRIG_RULE_MASK 0x0000007F 359 #define TS_DUPL_LOCAL_TRIG_WIDTH_MASK 0x0000FF00 360 #define TS_DUPL_FAST_CLEAR_WIDTH_MASK 0x00FF0000 361 #define TS_DUPL_FAST_CLEAR_VETO_WIDTH_MASK 0xFF000000 364 #define TS_SPECIALEVTYPES_MULT_GTP_OR_FP_MASK 0x000000FF 365 #define TS_SPECIALEVTYPES_GTP_AND_FP_MASK 0x0000FF00 366 #define TS_SPECIALEVTYPES_VME_MASK 0x00FF0000 367 #define TS_SPECIALEVTYPES_PULSER_MASK 0xFF000000 370 #define TS_SYNCCOMMAND_VME_CLOCKRESET 0x11 371 #define TS_SYNCCOMMAND_CLK250_RESYNC 0x22 372 #define TS_SYNCCOMMAND_AD9510_RESYNC 0x33 373 #define TS_SYNCCOMMAND_GTP_STATUSB_RESET 0x44 374 #define TS_SYNCCOMMAND_TRIGGERLINK_ENABLE 0x55 375 #define TS_SYNCCOMMAND_TRIGGERLINK_DISABLE 0x77 376 #define TS_SYNCCOMMAND_SYNCRESET_HIGH 0x99 377 #define TS_SYNCCOMMAND_TRIGGER_READY_RESET 0xAA 378 #define TS_SYNCCOMMAND_RESET_EVNUM 0xBB 379 #define TS_SYNCCOMMAND_SYNCRESET_LOW 0xCC 380 #define TS_SYNCCOMMAND_SYNCRESET 0xDD 381 #define TS_SYNCCOMMAND_SYNCRESET_4US 0xEE 382 #define TS_SYNCCOMMAND_SYNCCODE_MASK 0x000000FF 385 #define TS_SYNCDELAY_MASK 0x0000007F 388 #define TS_SYNCWIDTH_MASK 0x7F 389 #define TS_SYNCWIDTH_LONGWIDTH_ENABLE (1<<7) 392 #define TS_TRIGGERCOMMAND_VALUE_MASK 0x000000FF 393 #define TS_TRIGGERCOMMAND_CODE_MASK 0x00000F00 394 #define TS_TRIGGERCOMMAND_TRIG1 0x00000100 395 #define TS_TRIGGERCOMMAND_TRIG2 0x00000200 396 #define TS_TRIGGERCOMMAND_SYNC_EVENT 0x00000300 397 #define TS_TRIGGERCOMMAND_SET_BLOCKLEVEL 0x00000800 401 #define TS_RANDOMPULSER_TRIG1_RATE_MASK 0x0000000F 402 #define TS_RANDOMPULSER_TRIG1_ENABLE (1<<7) 403 #define TS_RANDOMPULSER_TRIG2_RATE_MASK 0x00000F00 404 #define TS_RANDOMPULSER_TRIG2_ENABLE (1<<15) 407 #define TS_FIXEDPULSER1_NTRIGGERS_MASK 0x0000FFFF 408 #define TS_FIXEDPULSER1_PERIOD_MASK 0x7FFF0000 409 #define TS_FIXEDPULSER1_PERIOD_RANGE (1<<31) 412 #define TS_FIXEDPULSER2_NTRIGGERS_MASK 0x0000FFFF 413 #define TS_FIXEDPULSER2_PERIOD_MASK 0x7FFF0000 414 #define TS_FIXEDPULSER2_PERIOD_RANGE (1<<31) 417 #define TS_NBLOCKS_COUNT_MASK 0x00FFFFFF 418 #define TS_NBLOCKS_EVENTS_IN_BLOCK_MASK 0xFF000000 425 #define TS_GTPSTATUSA_RESET_DONE_MASK 0x000000FF 426 #define TS_GTPSTATUSA_PLL_LOCK_MASK 0x00000F00 429 #define TS_GTPSTATUSB_CHANNEL_BONDING_MASK 0x000000FF 430 #define TS_GTPSTATUSB_DATA_ERROR_MASK 0x0000FF00 431 #define TS_GTPSTATUSB_DISPARITY_ERROR_MASK 0x00FF0000 432 #define TS_GTPSTATUSB_DATA_NOT_IN_TABLE_ERROR_MASK 0xFF000000 435 #define TS_GTPTRIGGERBUFFERLENGTH_GLOBAL_LENGTH_MASK 0x000007FF 436 #define TS_GTPTRIGGERBUFFERLENGTH_SUBSYS_LENGTH_MASK 0x07FF0000 437 #define TS_GTPTRIGGERBUFFERLENGTH_HFBR1_MGT_ERROR (1<<28) 438 #define TS_GTPTRIGGERBUFFERLENGTH_CLK250_DCM_LOCK (1<<29) 439 #define TS_GTPTRIGGERBUFFERLENGTH_CLK125_DCM_LOCK (1<<30) 440 #define TS_GTPTRIGGERBUFFERLENGTH_VMECLK_DCM_LOCK (1<<31) 443 #define TS_BLOCKSTATUS_NBLOCKS_READY0 0x000000FF 444 #define TS_BLOCKSTATUS_NBLOCKS_NEEDACK0 0x0000FF00 445 #define TS_BLOCKSTATUS_NBLOCKS_READY1 0x00FF0000 446 #define TS_BLOCKSTATUS_NBLOCKS_NEEDACK1 0xFF000000 449 #define TS_ADR24_ADDRESS_MASK 0x0000001F 450 #define TS_ADR24_HARDWARE_SET_MASK 0x000003E0 451 #define TS_ADR24_TM_NBLOCKS_READY1 0x00FF0000 452 #define TS_ADR24_TM_NBLOCKS_NEEDACK1 0xFF000000 455 #define TS_SYNCEVENTCTRL_NBLOCKS_MASK 0x00FFFFFF 458 #define TS_EVENTNUMBER_FIBER_A_ENABLE (1<<0) 459 #define TS_EVENTNUMBER_FIBER_B_ENABLE (1<<1) 460 #define TS_EVENTNUMBER_FIBER_A_TRANSCEIVER_MISSING (1<<4) 461 #define TS_EVENTNUMBER_FIBER_A_INT_NOT_REQUESTED (1<<5) 462 #define TS_EVENTNUMBER_FIBER_B_TRANSCEIVER_MISSING (1<<6) 463 #define TS_EVENTNUMBER_FIBER_B_INT_NOT_REQUESTED (1<<7) 464 #define TS_EVENTNUMBER_HI_MASK 0xFFFF0000 467 #define TS_ID_TRIGSRC_ENABLE_MASK 0x000000FF 468 #define TS_ID_CRATEID_MASK 0x0000FF00 471 #define TS_RESET_I2C (1<<1) 472 #define TS_RESET_JTAG (1<<2) 473 #define TS_RESET_SFM (1<<3) 474 #define TS_RESET_SOFT (1<<4) 475 #define TS_RESET_BUSYACK (1<<7) 476 #define TS_RESET_CLK250 (1<<8) 477 #define TS_RESET_CLK200 (1<<8) 478 #define TS_RESET_CLK125 (1<<9) 479 #define TS_RESET_MGT (1<<10) 480 #define TS_RESET_AUTOALIGN_HFBR1_SYNC (1<<11) 481 #define TS_RESET_AUTOALIGN_HFBR5_SYNC (1<<12) 482 #define TS_RESET_RAM_WRITE (1<<12) 483 #define TS_RESET_IODELAY (1<<14) 484 #define TS_RESET_MEASURE_LATENCY (1<<15) 485 #define TS_RESET_TAKE_TOKEN (1<<16) 486 #define TS_RESET_FORCE_SYNCEVENT (1<<20) 487 #define TS_RESET_SYNCRESET_REQUEST (1<<23) 488 #define TS_RESET_LATCH_TIMERS (1<<24) 489 #define TS_RESET_RESET_L1A_NUMBER (1<<25) 490 #define TS_RESET_PART_ACK(pID) (1<<(pID+25)) 491 #define TS_RESET_FILL_TO_END_BLOCK (1<<31) 494 #define TS_FPDELAY_MASK(x) (0x1FF<<(10*(x%3))) 497 #define TS_DUPL_FAST_CLEAR_DELAY_MASK 0x0007fc00 500 #define TS_DUPL_LOCAL_TRIG_BUSY_MASK 0x000003FF 501 #define TS_DUPL_FAST_CLEAR_BUSY_MASK 0x3FF00000 504 #define TS_TRIGGERRULEMIN_MIN2_MASK 0x00007F00 505 #define TS_TRIGGERRULEMIN_MIN2_EN (1<<15) 506 #define TS_TRIGGERRULEMIN_MIN3_MASK 0x007F0000 507 #define TS_TRIGGERRULEMIN_MIN3_EN (1<<23) 508 #define TS_TRIGGERRULEMIN_MIN4_MASK 0x7F000000 509 #define TS_TRIGGERRULEMIN_MIN4_EN (1<<31) 512 #define TS_INT_VEC 0xc8 513 #define TS_INT_LEVEL 5 516 #define TS_I2C_DATA_MASK 0x0000ffff 517 #define TS_I2C_8BIT_DATA_MASK 0x000000ff 520 #define TS_SCALER_SCALE_HI_MSB_MASK 0x0000007f 521 #define TS_SCALER_SCALE_HI_LSB_MASK 0x7fffff80 522 #define TS_SCALER_SCALE_HI (1<<31) 525 #define TS_PART_BLOCKBUFFER_EVENTS_LEFT_IN_BLOCK_MASK 0xFF000000 526 #define TS_PART_BLOCKBUFFER_BLOCKS_READY_MASK 0x00FFFF00 527 #define TS_PART_BLOCKBUFFER_BLOCKLEVEL_MASK 0x000000FF 529 #define TS_PART_BLOCKBUFFERINFO_BLOCKS_READY_MASK 0x00FFFF00 531 #define TS_PART_BUSYCONFIG_BUFFERLEVEL_MASK 0xFF000000 532 #define TS_PART_BUSYCONFIG_BUSYSRC_MASK 0x00F00000 533 #define TS_PART_BUSYCONFIG_TI_B (1<<23) 534 #define TS_PART_BUSYCONFIG_TI_A (1<<22) 535 #define TS_PART_BUSYCONFIG_FP (1<<21) 536 #define TS_PART_BUSYCONFIG_SWB (1<<20) 537 #define TS_PART_BUSYCONFIG_BUFFERLEVEL_ENABLE (1<<17) 538 #define TS_PART_BUSYCONFIG_ALMOSTFULL_ENABLE (1<<16) 539 #define TS_PART_BUSYCONFIG_TD_INPUT_MASK 0x0000FFFF 541 #define TS_PART_BUSYTIME_MASK 0x0000FFFF 545 #define TS_EMPTY_FIFO 0xF545BAD5 546 #define TS_BLOCK_HEADER_CRATEID_MASK 0xFF000000 547 #define TS_BLOCK_HEADER_SLOTS_MASK 0x001F0000 548 #define TS_BLOCK_TRAILER_CRATEID_MASK 0x00FF0000 549 #define TS_BLOCK_TRAILER_SLOTS_MASK 0x1F000000 550 #define TS_DATA_BLKNUM_MASK 0x0000FF00 551 #define TS_DATA_BLKLEVEL_MASK 0x000000FF 553 #define TS_DATAFORMAT_DATA_TYPE_WORD (1<<31) 554 #define TS_DATAFORMAT_TYPE_MASK 0x78000000 555 #define TS_DATAFORMAT_FILLER_WORD_TYPE 0x78000000 556 #define TS_DATAFORMAT_TYPE_BLOCK_HEADER 0 557 #define TS_DATAFORMAT_BLOCKHEADER_SLOT_MASK 0x07C00000 558 #define TS_DATAFORMAT_BLOCKHEADER_MODID_MASK 0x003C0000 559 #define TS_DATAFORMAT_BLOCKHEADER_BLKNUM_MASK 0x0003FF00 560 #define TS_DATAFORMAT_BLOCKHEADER_NEVTS_MASK 0x000000FF 561 #define TS_DATAFORMAT_TYPE_BLOCK_TRAILER 1 562 #define TS_DATAFORMAT_BLOCKTRAILER_SLOT_MASK 0x07C00000 563 #define TS_DATAFORMAT_BLOCKTRAILER_NWORDS_MASK 0x003FFFFF 566 #define TS_INIT_NO_INIT (1<<0) 567 #define TS_INIT_SKIP_FIRMWARE_CHECK (1<<2) 568 #define TS_INIT_DUPLICATION_MODE (1<<3) 575 int tsInit(
unsigned int tAddr,
unsigned int mode,
int force);
604 int tsSoftTrig(
int trigger,
unsigned int nevents,
unsigned int period_inc,
int range);
607 int tsReadBlock(
volatile unsigned int *data,
int nwrds,
int rflag);
640 int tsIntConnect(
unsigned int vector, VOIDFUNCPTR routine,
unsigned int arg);
642 int tsAckConnect(VOIDFUNCPTR routine,
unsigned int arg);
656 int tsDefineEventType(
int inputType,
unsigned int trigMask,
int hwTrig,
int evType);
664 int tsSetOutputPort(
unsigned int set1,
unsigned int set2,
unsigned int set3,
665 unsigned int set4,
unsigned int set5,
unsigned int set6);
706 int tsPartInit(
int pID,
unsigned int tAddr,
unsigned int mode,
int iFlag);
710 int tsPartSetFPInput(
unsigned short input1,
unsigned short input2,
unsigned short input3);
711 int tsPartSetGTPInput(
unsigned short input1,
unsigned short input2,
unsigned short input3,
unsigned short input4,
unsigned short input5);
int tsDuplGetLocalTriggerWidth()
Definition: tsLib.c:7419
int tsSetGTPInput(unsigned int inputmask)
Set which GTP inputs are enabled.
Definition: tsLib.c:1690
int tsIntConnect(unsigned int vector, VOIDFUNCPTR routine, unsigned int arg)
Connect a user routine to the TS Interrupt or latched trigger, if polling.
Definition: tsLib.c:3772
void tsSyncResetResync()
Generate a Sync Reset Resync signal.
Definition: tsLib.c:3261
void tsDisableBusError()
Disable Bus Errors to terminate Block Reads.
Definition: tsLib.c:2761
volatile unsigned int FPTriggerTable
Definition: tsLib.h:80
int tsSetBusySource(unsigned int sourcemask, int rFlag)
Set the busy source with a given sourcemask sourcemask bits:
Definition: tsLib.c:2685
int tsGetNextBlockLevel()
Get the block level that will be updated on the end of the block readout.
Definition: tsLib.c:1500
volatile unsigned int GTPtriggerBufferLength
Definition: tsLib.h:127
volatile unsigned int data
Definition: tsLib.h:68
void tsTriggerTableDefault()
Configure trigger table to be loaded with a predefined trigger table (mapping GTP and FP inputs to tr...
Definition: tsLib.c:4909
int tsReadTriggerBlock(volatile unsigned int *data)
Read a block from the TS and form it into a CODA Trigger Bank.
Definition: tsLib.c:2355
int tsDuplGetBusyTime()
Definition: tsLib.c:7795
volatile unsigned int triggerRule
Definition: tsLib.h:99
int tsDuplSetLocalTrigBusy(int value)
Definition: tsLib.c:7657
int tsPayloadPort2VMESlot(int payloadport)
Routine to return the VME slot, provided the VXS payload port.
Definition: tsLib.c:2785
volatile unsigned int blockBuffer
Definition: tsLib.h:98
unsigned int tsBReady()
Returns the number of Blocks available for readout.
Definition: tsLib.c:4108
unsigned int tsGetIntCount()
Return current readout count.
Definition: tsLib.c:3621
volatile unsigned int eJTAGLoad
Definition: tsLib.h:159
volatile unsigned int dataFormat
Definition: tsLib.h:91
unsigned int tsFind()
Find the TS within the prescribed "GEO Slot to A24 VME Address" range from slot 2 to 21...
Definition: tsLib.c:454
volatile unsigned int nblocks
Definition: tsLib.h:118
int tsCheckAddresses()
Definition: tsLib.c:520
volatile unsigned int fpScaler
Definition: tsLib.h:137
volatile unsigned int boardID
Definition: tsLib.h:85
int tsSetSyncSource(unsigned int sync)
Set the Sync source mask.
Definition: tsLib.c:1913
int tsGetSyncResetRequest()
Determine if a TI has requested a Sync Reset.
Definition: tsLib.c:5790
int tsGetTrigInhibitWindow()
Get the trigger inhibit window.
Definition: tsLib.c:6256
volatile unsigned int sync
Definition: tsLib.h:94
int tsGetInstantBlockLevelChange()
Get Status of instant blocklevel change when broadcast is received.
Definition: tsLib.c:1600
int tsAckConnect(VOIDFUNCPTR routine, unsigned int arg)
Connect a user routine to be executed instead of the default TS interrupt/trigger latching acknowledg...
Definition: tsLib.c:3939
int tsGetTrigCoinWindow()
Get the trigger coincidence window.
Definition: tsLib.c:6201
int tsDuplSetFastClearWidth(int width)
Definition: tsLib.c:7450
int tsSetTSIODrive(int enable)
Enable/Disable the FPGA drive to the TSIO.
Definition: tsLib.c:6001
int tsSetEventFormat(int format)
Set the event format.
Definition: tsLib.c:1949
volatile unsigned int trigDelay
Definition: tsLib.h:88
volatile unsigned int GTPtrigger
Definition: tsLib.h:101
int tsSetClockSource(unsigned int source)
Set the clock to the specified source.
Definition: tsLib.c:4274
int tsReadBlock(volatile unsigned int *data, int nwrds, int rflag)
Read a block of events from the TI.
Definition: tsLib.c:2167
int tsIntDisconnect()
Disable interrupts or kill the polling service thread.
Definition: tsLib.c:3862
void tsSetFiberDelay(unsigned int number, unsigned int offset)
volatile unsigned int trigger
Definition: tsLib.h:93
int tsPartReadBlock(volatile unsigned int *data, int nwrds)
Read a block of events from the current TS partition.
Definition: tsLib.c:6741
volatile unsigned int hel_livetime
Definition: tsLib.h:72
int tsForceSyncEvent()
Force a sync event (type = 0).
Definition: tsLib.c:5741
volatile unsigned int GTP[8]
Definition: tsLib.h:54
unsigned int tsGetSerialNumber(char **rSN)
Get the Module Serial Number.
Definition: tsLib.c:1279
volatile unsigned int blocklimit
Definition: tsLib.h:140
int tsResetEventCounter()
Reset the L1A counter, as incremented by the TS.
Definition: tsLib.c:3430
int tsGetSyncEventReceived()
Return the value of whether or not the sync event has been received.
Definition: tsLib.c:4167
int tsGetCrateID(int port)
Get the crate ID of the selected port.
Definition: tsLib.c:1404
int tsDuplSetLocalTriggerWidth(int width)
Definition: tsLib.c:7381
int tsGetSpecialEventType(int trigOpt)
Get the trigger type for the specified special trigger.
Definition: tsLib.c:5107
int tsDuplGetFastClearWidth()
Definition: tsLib.c:7488
void tsEnableBusError()
Enable Bus Errors to terminate Block Reads.
Definition: tsLib.c:2737
int tsPrintFPDelay()
Print Front Panel Channel Delays to Standard Out.
Definition: tsLib.c:5962
int tsSetInputMix(int enable)
Set option to mix FP and GTP inputs Effectively swaps the FP(16:1) -> GTP'(32:17) and GTP(32:17) -> F...
Definition: tsLib.c:1631
volatile unsigned int fp[4]
Definition: tsLib.h:53
int tsDefineSpecialEventType(int trigOpt, int evType)
Set the trigger type for the specified special trigger.
Definition: tsLib.c:5042
int tsSetTrigInhibitWindow(unsigned int size)
Set the trigger inhibit window.
Definition: tsLib.c:6227
volatile unsigned int duplBusyTime
Definition: tsLib.h:121
int tsGetTrigSrcEnabledFiberMask()
Returns the mask of fiber channels that report a "connected" status from a TI has it's trigger source...
Definition: tsLib.c:1184
int tsSetTriggerSource(int trig)
Set the trigger source.
Definition: tsLib.c:1743
int tsDuplSetBranchEnable(int b1, int b2, int b3, int b4)
Definition: tsLib.c:7152
volatile unsigned int triggerWindow
Definition: tsLib.h:100
int tsSetCrateID(unsigned int crateID)
Set the crate ID.
Definition: tsLib.c:1368
int tsResetSlaveConfig()
Reset the configuration of TI Slaves on the TS. This routine removes all slaves and resets the fiber ...
Definition: tsLib.c:4345
volatile unsigned int inputCounter
Definition: tsLib.h:128
void tsSlaveStatus(int pflag)
Print a summary of all fiber port connections to potential TI Slaves.
Definition: tsLib.c:1007
void tsPartIntAck()
Acknowledge an interrupt or latched trigger for this partition.
Definition: tsLib.c:6831
int tsSetBlockLevel(int blockLevel)
Set the number of events per block.
Definition: tsLib.c:1441
int tsDuplGetFastClearVetoWidth()
Definition: tsLib.c:7626
unsigned int tsPartBReady()
Returns the number of Blocks available for readout for this partition.
Definition: tsLib.c:6804
void tsClockReset()
Generate a Clock Reset signal. This signal is sent to the loopback and all configured TI Slaves...
Definition: tsLib.c:3283
volatile unsigned int eventNumber_lo
Definition: tsLib.h:133
unsigned int tsGetLiveTime_InputHigh()
Return the current "live" time of the module.
Definition: tsLib.c:5455
int tsSetTrigCoinWindow(unsigned int size)
Set the trigger coincidence window.
Definition: tsLib.c:6166
volatile unsigned int syncCommand
Definition: tsLib.h:111
int tsPartIntConnect(VOIDFUNCPTR routine, unsigned int arg)
Connect a user routine to the TS Interrupt or latched trigger, if polling.
Definition: tsLib.c:7026
int tsDisableTriggerSource(int fflag)
Disable trigger sources.
Definition: tsLib.c:1871
volatile unsigned int fpConfig
Definition: tsLib.h:64
int tsBroadcastNextBlockLevel(int blockLevel)
Broadcast the next block level (to be changed at the end of the next sync event, or during a call to ...
Definition: tsLib.c:1458
unsigned int blank2
Definition: tsLib.h:145
volatile unsigned int syncDelay
Definition: tsLib.h:112
volatile unsigned int fixedPulser2
Definition: tsLib.h:117
volatile unsigned int adr32
Definition: tsLib.h:89
unsigned int tsGetDaqStatus()
int tsVMESlotMask2PayloadPortMask(int vmeslot_mask)
int tsGetTriggerHoldoff(int rule)
Get the value for a specified trigger rule.
Definition: tsLib.c:4585
int tsSetOutputPort(unsigned int set1, unsigned int set2, unsigned int set3, unsigned int set4, unsigned int set5, unsigned int set6)
Set (or unset) high level for the user controllable output ports on the front panel.
Definition: tsLib.c:4233
volatile unsigned int syncWidth
Definition: tsLib.h:113
int tsSyncResetRequest()
Sync Reset Request is sent to TI-Master or TS.
Definition: tsLib.c:5768
int tsDuplGetLocalTrigBusy()
Definition: tsLib.c:7695
int tsDuplGetFastClearBusy()
Definition: tsLib.c:7764
int tsPartIntEnable(int iflag)
Enable interrupts or latching triggers for this partition.
Definition: tsLib.c:6927
int tsGetTriggerTable(unsigned int **otable)
Get the current trigger table stored in local memory (not necessarily on TS).
Definition: tsLib.c:4884
volatile unsigned int master_tiID
Definition: tsLib.h:135
int tsSoftTrig(int trigger, unsigned int nevents, unsigned int period_inc, int range)
Set and enable the "software" trigger.
Definition: tsLib.c:2013
int tsDuplGetFastClearDelay()
Definition: tsLib.c:7557
int tsResetMGT()
Reset the MGT.
Definition: tsLib.c:5871
int tsGetBusyStatus(int pflag)
Returns the bits that are contributing to the current busy state.
Definition: tsLib.c:5619
int tsPartSetBusySource(int busysrc)
Set the busy source for this partition.
Definition: tsLib.c:6485
int tsVMESlot2PayloadPort(int vmeslot)
Routine to return the VXS payload port, provided the VME Slot.
Definition: tsLib.c:2822
int tsDuplPrintBusyStatus()
Definition: tsLib.c:7857
int tsDisableRandomTrigger()
Disable random trigger generation.
Definition: tsLib.c:2138
volatile unsigned int blockBuffer
Definition: tsLib.h:61
unsigned long long int tsGetEventCounter()
Returns the event counter (48 bit)
Definition: tsLib.c:3452
volatile unsigned int eventNumber_hi
Definition: tsLib.h:132
unsigned int blank0
Definition: tsLib.h:63
volatile unsigned int busyConfig
Definition: tsLib.h:70
volatile unsigned int fixedPulser1
Definition: tsLib.h:116
int tsDuplSetLocalTrigCombo(unsigned int mask, int set)
Definition: tsLib.c:7259
int tsDuplMode(int set)
Enable/Disable Duplication Mode.
Definition: tsLib.c:7126
int tsSetFPDelay(int chan, int delay)
Set the input delay for teh specified front panel input (0-31)
Definition: tsLib.c:5895
volatile unsigned int specialEvTypes
Definition: tsLib.h:110
pthread_mutex_t tsISR_mutex
Definition: tsLib.h:26
volatile unsigned int triggerRuleMin
Definition: tsLib.h:62
volatile unsigned int output
Definition: tsLib.h:104
int tsLive(int sflag)
Calculate the live time (percentage) from the live and busy time scalers.
Definition: tsLib.c:5505
int tsDuplSetFastClearVetoWidth(int width)
Definition: tsLib.c:7588
int tsIntEnable(int iflag)
Enable interrupts or latching triggers (depending on set TS mode)
Definition: tsLib.c:4008
unsigned int blank1
Definition: tsLib.h:136
unsigned int blank0
Definition: tsLib.h:119
volatile unsigned int vmeControl
Definition: tsLib.h:92
int tsLoadTriggerTable()
Load up the default trigger lookup table for the TS.
Definition: tsLib.c:5226
int tsCurrentBlockFilled(unsigned short npoll)
Poll the TS to determine status of current block, for specified number of times. Return immediately w...
Definition: tsLib.c:5839
unsigned int tsGetBusyTime()
Return the current "busy" time of the module.
Definition: tsLib.c:5431
void tsIntDisable()
Disable interrupts or latching triggers.
Definition: tsLib.c:4082
volatile unsigned int trig1Prescale
Definition: tsLib.h:97
void tsPrintTriggerTable(int inputType, int subGroup, int showbits)
Print trigger table to standard out.
Definition: tsLib.c:5257
int tsTriggerTableConfig(unsigned int **itable)
Configure trigger table to be loaded with a user provided array.
Definition: tsLib.c:4857
void tsStatus(int pflag)
Print some status information of the TS to standard out.
Definition: tsLib.c:682
volatile unsigned int fiber
Definition: tsLib.h:86
unsigned int tsGetBlockLimit()
Returns the value that is currently programmed as the block limit.
Definition: tsLib.c:3502
volatile unsigned int randomPulser
Definition: tsLib.h:115
volatile unsigned int syncEventCtrl
Definition: tsLib.h:131
int tsPartIntDisconnect()
Disable interrupts or kill the polling service thread.
Definition: tsLib.c:7068
unsigned int tsGetBusyTime_InputHigh()
Return the current "busy" time of the module.
Definition: tsLib.c:5479
int tsPrintTriggerHoldoff(int dflag)
Definition: tsLib.c:4630
int tsSetInstantBlockLevelChange(int enable)
Set TS to instantly change blocklevel when broadcast is received.
Definition: tsLib.c:1572
volatile unsigned int triggerCommand
Definition: tsLib.h:114
int tsPartSetBlockBufferLevel(unsigned int bufferlevel)
Set up the Block Buffer Level.
Definition: tsLib.c:6543
volatile unsigned int genConfig
Definition: tsLib.h:66
int tsFillToEndBlock()
Generate non-physics triggers until the current block is filled. This feature is useful for "end of r...
Definition: tsLib.c:5814
void tsSetSyncDelayWidth(unsigned int delay, unsigned int width, int widthstep)
Set the delay time and width of the Sync signal.
Definition: tsLib.c:3102
int tsReset()
Perform a soft reset of the TS.
Definition: tsLib.c:1346
int tsGetCurrentBlockLevel()
Get the current block level.
Definition: tsLib.c:1529
int tsInit(unsigned int tAddr, unsigned int mode, int force)
Initialize the TSp register space into local memory, and setup registers given user input...
Definition: tsLib.c:188
int tsSetBlockBufferLevel(unsigned int level)
Set the block buffer level for the number of blocks in the system that need to be read out...
Definition: tsLib.c:4197
void tsPartIntDisable()
Disable interrupts or latching triggers for this partition.
Definition: tsLib.c:6988
volatile unsigned int busytime
Definition: tsLib.h:124
volatile unsigned int busytime
Definition: tsLib.h:71
int tsGetTSIODrive()
Return the Enable/Disable status the FPGA drive to the TSIO.
Definition: tsLib.c:6031
volatile unsigned int gtpScaler
Definition: tsLib.h:138
int tsSetTriggerPulse(int trigger, int delay, int width)
Set the characteristics of a specified trigger.
Definition: tsLib.c:3045
int tsSetSyncEventInterval(int blk_interval)
Set the value of the syncronization event interval.
Definition: tsLib.c:5713
volatile unsigned int duplBusyStatus
Definition: tsLib.h:122
int tsSetTriggerSourceMask(int trigmask)
Set trigger sources with specified trigmask.
Definition: tsLib.c:1805
int tsGetSyncEventFlag()
Return the value of the Synchronization flag, obtained from tsBReady. i.e. Return the value of the Sy...
Definition: tsLib.c:4146
volatile unsigned int fpInput
Definition: tsLib.h:102
int tsDuplGetTriggerHoldoff()
Definition: tsLib.c:7350
volatile unsigned int GTPTriggerTable
Definition: tsLib.h:79
unsigned int tsBlockStatus(int fiber, int pflag)
Show block Status of specified fiber.
Definition: tsLib.c:5558
int tsPartLoadTriggerTable()
Load the trigger table for current partition.
Definition: tsLib.c:6710
int tsGetFPDelay(int chan)
Get the input delay for teh specified front panel input (0-31)
Definition: tsLib.c:5933
void tsTriggerReadyReset()
Reset the registers that record the triggers enabled status of TI Slaves.
Definition: tsLib.c:3337
int tsGetInputMix()
Get option to mix FP and GTP inputs Effectively swaps the FP(16:1) -> GTP'(32:17) and GTP(32:17) -> F...
Definition: tsLib.c:1660
int tsSetAdr32(unsigned int a32base)
Routine to set the A32 Base.
Definition: tsLib.c:3359
volatile unsigned int blockBufferInfo
Definition: tsLib.h:69
volatile unsigned int blank[(0x334-0x1D0)/4]
Definition: tsLib.h:56
int tsGetPortTrigSrcEnabled(int port)
Get the trigger sources enabled bits of the selected port.
Definition: tsLib.c:1147
volatile unsigned int genScaler
Definition: tsLib.h:139
volatile unsigned int busy
Definition: tsLib.h:95
volatile unsigned int intsetup
Definition: tsLib.h:87
int tsDuplSetFastClearDelay(int delay)
Definition: tsLib.c:7519
void tsIntAck()
Acknowledge an interrupt or latched trigger. This "should" effectively release the "Busy" state of th...
Definition: tsLib.c:3965
volatile unsigned int triggerTable
Definition: tsLib.h:67
unsigned int tsDuplGetBusyStatus()
Definition: tsLib.c:7826
int tsGetBlockLimitStatus()
Get the current status of the block limit.
Definition: tsLib.c:3526
int tsSetTriggerHoldoffMin(int rule, unsigned int value)
Set the value for the minimum time of specified trigger rule.
Definition: tsLib.c:4728
int tsDuplSetFastClearBusy(int value)
Definition: tsLib.c:7726
int tsDuplSetLocalTrigComboMask(unsigned int mask)
Definition: tsLib.c:7191
int tsSetFPInputReadout(int enable)
Set whether or not the latched pattern of FP Inputs in block readout.
Definition: tsLib.c:3590
int tsReload()
Reload the firmware on the FPGA.
Definition: tsLib.c:1250
int tsClockResync()
Resync the 250 MHz Clock.
Definition: tsLib.c:1320
void tsResetIODelay()
Reset the IO Delay on the TS.
Definition: tsLib.c:4322
volatile unsigned int blocklevel
Definition: tsLib.h:90
int tsSetRandomTrigger(int trigger, int setting)
Set the parameters of the random internal trigger.
Definition: tsLib.c:2088
int tsSetBlockLimit(unsigned int limit)
Set the block number at which triggers will be disabled automatically.
Definition: tsLib.c:3480
volatile unsigned int adr24
Definition: tsLib.h:130
volatile unsigned int GTPStatusB
Definition: tsLib.h:126
volatile unsigned int livetime
Definition: tsLib.h:123
int tsSetCrateID_preInit(int cid)
Set the CrateID to be used during initialization.
Definition: tsLib.c:154
volatile unsigned int gen[8]
Definition: tsLib.h:55
void tsSyncReset(int blflag)
Generate a Sync Reset signal.
Definition: tsLib.c:3229
volatile unsigned int reset
Definition: tsLib.h:141
int tsReadScalersMon(volatile unsigned int *data)
Readout input scalers Returned data: bit 31 0: As stored 1: Shifted by 7 bits (must multiply by 2**7)...
Definition: tsLib.c:6073
int tsGetFirmwareVersion()
Get the Firmware Version.
Definition: tsLib.c:1212
unsigned int tsDuplGetLocalTrigComboMask()
Definition: tsLib.c:7228
void tsTrigLinkReset()
Reset the trigger link.
Definition: tsLib.c:3148
int tsGetTriggerHoldoffMin(int rule, int pflag)
Get the value for a specified trigger rule minimum busy.
Definition: tsLib.c:4796
int tsSetGTPInputReadout(int enable)
Set whether or not the latched pattern of GTP Inputs in block readout.
Definition: tsLib.c:3558
int tsPartSetGTPInput(unsigned short input1, unsigned short input2, unsigned short input3, unsigned short input4, unsigned short input5)
Set the GTP Inputs for this partition.
Definition: tsLib.c:6667
int tsRemoveSlave(unsigned int fiber)
Remove a TI Slave for the TS.
Definition: tsLib.c:4417
volatile unsigned int genInput
Definition: tsLib.h:103
volatile unsigned int fiberSyncDelay
Definition: tsLib.h:105
volatile unsigned int gtpConfig
Definition: tsLib.h:65
void tsUserSyncReset(int enable)
Control level of the SyncReset signal.
Definition: tsLib.c:3306
int tsSetTriggerHoldoff(int rule, unsigned int value, int timestep)
Set the value for a specified trigger rule.
Definition: tsLib.c:4484
int tsGetDriverSupportedVersion()
Return the Firmware Version that is Supported by the Library.
Definition: tsLib.c:6053
int tsPartInit(int pID, unsigned int tAddr, unsigned int mode, int iFlag)
Initialize a TS partition.
Definition: tsLib.c:6295
int tsPrintScalers(int choice)
Print input scalers to standard out.
Definition: tsLib.c:2620
int tsDuplSetTriggerHoldoff(unsigned int value)
Definition: tsLib.c:7312
int tsAddSlave(unsigned int fiber)
Add and configurate a TI Slave.
Definition: tsLib.c:4373
volatile unsigned int clock
Definition: tsLib.h:96
int tsPartSetFPInput(unsigned short input1, unsigned short input2, unsigned short input3)
Set the FP Inputs for this partition.
Definition: tsLib.c:6623
int tsReadScalers(volatile unsigned int *data, int choice)
Readout input scalers Returned data: bit 31 0: As stored 1: Shifted by 7 bits (must multiply by 2**7)...
Definition: tsLib.c:2512
int tsSetupFiberLoopback()
int tsSetFPInput(unsigned int inputmask)
Set which FP inputs are enabled.
Definition: tsLib.c:1714
unsigned int tsGetLiveTime()
Return the current "live" time of the module.
Definition: tsLib.c:5407
int tsDefineEventType(int inputType, unsigned int trigMask, int hwTrig, int evType)
Define a specific trigger pattern as a hardware trigger (trig1/trig2/syncevent) and Event Type...
Definition: tsLib.c:4962
volatile unsigned int runningMode
Definition: tsLib.h:120
int tsPartSetTDInput(unsigned int tdinput)
Select the input that has the TD Busy.
Definition: tsLib.c:6584
volatile unsigned int GTPStatusA
Definition: tsLib.h:125
volatile unsigned int hel_busytime
Definition: tsLib.h:73
int tsGetPrescale()
Get the current prescale factor.
Definition: tsLib.c:2883
int tsSetPrescale(int prescale)
Set the prescale factor for the external trigger.
Definition: tsLib.c:2855
int tsPayloadPortMask2VMESlotMask(int payloadport_mask)