#include <stdlib.h>
#include <intLib.h>
#include <iv.h>
#include <sysLib.h>
#include "BBC/SPIN.h"
#include "BBC/TIMERS.h"
#include "BVME/VME.h"
#include "BFPGA/FPGA_bs.h"
#include "BFPGA/FPGA_ttc.h"
#include "BTU/TEM.h"
#include "BTU/FPGA_vme.h"
#include "BTU/TEM_temDsc.h"
#include "BTU/TEM_fpgaDsc.h"
Defines | |
| #define | OFFSET_OF(_type, _member) |
| Macro to get the byte offset of a structure member. More... | |
| #define | CNT_OF(array) (sizeof(array)/sizeof(*array)) |
| Macro to get the number of elements in an array. | |
| #define | TEM_REGADR(lcl, offset) (volatile unsigned int *)((char *)lcl+offset) |
| Converts a base address and offset to an address. More... | |
| #define | BASE_K_SHIFT 5 |
| Used in verifying that a VME BASE INTERRUPT VECTOR is valid. | |
| #define | BASE_M_MBZ_BITS ((1 << BASE_K_SHIFT) - 1) |
| Used in verifying that a VME BASE INTERRUPT VECTOR is valid. | |
| #define | BASE_M_CHECK(_base) (_base >> BASE_K_SHIFT) |
| Used in verifying that a VME BASE INTERRUPT VECTOR is valid. | |
| #define | BASE_M_VALID |
| Used in verifying that a VME BASE INTERRUPT VECTOR is valid. More... | |
| #define | LVL_M_VALID 0xFE |
| Mask of allowable VME interrupt levels( 1-7). | |
| #define | TEM_M_EVT_NEVTS 0x7ff |
| Bit mask used to extract the number of events. More... | |
Typedefs | |
| typedef enum _ToggleAndCheckOpts | ToggleAndCheckOpts |
| Typedef for enum _ToggleAndCheckOpts. More... | |
Enumerations | |
| enum | _ToggleAndCheckOpts { OPT_M_SET = (1 << 0), OPT_M_CLR = (1 << 1), OPT_M_TOGGLE, OPT_M_CHECK = (1 << 2), OPT_M_SET_AND_CHECK, OPT_M_CLR_AND_CHECK, OPT_M_TOGGLE_AND_CHECK } |
| Enumerates all the action options to the toggleAndCheck() routine. More... | |
Functions | |
| int | getMaxSize (TEM_fpga *fpgas, unsigned int fpgaList) |
| Finds the maximum size of a set of FPGA download files. More... | |
| void | initLogs (TEM_fpgaLog *logs, int cnt) |
| Initializes an array of TEM_fpgaLog structures. More... | |
| unsigned int | toggleAndCheck (TEM_tem *tem, unsigned int temList, unsigned int capabilities, TEM_temActionId which, ToggleAndCheckOpts opts, TEM_temState newState) |
| Sets, clears, toggles or checks some bits in the TEM registers. More... | |
| unsigned int | doFpgaAction (TEM_fpga *fpga, unsigned int fpgaList, FPGA_vmeAction action, TEM_fpgaLogId logId) |
| Performs simple actions on a set of FPGAs. More... | |
| unsigned int | fpgasAuxCtlGet (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int which, unsigned int *retList) |
| Returns the state of the specified bit. More... | |
| unsigned int | fpgasAuxCtlSupported (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int which) |
| Returns a bit list indicating whether the FPGAs support the specified bit. FPGAs. More... | |
| unsigned int | fpgasAuxCtlWrite (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int which, unsigned int list) |
| Writes the bit for the specified FPGAs. More... | |
| unsigned int | fpgasCtlGet (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int which, unsigned int *retList) |
| Returns the state of the specified bit. More... | |
| unsigned int | fpgasCtlSupported (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int which) |
| Returns a bit list indicating whether the FPGAs support the specified bit. FPGAs. More... | |
| unsigned int | fpgasCtlWrite (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int which, unsigned int list) |
| Writes the bit for the specified FPGAs. More... | |
| unsigned int | fpgasStatGet (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int which, unsigned int *retList) |
| Returns the state of the specified bit. More... | |
| unsigned int | fpgasStatSupported (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int which) |
| Returns a bit list indicating whether the FPGAs support the specified bit. FPGAs. More... | |
| unsigned int | temTrgsCtlGet (const TEM_tem *tems, unsigned int temList, unsigned int which, unsigned int *retList) |
| Returns the state of the specified bit. More... | |
| unsigned int | temTrgsCtlSupported (const TEM_tem *tems, unsigned int temList, unsigned int which) |
| Returns a bit list indicating whether the TEMs support the specified bit. More... | |
| unsigned int | temTrgsCtlWrite (const TEM_tem *tems, unsigned int temList, unsigned int which, unsigned int list) |
| Writes the bit for the specified TEMs. More... | |
| unsigned int | temTrgsMskGet (const TEM_tem *tems, unsigned int temList, unsigned int which, unsigned int width, unsigned int lmsk, unsigned int *retList) |
| Returns the state of the specified msk. More... | |
| unsigned int | temTrgsMskSupported (const TEM_tem *tems, unsigned int temList, unsigned int which) |
| Returns a bit list indicating whether the TEMs support the specified bit. More... | |
| unsigned int | temTrgsMskWrite (const TEM_tem *tems, unsigned int temList, unsigned int which, unsigned int width, unsigned int lmsk, unsigned int list) |
| Writes the bit for the specified TEMs. More... | |
| unsigned int | temTrgsTstGet (const TEM_tem *tems, unsigned int temList, unsigned int which, unsigned int width, unsigned int lmsk, unsigned int *retList) |
| Returns the state of the specified msk. More... | |
| unsigned int | temTrgsTstSupported (const TEM_tem *tems, unsigned int temList, unsigned int which) |
| Returns a bit list indicating whether the TEMs support the specified bit. More... | |
| unsigned int | temTrgsTstWrite (const TEM_tem *tems, unsigned int temList, unsigned int which, unsigned int width, unsigned int lmsk, unsigned int list) |
| Writes the bit for the specified TEMs. More... | |
| unsigned int | TEM_temsAdd (TEM_tem *tem, unsigned int temList, const unsigned int vmeAdrs[TEM_C_CNT], const struct _TEM_temDsc *const temDscs[TEM_C_CNT]) |
| Completes a high level description of each active TEM. More... | |
| unsigned int | TEM_temsAdrsGet (const TEM_tem *tems, unsigned int temList, unsigned int vmeAdrs[TEM_C_CNT], volatile unsigned int *lclAdrs[TEM_C_CNT]) |
| Fills in arrays of the VME and LOCAL addresss of the specified TEMs. More... | |
| unsigned int | TEM_temsDetsReset (TEM_tem *tem, unsigned int temList) |
| Issues a reset to the detector specific registers on the specified TEMs. More... | |
| unsigned int | TEM_temsFifosReset (TEM_tem *tem, unsigned int temList) |
| Issues a reset to the all FIFOs on the specified TEMs. More... | |
| unsigned int | TEM_temsFpgasGet (const TEM_tem *tem, unsigned int temList) |
| Returns a bit mask of the FPGAs associated with the requested set of TEMs. More... | |
| unsigned int | TEM_temsFpgasReset (TEM_tem *tem, unsigned int temList) |
| Issues a reset to the all FPGAs on the specified TEMs. More... | |
| unsigned int | TEM_temsPreset (TEM_tem *tem, unsigned temList) |
| Puts the TEM control registers in a known state so the TEM's FPGAs can be loaded. More... | |
| unsigned int | TEM_temsProbe (TEM_tem *tem, unsigned int temList) |
| Probes the VME bus for the present of the specified list of. More... | |
| unsigned int | TEM_temsReady (TEM_tem *tem, unsigned temList) |
| Toggles the RESET FPGA and RESET FIFOs bit in the control register. More... | |
| unsigned int | TEM_temsReset (TEM_tem *tem, unsigned int temList) |
| Resets all FPGAs, FIFOs and DETs on the specified TEMs. More... | |
| unsigned int | TEM_temsScopeBitClear (TEM_tem *tem, unsigned int temList) |
| Clears the scope bit on the specified TEMs. More... | |
| unsigned int | TEM_temsScopeBitSet (TEM_tem *tem, unsigned int temList) |
| Sets the scope bit on the specified TEMs. More... | |
| unsigned int | TEM_temsScopeBitToggle (TEM_tem *tem, unsigned int temList) |
| Toggles the scope bit on the specified TEMs. More... | |
| unsigned int | TEM_temsUnreadied (const TEM_tem *tem, unsigned int temList) |
| Simply query routine to learn which TEMs are not ready. More... | |
| unsigned int | TEM_fpgasAdd (TEM_fpga *fpgas, unsigned int fpgaList, const struct _TEM_fpgaDsc *const fpgaDscs[TEM_C_FPGA_CNT], const struct _FPGA_ttcHdr *const fpgaTtcs[TEM_C_FPGA_CNT], const TEM_tem *tem) |
| Adds the specified FPGAs to the internal database. More... | |
| unsigned int | TEM_fpgasAdrsGet (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int vmeAdrs[TEM_C_FPGA_CNT], volatile unsigned int *lclAdrs[TEM_C_FPGA_CNT]) |
| Fills in arrays of the VME and LOCAL addresss of the specified FPGAs. More... | |
| unsigned int | TEM_fpgasBistClear (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Clears the self test bit for the selected FPGAs. More... | |
| unsigned int | TEM_fpgasBistGet (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int *bistList) |
| Returns the state of the Self Test for the specified fpgas. More... | |
| unsigned int | TEM_fpgasBistSet (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Sets the Self Test for the specified FPGAs. More... | |
| unsigned int | TEM_fpgasBistSupported (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Returns which of the specified FPGAs support a self-test mode. More... | |
| unsigned int | TEM_fpgasBistWrite (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int bistList) |
| Writes the Self Test for the specified FPGAs. More... | |
| unsigned int | TEM_fpgasHfullClrClear (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Clears the FIFO Half Full Throttle Manual Clear for the selected FPGAs. More... | |
| unsigned int | TEM_fpgasHfullClrGet (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int *hfullList) |
| Returns the state of the FIFO Half Full Throttle Manual Clear. for the specified fpgas. More... | |
| unsigned int | TEM_fpgasHfullClrSet (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Sets the FIFO Half Full Throttle for the specified FPGAs. More... | |
| unsigned int | TEM_fpgasHfullClrSupported (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Returns which of the specified FPGAs support a FIFO Half Full Throttle Manual Clear mode. More... | |
| unsigned int | TEM_fpgasHfullClrWrite (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int hfullList) |
| Writes the Half Full Throttle Manual Clear mode for the specified FPGAs. More... | |
| unsigned int | TEM_fpgasHfullEnbClear (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Clears the FIFO Half Full Throttle for the selected FPGAs. More... | |
| unsigned int | TEM_fpgasHfullEnbGet (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int *hfullList) |
| Returns the state of the FIFO Half Full Throttle for the specified fpgas. More... | |
| unsigned int | TEM_fpgasHfullEnbSet (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Sets the FIFO Half Full Throttle for the specified FPGAs. More... | |
| unsigned int | TEM_fpgasHfullEnbSupported (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Returns which of the specified FPGAs support a FIFO Half Full Throttle mode. More... | |
| unsigned int | TEM_fpgasHfullEnbWrite (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int hfullList) |
| Writes the Half Full Throttle mode for the specified FPGAs. More... | |
| unsigned int | TEM_fpgasRdoModeClear (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Clears the Readout Mode for the selected FPGAs. More... | |
| unsigned int | TEM_fpgasRdoModeGet (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int *rdoList) |
| Returns the state of the Readout Mode for the specified FPGAs. More... | |
| unsigned int | TEM_fpgasRdoModeSet (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Sets the Readout Mode to 1, for the specified FPGAs. More... | |
| unsigned int | TEM_fpgasRdoModeSupported (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Returns a bit list indicating which FPGAs support an alternative Readout Mode. More... | |
| unsigned int | TEM_fpgasRdoModeWrite (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int rdoList) |
| Writes the Readout Mode for the specified FPGAs. More... | |
| unsigned int | TEM_fpgasRdoBsyMinMaxClear (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Clears the Readout Min/MaxMode for the selected FPGAs. More... | |
| unsigned int | TEM_fpgasRdoBsyMinMaxGet (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int *rdoMinMaxList) |
| Returns the state of the Readout Min/MaxMode for the specified FPGAs. More... | |
| unsigned int | TEM_fpgasRdoBsyMinMaxSet (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Sets the Readout Busy Min/Max 1, for the specified FPGAs. More... | |
| unsigned int | TEM_fpgasRdoBsyMinMaxSupported (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Returns a bit list indicating which FPGAs support the Readout Busy Min/Max mode. More... | |
| unsigned int | TEM_fpgasRdoBsyMinMaxWrite (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int rdoBsyMinMaxList) |
| Writes the Readout Busy Min/Max mode for the specified FPGAs. More... | |
| unsigned int | TEM_fpgasRdoToGet (const TEM_fpga *fpgas, unsigned int fpgaList, unsigned int *rdoToList) |
| Returns the state of the Readout Timeout status bit for the specified FPGAs. More... | |
| unsigned int | TEM_fpgasRdoToSupported (const TEM_fpga *fpgas, unsigned int fpgaList) |
| Returns a bit list indicating which FPGAs support the Readout Timeout status bit. More... | |
| unsigned int | TEM_fpgasClear (TEM_fpga *fpgas, unsigned int fpgaList) |
| Clears the specified list of FPGAs. More... | |
| unsigned int | TEM_fpgasL1tCounterClear (TEM_fpga *fpgas, unsigned int fpgaList) |
| Does a L1T COUNTER CLEAR on the specified list of FPGAs. More... | |
| unsigned int | TEM_fpgasL1tTimerClear (TEM_fpga *fpgas, unsigned int fpgaList) |
| Does a CLEAR L1T TIMER on the specified list of FPGAs. More... | |
| unsigned int | TEM_fpgasLoad (TEM_fpga *fpgas, unsigned int fpgaList) |
| Loads the specified list of FPGAs. More... | |
| unsigned int | TEM_fpgasLogicClear (TEM_fpga *fpgas, unsigned int fpgaList) |
| Does a CLEAR LOGIC on the specified list of FPGAs. More... | |
| unsigned int | TEM_fpgasRegsClear (TEM_fpga *fpgas, unsigned int fpgaList) |
| Does a CLEAR REGS on the specified list of FPGAs. More... | |
| unsigned int | TEM_fpgasTemsGet (const TEM_fpga *fpga, unsigned int fpgaList) |
| Returns a bit mask of the TEMs associated with the requested set of FPGASs. More... | |
| unsigned int | TEM_fpgasUnload (TEM_fpga *fpga, unsigned int fpgaList) |
| Unloads the specified list of FPGAs. More... | |
| unsigned int | TEM_temIntsIscsGet (const TEM_tem *tems, unsigned int temList, const struct _TEM_temInt *isc[]) |
| Returns a pointer to an array of TEM interrupt structures. More... | |
| unsigned int | TEM_temIntsInit (const TEM_tem *tems, unsigned int temList, const unsigned int *levels, const unsigned int *bases) |
| Initializes the TEM interrupt registers. More... | |
| int | TEM_temIntsMinEventsGet (const TEM_tem *tems, unsigned int temList, unsigned int *nevts) |
| Returns the minimum number of events pending from the specified list of TEMs. More... | |
| unsigned int | TEM_temIntsDisable (const TEM_tem *tems, unsigned int temList, unsigned int irpts) |
| Disables the specified list of interrupts on all specified TEMs. More... | |
| unsigned int | TEM_temIntsEnable (const TEM_tem *tems, unsigned int temList, unsigned int irpts) |
| Enables the specified list of interrupts on all specified TEMs. More... | |
| unsigned int | TEM_temIntsMasterDisable (const TEM_tem *tems, unsigned int temList) |
| Disables the master interrupt on the specified list of TEMs. More... | |
| unsigned int | TEM_temIntsMasterEnable (const TEM_tem *tems, unsigned int temList) |
| Enables the master interrupt on the specified list of TEMs. More... | |
| unsigned int | TEM_temIntsMasterReset (const TEM_tem *tems, unsigned int temList) |
| Resets the master interrupt on the specified list of TEMs. More... | |
| int | TEM_temIntConnect (const TEM_tem *tems, TEM_temId temId, unsigned int vector, TEM_temIntCbRtn cb_rtn, TEM_temIntCbPrm cb_prm) |
| Connects the interrupt vector on a individual TEM basis. The TEM must be at least in the PRESENT state. More... | |
| unsigned int | TEM_temIntsVmeDisable (const TEM_tem *tems, unsigned int temList) |
| Disables the VME interrupt on the specified list of TEMs. A TEM must be at least PRESENT before its interrupts can be disabled. More... | |
| unsigned int | TEM_temIntsVmeEnable (const TEM_tem *tems, unsigned int temList) |
| Enables the VME interrupt on the specified list of TEMs. A TEM must be at least PRESENT before its interrupts can be disabled. More... | |
| unsigned int | TEM_temIntsThresholdSet (const TEM_tem *tems, unsigned int temList, const unsigned int *thresholds) |
| Sets the event threshold on the specified list of TEMs. More... | |
| unsigned int | TEM_temTrgsTcssGet (const TEM_tem *tems, unsigned int temList, const struct _TEM_temTrg *trg[]) |
| Returns a pointer to an array of TEM trigger structures. More... | |
| unsigned int | TEM_temTrgsCpuBsyClr (const TEM_tem *tems, unsigned int temList) |
| Clears the CPU BSY bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsCpuBsyGet (const TEM_tem *tems, unsigned int temList, unsigned int *cpuBsy) |
| Gets the state of the CPU BSY bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsCpuBsySet (const TEM_tem *tems, unsigned int temList) |
| Sets the CPU BSY bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsCpuBsySupported (const TEM_tem *tems, unsigned int temList) |
| Returns a bit mask of TEMs which support the CPU BSY bit. More... | |
| unsigned int | TEM_temTrgsCpuBsyWrite (const TEM_tem *tems, unsigned int temList, unsigned int cpuBsys) |
| Writes the CPU BSY bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsL1tEnbClr (const TEM_tem *tems, unsigned int temList) |
| Clears the L1T ENABLE bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsL1tEnbGet (const TEM_tem *tems, unsigned int temList, unsigned int *l1tEnb) |
| Gets the state of the L1T ENABLE bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsL1tEnbSet (const TEM_tem *tems, unsigned int temList) |
| Sets the L1T ENABLE bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsL1tEnbSupported (const TEM_tem *tems, unsigned int temList) |
| Returns a bit mask of TEMs which support the L1T ENABLE bit. More... | |
| unsigned int | TEM_temTrgsL1tEnbWrite (const TEM_tem *tems, unsigned int temList, unsigned int l1tEnbs) |
| Writes the L1T ENABLE bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsL1tTmrClr (const TEM_tem *tems, unsigned int temList) |
| Clears the L1T TMR bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsL1tTmrGet (const TEM_tem *tems, unsigned int temList, unsigned int *l1tTmr) |
| Gets the state of the L1T TMR bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsL1tTmrSet (const TEM_tem *tems, unsigned int temList) |
| Sets the L1T TMR bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsL1tTmrSupported (const TEM_tem *tems, unsigned int temList) |
| Returns a bit mask of TEMs which support the L1T TMR bit. More... | |
| unsigned int | TEM_temTrgsL1tTmrWrite (const TEM_tem *tems, unsigned int temList, unsigned int tmrEnbs) |
| Writes the L1T TMR bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsTreqEnbClr (const TEM_tem *tems, unsigned int temList) |
| Clears the TREQ ENABLE bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsTreqEnbGet (const TEM_tem *tems, unsigned int temList, unsigned int *treqEnb) |
| Gets the state of the TREQ ENABLE bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsTreqEnbSet (const TEM_tem *tems, unsigned int temList) |
| Sets the TREQ ENABLE bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsTreqEnbSupported (const TEM_tem *tems, unsigned int temList) |
| Returns a bit mask of TEMs which support the TREQ ENABLE bit. More... | |
| unsigned int | TEM_temTrgsTreqEnbWrite (const TEM_tem *tems, unsigned int temList, unsigned int treqEnbs) |
| Writes the TREQ ENABLE bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsL1tInGet (const TEM_tem *tems, unsigned int temList, unsigned int *l1tIn) |
| Gets the state of the L1T IN mask for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsL1tInWrite (const TEM_tem *tems, unsigned int temList, unsigned int l1tIn) |
| Writes the L1T IN mask for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsL1tOutGet (const TEM_tem *tems, unsigned int temList, unsigned int *l1tOut) |
| Gets the state of the L1T OUT mask for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsL1tOutWrite (const TEM_tem *tems, unsigned int temList, unsigned int l1tOut) |
| Writes the L1T OUT mask for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsExtTreqEnbClr (const TEM_tem *tems, unsigned int temList) |
| Clears the EXT TREQ ENB bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsExtTreqEnbGet (const TEM_tem *tems, unsigned int temList, unsigned int *extTreq) |
| Gets the state of the EXT TREQ ENB bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsExtTreqEnbSet (const TEM_tem *tems, unsigned int temList) |
| Sets the EXT TREQ ENB bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsExtTreqEnbSupported (const TEM_tem *tems, unsigned int temList) |
| Returns a bit mask of TEMs which support the EXT TREQ ENB bit. More... | |
| unsigned int | TEM_temTrgsExtTreqEnbWrite (const TEM_tem *tems, unsigned int temList, unsigned int extTreq) |
| Writes the EXT TREQ ENB bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsGblL1tArmClr (const TEM_tem *tems, unsigned int temList) |
| Clears the Global L1t Arm bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsGblL1tArmGet (const TEM_tem *tems, unsigned int temList, unsigned int *gblL1tArm) |
| Gets the state of the Global L1t Arm bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsGblL1tArmSet (const TEM_tem *tems, unsigned int temList) |
| Sets the Global L1t Enable bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsGblL1tArmSupported (const TEM_tem *tems, unsigned int temList) |
| Returns a bit mask of TEMs which support a Global L1t Arm. More... | |
| unsigned int | TEM_temTrgsGblL1tArmWrite (const TEM_tem *tems, unsigned int temList, unsigned int gblL1tArm) |
| Writes the Global L1t Enable bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsGblL1tEnbClr (const TEM_tem *tems, unsigned int temList) |
| Clears the Global L1t Enable bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsGblL1tEnbGet (const TEM_tem *tems, unsigned int temList, unsigned int *gblL1tEnb) |
| Gets the state of the Global L1t Enable bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsGblL1tEnbSet (const TEM_tem *tems, unsigned int temList) |
| Sets the Global L1t Enable bit for the selected TEMs. More... | |
| unsigned int | TEM_temTrgsGblL1tEnbSupported (const TEM_tem *tems, unsigned int temList) |
| Returns a bit mask of TEMs which support a Global L1t Enable. More... | |
| unsigned int | TEM_temTrgsGblL1tEnbWrite (const TEM_tem *tems, unsigned int temList, unsigned int gblL1tEnb) |
| Writes the Global L1t Enable bit for the selected TEMs. More... | |
The facility breaks into 3 sub-facilities
TEM_tems<XXX> - Routines that act on a collection of TEMs
TEM_fpgas<XXX> - Routines that act on a collection of FPGAs
TEM_temInt<XXX> - Routines that act on a collection of TEMs,
addressing the interrupt structure.
|
|
Value: ((1 << (0x60 >> BASE_K_SHIFT)) | \ (1 << (0x80 >> BASE_K_SHIFT)) | \ (1 << (0xA0 >> BASE_K_SHIFT)) | \ (1 << (0xC0 >> BASE_K_SHIFT)))
These macros are used to determine whether a base interrupt vector is legitimate. Legitimate base interrupt vectors must be drawn from the set, 0x60, x080, 0xA0 and 0xC0. The verification routines first verify that the least significant 5 bits, are zero using BASE_M_MBZ_BITS as a mask. After verifying this, these bits are shifted off and leaving the numbers 3,4,5,6. This number is converted to a bit mask and checked against BASE_M_VALID, which is a mask of all the valid numbers. |
|
|
Value: ((int) \
((char *)&((_type *)0)->_member - (char *)(_type *)0))
|
|
|
Bit mask used to extract the number of events.
The number of events field in all TEMs has 11 valid bits. What differs is the actual range of these bits. Some only count to 9 bits, others to 11 bits. However, in those that do not reach 11 bits, the unused bits are guaranteed to be 0. |
|
|
Converts a base address and offset to an address.
Simple macro to get the address of a register from its base and offset. This really just hides all the ugly casting that's going on. |
|
|
Typedef for enum _ToggleAndCheckOpts.
The toggleAndCheck() is a low-performance but very convenient routine used to perform various operations on a TEM register. This enumerates all the possible actions. |
|
|
Enumerates all the action options to the toggleAndCheck() routine.
|
|
||||||||||||||||||||
|
Performs simple actions on a set of FPGAs.
|
|
||||||||||||||||||||
|
Returns the state of the specified bit.
|
|
||||||||||||||||
|
Returns a bit list indicating whether the FPGAs support the specified bit. FPGAs.
|
|
||||||||||||||||||||
|
Writes the bit for the specified FPGAs.
|
|
||||||||||||||||||||
|
Returns the state of the specified bit.
|
|
||||||||||||||||
|
Returns a bit list indicating whether the FPGAs support the specified bit. FPGAs.
|
|
||||||||||||||||||||
|
Writes the bit for the specified FPGAs.
|
|
||||||||||||||||||||
|
Returns the state of the specified bit.
|
|
||||||||||||||||
|
Returns a bit list indicating whether the FPGAs support the specified bit. FPGAs.
|
|
||||||||||||
|
Finds the maximum size of a set of FPGA download files.
|
|
||||||||||||
|
Initializes an array of TEM_fpgaLog structures.
|
|
||||||||||||||||||||||||
|
Adds the specified FPGAs to the internal database.
|
|
||||||||||||||||||||
|
Fills in arrays of the VME and LOCAL addresss of the specified FPGAs.
|
|
||||||||||||
|
Clears the self test bit for the selected FPGAs.
|
|
||||||||||||||||
|
Returns the state of the Self Test for the specified fpgas.
|
|
||||||||||||
|
Sets the Self Test for the specified FPGAs.
|
|
||||||||||||
|
Returns which of the specified FPGAs support a self-test mode.
|
|
||||||||||||||||
|
Writes the Self Test for the specified FPGAs.
|
|
||||||||||||
|
Clears the specified list of FPGAs.
The return value is a bit mask indicating which FPGAs failed to properly clear. The corresponding status of each TEM_fpga structure must be examined for details of what went wrong. |
|
||||||||||||
|
Clears the FIFO Half Full Throttle Manual Clear for the selected FPGAs.
|
|
||||||||||||||||
|
Returns the state of the FIFO Half Full Throttle Manual Clear. for the specified fpgas.
|
|
||||||||||||
|
Sets the FIFO Half Full Throttle for the specified FPGAs.
|
|
||||||||||||
|
Returns which of the specified FPGAs support a FIFO Half Full Throttle Manual Clear mode.
|
|
||||||||||||||||
|
Writes the Half Full Throttle Manual Clear mode for the specified FPGAs.
|
|
||||||||||||
|
Clears the FIFO Half Full Throttle for the selected FPGAs.
|
|
||||||||||||||||
|
Returns the state of the FIFO Half Full Throttle for the specified fpgas.
|
|
||||||||||||
|
Sets the FIFO Half Full Throttle for the specified FPGAs.
|
|
||||||||||||
|
Returns which of the specified FPGAs support a FIFO Half Full Throttle mode.
|
|
||||||||||||||||
|
Writes the Half Full Throttle mode for the specified FPGAs.
|
|
||||||||||||
|
Does a L1T COUNTER CLEAR on the specified list of FPGAs.
|
|
||||||||||||
|
Does a CLEAR L1T TIMER on the specified list of FPGAs.
|
|
||||||||||||
|
Loads the specified list of FPGAs.
|
|
||||||||||||
|
Does a CLEAR LOGIC on the specified list of FPGAs.
|
|
||||||||||||
|
Clears the Readout Min/MaxMode for the selected FPGAs.
|
|
||||||||||||||||
|
Returns the state of the Readout Min/MaxMode for the specified FPGAs.
|
|
||||||||||||
|
Sets the Readout Busy Min/Max 1, for the specified FPGAs.
|
|
||||||||||||
|
Returns a bit list indicating which FPGAs support the Readout Busy Min/Max mode.
|
|
||||||||||||||||
|
Writes the Readout Busy Min/Max mode for the specified FPGAs.
|
|
||||||||||||
|
Clears the Readout Mode for the selected FPGAs.
|
|
||||||||||||||||
|
Returns the state of the Readout Mode for the specified FPGAs.
|
|
||||||||||||
|
Sets the Readout Mode to 1, for the specified FPGAs.
|
|
||||||||||||
|
Returns a bit list indicating which FPGAs support an alternative Readout Mode.
|
|
||||||||||||||||
|
Writes the Readout Mode for the specified FPGAs.
|
|
||||||||||||||||
|
Returns the state of the Readout Timeout status bit for the specified FPGAs.
|
|
||||||||||||
|
Returns a bit list indicating which FPGAs support the Readout Timeout status bit.
|
|
||||||||||||
|
Does a CLEAR REGS on the specified list of FPGAs.
|
|
||||||||||||
|
Returns a bit mask of the TEMs associated with the requested set of FPGASs.
|
|
||||||||||||
|
Unloads the specified list of FPGAs.
|
|
||||||||||||||||||||||||
|
Connects the interrupt vector on a individual TEM basis. The TEM must be at least in the PRESENT state.
|
|
||||||||||||||||
|
Disables the specified list of interrupts on all specified TEMs.
The return value is a bit mask indicating which TEMs of the requested set failed to have their interrupts disabled. The only known failure mode that the TEM is not at least in the PRESENT state. |
|
||||||||||||||||
|
Enables the specified list of interrupts on all specified TEMs.
The return value is a bit mask indicating which TEMs of the requested set failed to have their interrupts enabled. The only known failure mode that the TEM is not at least in the PRESENT state. |
|
||||||||||||||||||||
|
Initializes the TEM interrupt registers.
The return value is a bit mask indicating those TEMs which were requested to be initialized but which failed. Common errors are
a. TEM is not PRESENT
b. LEVEL is out of range or duplicated.
c. BASE is out of range or duplicated.
|
|
||||||||||||||||
|
Returns a pointer to an array of TEM interrupt structures.
This operation requires no VME operations and, so, does not depend on the module actually existing. It only depends on the TEM being included in the system. The return value is a mask of those TEMs for which an address was requested, but was not provided. These are usually TEMs which are not at least in the INCLUDED state.) |
|
||||||||||||
|
Disables the master interrupt on the specified list of TEMs.
The return value is a bit mask indicating which TEMs of the requested set failed to have their master interrupts disabled. The only known failure mode that the TEM is not at least in the READY state. |
|
||||||||||||
|
Enables the master interrupt on the specified list of TEMs.
The return value is a bit mask indicating which TEMs of the requested set failed to have their master interrupts enabled. The only known failure mode that the TEM is not at least in the READY state. |
|
||||||||||||
|
Resets the master interrupt on the specified list of TEMs.
The return value is a bit mask indicating which TEMs of the requested set failed to have their master interrupts enabled. The only known failure mode that the TEM is not at least in the READY state. |
|
||||||||||||||||
|
Returns the minimum number of events pending from the specified list of TEMs.
Technically this is not a TEM interrupt routine, but, since it is almost exclusively used in that context, it was included with them. |
|
||||||||||||||||
|
Sets the event threshold on the specified list of TEMs.
The return value is a list of TEMs requested but not set. Typically the only reason that this will come back non-zero is that one of the target TEMs is not present in the system. |
|
||||||||||||
|
Disables the VME interrupt on the specified list of TEMs. A TEM must be at least PRESENT before its interrupts can be disabled.
|
|
||||||||||||
|
Enables the VME interrupt on the specified list of TEMs. A TEM must be at least PRESENT before its interrupts can be disabled.
|
|
||||||||||||||||||||
|
Completes a high level description of each active TEM.
The return value is a bit mask of the excluded TEMs. These are TEMs which where requested to be in the system, but where rejected because they could not be included. At this point only a configuration inconsistency would led to a rejection. A value of 0 indicates that all TEMs requested have been added to the system. |
|
||||||||||||||||||||
|
Fills in arrays of the VME and LOCAL addresss of the specified TEMs.
|
|
||||||||||||
|
Issues a reset to the detector specific registers on the specified TEMs.
The return value is bit mask indicating which TEMs detector registers failed to properly reset. The corresponding status of each TEM_tem structure must be examined for details of what went wrong. |
|
||||||||||||
|
Issues a reset to the all FIFOs on the specified TEMs.
The return value is bit mask indicating which TEMs had FIFOs which failed to properly reset. The corresponding status of each TEM_tem structure must be examined for details of what went wrong. Practically speaking, the board FIFOs must come to their empty state. If not, they are in error. |
|
||||||||||||
|
Returns a bit mask of the FPGAs associated with the requested set of TEMs.
|
|
||||||||||||
|
Issues a reset to the all FPGAs on the specified TEMs.
|
|
||||||||||||
|
Puts the TEM control registers in a known state so the TEM's FPGAs can be loaded.
|
|
||||||||||||
|
Probes the VME bus for the present of the specified list of.
|
|
||||||||||||
|
Toggles the RESET FPGA and RESET FIFOs bit in the control register.
|
|
||||||||||||
|
Resets all FPGAs, FIFOs and DETs on the specified TEMs.
|
|
||||||||||||
|
Clears the scope bit on the specified TEMs.
|
|
||||||||||||
|
Sets the scope bit on the specified TEMs.
|
|
||||||||||||
|
Toggles the scope bit on the specified TEMs.
|
|
||||||||||||
|
Simply query routine to learn which TEMs are not ready.
|
|
||||||||||||
|
Clears the CPU BSY bit for the selected TEMs.
|
|
||||||||||||||||
|
Gets the state of the CPU BSY bit for the selected TEMs.
|
|
||||||||||||
|
Sets the CPU BSY bit for the selected TEMs.
|
|
||||||||||||
|
Returns a bit mask of TEMs which support the CPU BSY bit.
|
|
||||||||||||||||
|
Writes the CPU BSY bit for the selected TEMs.
|
|
||||||||||||
|
Clears the EXT TREQ ENB bit for the selected TEMs.
|
|
||||||||||||||||
|
Gets the state of the EXT TREQ ENB bit for the selected TEMs.
|
|
||||||||||||
|
Sets the EXT TREQ ENB bit for the selected TEMs.
|
|
||||||||||||
|
Returns a bit mask of TEMs which support the EXT TREQ ENB bit.
|
|
||||||||||||||||
|
Writes the EXT TREQ ENB bit for the selected TEMs.
|
|
||||||||||||
|
Clears the Global L1t Arm bit for the selected TEMs.
|
|
||||||||||||||||
|
Gets the state of the Global L1t Arm bit for the selected TEMs.
|
|
||||||||||||
|
Sets the Global L1t Enable bit for the selected TEMs.
|
|
||||||||||||
|
Returns a bit mask of TEMs which support a Global L1t Arm.
|
|
||||||||||||||||
|
Writes the Global L1t Enable bit for the selected TEMs.
|
|
||||||||||||
|
Clears the Global L1t Enable bit for the selected TEMs.
|
|
||||||||||||||||
|
Gets the state of the Global L1t Enable bit for the selected TEMs.
|
|
||||||||||||
|
Sets the Global L1t Enable bit for the selected TEMs.
|
|
||||||||||||
|
Returns a bit mask of TEMs which support a Global L1t Enable.
|
|
||||||||||||||||
|
Writes the Global L1t Enable bit for the selected TEMs.
|
|
||||||||||||
|
Clears the L1T ENABLE bit for the selected TEMs.
|
|
||||||||||||||||
|
Gets the state of the L1T ENABLE bit for the selected TEMs.
|
|
||||||||||||
|
Sets the L1T ENABLE bit for the selected TEMs.
|
|
||||||||||||
|
Returns a bit mask of TEMs which support the L1T ENABLE bit.
|
|
||||||||||||||||
|
Writes the L1T ENABLE bit for the selected TEMs.
|
|
||||||||||||||||
|
Gets the state of the L1T IN mask for the selected TEMs.
|
|
||||||||||||||||
|
Writes the L1T IN mask for the selected TEMs.
|
|
||||||||||||||||
|
Gets the state of the L1T OUT mask for the selected TEMs.
|
|
||||||||||||||||
|
Writes the L1T OUT mask for the selected TEMs.
|
|
||||||||||||
|
Clears the L1T TMR bit for the selected TEMs.
|
|
||||||||||||||||
|
Gets the state of the L1T TMR bit for the selected TEMs.
|
|
||||||||||||
|
Sets the L1T TMR bit for the selected TEMs.
|
|
||||||||||||
|
Returns a bit mask of TEMs which support the L1T TMR bit.
|
|
||||||||||||||||
|
Writes the L1T TMR bit for the selected TEMs.
|
|
||||||||||||||||
|
Returns a pointer to an array of TEM trigger structures.
This operation requires no VME operations and, so, does not depend on the module actually existing. It only depends on the TEM being included in the system. The return value is a mask of those TEMs for which an address was requested, but was not provided. These are usually TEMs which are not at least in the INCLUDED state.) |
|
||||||||||||
|
Clears the TREQ ENABLE bit for the selected TEMs.
|
|
||||||||||||||||
|
Gets the state of the TREQ ENABLE bit for the selected TEMs.
|
|
||||||||||||
|
Sets the TREQ ENABLE bit for the selected TEMs.
|
|
||||||||||||
|
Returns a bit mask of TEMs which support the TREQ ENABLE bit.
|
|
||||||||||||||||
|
Writes the TREQ ENABLE bit for the selected TEMs.
|
|
||||||||||||||||||||
|
Returns the state of the specified bit.
|
|
||||||||||||||||
|
Returns a bit list indicating whether the TEMs support the specified bit.
|
|
||||||||||||||||||||
|
Writes the bit for the specified TEMs.
|
|
||||||||||||||||||||||||||||
|
Returns the state of the specified msk.
|
|
||||||||||||||||
|
Returns a bit list indicating whether the TEMs support the specified bit.
|
|
||||||||||||||||||||||||||||
|
Writes the bit for the specified TEMs.
|
|
||||||||||||||||||||||||||||
|
Returns the state of the specified msk.
|
|
||||||||||||||||
|
Returns a bit list indicating whether the TEMs support the specified bit.
|
|
||||||||||||||||||||||||||||
|
Writes the bit for the specified TEMs.
|
|
||||||||||||||||||||||||||||
|
Sets, clears, toggles or checks some bits in the TEM registers.
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002