JLab Pipeline TS Library  3v7.1
Initialization/Configuration

Functions

int tsInit (unsigned int tAddr, unsigned int mode, int iFlag)
 Initialize the TSp register space into local memory, and setup registers given user input. More...
 
unsigned int tsFind ()
 Find the TS within the prescribed "GEO Slot to A24 VME Address" range from slot 2 to 21. More...
 
void tsSlaveStatus (int pflag)
 Print a summary of all fiber port connections to potential TI Slaves. More...
 
int tsReload ()
 Reload the firmware on the FPGA. More...
 
int tsClockResync ()
 Resync the 250 MHz Clock. More...
 
int tsReset ()
 Perform a soft reset of the TS. More...
 
int tsSetCrateID (unsigned int crateID)
 Set the crate ID. More...
 
int tsSetBlockLevel (int blockLevel)
 Set the number of events per block. More...
 
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 tsSyncReset(1). More...
 
int tsSetInstantBlockLevelChange (int enable)
 Set TS to instantly change blocklevel when broadcast is received. More...
 
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) -> FP'(16:1) in both trigger table and data pattern output. More...
 
int tsSetGTPInput (unsigned int inputmask)
 Set which GTP inputs are enabled. More...
 
int tsSetFPInput (unsigned int inputmask)
 Set which FP inputs are enabled. More...
 
int tsSetTriggerSource (int trig)
 Set the trigger source. More...
 
int tsSetTriggerSourceMask (int trigmask)
 Set trigger sources with specified trigmask. More...
 
int tsEnableTriggerSource ()
 Enable trigger sources set by tsSetTriggerSource(...) or tsSetTriggerSourceMask(...) More...
 
int tsDisableTriggerSource (int fflag)
 Disable trigger sources. More...
 
int tsSetSyncSource (unsigned int sync)
 Set the Sync source mask. More...
 
int tsSetEventFormat (int format)
 Set the event format. More...
 
int tsSoftTrig (int trigger, unsigned int nevents, unsigned int period_inc, int range)
 Set and enable the "software" trigger. More...
 
int tsSetRandomTrigger (int trigger, int setting)
 Set the parameters of the random internal trigger. More...
 
int tsDisableRandomTrigger ()
 Disable random trigger generation. More...
 
int tsSetBusySource (unsigned int sourcemask, int rFlag)
 Set the busy source with a given sourcemask sourcemask bits: More...
 
void tsEnableBusError ()
 Enable Bus Errors to terminate Block Reads. More...
 
void tsDisableBusError ()
 Disable Bus Errors to terminate Block Reads. More...
 
int tsSetPrescale (int prescale)
 Set the prescale factor for the external trigger. More...
 
int tsSetTriggerPrescale (int type, int chan, unsigned int prescale)
 Set the prescale for specified type and channel. More...
 
int tsSetTriggerPulse (int trigger, int delay, int width)
 Set the characteristics of a specified trigger. More...
 
void tsSetSyncDelayWidth (unsigned int delay, unsigned int width, int widthstep)
 Set the delay time and width of the Sync signal. More...
 
void tsTrigLinkReset ()
 Reset the trigger link. More...
 
void tsTrigLinkDisable ()
 Disable the trigger link. More...
 
int tsSetSyncResetType (int type)
 Set type of SyncReset to send to TI Slaves. More...
 
void tsSyncReset (int blflag)
 Generate a Sync Reset signal. More...
 
void tsSyncResetResync ()
 Generate a Sync Reset Resync signal. More...
 
void tsClockReset ()
 Generate a Clock Reset signal. This signal is sent to the loopback and all configured TI Slaves. More...
 
void tsUserSyncReset (int enable)
 Control level of the SyncReset signal. More...
 
void tsTriggerReadyReset ()
 Reset the registers that record the triggers enabled status of TI Slaves. More...
 
int tsSetAdr32 (unsigned int a32base)
 Routine to set the A32 Base. More...
 
int tsResetEventCounter ()
 Reset the L1A counter, as incremented by the TS. More...
 
int tsSetBlockLimit (unsigned int limit)
 Set the block number at which triggers will be disabled automatically. More...
 
int tsSetGTPInputReadout (int enable)
 Set whether or not the latched pattern of GTP Inputs in block readout. More...
 
