JLab Pipeline TD Library
3v6.1
|
Functions | |
STATUS | tdInit (UINT32 addr, UINT32 addr_inc, int nfind, int iFlag) |
Initialize JLAB TD Library. More... | |
void | tdInitPortNames () |
Initialize portName array with default names in the form: Slot%2d - Portd. More... | |
int | tdSetPortName (int id, int iport, char *name) |
Rename a specified port to a specified 20 character string. More... | |
int | tdLoadPortNames (char *filename) |
Load the Port Names as specified in a file. More... | |
int | tdSetBlockLevel (int id, unsigned int blockLevel) |
Set the number of events per block. More... | |
int | tdGSetBlockLevel (unsigned int blockLevel) |
Set the block level for all initialized TDs. More... | |
int | tdSetBlockBufferLevel (int id, unsigned int level) |
Set the block buffer level for the number of blocks in the system that need to be read out. More... | |
int | tdGSetBlockBufferLevel (unsigned int level) |
Set the block buffer level for the number of blocks in the system that need to be read out for all initialized TDs. More... | |
int | tdEnableFiber (int id, unsigned int fiber) |
Enable Fiber transceiver. More... | |
int | tdDisableFiber (int id, unsigned int fiber) |
Disable Fiber transceiver. More... | |
int | tdSetFiberMask (int id, unsigned int fibermask) |
Enable/Disable fiber ports according to specified mask. More... | |
int | tdSetBusySource (int id, unsigned int sourcemask, int rFlag) |
Set the busy source with a specified sourcemask. More... | |
int | tdSetTriggerLock (int id, int enable) |
Set the the trigger lock mode for the specified TD. More... | |
int | tdGSetTriggerLock (int enable) |
Set the the trigger lock mode for all initialized TDs. More... | |
int | tdGetTriggerLock (int id) |
Get the current setting of the trigger lock mode for the specified TD. More... | |
int | tdSetTriggerSource (int id, int trigmask) |
Set trigger sources with specified trigmask. More... | |
int | tdResetSlaveConfig (int id) |
Reset the configuration of TI Slaves on the TD. More... | |
int | tdAddSlave (int id, unsigned int fiber) |
Add and configure a TI Slave for the TD. More... | |
int | tdRemoveSlave (int id, unsigned int fiber) |
Remove a TI Slave for the TD. More... | |
int | tdAddSlaveMask (int id, unsigned int fibermask) |
Add and configure TI Slaves by using a mask for the TD. More... | |
int | tdAutoAlignSync (int id) |
Auto Align Sync Delay. More... | |
int | tdLatchTimers (int id) |
Latch the Busy and Live Timers. More... | |
int | tdEnableSyncResetRequest (int id, unsigned int portMask) |
Configure which ports (and self) to enable response of a SyncReset request. More... | |
int | tdTriggerReadyReset (int id) |
Reset the triggers enabled status bits of TI Slaves. More... | |
int | tdSetPortNamesFromCrateID (int id) |
Set the port names for the specified TD from the received Crate IDs from the TI Slaves. More... | |
void | tdGSetPortNamesFromCrateID () |
Set the port names for all initialized TD from the received Crate IDs from the TI Slaves. More... | |
int | tdResetMGT (int id) |
Reset the MGT. More... | |
int | tdResetMGTRx (int id) |
Reset the MGT Rx CDR. More... | |
int | tdSetOutputPort (int id, unsigned int set1, unsigned int set2, unsigned int set3, unsigned int set4) |
Set (or unset) high level for the output ports on the front panel labelled as O#1-4. More... | |
int tdAddSlave | ( | int | id, |
unsigned int | fiber | ||
) |
Add and configure a TI Slave for the TD.
This routine should be used by the TD to configure HFBR port and BUSY sources.
id | Slot number |
fiber | The fiber port of the TD that is connected to the slave |
References TD_BUSY_HFBR1, tdEnableFiber(), tdID, tdSetBusySource(), and tdSlaveMask.
Referenced by tdAddSlaveMask().
int tdAddSlaveMask | ( | int | id, |
unsigned int | fibermask | ||
) |
Add and configure TI Slaves by using a mask for the TD.
This routine should be used by the TD to configure HFBR ports and BUSY sources.
id | Slot number |
fibermask | The fiber port mask of the TDs that are connected to the slaves. bit 0 - port 1... bit 7 - port 8 |
References tdAddSlave(), and tdID.
int tdAutoAlignSync | ( | int | id | ) |
Auto Align Sync Delay.
This routine is called in tiInit
id | Slot number |
References TD_A24RegStruct::reset, TD_RESET_AUTOALIGN_P0_SYNC, TD_RESET_IODELAY, tdID, TDLOCK, and TDUNLOCK.
Referenced by tdInit().
int tdDisableFiber | ( | int | id, |
unsigned int | fiber | ||
) |
int tdEnableFiber | ( | int | id, |
unsigned int | fiber | ||
) |
Enable Fiber transceiver.
Note: All Fiber are enabled by default (no harm, except for 1-2W power usage)
id | Slot number |
fiber | integer indicative of the transceiver to enable |
References tdID, TDLOCK, and TDUNLOCK.
Referenced by tdAddSlave().
int tdEnableSyncResetRequest | ( | int | id, |
unsigned int | portMask | ||
) |
Configure which ports (and self) to enable response of a SyncReset request.
id | Slot number |
portMask | Mask of ports to enable (port 1 = bit 0) |
self | 1 to enable self, 0 to disable |
References TD_A24RegStruct::rocEnable, TD_ROCENABLE_MASK, tdID, TDLOCK, and TDUNLOCK.
int tdGetTriggerLock | ( | int | id | ) |
Get the current setting of the trigger lock mode for the specified TD.
id | Slot number |
References TD_A24RegStruct::busy, TD_BUSY_TRIGGER_LOCK, tdID, TDLOCK, and TDUNLOCK.
int tdGSetBlockBufferLevel | ( | unsigned int | level | ) |
Set the block buffer level for the number of blocks in the system that need to be read out for all initialized TDs.
If this buffer level is full, the TD will go BUSY. The BUSY is released as soon as the number of buffers in the system drops below this level.
level |
|
References nTD, tdID, and tdSetBlockBufferLevel().
int tdGSetBlockLevel | ( | unsigned int | blockLevel | ) |
Set the block level for all initialized TDs.
blockLevel | Block Level |
References nTD, tdID, and tdSetBlockLevel().
void tdGSetPortNamesFromCrateID | ( | ) |
Set the port names for all initialized TD from the received Crate IDs from the TI Slaves.
References nTD, tdSetPortNamesFromCrateID(), and tdSlot().
int tdGSetTriggerLock | ( | int | enable | ) |
Set the the trigger lock mode for all initialized TDs.
enable | Enable flag 0: Disable !0: Enable |
References TD_A24RegStruct::busy, nTD, TD_BUSY_TRIGGER_LOCK, TDLOCK, tdSlot(), and TDUNLOCK.
STATUS tdInit | ( | UINT32 | addr, |
UINT32 | addr_inc, | ||
int | nfind, | ||
int | iFlag | ||
) |
Initialize JLAB TD Library.
addr |
|
addr_inc |
|
nfind |
|
iFlag | - Initialization mask
|
References TD_A24RegStruct::boardID, nTD, TD_BOARDID_GEOADR_MASK, TD_BOARDID_TYPE_MASK, TD_BOARDID_TYPE_TD, TD_FIRMWARE_ID_MASK, TD_FIRMWARE_MAJOR_VERSION_MASK, TD_FIRMWARE_TYPE_MASK, TD_FIRWMARE_MINOR_VERSION_MASK, TD_INIT_NO_INIT, TD_INIT_SKIP_FIRMWARE_CHECK, TD_INIT_USE_ADDR_LIST, TD_SUPPORTED_FIRMWARE, TD_SUPPORTED_TYPE, TD_SYNC_P0, TD_TRIGSRC_LOOPBACK, TD_TRIGSRC_P0, tdA24Offset, tdAddrList, tdAutoAlignSync(), tdGetFirmwareVersion(), tdID, tdInitPortNames(), tdResetMGT(), tdSetBlockBufferLevel(), tdSetBlockLevel(), tdSetBusySource(), tdSetFiberMask(), tdSetSyncSource(), tdSetTriggerSource(), tdSlaveMask, and tdTriggerReadyReset().
void tdInitPortNames | ( | ) |
Initialize portName array with default names in the form: Slot%2d - Portd.
References TD_MAX_FIBER_PORTS, and TD_MAX_VME_SLOTS.
Referenced by tdInit().
int tdLatchTimers | ( | int | id | ) |
Latch the Busy and Live Timers.
This routine should be called prior to a call to tdGetLiveTime and tdGetBusyTime
id | Slot number |
References TD_A24RegStruct::reset, TD_RESET_LATCH_TIMERS, tdID, TDLOCK, and TDUNLOCK.
Referenced by tdStatus().
int tdLoadPortNames | ( | char * | filename | ) |
Load the Port Names as specified in a file.
Format must be: Slot Port Name e.g. 3 2 ROC5 3 3 ROC10
filename | Name of input file |
References TD_MAX_PORTNAME_CHARS, and tdSetPortName().
int tdRemoveSlave | ( | int | id, |
unsigned int | fiber | ||
) |
Remove a TI Slave for the TD.
id | Slot number |
fiber | The fiber port of the TD to remove. |
References TD_A24RegStruct::busy, TD_A24RegStruct::fiber, TD_BUSY_HFBR1, tdID, TDLOCK, tdSlaveMask, and TDUNLOCK.
int tdResetMGT | ( | int | id | ) |
Reset the MGT.
id | Slot number |
References TD_A24RegStruct::reset, TD_RESET_MGT, tdID, TDLOCK, and TDUNLOCK.
Referenced by tdInit().
int tdResetMGTRx | ( | int | id | ) |
Reset the MGT Rx CDR.
id | Slot number |
References TD_A24RegStruct::reset, TD_RESET_MGT_RX_RESET, tdID, TDLOCK, and TDUNLOCK.
int tdResetSlaveConfig | ( | int | id | ) |
Reset the configuration of TI Slaves on the TD.
This routine removes all slaves and resets the fiber port busys.
id | Slot number |
References TD_A24RegStruct::busy, TD_BUSY_HFBR_MASK, tdID, TDLOCK, tdSlaveMask, and TDUNLOCK.
int tdSetBlockBufferLevel | ( | int | id, |
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 TD will go BUSY. The BUSY is released as soon as the number of buffers in the system drops below this level.
id | Slot number |
level |
|
References TD_A24RegStruct::blockBuffer, TD_BLOCKBUFFER_BUFFERLEVEL_MASK, tdID, TDLOCK, and TDUNLOCK.
Referenced by tdGSetBlockBufferLevel(), and tdInit().
int tdSetBlockLevel | ( | int | id, |
unsigned int | blockLevel | ||
) |
Set the number of events per block.
id | Slot number |
blockLevel | Block Level |
References TD_A24RegStruct::blocklevel, TD_BLOCKLEVEL_MASK, tdID, TDLOCK, and TDUNLOCK.
Referenced by tdGSetBlockLevel(), and tdInit().
int tdSetBusySource | ( | int | id, |
unsigned int | sourcemask, | ||
int | rFlag | ||
) |
Set the busy source with a specified sourcemask.
id | Slot number |
sourcemask | bits:
|
rFlag | - decision to reset the global source flags
|
References TD_A24RegStruct::busy, TD_BUSY_SOURCEMASK, tdID, TDLOCK, and TDUNLOCK.
Referenced by tdAddSlave(), and tdInit().
int tdSetFiberMask | ( | int | id, |
unsigned int | fibermask | ||
) |
Enable/Disable fiber ports according to specified mask.
id | Slot number |
fibermask | mask indicative of the transceivers to enable/disable |
References TD_A24RegStruct::fiber, tdID, TDLOCK, and TDUNLOCK.
Referenced by tdInit().
int tdSetOutputPort | ( | int | id, |
unsigned int | set1, | ||
unsigned int | set2, | ||
unsigned int | set3, | ||
unsigned int | set4 | ||
) |
Set (or unset) high level for the output ports on the front panel labelled as O#1-4.
set1 | O#1 |
set2 | O#2 |
set3 | O#3 |
set4 | O#4 |
References TD_A24RegStruct::output, tdID, TDLOCK, and TDUNLOCK.
int tdSetPortName | ( | int | id, |
int | iport, | ||
char * | name | ||
) |
Rename a specified port to a specified 20 character string.
id | Slot number |
iport | Port Number |
name | String to assign to port |
References TD_MAX_FIBER_PORTS, TD_MAX_PORTNAME_CHARS, TD_MAX_VME_SLOTS, and tdID.
Referenced by tdLoadPortNames(), and tdSetPortNamesFromCrateID().
int tdSetPortNamesFromCrateID | ( | int | id | ) |
Set the port names for the specified TD from the received Crate IDs from the TI Slaves.
id | Slot number |
References tdGetCrateID(), tdID, and tdSetPortName().
Referenced by tdGSetPortNamesFromCrateID().
int tdSetTriggerLock | ( | int | id, |
int | enable | ||
) |
Set the the trigger lock mode for the specified TD.
id | Slot number |
enable | Enable flag 0: Disable !0: Enable |
References TD_A24RegStruct::busy, TD_BUSY_TRIGGER_LOCK, tdID, TDLOCK, and TDUNLOCK.
int tdSetTriggerSource | ( | int | id, |
int | trigmask | ||
) |
Set trigger sources with specified trigmask.
id | Slot number |
trigmask | bits:
|
References TD_TRIGSRC_SOURCEMASK, tdID, TDLOCK, TDUNLOCK, and TD_A24RegStruct::trigsrc.
Referenced by tdInit().
int tdTriggerReadyReset | ( | int | id | ) |
Reset the triggers enabled status bits of TI Slaves.
id | Slot number |
References TD_A24RegStruct::reset, TD_A24RegStruct::sync, TD_A24RegStruct::syncCommand, TD_RESET_MGT_RX_RESET, TD_SYNC_LOOPBACK, TD_SYNC_SOURCEMASK, TD_SYNCCOMMAND_TRIGGER_READY_RESET, tdID, TDLOCK, and TDUNLOCK.
Referenced by tdInit().