JLab Pipeline TI Library  1.0
 All Data Structures Files Functions Variables Macros Groups
Initialization/Configuration

Functions

int tiInit (unsigned int tAddr, unsigned int mode, int iFlag)
 Initialize the TIp register space into local memory, and setup registers given user input. More...
 
unsigned int tiFind ()
 Find the TI within the prescribed "GEO Slot to A24 VME Address" range from slot 3 to 21. More...
 
int tiReload ()
 Reload the firmware on the FPGA. More...
 
int tiClockResync ()
 Resync the 250 MHz Clock. More...
 
int tiReset ()
 Perform a soft reset of the TI. More...
 
int tiSetCrateID (unsigned int crateID)
 Set the crate ID. More...
 
int tiSetBlockLevel (int blockLevel)
 Set the number of events per block. More...
 
int tiBroadcastNextBlockLevel (int blockLevel)
 Broadcast the next block level (to be changed at the end of the next sync event, or during a call to tiSyncReset(1). More...
 
int tiSetTriggerSource (int trig)
 Set the trigger source This routine will set a library variable to be set in the TI registers at a call to tiIntEnable. More...
 
int tiSetTriggerSourceMask (int trigmask)
 Set trigger sources with specified trigmask This routine is for special use when tiSetTriggerSource(...) does not set all of the trigger sources that is required by the user. More...
 
int tiEnableTriggerSource ()
 Enable trigger sources Enable trigger sources set by tiSetTriggerSource(...) or tiSetTriggerSourceMask(...) More...
 
int tiDisableTriggerSource (int fflag)
 Disable trigger sources. More...
 
int tiSetSyncSource (unsigned int sync)
 Set the Sync source mask. More...
 
int tiSetEventFormat (int format)
 Set the event format. More...
 
int tiSoftTrig (int trigger, unsigned int nevents, unsigned int period_inc, int range)
 Set and enable the "software" trigger. More...
 
int tiSetRandomTrigger (int trigger, int setting)
 Set the parameters of the random internal trigger. More...
 
int tiDisableRandomTrigger ()
 Disable random trigger generation. More...
 
int tiEnableFiber (unsigned int fiber)
 Enable Fiber transceiver. More...
 
int tiDisableFiber (unsigned int fiber)
 Disnable Fiber transceiver. More...
 

Detailed Description

Function Documentation

int tiBroadcastNextBlockLevel ( int  blockLevel)

Broadcast the next block level (to be changed at the end of the next sync event, or during a call to tiSyncReset(1).

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

References TI_BLOCKLEVEL_MASK, TI_TRIGGERCOMMAND_SET_BLOCKLEVEL, TI_TRIGSRC_VME, tiGetNextBlockLevel(), TILOCK, tiMaster, TIUNLOCK, TI_A24RegStruct::triggerCommand, and TI_A24RegStruct::trigsrc.

Referenced by tiSetBlockLevel(), and tiSyncReset().

int tiClockResync ( )

Resync the 250 MHz Clock.

Returns
OK if successful, ERROR otherwise

References TI_A24RegStruct::syncCommand, TI_SYNCCOMMAND_AD9510_RESYNC, TILOCK, and TIUNLOCK.

int tiDisableFiber ( unsigned int  fiber)

Disnable Fiber transceiver.

See Also
tiEnableFiber
Parameters
fiberinteger indicative of the transceiver to disable
Returns
OK if successful, ERROR otherwise.

References TI_A24RegStruct::fiber, TILOCK, and TIUNLOCK.

int tiDisableRandomTrigger ( )

Disable random trigger generation.

See Also
tiSetRandomTrigger
Returns
OK if successful, ERROR otherwise.

References TI_A24RegStruct::randomPulser, TILOCK, and TIUNLOCK.

int tiDisableTriggerSource ( 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 TI_TRIGSRC_LOOPBACK, tiFillToEndBlock(), TILOCK, tiMaster, TIUNLOCK, and TI_A24RegStruct::trigsrc.

Referenced by tiInit(), and tiIntDisable().

int tiEnableFiber ( unsigned int  fiber)

Enable Fiber transceiver.

Note: All Fiber are enabled by default (no harm, except for 1-2W power usage)

See Also
tiDisableFiber
Parameters
fiberinteger indicative of the transceiver to enable
Returns
OK if successful, ERROR otherwise.

References TI_A24RegStruct::fiber, TILOCK, and TIUNLOCK.

Referenced by tiAddSlave(), tiInit(), and tiSetSlavePort().

int tiEnableTriggerSource ( )

Enable trigger sources Enable trigger sources set by tiSetTriggerSource(...) or tiSetTriggerSourceMask(...)

See Also
tiSetTriggerSource
tiSetTriggerSourceMask
Returns
OK if successful, ERROR otherwise

References TILOCK, tiTriggerSource, TIUNLOCK, and TI_A24RegStruct::trigsrc.

Referenced by tiIntEnable().

unsigned int tiFind ( )

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

Returns
A24 VME address if found. Otherwise, 0

References TI_BOARDID_TYPE_MASK, and TI_BOARDID_TYPE_TI.

Referenced by tiInit().

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

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

Parameters
tAddrAddress or Slot Number
  • A24 VME Address of the TI (0x000016 - 0xffffff)
  • Slot number of TI (1 - 21)
modeReadout/Triggering Mode
  • 0 External Trigger - Interrupt Mode
  • 1 TI/TImaster Trigger - Interrupt Mode
  • 2 External Trigger - Polling Mode
  • 3 TI/TImaster Trigger - Polling Mode
iFlagInitialization bit mask
  • 0 Do not initialize the board, just setup the pointers to the registers
  • 1 Use Slave Fiber 5, instead of 1
  • 2 Ignore firmware check
Returns
OK if successful, otherwise ERROR.

References TI_A24RegStruct::boardID, TI_A24RegStruct::fiberSyncDelay, TI_A24RegStruct::reset, TI_A24RegStruct::SWB, TI_A24RegStruct::syncWidth, TI_BOARDID_GEOADR_MASK, TI_BOARDID_PROD_MASK, TI_BOARDID_TYPE_MASK, TI_BOARDID_TYPE_TI, TI_BUSY_LOOPBACK, TI_BUSY_SWB, TI_CLOCK_INTERNAL, TI_FIBERSYNCDELAY_LOOPBACK_SYNCDELAY_MASK, TI_INIT_NO_INIT, TI_INIT_SKIP_FIRMWARE_CHECK, TI_INIT_SLAVE_FIBER_5, TI_READOUT_EXT_INT, TI_READOUT_EXT_POLL, TI_READOUT_TS_INT, TI_READOUT_TS_POLL, TI_RESET_AUTOALIGN_HFBR1_SYNC, TI_RESET_AUTOALIGN_HFBR5_SYNC, TI_RESET_FIBER_AUTO_ALIGN, TI_RESET_I2C, TI_RESET_IODELAY, TI_RESET_MEASURE_LATENCY, TI_SUPPORTED_FIRMWARE, TI_SYNC_HFBR1, TI_SYNC_HFBR5, TI_SYNC_LOOPBACK, TI_TRIGGER_HFBR1, TI_TRIGGER_HFBR5, TI_TSINPUT_ALL, tiA24Offset, tiA32Base, tiCrateID, tiDisableTriggerSource(), tiDisableTSInput(), tiDisableVXSSignals(), tiEnableBusError(), tiEnableFiber(), tiFiberLatencyOffset, tiFind(), tiGetFirmwareVersion(), tiMaster, tiReadoutMode, tiReload(), tiResetMGT(), tiSetAdr32(), tiSetBlockBufferLevel(), tiSetBlockLevel(), tiSetBusySource(), tiSetClockSource(), tiSetCrateID(), tiSetEventFormat(), tiSetPrescale(), tiSetSyncDelayWidth(), tiSetSyncSource(), tiSetTriggerPulse(), tiSetTriggerSource(), tiSlaveMask, and tiTrigLinkReset().

int tiReload ( )

Reload the firmware on the FPGA.

Returns
OK if successful, ERROR otherwise

References TI_A24RegStruct::JTAGPROMBase, TI_A24RegStruct::reset, TI_RESET_JTAG, TILOCK, and TIUNLOCK.

Referenced by tiInit().

int tiReset ( )

Perform a soft reset of the TI.

Returns
OK if successful, ERROR otherwise

References TI_A24RegStruct::reset, TI_RESET_SOFT, TILOCK, and TIUNLOCK.

int tiSetBlockLevel ( int  blockLevel)

Set the number of events per block.

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

References tiBroadcastNextBlockLevel().

Referenced by tiInit().

int tiSetCrateID ( unsigned int  crateID)

Set the crate ID.

Returns
OK if successful, ERROR otherwise

References TI_A24RegStruct::boardID, TI_BOARDID_CRATEID_MASK, tiCrateID, TILOCK, and TIUNLOCK.

Referenced by tiInit().

int tiSetEventFormat ( 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 TI_A24RegStruct::dataFormat, TI_DATAFORMAT_HIGHERBITS_WORD, TI_DATAFORMAT_TIMING_WORD, TILOCK, and TIUNLOCK.

Referenced by tiInit().

int tiSetRandomTrigger ( 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
tiDisableRandomTrigger
Returns
OK if successful, ERROR otherwise.

References TI_A24RegStruct::randomPulser, TI_RANDOMPULSER_TRIG1_ENABLE, TI_RANDOMPULSER_TRIG1_RATE_MASK, TI_RANDOMPULSER_TRIG2_ENABLE, TILOCK, and TIUNLOCK.

int tiSetSyncSource ( unsigned int  sync)

Set the Sync source mask.

Parameters
sync- MASK indicating the sync source bit: description
  • 0: P0
  • 1: HFBR1
  • 2: HFBR5
  • 3: FP
  • 4: LOOPBACK
Returns
OK if successful, ERROR otherwise

References TI_A24RegStruct::sync, TI_SYNC_SOURCEMASK, TILOCK, and TIUNLOCK.

Referenced by tiInit(), and tiSetSlavePort().

int tiSetTriggerSource ( int  trig)

Set the trigger source This routine will set a library variable to be set in the TI registers at a call to tiIntEnable.

Parameters
trig- integer indicating the trigger source
  • 0: P0
  • 1: HFBR#1
  • 2: Front Panel (TRG)
  • 3: Front Panel TS Inputs
  • 4: TS (rev2)
  • 5: Random
  • 6-9: TS Partition 1-4
  • 10: HFBR#5
Returns
OK if successful, ERROR otherwise

References TI_TRIGGER_FPTRG, TI_TRIGGER_HFBR1, TI_TRIGGER_HFBR5, TI_TRIGGER_P0, TI_TRIGGER_PART_1, TI_TRIGGER_PART_2, TI_TRIGGER_PART_3, TI_TRIGGER_PART_4, TI_TRIGGER_PULSER, TI_TRIGGER_TSINPUTS, TI_TRIGGER_TSREV2, TI_TRIGSRC_FPTRG, TI_TRIGSRC_HFBR1, TI_TRIGSRC_HFBR5, TI_TRIGSRC_LOOPBACK, TI_TRIGSRC_P0, TI_TRIGSRC_PART_1, TI_TRIGSRC_PART_2, TI_TRIGSRC_PART_3, TI_TRIGSRC_PART_4, TI_TRIGSRC_PULSER, TI_TRIGSRC_TSINPUTS, TI_TRIGSRC_TSREV2, TI_TRIGSRC_VME, tiMaster, and tiTriggerSource.

Referenced by tiInit(), and tiSetSlavePort().

int tiSetTriggerSourceMask ( int  trigmask)

Set trigger sources with specified trigmask This routine is for special use when tiSetTriggerSource(...) 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 TI_TRIGSRC_SOURCEMASK, and tiTriggerSource.

int tiSoftTrig ( 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 30ns up to 983.13us)
  • 1: large period range (min: 120ns, increments of 30.72us up to 1.007s)
Returns
OK if successful, ERROR otherwise

References TI_A24RegStruct::fixedPulser1, TI_A24RegStruct::fixedPulser2, TI_FIXEDPULSER1_NTRIGGERS_MASK, TI_FIXEDPULSER1_PERIOD_MASK, TILOCK, and TIUNLOCK.