int tsSetFPInputReadout (int enable)
 Set whether or not the latched pattern of FP Inputs in block readout. More...
 
int tsSetBlockBufferLevel (unsigned int level)
 Set the block buffer level for the number of blocks in the system that need to be read out. More...
 
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. More...
 
int tsSetClockSource (unsigned int source)
 Set the clock to the specified source. More...
 
void tsResetIODelay ()
 Reset the IO Delay on the TS. More...
 
int tsResetSlaveConfig ()
 Reset the configuration of TI Slaves on the TS. This routine removes all slaves and resets the fiber port busy's. More...
 
int tsAddSlave (unsigned int fiber)
 Add and configurate a TI Slave. More...
 
int tsRemoveSlave (unsigned int fiber)
 Remove a TI Slave for the TS. More...
 
int tsSetTriggerHoldoff (int rule, unsigned int value, int timestep)
 Set the value for a specified trigger rule. More...
 
int tsSetTriggerHoldoffMin (int rule, unsigned int value)
 Set the value for the minimum time of specified trigger rule. More...
 
int tsTriggerTableConfig (unsigned int **itable)
 Configure trigger table to be loaded with a user provided array. More...
 
int tsGetTriggerTable (unsigned int **otable)
 Get the current trigger table stored in local memory (not necessarily on TS). More...
 
void tsTriggerTableDefault ()
 Configure trigger table to be loaded with a predefined trigger table (mapping GTP and FP inputs to trigger types). More...
 
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. More...
 
int tsDefineSpecialEventType (int trigOpt, int evType)
 Set the trigger type for the specified special trigger. More...
 
int tsLoadTriggerTable ()
 Load up the default trigger lookup table for the TS. More...
 
int tsLatchTimers ()
 Latch the Busy and Live Timers. More...
 
int tsSetSyncEventInterval (int blk_interval)
 Set the value of the syncronization event interval. More...
 
int tsResetMGT ()
 Reset the MGT. More...
 
int tsSetFPDelay (int chan, int delay)
 Set the input delay for teh specified front panel input (0-31) More...
 
int tsSetTSIODrive (int enable)
 Enable/Disable the FPGA drive to the TSIO. More...
 
int tsSetTrigCoinWindow (unsigned int size)
 Set the trigger coincidence window. More...
 
int tsSetTrigInhibitWindow (unsigned int size)
 Set the trigger inhibit window. More...
 

Detailed Description

Function Documentation

◆ tsAddSlave()

int tsAddSlave ( unsigned int  fiber)

Add and configurate a TI Slave.

This routine should be used by the TS to configure HFBR port and BUSY sources.

Parameters
fiberThe fiber port of the TS that is connected to the slave
Returns
OK if successful, otherwise ERROR

References TS_BUSY_TI_A, TS_BUSY_TI_B, tsSetBusySource(), and tsSlaveMask.

◆ tsBroadcastNextBlockLevel()

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 tsSyncReset(1).

See also
tsSyncReset(1)
Parameters
blockLevelblock level to broadcats
Returns
OK if successful, ERROR otherwise

References TS_A24RegStruct::trigger, TS_A24RegStruct::triggerCommand, TS_BLOCKLEVEL_MASK, TS_TRIGGER_VME, TS_TRIGGERCOMMAND_SET_BLOCKLEVEL, tsGetNextBlockLevel(), TSLOCK, and TSUNLOCK.

Referenced by tsSetBlockLevel().

◆ tsClockReset()

void tsClockReset ( )

Generate a Clock Reset signal. This signal is sent to the loopback and all configured TI Slaves.

References TS_A24RegStruct::syncCommand, TS_SYNCCOMMAND_CLK250_RESYNC, TSLOCK, and TSUNLOCK.

◆ tsClockResync()

int tsClockResync ( )

Resync the 250 MHz Clock.

Returns
OK if successful, ERROR otherwise

References TS_A24RegStruct::syncCommand, TS_SYNCCOMMAND_AD9510_RESYNC, TSLOCK, and TSUNLOCK.

◆ tsDefineEventType()

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.

