JLab Pipeline TS Library  3v7.1
TS Partitioning

Functions

int tsPartInit (int pID, unsigned int tAddr, unsigned int mode, int iFlag)
 Initialize a TS partition. More...
 
int tsPartSetBusySource (int busysrc)
 Set the busy source for this partition. More...
 
int tsPartSetBlockBufferLevel (unsigned int bufferlevel)
 Set up the Block Buffer Level. More...
 
int tsPartSetTDInput (unsigned int tdinput)
 Select the input that has the TD Busy. More...
 
int tsPartSetFPInput (unsigned short input1, unsigned short input2, unsigned short input3)
 Set the FP Inputs for this partition. More...
 
int tsPartSetGTPInput (unsigned short input1, unsigned short input2, unsigned short input3, unsigned short input4, unsigned short input5)
 Set the GTP Inputs for this partition. More...
 
int tsPartLoadTriggerTable ()
 Load the trigger table for current partition. More...
 
int tsPartReadBlock (volatile unsigned int *data, int nwrds)
 Read a block of events from the current TS partition. More...
 
unsigned int tsPartBReady ()
 Returns the number of Blocks available for readout for this partition. More...
 
void tsPartIntAck ()
 Acknowledge an interrupt or latched trigger for this partition. More...
 
int tsPartIntEnable (int iflag)
 Enable interrupts or latching triggers for this partition. More...
 
void tsPartIntDisable ()
 Disable interrupts or latching triggers for this partition. More...
 
int tsPartIntConnect (VOIDFUNCPTR routine, unsigned int arg)
 Connect a user routine to the TS Interrupt or latched trigger, if polling. More...
 
int tsPartIntDisconnect ()
 Disable interrupts or kill the polling service thread. More...
 

Detailed Description

Function Documentation

◆ tsPartBReady()

unsigned int tsPartBReady ( )

Returns the number of Blocks available for readout for this partition.

Returns
Number of blocks available for readout if successful, otherwise ERROR

◆ tsPartInit()

int tsPartInit ( int  pID,
unsigned int  tAddr,
unsigned int  mode,
int  iFlag 
)

Initialize a TS partition.

Parameters
pIDThe partition identification number (1-4)
tAddr
  • A24 VME Address of the TS
  • Slot number of TS (1 - 21)
modeWhat mode to signal data ready from the partition
  • 0: Interrupt
  • 2: Polling
iFlagInitialization bit mask
  • 0: No TS Initialization (map pointer only)
Returns
OK if successful, otherwise ERROR

References TS_A24RegStruct::boardID, MAX_VME_SLOTS, TS_BOARDID_GEOADR_MASK, TS_BOARDID_TYPE_MASK, TS_BOARDID_TYPE_TS, TS_FIRMWARE_ID_MASK, TS_FIRMWARE_MAJOR_VERSION_MASK, TS_FIRMWARE_TYPE_MASK, TS_FIRWMARE_MINOR_VERSION_MASK, tsA24Offset, and tsGetFirmwareVersion().

◆ tsPartIntAck()

void tsPartIntAck ( )

Acknowledge an interrupt or latched trigger for this partition.

◆ tsPartIntConnect()

int tsPartIntConnect ( VOIDFUNCPTR  routine,
unsigned int  arg 
)

Connect a user routine to the TS Interrupt or latched trigger, if polling.

Parameters
routineRoutine to call if block is available
argargument to pass to routine
Returns
OK if successful, otherwise ERROR

◆ tsPartIntDisable()

void tsPartIntDisable ( )

Disable interrupts or latching triggers for this partition.

◆ tsPartIntDisconnect()

int tsPartIntDisconnect ( )

Disable interrupts or kill the polling service thread.

Returns
OK if successful, otherwise ERROR

◆ tsPartIntEnable()

int tsPartIntEnable ( int  iflag)

Enable interrupts or latching triggers for this partition.

Parameters
iflagif = 1, trigger counter will be reset
Returns
OK if successful, otherwise ERROR

◆ tsPartLoadTriggerTable()

int tsPartLoadTriggerTable ( )

Load the trigger table for current partition.

Returns
OK if successful, otherwise ERROR

◆ tsPartReadBlock()

int tsPartReadBlock ( volatile unsigned int *  data,
int  nwrds 
)

Read a block of events from the current TS partition.

Parameters
data- local memory address to place data
nwrds- Max number of words to transfer
Returns
Number of words transferred to data if successful, ERROR otherwise

◆ tsPartSetBlockBufferLevel()

int tsPartSetBlockBufferLevel ( unsigned int  bufferlevel)

Set up the Block Buffer Level.

Parameters
bufferlevelHow many unacknowledged blocks in the system before busy
Returns
OK if successful, otherwise ERROR

◆ tsPartSetBusySource()

int tsPartSetBusySource ( int  busysrc)

Set the busy source for this partition.

Parameters
busysrc
  • 1: Switch slot B
  • 2: Front Panel
  • 3: Fiber TI-A
  • 4: Fiber TI-B
Returns
OK if successful, otherwise ERROR.

◆ tsPartSetFPInput()

int tsPartSetFPInput ( unsigned short  input1,
unsigned short  input2,
unsigned short  input3 
)

Set the FP Inputs for this partition.

Parameters
input1
input2
input3
Returns
OK if successful, otherwise ERROR

◆ tsPartSetGTPInput()

int tsPartSetGTPInput ( unsigned short  input1,
unsigned short  input2,
unsigned short  input3,
unsigned short  input4,
unsigned short  input5 
)

Set the GTP Inputs for this partition.

Parameters
input1
input2
input3
input4
input5
Returns
OK if successful, otherwise ERROR

◆ tsPartSetTDInput()

int tsPartSetTDInput ( unsigned int  tdinput)

Select the input that has the TD Busy.

Parameters
tdinputInput selection
Returns
OK if successful, otherwise ERROR