JLab Signal Distribution Switch Slot module  A5
 All Data Structures Files Functions Variables Macros Groups
Status

Functions

int sdStatus (int rflag)
 Display status of SD registers. More...
 
int sdGetFirmwareVersion (int pflag)
 Return and optionally display the SD firmware version. More...
 
int sdGetTiFastLink ()
 Return the state of the fast link to the TI. More...
 
int sdGetPLLClockFrequency (int iclk)
 Return the PLL clock frequency for the selected iclk. More...
 
int sdGetClockFrequency (int iclk, int pflag)
 Return the detected clock frequency for the selected iclk. More...
 
int sdGetClockMode (int iclk)
 Return whether the Clock fanned out will be jitter attenuated (PLL) or as received from the TI(D) More...
 
int sdGetActivePayloadPorts ()
 Routine to return the currently defined Payload Ports that participate in Trigger Out, Busy Out, Token, and Status communication. More...
 
int sdGetBusyoutCounter (int ipayload)
 Return the value of the Busyout Counter for a specified payload board Value of the counter is reset after read. More...
 
int sdPrintBusyoutCounters ()
 Display (to standard out) values of the busy counters for all VME Slots. More...
 
int sdGetBusyoutStatus (int pflag)
 Return the mask value of payload ports that are currently BUSY. More...
 
int sdGetTrigoutCounter (int ipayload)
 Return the value of the Trigout Counter for a specified payload board Value of the counter is reset after read. More...
 
int sdPrintTrigoutCounters ()
 Display (to standard out) values of the trigout counters for all VME Slots. More...
 
unsigned int sdGetSerialNumber (char *rSN)
 Return the serial number of the SD. More...
 

Detailed Description

Function Documentation

int sdGetActivePayloadPorts ( )

Routine to return the currently defined Payload Ports that participate in Trigger Out, Busy Out, Token, and Status communication.

Returns
Active Payload Port Mask if successful, otherwise ERROR

References SDStruct::busyoutPorts, SDStruct::payloadPorts, SDLOCK, SDUNLOCK, SDStruct::tokenPorts, and SDStruct::trigoutPorts.

int sdGetBusyoutCounter ( int  ipayload)

Return the value of the Busyout Counter for a specified payload board Value of the counter is reset after read.

Returns
Busy counter of specified payload port if successful, otherwise ERROR.

References SDStruct::busyoutCounter, SDLOCK, and SDUNLOCK.

Referenced by sdPrintBusyoutCounters().

int sdGetBusyoutStatus ( int  pflag)

Return the mask value of payload ports that are currently BUSY.

Parameters
pflagPrint flag
  • >0 : Print to standard out
Returns
Payload port busy mask

References SDStruct::busyoutStatus, SDLOCK, and SDUNLOCK.

int sdGetClockFrequency ( int  iclk,
int  pflag 
)

Return the detected clock frequency for the selected iclk.

Parameters
iclkClock selection
  • 0 for A (LHS of crate)
  • 1 for B (RHS of crate)
Returns
  • 0 for undefined
  • 1 for 31.25 MHz
  • 2 for 125.00 MHz
  • 3 for 250.00 MHz

References SD_STATUS_CLKA_DETECTED_MASK, SD_STATUS_CLKB_DETECTED_MASK, SDLOCK, SDUNLOCK, and SDStruct::status.

int sdGetClockMode ( int  iclk)

Return whether the Clock fanned out will be jitter attenuated (PLL) or as received from the TI(D)

Parameters
iclkClock Selection
  • 0 for A (LHS of crate)
  • 1 for B (RHS of crate)
Returns
  • 0 for Bypass mode
  • 1 for PLL mode

References SD_SYSTEM_CLKA_BYPASS_MODE, SD_SYSTEM_CLKB_BYPASS_MODE, SDLOCK, SDUNLOCK, and SDStruct::system.

int sdGetFirmwareVersion ( int  pflag)

Return and optionally display the SD firmware version.

Parameters
pflagPrint Flag If >0, will print firmware version to standard out
Returns
Firmware version if successful, otherwise ERROR.

References SDLOCK, SDUNLOCK, and SDStruct::version.

int sdGetPLLClockFrequency ( int  iclk)

Return the PLL clock frequency for the selected iclk.

Parameters
iclkClock selection
  • 0 for A (LHS of crate)
  • 1 for B (RHS of crate)
Returns
  • 1 for 31.25 MHz
  • 2 for 125.00 MHz
  • 3 for 250.00 MHz

References SD_SYSTEM_CLKA_FREQUENCY_MASK, SD_SYSTEM_CLKB_FREQUENCY_MASK, SDLOCK, SDUNLOCK, and SDStruct::system.

unsigned int sdGetSerialNumber ( char *  rSN)

Return the serial number of the SD.

Parameters
rSNLocal Memory address to store Serial Number in string format.
Returns
Number value of the serial number

References sdFirmwareReadAddr().

int sdGetTiFastLink ( )

Return the state of the fast link to the TI.

Returns
1 if enabled, 0 if disabled, otherwise ERROR

References SD_SYSTEM_TI_LINK_ENABLE, SDLOCK, SDUNLOCK, and SDStruct::system.

int sdGetTrigoutCounter ( int  ipayload)

Return the value of the Trigout Counter for a specified payload board Value of the counter is reset after read.

Parameters
ipayloadSelected Payload Port
Returns
Trigout Counter for selected payload port if successful, otherwise ERROR

References SDLOCK, SDUNLOCK, and SDStruct::trigoutCounter.

Referenced by sdPrintTrigoutCounters().

int sdPrintBusyoutCounters ( )

Display (to standard out) values of the busy counters for all VME Slots.

Returns
OK if successful, otherwise ERROR.

References sdGetBusyoutCounter().

int sdPrintTrigoutCounters ( )

Display (to standard out) values of the trigout counters for all VME Slots.

Returns
OK if successful, otherwise ERROR.

References sdGetTrigoutCounter().