Parameters
inputTypeThe Input Type 0: GTP 1: Front Panel
trigMaskTrigger Pattern
  • TS inputs defining the pattern. The current firmware limits each pattern to be within each subgroup inputs: GTP: 1-8, 9-16, 17-24, 25-32 FP: 1-8, 9-16, 17-24, 25-32 The routine will look for the first subgroup with a bit pattern. ALL OTHER PATTERNS WILL BE IGNORED (with WARN to standard out)
hwTrigHardware trigger type (must be less than 3) 0: no trigger 1: Trig1 (event trigger) 2: Trig2 (playback trigger) 3: SyncEvent
evTypeEvent Type (must be less than 256)
Returns
OK if successful, otherwise ERROR

◆ tsDefineSpecialEventType()

int tsDefineSpecialEventType ( int  trigOpt,
int  evType 
)

Set the trigger type for the specified special trigger.

Parameters
trigOptTrigger Option 0: Software (default = 253) 1: Pulser (default = 254) 2: Multiple GTP or FP Hits (default = 250) 3: Combined GTP and FP Hits (default = 251)
evTypeEvent Type
  • Must be 1-255
Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::specialEvTypes, TS_SPECIALEVTYPES_GTP_AND_FP_MASK, TS_SPECIALEVTYPES_MULT_GTP_OR_FP_MASK, TS_SPECIALEVTYPES_PULSER_MASK, TS_SPECIALEVTYPES_VME_MASK, TSLOCK, and TSUNLOCK.

◆ tsDisableBusError()

void tsDisableBusError ( )

Disable Bus Errors to terminate Block Reads.

See also
tsEnableBusError
Returns
OK if successful, otherwise ERROR

References TS_VMECONTROL_BERR, TSLOCK, and TS_A24RegStruct::vmeControl.

Referenced by tsGetCurrentBlockLevel().

◆ tsDisableRandomTrigger()

int tsDisableRandomTrigger ( )

Disable random trigger generation.

See also
tsSetRandomTrigger
Returns
OK if successful, ERROR otherwise.

References TS_A24RegStruct::randomPulser, TSLOCK, and TSUNLOCK.

◆ tsDisableTriggerSource()

int tsDisableTriggerSource ( int  fflag)

Disable trigger sources.

Parameters
fflag
  • 0: Disable Triggers
  • >0: Disable Triggers and generate enough triggers to fill the current block
Returns
OK if successful, ERROR otherwise

References TS_A24RegStruct::trigger, tsCurrentBlockFilled(), tsFillToEndBlock(), TSLOCK, and TSUNLOCK.

Referenced by tsIntDisable().

◆ tsEnableBusError()

void tsEnableBusError ( )

Enable Bus Errors to terminate Block Reads.

See also
tsDisableBusError
Returns
OK if successful, otherwise ERROR

References TS_VMECONTROL_BERR, TSLOCK, and TS_A24RegStruct::vmeControl.

Referenced by tsGetCurrentBlockLevel().

◆ tsEnableTriggerSource()

int tsEnableTriggerSource ( )

Enable trigger sources set by tsSetTriggerSource(...) or tsSetTriggerSourceMask(...)

See also
tsSetTriggerSource tsSetTriggerSourceMask(...)
Returns
OK if successful, ERROR otherwise

References TS_A24RegStruct::trigger, TSLOCK, tsTriggerSource, and TSUNLOCK.

◆ tsFind()

unsigned int tsFind ( )

Find the TS within the prescribed "GEO Slot to A24 VME Address" range from slot 2 to 21.

Returns
A24 VME address if found. Otherwise, 0

References TS_BOARDID_TYPE_MASK, and TS_BOARDID_TYPE_TS.

Referenced by tsInit().

◆ tsGetTriggerTable()

int tsGetTriggerTable ( unsigned int **  otable)

Get the current trigger table stored in local memory (not necessarily on TS).

Parameters
otableOutput Table (8x256 Array of 4byte words, user must allocate memory)
Returns
OK if successful, otherwise ERROR

◆ tsInit()

int tsInit ( unsigned int  tAddr,
unsigned int  mode,
int  iFlag 
)

Initialize the TSp register space into local memory, and setup registers given user input.

Parameters
tAddr
  • A24 VME Address of the TS
  • Slot number of TS (1 - 21)
