JLab Signal Distribution Switch Slot module  A5
 All Data Structures Files Functions Variables Macros Groups
Initialization/Configuration

Functions

int sdInit (int flag)
 Initialize the Signal Distribution Module. More...
 
int sdSetTiFastLink (int enable)
 Enable or Disable the Fast link to the TI. More...
 
int sdSetPLLClockFrequency (int iclk, int ifreq)
 Set the PLL Clock Frequency of A/B/Both. More...
 
int sdSetClockMode (int iclk, int imode)
 Select whether the Clock fanned out will be jitter attenuated (PLL on) or as received from the TI. More...
 
int sdReset ()
 Reset the SD. More...
 
int sdSetActivePayloadPorts (unsigned int imask)
 Routine for user to define the Payload Ports that participate in Trigger Out, Busy Out, Token, and Status communication. More...
 
int sdSetActiveVmeSlots (unsigned int vmemask)
 Routine for user to define the Vme Slots that participate in Trigger Out, Busy Out, Token, and Status communication. More...
 

Detailed Description

Function Documentation

int sdInit ( int  flag)

Initialize the Signal Distribution Module.

Parameters
flagInitialization bitmask
  • bit0 : Ignore module version
Returns
OK if successful, otherwise ERROR

References SDStruct::csrTest, SD_CSRTEST_TEST_RESET, SD_INIT_IGNORE_VERSION, SD_SUPPORTED_FIRMWARE, SDBASE, SDLOCK, SDUNLOCK, TIp, TSp, and SDStruct::version.

int sdReset ( )

Reset the SD.

Returns
OK if successful, otherwise ERROR

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

int sdSetActivePayloadPorts ( unsigned int  imask)

Routine for user to define the Payload Ports that participate in Trigger Out, Busy Out, Token, and Status communication.

Parameters
imaskPayload port mask
Returns
OK if successful, otherwise ERROR.

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

Referenced by sdSetActiveVmeSlots().

int sdSetActiveVmeSlots ( unsigned int  vmemask)

Routine for user to define the Vme Slots that participate in Trigger Out, Busy Out, Token, and Status communication.

Parameters
vmemaskVME Slot mask
  • bit 0: Vme Slot 0 (non-existant)
  • bit 1: Vme Slot 1 (controller slot)
  • bit 2: Vme Slot 2 (not used by CTP)
  • bit 3: Vme Slot 3 (First slot on the LHS of crate that is used by CTP) ..
  • bit 20: Vme Slot 20 (Last slot that is used by the CTP)
  • bit 21: Vme Slot 21 (Slot for the TID)
Returns
OK if successful, otherwise ERROR.

References sdSetActivePayloadPorts().

int sdSetClockMode ( int  iclk,
int  imode 
)

Select whether the Clock fanned out will be jitter attenuated (PLL on) or as received from the TI.

Parameters
iclkClock Selection
  • 0 for A (LHS of crate)
  • 1 for B (RHS of crate)
imodeMode selection
  • 0 for Bypass mode
  • 1 for PLL mode
Returns
OK if successful, otherwise ERROR

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

int sdSetPLLClockFrequency ( int  iclk,
int  ifreq 
)

Set the PLL Clock Frequency of A/B/Both.

Parameters
iclkWhich side of crate to activate PLL
  • 0 for A (LHS of crate)
  • 1 for B (RHS of crate)
  • 2 for Both
ifreqFrequency to lock on.
  • 1 for 31.25 MHz
  • 2 for 125.00 MHz
  • 3 for 250.00 MHz
Returns
OK if successul, otherwise ERROR.

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

int sdSetTiFastLink ( int  enable)

Enable or Disable the Fast link to the TI.

Parameters
enableEnable flag 0 : Disable >0 : Enable
Returns
OK if successful, otherwise ERROR

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