mode- Readout/Triggering Mode
  • 0: External Trigger - Interrupt Mode
  • 2: External Trigger - Polling Mode
iFlag- Initialization mask
  • 0: Do not initialize the board, just setup the pointers to the registers
  • 2: Ignore firmware check
Returns
OK if successful, otherwise ERROR.

References TS_INIT_DUPLICATION_MODE, TS_INIT_NO_INIT, TS_INIT_SKIP_FIRMWARE_CHECK, and tsFind().

◆ tsLatchTimers()

int tsLatchTimers ( )

Latch the Busy and Live Timers.

This routine should be called prior to a call to tsGetLiveTime and tsGetBusyTime

See also
tsGetLiveTime
tsGetBusyTime
Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::reset, TS_RESET_LATCH_TIMERS, TSLOCK, and TSUNLOCK.

◆ tsLoadTriggerTable()

int tsLoadTriggerTable ( )

Load up the default trigger lookup table for the TS.

Returns
OK if successful, otherwise ERROR

◆ tsReload()

int tsReload ( )

Reload the firmware on the FPGA.

Returns
OK if successful, ERROR otherwise

References TS_A24RegStruct::JTAGPROMBase, TS_A24RegStruct::reset, TS_RESET_JTAG, TSLOCK, and TSUNLOCK.

◆ tsRemoveSlave()

int tsRemoveSlave ( unsigned int  fiber)

Remove a TI Slave for the TS.

Parameters
fiberThe fiber port of the TS to remove.
Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::busy, TS_BUSY_TI_A, TSLOCK, tsSlaveMask, and TSUNLOCK.

◆ tsReset()

int tsReset ( )

Perform a soft reset of the TS.

Returns
OK if successful, ERROR otherwise

References TS_A24RegStruct::reset, TS_RESET_SOFT, TSLOCK, and TSUNLOCK.

◆ tsResetEventCounter()

int tsResetEventCounter ( )

Reset the L1A counter, as incremented by the TS.

Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::reset, TS_RESET_RESET_L1A_NUMBER, TSLOCK, and TSUNLOCK.

Referenced by tsIntEnable().

◆ tsResetIODelay()

void tsResetIODelay ( )

Reset the IO Delay on the TS.

References TS_A24RegStruct::reset, TS_RESET_IODELAY, TSLOCK, and TSUNLOCK.

◆ tsResetMGT()

int tsResetMGT ( )

Reset the MGT.

Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::reset, TS_RESET_MGT, TSLOCK, and TSUNLOCK.

◆ tsResetSlaveConfig()

int tsResetSlaveConfig ( )

Reset the configuration of TI Slaves on the TS. This routine removes all slaves and resets the fiber port busy's.

Returns
OK if successful, ERROR otherwise

References TS_A24RegStruct::busy, TS_BUSY_HFBR_MASK, TSLOCK, tsSlaveMask, and TSUNLOCK.

◆ tsSetAdr32()

int tsSetAdr32 ( unsigned int  a32base)

Routine to set the A32 Base.

Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::adr32, TS_ADR32_BASE_MASK, TS_VMECONTROL_A32, tsA32Base, tsA32Offset, TSLOCK, TSpd, TSUNLOCK, and TS_A24RegStruct::vmeControl.

◆ tsSetBlockBufferLevel()

int tsSetBlockBufferLevel ( unsigned int  level)

Set the block buffer level for the number of blocks in the system that need to be read out.

If this buffer level is full, the TI will go BUSY. The BUSY is released as soon as the number of buffers in the system drops below this level.

Parameters
level
  • 0: No Buffer Limit - Pipeline mode
  • 1: One Block Limit - "ROC LOCK" mode
  • 2-65535: "Buffered" mode.
Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::blockBuffer, TS_BLOCKBUFFER_BUFFERLEVEL_MASK, TSLOCK, and TSUNLOCK.

◆ tsSetBlockLevel()

int tsSetBlockLevel ( int  blockLevel)

Set the number of events per block.

Parameters
blockLevelNumber of events per block
Returns
OK if successful, ERROR otherwise

References tsBroadcastNextBlockLevel().

◆ tsSetBlockLimit()

int tsSetBlockLimit ( unsigned int  limit)

Set the block number at which triggers will be disabled automatically.

Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::blocklimit, TSLOCK, and TSUNLOCK.

◆ tsSetBusySource()

int tsSetBusySource ( unsigned int  sourcemask,
int  rFlag 
)

Set the busy source with a given sourcemask sourcemask bits:

Parameters
sourcemask
  • 0: SWA
  • 1: SWB
  • 2: P2
  • 3: FP-FTDC
  • 4: FP-FADC
  • 5: FP
  • 6: Unused
  • 7: Loopack
  • 8-9: Fiber 1-2
rFlag- decision to reset the global source flags
  • 0: Keep prior busy source settings and set new "sourcemask"
  • 1: Reset, using only that specified with "sourcemask"
Returns
OK if successful, ERROR otherwise.

References TS_A24RegStruct::busy, TS_BUSY_P2_TRIGGER_INPUT, TS_BUSY_SOURCEMASK, TSLOCK, and TSUNLOCK.

Referenced by tsAddSlave().

◆ tsSetClockSource()

int tsSetClockSource ( unsigned int  source)

Set the clock to the specified source.

Parameters
source
  • 0: Onboard clock
  • 1: External clock (FP input)
Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::clock, TS_A24RegStruct::reset, TS_CLOCK_EXTERNAL, TS_CLOCK_INTERNAL, TS_RESET_CLK125, TS_RESET_CLK250, TSLOCK, and TSUNLOCK.

◆ tsSetCrateID()

int tsSetCrateID ( unsigned int  crateID)

Set the crate ID.

Returns
OK if successful, ERROR otherwise

References TS_A24RegStruct::boardID, TS_BOARDID_CRATEID_MASK, tsCrateID, TSLOCK, and TSUNLOCK.

◆ tsSetEventFormat()

int tsSetEventFormat ( int  format)

Set the event format.

Parameters
format- integer number indicating the event format
  • 0: 32 bit event number only
  • 1: 32 bit event number + 32 bit timestamp
  • 2: 32 bit event number + higher 16 bits of timestamp + higher 16 bits of eventnumber
  • 3: 32 bit event number + 32 bit timestamp + higher 16 bits of timestamp + higher 16 bits of eventnumber
Returns
OK if successful, ERROR otherwise

References TS_A24RegStruct::dataFormat, TS_DATAFORMAT_HIGHERBITS_WORD, TS_DATAFORMAT_TIMING_WORD, TS_DATAFORMAT_WORDS_MASK, TSLOCK, and TSUNLOCK.

◆ tsSetFPDelay()

int tsSetFPDelay ( int  chan,
int  delay 
)

Set the input delay for teh specified front panel input (0-31)

Parameters
chanFront Panel Input Channel (0-31)
delayDelay in units of 4ns (0=8ns)
Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::fpDelay, TS_FPDELAY_MASK, TSLOCK, and TSUNLOCK.

◆ tsSetFPInput()

int tsSetFPInput ( unsigned int  inputmask)

Set which FP inputs are enabled.

Parameters
inputmask- MASK of which FP inputs (A-D) to enable
Returns
OK if successful, ERROR otherwise

References TS_A24RegStruct::fpInput, TSLOCK, and TSUNLOCK.

◆ tsSetFPInputReadout()

int tsSetFPInputReadout ( int  enable)

Set whether or not the latched pattern of FP Inputs in block readout.

Parameters
enable
  • 0: Disable
  • >0: Enable
Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::dataFormat, TS_DATAFORMAT_FPINPUT_READOUT, TSLOCK, and TSUNLOCK.

◆ tsSetGTPInput()

int tsSetGTPInput ( unsigned int  inputmask)

Set which GTP inputs are enabled.

Parameters
inputmask- MASK of which GTP inputs to enable
Returns
OK if successful, ERROR otherwise

References TS_A24RegStruct::GTPtrigger, TSLOCK, and TSUNLOCK.

◆ tsSetGTPInputReadout()

int tsSetGTPInputReadout ( int  enable)

Set whether or not the latched pattern of GTP Inputs in block readout.

Parameters
enable
  • 0: Disable
  • >0: Enable
Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::dataFormat, TS_DATAFORMAT_GTPINPUT_READOUT, TSLOCK, and TSUNLOCK.

◆ tsSetInputMix()

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) -> FP'(16:1) in both trigger table and data pattern output.

Parameters
enable
   0 - disable
  !1 - enable
Returns
OK if successful, ERROR otherwise

References TS_A24RegStruct::clock, TS_CLOCK_INPUT_MIX_CONTROL_MASK, TS_CLOCK_INPUT_MIX_ENABLE, TSLOCK, and TSUNLOCK.

◆ tsSetInstantBlockLevelChange()

int tsSetInstantBlockLevelChange ( int  enable)

Set TS to instantly change blocklevel when broadcast is received.

Parameters
enableOption to enable or disable this feature
  • 0: Disable !0: Enable
Returns
OK if successful, ERROR otherwise

References TS_VMECONTROL_BLOCKLEVEL_UPDATE, TSLOCK, TSUNLOCK, and TS_A24RegStruct::vmeControl.

◆ tsSetOutputPort()

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.

Parameters
set1OUT #3
set2OUT #4
set3OUT #5
set4OUT #6
set5OUT #11
set6OUT #12
Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::output, TS_OUTPUT_FP_1, TS_OUTPUT_FP_2, TS_OUTPUT_FP_3, TS_OUTPUT_FP_4, TS_OUTPUT_FP_5, TS_OUTPUT_FP_6, TSLOCK, and TSUNLOCK.

◆ tsSetPrescale()

int tsSetPrescale ( int  prescale)

Set the prescale factor for the external trigger.

Parameters
prescaleFactor for prescale. Max {prescale} available is 65535
Returns
OK if successful, otherwise ERROR.

References TS_A24RegStruct::trig1Prescale, TSLOCK, and TSUNLOCK.

◆ tsSetRandomTrigger()

int tsSetRandomTrigger ( int  trigger,
int  setting 
)

Set the parameters of the random internal trigger.

Parameters
trigger- Trigger Selection
  • 1: trig1
  • 2: trig2
setting- frequency prescale from 500MHz
See also
tsDisableRandomTrigger
Returns
OK if successful, ERROR otherwise.

References TS_A24RegStruct::randomPulser, TS_RANDOMPULSER_TRIG1_ENABLE, TS_RANDOMPULSER_TRIG1_RATE_MASK, TS_RANDOMPULSER_TRIG2_ENABLE, TSLOCK, and TSUNLOCK.

◆ tsSetSyncDelayWidth()

void tsSetSyncDelayWidth ( unsigned int  delay,
unsigned int  width,
int  widthstep 
)

Set the delay time and width of the Sync signal.

Parameters
delaythe delay (latency) set in units of 4ns.
widththe width set in units of 4ns.
twidthif this is non-zero, set width in units of 32ns.

References TS_A24RegStruct::syncDelay, TS_A24RegStruct::syncWidth, TS_SYNCDELAY_MASK, TS_SYNCWIDTH_LONGWIDTH_ENABLE, TS_SYNCWIDTH_MASK, TSLOCK, and TSUNLOCK.

◆ tsSetSyncEventInterval()

int tsSetSyncEventInterval ( int  blk_interval)

Set the value of the syncronization event interval.

Parameters
blk_intervalSync Event will occur in the last event of the set blk_interval (number of blocks)
Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::syncEventCtrl, TS_SYNCEVENTCTRL_NBLOCKS_MASK, TSLOCK, and TSUNLOCK.

◆ tsSetSyncResetType()

int tsSetSyncResetType ( int  type)

Set type of SyncReset to send to TI Slaves.

Parameters
typeSync Reset Type
  • 0: User programmed width in each TI
  • !0: Fixed 4 microsecond width in each TI
Returns
OK if successful, otherwise ERROR

◆ tsSetSyncSource()

int tsSetSyncSource ( unsigned int  sync)

Set the Sync source mask.

Parameters
sync- MASK indicating the sync source
  • 0: P0
  • 1: HFBR1
  • 2: HFBR5
  • 3: Front Panel
  • 4: Loopback
Returns
OK if successful, ERROR otherwise

References TS_A24RegStruct::sync, TS_SYNC_SOURCEMASK, TSLOCK, and TSUNLOCK.

◆ tsSetTrigCoinWindow()

int tsSetTrigCoinWindow ( unsigned int  size)

Set the trigger coincidence window.

Parameters
sizeSize of the coincidence window in units of 4ns
Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::triggerWindow, TS_TRIGGERWINDOW_COINC_MASK, TSLOCK, and TSUNLOCK.

◆ tsSetTriggerHoldoff()

int tsSetTriggerHoldoff ( int  rule,
unsigned int  value,
int  timestep 
)

Set the value for a specified trigger rule.

Parameters
rulethe number of triggers within some time period.. e.g. rule=1: No more than ONE trigger within the specified time period
valuethe specified time period (in steps of timestep)
timestepTimestep that is dependent on the trigger rule selected
                            rule
     timestep    1       2       3       4
     --------  ------ ------- ------- --------
        0        16ns    16ns    32ns     64ns
        1       480ns   960ns  1920ns   3840ns
        2     15360ns 30720ns 61440ns 122880ns
*
Returns
OK if successful, otherwise ERROR.

References TS_A24RegStruct::triggerRule, TS_TRIGGERRULE_RULE1_MASK, TS_TRIGGERRULE_RULE2_MASK, TS_TRIGGERRULE_RULE3_MASK, TS_TRIGGERRULE_RULE4_MASK, TS_VMECONTROL_SLOWER_TRIGGER_RULES, TSLOCK, TSUNLOCK, and TS_A24RegStruct::vmeControl.

◆ tsSetTriggerHoldoffMin()

int tsSetTriggerHoldoffMin ( int  rule,
unsigned int  value 
)

Set the value for the minimum time of specified trigger rule.

Parameters
rulethe number of triggers within some time period.. e.g. rule=1: No more than ONE trigger within the specified time period
valuethe specified time period (in steps of timestep)
                      rule
                     2      3      4
                   ----- ------ ------
                    16ns  480ns  480ns 
*
Returns
OK if successful, otherwise ERROR.

References TS_A24RegStruct::part1, PartitionStruct::triggerRuleMin, TS_TRIGGERRULEMIN_MIN2_EN, TS_TRIGGERRULEMIN_MIN2_MASK, TS_TRIGGERRULEMIN_MIN3_EN, TS_TRIGGERRULEMIN_MIN3_MASK, TS_TRIGGERRULEMIN_MIN4_EN, TS_TRIGGERRULEMIN_MIN4_MASK, TSLOCK, and TSUNLOCK.

◆ tsSetTriggerPrescale()

int tsSetTriggerPrescale ( int  type,
int  chan,
unsigned int  prescale 
)

Set the prescale for specified type and channel.

Parameters
typeType of input
  • 1: GTP
  • 2: FP
chanChannel of specified type
Returns
Current prescale factor, otherwise ERROR.

References TS_A24RegStruct::fpInputPrescale, TS_A24RegStruct::GTPprescale, TSLOCK, and TSUNLOCK.

◆ tsSetTriggerPulse()

int tsSetTriggerPulse ( int  trigger,
int  delay,
int  width 
)

Set the characteristics of a specified trigger.

Parameters
trigger
  • 1: set for trigger 1
  • 2: set for trigger 2 (playback trigger)
delaydelay in units of 4ns
widthpulse width in units of 4ns
Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::trigDelay, TS_TRIGDELAY_TRIG1_DELAY_MASK, TS_TRIGDELAY_TRIG1_WIDTH_MASK, TS_TRIGDELAY_TRIG2_DELAY_MASK, TS_TRIGDELAY_TRIG2_WIDTH_MASK, TSLOCK, and TSUNLOCK.

◆ tsSetTriggerSource()

int tsSetTriggerSource ( int  trig)

Set the trigger source.

This routine will set a library variable to be set in the TS registers at a call to tsIntEnable.

Parameters
trig- integer indicating the trigger source
  • 5: Random
  • 6: GTP/Ext/GTP
Returns
OK if successful, ERROR otherwise

References TS_TRIGGER_ENABLE, TS_TRIGGER_LOOPBACK, TS_TRIGGER_PULSER, TS_TRIGGER_VME, and tsTriggerSource.

◆ tsSetTriggerSourceMask()

int tsSetTriggerSourceMask ( int  trigmask)

Set trigger sources with specified trigmask.

This routine is for special use when tsSetTriggerSource(...) does not set all of the trigger sources that is required by the user.

Parameters
trigmaskbits:
  • 0: P0
  • 1: HFBR #1
  • 2: TI Master Loopback
  • 3: Front Panel (TRG) Input
  • 4: VME Trigger
  • 5: Front Panel TS Inputs
  • 6: TS (rev 2) Input
  • 7: Random Trigger
  • 8: FP/Ext/GTP
  • 9: P2 Busy
Returns
OK if successful, ERROR otherwise

References TS_TRIGGER_SOURCEMASK, and tsTriggerSource.

◆ tsSetTrigInhibitWindow()

int tsSetTrigInhibitWindow ( unsigned int  size)

Set the trigger inhibit window.

Parameters
sizeSize of the inhibit window in units of 4ns
Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::triggerWindow, TS_TRIGGERWINDOW_INHIBIT_MASK, TSLOCK, and TSUNLOCK.

◆ tsSetTSIODrive()

int tsSetTSIODrive ( int  enable)

Enable/Disable the FPGA drive to the TSIO.

Parameters
enableEnable/Disable 0: Disable >0: Enable
Returns
OK if successful, otherwise ERROR

References TS_VMECONTROL_DRIVE_TSIO_EN, TSLOCK, TSUNLOCK, and TS_A24RegStruct::vmeControl.

◆ tsSlaveStatus()

◆ tsSoftTrig()

int tsSoftTrig ( int  trigger,
unsigned int  nevents,
unsigned int  period_inc,
int  range 
)

Set and enable the "software" trigger.

Parameters
triggertrigger type 1 or 2 (playback trigger)
neventsinteger number of events to trigger
period_incperiod multiplier, depends on range (0-0x7FFF)
range
  • 0: small period range (min: 120ns, increments of 120ns)
  • 1: large period range (min: 120ns, increments of 245.7us)
Returns
OK if successful, ERROR otherwise

References TS_A24RegStruct::fixedPulser1, TS_A24RegStruct::fixedPulser2, TS_FIXEDPULSER1_NTRIGGERS_MASK, TS_FIXEDPULSER1_PERIOD_MASK, TSLOCK, and TSUNLOCK.

◆ tsSyncReset()

void tsSyncReset ( int  blflag)

Generate a Sync Reset signal.

Parameters
blflagOption to change block level, after SyncReset issued
  • 0: Do not change block level
  • >0: Broadcast block level to all connected slaves (including self) BlockLevel broadcasted will be set to library value (Set with tsSetBlockLevel)

References TS_A24RegStruct::syncCommand, and TSLOCK.

◆ tsSyncResetResync()

void tsSyncResetResync ( )

Generate a Sync Reset Resync signal.

This type of Sync Reset will NOT reset event numbers

References TS_A24RegStruct::syncCommand, and TSLOCK.

◆ tsTriggerReadyReset()

void tsTriggerReadyReset ( )

Reset the registers that record the triggers enabled status of TI Slaves.

References TS_A24RegStruct::syncCommand, TS_SYNCCOMMAND_TRIGGER_READY_RESET, TSLOCK, and TSUNLOCK.

◆ tsTriggerTableConfig()

int tsTriggerTableConfig ( unsigned int **  itable)

Configure trigger table to be loaded with a user provided array.

Parameters
itableInput Table (8x256 Array of 4byte words)
Returns
OK if successful, otherwise ERROR

◆ tsTriggerTableDefault()

void tsTriggerTableDefault ( )

Configure trigger table to be loaded with a predefined trigger table (mapping GTP and FP inputs to trigger types).

◆ tsTrigLinkDisable()

void tsTrigLinkDisable ( )

◆ tsTrigLinkReset()

void tsTrigLinkReset ( )

◆ tsUserSyncReset()

void tsUserSyncReset ( int  enable)

Control level of the SyncReset signal.

See also
tsSetUserSyncResetReceive
Parameters
enable
  • >0: High
  • 0: Low

References TS_A24RegStruct::syncCommand, TS_SYNCCOMMAND_SYNCRESET_HIGH, TS_SYNCCOMMAND_SYNCRESET_LOW, TSLOCK, and TSUNLOCK.