JLab fADC250-V2 Library  0x42
Initialization/Configuration

Modules

 SDC Initialization/Configuration
 

Functions

STATUS faInit (UINT32 addr, UINT32 addr_inc, int nadc, int iFlag)
 Initialize JLAB FADC Library. More...
 
int faSlot (unsigned int i)
 Convert an index into a slot number, where the index is the element of an array of FADCs in the order in which they were initialized. More...
 
int faSetClockSource (int id, int clkSrc)
 Set the clock source. More...
 
int faGSetClockSource (int clkSrc)
 Set the clock source for all initialized modules. More...
 
int faSetProcMode (int id, int pmode, unsigned int PL, unsigned int PTW, int NSB, unsigned int NSA, unsigned int NP, unsigned int NPED, unsigned int MAXPED, unsigned int NSAT)
 Configure the processing type/mode. More...
 
void faGSetProcMode (int pmode, unsigned int PL, unsigned int PTW, int NSB, unsigned int NSA, unsigned int NP, unsigned int NPED, unsigned int MAXPED, unsigned int NSAT)
 Configure the processing type/mode for all initialized fADC250s. More...
 
int faCalcMaxUnAckTriggers (int mode, int ptw, int nsa, int nsb, int np)
 Return the maximum number of unacknowledged triggers a specific mode can handle. More...
 
int faSetTriggerStopCondition (int id, int trigger_max)
 Set the maximum number of unacknowledged triggers before module stops accepting incoming triggers. More...
 
int faSetTriggerBusyCondition (int id, int trigger_max)
 Set the maximum number of unacknowledged triggers before module asserts BUSY. More...
 
int faSetTriggerPathSamples (int id, unsigned int TNSA, unsigned int TNSAT)
 Set the number of samples that are included before and after threshold crossing that are sent through the trigger path. More...
 
void faGSetTriggerPathSamples (unsigned int TNSA, unsigned int TNSAT)
 Set the number of samples that are included before and after threshold crossing that are sent through the trigger path for all initialized fADC250s. More...
 
int faSetTriggerPathThreshold (int id, unsigned int TPT)
 Set the threshold used to determine what samples are sent through the trigger path. More...
 
void faGSetTriggerPathThreshold (unsigned int TPT)
 Set the threshold used to determine what samples are sent through the trigger path for all initialized fADC250s. More...
 
void faSetNormalMode (int id, int opt)
 Configure the ADC Processing in "Normal Mode". More...
 
void faSetInvertedMode (int id)
 Configure the ADC Processing in "Inverted (positive polarity) Mode". More...
 
int faSetPPG (int id, int pmode, unsigned short *sdata, int nsamples)
 Setup FADC Progammable Pulse Generator. More...
 
void faPPGEnable (int id)
 Enable the programmable pulse generator. More...
 
void faPPGDisable (int id)
 Disable the programmable pulse generator. More...
 
int faSuppressTriggerTime (int id, int suppress)
 Suppress all, or just the MSB, of the trigger time words from the datastream. More...
 
int faGSuppressTriggerTime (int suppress)
 Suppress all, or just the MSB, of the trigger time words from the datastream. More...
 
void faClear (int id)
 Perform a soft reset. More...
 
void faGClear ()
 Perform a soft reset of all initialized fADC250s. More...
 
void faClearError (int id)
 Clear latched errors. More...
 
void faGClearError ()
 Clear latched errors of all initialized fADC250s. More...
 
void faReset (int id, int iFlag)
 Perform a hard reset. More...
 
void faGReset (int iFlag)
 Perform a hard reset on all initialized fADC250s. More...
 
void faSoftReset (int id, int cflag)
 Perform either a soft clear or soft reset. More...
 
void faDACReset (int id)
 Perform a reset of the DAC chip. More...
 
void faGDACReset ()
 Perform a reset of the DAC chip for all initialized modules. More...
 
void faResetToken (int id)
 Reset the token. More...
 
int faSetChannelDisable (int id, int channel)
 Disable the specified channel. More...
 
void faChanDisable (int id, unsigned short cmask)
 Disable all channels in the specified mask. More...
 
int faSetChannelDisableMask (int id, unsigned short cmask)
 Disable all channels in the specified mask. More...
 
int faSetChannelEnable (int id, int channel)
 Enable the specified channel. More...
 
int faSetChannelEnableMask (int id, unsigned short enMask)
 Enable all channels in the specified mask. More...
 
void faEnableSyncSrc (int id)
 Enabled the SyncReset source. More...
 
void faGEnableSyncSrc ()
 Enable the SyncReset Source of all initialized fADC250s. More...
 
void faEnable (int id, int eflag, int bank)
 Enable data acquisition, trigger, and SyncReset on the module. More...
 
void faGEnable (int eflag, int bank)
 Enable data acquisition, trigger, and SyncReset on all initialized fADC250s. More...
 
void faDisable (int id, int eflag)
 Disable data acquisition, triggers, and SyncReset on the module. More...
 
void faGDisable (int eflag)
 Disable data acquisition, triggers, and SyncReset on all initialized fADC250s. More...
 
int faSetTrig21Delay (int id, int delay)
 Configure the delay between the software playback trigger and trigger. More...
 
int faEnableInternalPlaybackTrigger (int id)
 Enable the software playback trigger and trigger. More...
 
void faSync (int id)
 Pulse a software SyncReset. More...
 
int faBusyLevel (int id, unsigned int val, int bflag)
 Set/Readback Busy Level. More...
 
void faEnableSoftTrig (int id)
 Enable software triggers. More...
 
void faGEnableSoftTrig ()
 Enable Software Triggers for all initialized fADC250s. More...
 
void faDisableSoftTrig (int id)
 Disable Software Triggers. More...
 
void faEnableSoftSync (int id)
 Enable Software SyncReset. More...
 
void faDisableSoftSync (int id)
 Disable Software SyncReset. More...
 
void faEnableClk (int id)
 Enable the internal clock. More...
 
void faDisableClk (int id)
 Disable the internal clock. More...
 
void faEnableTriggerOut (int id, int output)
 Enable trigger out for front panel or p0. More...
 
void faEnableBusError (int id)
 Enable bus errors to terminate a block transfer. More...
 
void faGEnableBusError ()
 Enable bus errors to terminate a block transfer for all initialized fADC250s. More...
 
void faDisableBusError (int id)
 Disable bus errors. More...
 
void faEnableMultiBlock (int tflag)
 Enable and setup multiblock transfers for all initialized fADC250s. More...
 
void faDisableMultiBlock ()
 Disable multiblock transfer for all initialized fADC250s. More...
 
int faSetBlockLevel (int id, int level)
 Set the block level for the module. More...
 
void faGSetBlockLevel (int level)
 Set the block level for all initialized fADC250s. More...
 
int faSetClkSource (int id, int source)
 Set the Clock Source for the module. More...
 
int faSetTrigSource (int id, int source)
 Set the trigger source for the module. More...
 
int faSetSyncSource (int id, int source)
 Set the SyncReset source for the module. More...
 
void faEnableFP (int id)
 Enable Front Panel Inputs. More...
 
int faSetTrigOut (int id, int trigout)
 Set trigger output options. More...
 
int faResetTriggerCount (int id)
 Reset the trigger count for the module. More...
 
int faCheckThreshold (int id)
 Check and make sure readout threshold for each channel is non zero. More...
 
int faSetThreshold (int id, unsigned short tvalue, unsigned short chmask)
 Set the readout threshold value for specified channel mask. More...
 
int faSetDAC (int id, unsigned short dvalue, unsigned short chmask)
 Set the DAC value of the specified channel mask. More...
 
int faSetDACandCheck (int id, unsigned short dvalue, unsigned short chmask)
 Set the DAC value of the specified channel mask and readback and check that it was written properly. More...
 
int faGetDAC (int id, unsigned short *indata)
 Readback the DAC values currently used by the module in the specified slot. More...
 
int faGetChannelDAC (int id, int channel)
 Readback the DAC for a specific channel by the module in the specified slot. More...
 
int faSetChannelPedestal (int id, unsigned int chan, unsigned int ped)
 Set the pedestal value of specified channel. More...
 
int faSetAlignmentDebugMode (int enable)
 Enable/Disable the alignment sequence that is sent to the CTP for debugging. More...
 
int faSetHitbitsMode (int id, int enable)
 Enable/Disable Hitbits mode on the module. More...
 
void faGSetHitbitsMode (int enable)
 Enable/Disable Hitbits mode for all initialized fADC250s. More...
 
int faClearScalers (int id)
 Clear the scalers (and enable, if disabled) More...
 
int faLatchScalers (int id)
 Latch the current scaler count. More...
 
int faEnableScalers (int id)
 Enable the scalers to count. More...
 
int faDisableScalers (int id)
 Disable counting in the scalers. More...
 
int faDataInsertAdcParameters (int id, int enable)
 Insert ADC parameter word into datastream. The data word appears as a block header continuation word. More...
 
void faGDataInsertAdcParameters (int enable)
 Insert ADC parameter word into datastream. For all initialized modules. The data word appears as a block header continuation word. More...
 
int faDataSuppressTriggerTime (int id, int suppress)
 Enable/Disable suppression of one or both of the trigger time words in the data stream. More...
 
void faGDataSuppressTriggerTime (int suppress)
 Enable/Disable suppression of one or both of the trigger time words in the data stream for all initialized modules. More...
 
int faSetDataFormat (int id, int format)
 Set the readout data form which allows for suppression of repetitious data words. More...
 
void faGSetDataFormat (int format)
 Set the readout data form for all initialized modules. More...
 
void faTestSetSystemTestMode (int id, int mode)
 Enable/Disable System test mode. More...
 
void faTestSetTrigOut (int id, int mode)
 Set the level of Trig Out to the SD. More...
 
void faTestSetBusyOut (int id, int mode)
 Set the level of Busy Out to the SD. More...
 
void faTestSetSdLink (int id, int mode)
 Set the level of the SD Link. More...
 
void faTestSetTokenOut (int id, int mode)
 Set the level of Token Out to the SD. More...
 
void faTestResetSyncCounter (int id)
 Reset the counter of the SyncReset scaler. More...
 
void faTestResetTrig1Counter (int id)
 Reset the counter of the trig1 scaler. More...
 
void faTestResetTrig2Counter (int id)
 Reset the counter of the trig2 scaler. More...
 
int faSetScalerBlockInterval (int id, unsigned int nblock)
 Set the block interval of scaler data insertion. More...
 
int faForceEndOfBlock (int id, int scalers)
 Allows for the insertion of a block trailer into the data stream. More...
 
void faGForceEndOfBlock (int scalers)
 Allows for the insertion of a block trailer into the data stream for all initialized fADC250s. More...
 
int faSetHistoryBufferThreshold (int id, int thres)
 Set the threshold to trigger for the history buffer to be saved for readout. More...
 
void faGSetHistoryBufferThreshold (int thres)
 Set the threshold to trigger for the history buffer to be saved for readout for all initialized fADC250s. More...
 
int faArmHistoryBuffer (int id)
 Enable the history buffer for data acquisition for the module. More...
 
void faGArmHistoryBuffer ()
 Enable the history buffer for data acquisition for all initialized fADC250s. More...
 
int faStateArmBuffer (int id, int enable)
 Enable/Disable Buffer to store state machine diagnostics. More...
 

Detailed Description

Function Documentation

◆ faArmHistoryBuffer()

int faArmHistoryBuffer ( int  id)

Enable the history buffer for data acquisition for the module.

Parameters
idSlot number
Returns
OK if successful, otherwise ERROR.

References FA_SUM_DATA_ARM_HISTORY_BUFFER, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::sum_data.

Referenced by faGArmHistoryBuffer().

◆ faBusyLevel()

int faBusyLevel ( int  id,
unsigned int  val,
int  bflag 
)

Set/Readback Busy Level.

Parameters
idSlot number
val
  • >0: set the busy level to val
  • 0: read back busy level
bflagi
  • >0: force the module Busy
Returns
OK if successful, otherwise ERROR.

References fadc_struct::busy_level, FA_BUSY_LEVEL_MASK, FA_FORCE_BUSY, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faCalcMaxUnAckTriggers()

int faCalcMaxUnAckTriggers ( int  mode,
int  ptw,
int  nsa,
int  nsb,
int  np 
)

Return the maximum number of unacknowledged triggers a specific mode can handle.

Parameters
pmodeProcessing Mode
ptwWindow Width
nsbNumber of samples before pulse over threshold
nsaNumber of samples after pulse over threshold
npNumber of pulses processed per window
Returns
The minimum of 9 and the calculated maximum number of triggers allowed given specified mode and window paramters.

References FA_SUPPORTED_MODES, and FA_SUPPORTED_NMODES.

Referenced by faSetProcMode().

◆ faChanDisable()

void faChanDisable ( int  id,
unsigned short  cmask 
)

Disable all channels in the specified mask.

Parameters
idSlot number
cmaskChannel mask of channels to disable

References faSetChannelDisableMask().

◆ faCheckThreshold()

int faCheckThreshold ( int  id)

Check and make sure readout threshold for each channel is non zero.

Parameters
idSlot number
Returns
OK if successful, otherwise ERROR.

References fadc_struct::adc_thres, FA_MAX_ADC_CHANNELS, fadcID, FALOCK, FAp, and FAUNLOCK.

Referenced by faInit().

◆ faClear()

void faClear ( int  id)

Perform a soft reset.

Parameters
idSlot number

References fadc_struct::csr, FA_CSR_SOFT_RESET, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faClearError()

void faClearError ( int  id)

Clear latched errors.

Parameters
idSlot number

References fadc_struct::csr, FA_CSR_ERROR_CLEAR, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faClearScalers()

int faClearScalers ( int  id)

Clear the scalers (and enable, if disabled)

Parameters
idSlot number
Returns
OK if successful, otherwise ERROR.

References FA_SCALER_CTRL_ENABLE, FA_SCALER_CTRL_RESET, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::scaler_ctrl.

◆ faDACReset()

void faDACReset ( int  id)

Perform a reset of the DAC chip.

Parameters
idSlot number

References FA_RESET_DAC, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::reset.

◆ faDataInsertAdcParameters()

int faDataInsertAdcParameters ( int  id,
int  enable 
)

Insert ADC parameter word into datastream. The data word appears as a block header continuation word.

Parameters
idSlot number
enableEnable flag
  • 0: Disable
  • !0: Enable
Returns
OK if successful, otherwise ERROR.

References fadc_struct::ctrl1, FA_ENABLE_ADC_PARAMETERS_DATA, fadcID, FALOCK, FAp, and FAUNLOCK.

Referenced by faGDataInsertAdcParameters().

◆ faDataSuppressTriggerTime()

int faDataSuppressTriggerTime ( int  id,
int  suppress 
)

Enable/Disable suppression of one or both of the trigger time words in the data stream.

Parameters
idSlot number
suppressSuppression Flag
  • 0: Trigger time words are enabled in datastream
  • 1: Suppress BOTH trigger time words
  • 2: Suppress trigger time word 2 (that with most significant bytes)
Returns
OK if successful, otherwise ERROR.

References fadc_struct::ctrl1, FA_SUPPRESS_TRIGGER_TIME_DATA, FA_SUPPRESS_TRIGGER_TIME_WORD2_DATA, fadcID, FALOCK, FAp, and FAUNLOCK.

Referenced by faGDataSuppressTriggerTime().

◆ faDisable()

void faDisable ( int  id,
int  eflag 
)

Disable data acquisition, triggers, and SyncReset on the module.

Parameters
idSlot number
eflag
  • >0: Turn off FIFO transfer as well.

References fadc_struct::adc_status, fadc_struct::ctrl2, FA_ADC_STATUS1_TRIG_RCV_DONE, FA_CTRL_GO, fadcID, FALOCK, FAp, and FAUNLOCK.

Referenced by faGDisable().

◆ faDisableBusError()

void faDisableBusError ( int  id)

Disable bus errors.

Parameters
idSlot number

References fadc_struct::ctrl1, FA_ENABLE_BERR, fadcID, FALOCK, FAp, and FAUNLOCK.

Referenced by faEnableMultiBlock().

◆ faDisableClk()

void faDisableClk ( int  id)

Disable the internal clock.

Parameters
idSlot number

References fadc_struct::ctrl1, FA_ENABLE_INTERNAL_CLK, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faDisableMultiBlock()

void faDisableMultiBlock ( )

Disable multiblock transfer for all initialized fADC250s.

References fadc_struct::ctrl1, FA_ENABLE_MULTIBLOCK, fadcID, FALOCK, FAp, FAUNLOCK, and nfadc.

◆ faDisableScalers()

int faDisableScalers ( int  id)

Disable counting in the scalers.

Parameters
idSlot number
Returns
OK if successful, otherwise ERROR.

References FA_SCALER_CTRL_ENABLE, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::scaler_ctrl.

◆ faDisableSoftSync()

void faDisableSoftSync ( int  id)

Disable Software SyncReset.

Parameters
idSlot number

References fadc_struct::ctrl1, FA_ENABLE_SOFT_SRESET, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faDisableSoftTrig()

void faDisableSoftTrig ( int  id)

Disable Software Triggers.

Parameters
idSlot number

References fadc_struct::ctrl1, FA_ENABLE_SOFT_TRIG, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faEnable()

void faEnable ( int  id,
int  eflag,
int  bank 
)

◆ faEnableBusError()

void faEnableBusError ( int  id)

Enable bus errors to terminate a block transfer.

Parameters
idSlot number

References fadc_struct::ctrl1, FA_ENABLE_BERR, fadcID, FALOCK, FAp, and FAUNLOCK.

Referenced by faEnableMultiBlock().

◆ faEnableClk()

void faEnableClk ( int  id)

Enable the internal clock.

Parameters
idSlot number

References fadc_struct::ctrl1, FA_ENABLE_INTERNAL_CLK, FA_REF_CLK_INTERNAL, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faEnableFP()

void faEnableFP ( int  id)

Enable Front Panel Inputs.

Also disables software triggers/syncs but leaves the clock source alone

Parameters
idSlot number

References fadc_struct::ctrl1, FA_ENABLE_SOFT_SRESET, FA_ENABLE_SOFT_TRIG, FA_SRESET_FP_ISYNC, FA_SRESET_SEL_MASK, FA_TRIG_FP_ISYNC, FA_TRIG_SEL_MASK, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faEnableInternalPlaybackTrigger()

int faEnableInternalPlaybackTrigger ( int  id)

Enable the software playback trigger and trigger.

Parameters
idSlot number
See also
faSetTrig21Delay
Returns
OK if successful, otherwise ERROR.

References fadc_struct::ctrl1, FA_TRIG_MASK, FA_TRIG_VME_PLAYBACK, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faEnableMultiBlock()

void faEnableMultiBlock ( int  tflag)

Enable and setup multiblock transfers for all initialized fADC250s.

Parameters
tflagToken Flag
  • >0: Token via P0/VXS
  • 0: Token via P2

References fadc_struct::ctrl1, FA_ENABLE_MULTIBLOCK, FA_FIRST_BOARD, FA_LAST_BOARD, FA_MB_TOKEN_VIA_P0, FA_MB_TOKEN_VIA_P2, fadcID, fadcMaxSlot, fadcMinSlot, faDisableBusError(), faEnableBusError(), FALOCK, FAp, FAUNLOCK, and nfadc.

◆ faEnableScalers()

int faEnableScalers ( int  id)

Enable the scalers to count.

Parameters
idSlot number
Returns
OK if successful, otherwise ERROR.

References FA_SCALER_CTRL_ENABLE, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::scaler_ctrl.

◆ faEnableSoftSync()

void faEnableSoftSync ( int  id)

Enable Software SyncReset.

Parameters
idSlot number

References fadc_struct::ctrl1, FA_ENABLE_SOFT_SRESET, FA_SRESET_MASK, FA_SRESET_VME, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faEnableSoftTrig()

void faEnableSoftTrig ( int  id)

Enable software triggers.

Parameters
idSlot number

References fadc_struct::ctrl1, FA_ENABLE_SOFT_TRIG, FA_TRIG_MASK, FA_TRIG_VME, fadcID, FALOCK, FAp, and FAUNLOCK.

Referenced by faGEnableSoftTrig().

◆ faEnableSyncSrc()

◆ faEnableTriggerOut()

void faEnableTriggerOut ( int  id,
int  output 
)

Enable trigger out for front panel or p0.

Parameters
idSlot number
output
  • 0: FP trigger out
  • 1: P0 trigger out
  • 2: FP and P0 trigger out

References fadc_struct::ctrl1, FA_ENABLE_TRIG_OUT_FP, FA_ENABLE_TRIG_OUT_P0, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faForceEndOfBlock()

int faForceEndOfBlock ( int  id,
int  scalers 
)

Allows for the insertion of a block trailer into the data stream.

Allows for the insertion of a block trailer into the data stream. This is useful for the efficient extraction of a partial block of events from the FADC (e.g. for an end of run event, or the resynchonize with other modules). Event count within block is reset, after successful execution.

Parameters
idSlot number
scalersIf set to > 0, scalers will also be inserted with the End of Block
Returns
OK if successful, otherwise ERROR.

References fadc_struct::adc_config, fadc_struct::csr, FA_ADC_PROC_ENABLE, FA_CSR_DATA_STREAM_SCALERS, FA_CSR_FORCE_EOB_FAILED, FA_CSR_FORCE_EOB_INSERT, FA_CSR_FORCE_EOB_SUCCESS, fadcID, FALOCK, FAp, and FAUNLOCK.

Referenced by faGForceEndOfBlock().

◆ faGArmHistoryBuffer()

void faGArmHistoryBuffer ( )

Enable the history buffer for data acquisition for all initialized fADC250s.

References faArmHistoryBuffer(), faSlot(), and nfadc.

◆ faGClear()

void faGClear ( )

Perform a soft reset of all initialized fADC250s.

References fadc_struct::csr, FA_CSR_SOFT_RESET, fadcID, FALOCK, FAp, FAUNLOCK, and nfadc.

◆ faGClearError()

void faGClearError ( )

Clear latched errors of all initialized fADC250s.

References fadc_struct::csr, FA_CSR_ERROR_CLEAR, fadcID, FALOCK, FAp, FAUNLOCK, and nfadc.

◆ faGDACReset()

void faGDACReset ( )

Perform a reset of the DAC chip for all initialized modules.

References FA_RESET_DAC, FALOCK, FAp, faSlot(), FAUNLOCK, nfadc, and fadc_struct::reset.

◆ faGDataInsertAdcParameters()

void faGDataInsertAdcParameters ( int  enable)

Insert ADC parameter word into datastream. For all initialized modules. The data word appears as a block header continuation word.

Parameters
enableEnable flag
  • 0: Disable
  • !0: Enable

References faDataInsertAdcParameters(), faSlot(), and nfadc.

◆ faGDataSuppressTriggerTime()

void faGDataSuppressTriggerTime ( int  suppress)

Enable/Disable suppression of one or both of the trigger time words in the data stream for all initialized modules.

Parameters
suppressSuppression Flag
  • 0: Trigger time words are enabled in datastream
  • 1: Suppress BOTH trigger time words
  • 2: Suppress trigger time word 2 (that with most significant bytes)

References faDataSuppressTriggerTime(), faSlot(), and nfadc.

◆ faGDisable()

void faGDisable ( int  eflag)

Disable data acquisition, triggers, and SyncReset on all initialized fADC250s.

Parameters
eflag
  • >0: Turn off FIFO transfer as well.

References fadcID, fadcUseSDC, faDisable(), faSDC_Disable(), and nfadc.

◆ faGEnable()

void faGEnable ( int  eflag,
int  bank 
)

Enable data acquisition, trigger, and SyncReset on all initialized fADC250s.

Also enables the SDC if it is initalized and used.

Parameters
eflagEnable Internal Trigger Logic, as well
bankNot used

References fadcID, fadcUseSDC, faEnable(), faSDC_Enable(), and nfadc.

◆ faGEnableBusError()

void faGEnableBusError ( )

Enable bus errors to terminate a block transfer for all initialized fADC250s.

References fadc_struct::ctrl1, FA_ENABLE_BERR, fadcID, FALOCK, FAp, FAUNLOCK, and nfadc.

◆ faGEnableSoftTrig()

void faGEnableSoftTrig ( )

Enable Software Triggers for all initialized fADC250s.

References fadcID, faEnableSoftTrig(), and nfadc.

◆ faGEnableSyncSrc()

void faGEnableSyncSrc ( )

Enable the SyncReset Source of all initialized fADC250s.

References fadcID, faEnableSyncSrc(), and nfadc.

◆ faGetChannelDAC()

int faGetChannelDAC ( int  id,
int  channel 
)

Readback the DAC for a specific channel by the module in the specified slot.

Parameters
idSlot number
channelChannel number (0-15)
Returns
DAC Value if successful, otherwise ERROR.

References fadc_struct::dac, FA_DAC_VALUE_MASK, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faGetDAC()

int faGetDAC ( int  id,
unsigned short *  indata 
)

Readback the DAC values currently used by the module in the specified slot.

Parameters
idSlot number
intdataLocal location to store DAC values.
Returns
OK if successful, otherwise ERROR.

References fadc_struct::dac, FA_DAC_VALUE_MASK, FA_MAX_ADC_CHANNELS, fadcID, FALOCK, FAp, and FAUNLOCK.

Referenced by faSetDACandCheck().

◆ faGForceEndOfBlock()

void faGForceEndOfBlock ( int  scalers)

Allows for the insertion of a block trailer into the data stream for all initialized fADC250s.

Allows for the insertion of a block trailer into the data stream. This is useful for the efficient extraction of a partial block of events from the FADC (e.g. for an end of run event, or the resynchonize with other modules). Event count within block is reset, after successful execution.

Parameters
scalersIf set to > 0, scalers will also be inserted with the End of Block

References fadcID, faForceEndOfBlock(), and nfadc.

◆ faGReset()

void faGReset ( int  iFlag)

Perform a hard reset on all initialized fADC250s.

Parameters
iFlagDecision to restore A32 readout after reset.
  • 0: Restore A32 readout after reset.
  • !0: Do not restore A32 readout after reset. (Useful for configuration changes)

References fadc_struct::adr32, fadc_struct::adr_mb, fadc_struct::csr, FA_CSR_HARD_RESET, FA_MAX_BOARDS, FALOCK, FAp, faSlot(), FAUNLOCK, and nfadc.

◆ faGSetBlockLevel()

void faGSetBlockLevel ( int  level)

Set the block level for all initialized fADC250s.

Parameters
levelblock level

References fadc_struct::blk_level, fadcBlockLevel, fadcID, FALOCK, FAp, FAUNLOCK, and nfadc.

◆ faGSetClockSource()

int faGSetClockSource ( int  clkSrc)

Set the clock source for all initialized modules.

This routine should be used in the case that the source clock is NOT set in faInit (and defaults to Internal). Such is the case when clocks are synchronized in a many crate system. The clock source of the FADC should ONLY be set AFTER those clocks have been set and synchronized.

Parameters
clkSrc2 bit integer
      bits 1-0:  defines Clock Source
          0 0  Internal 250MHz Clock
          0 1  Front Panel 
          1 0  VXS (P0)
          1 1  VXS (P0)
Returns
OK if successful, otherwise ERROR.

References FA_ENABLE_INTERNAL_CLK, FA_REF_CLK_FP, FA_REF_CLK_INTERNAL, FA_REF_CLK_MASK, FA_REF_CLK_P0, FALOCK, FAp, faSlot(), FAUNLOCK, and nfadc.

◆ faGSetDataFormat()

void faGSetDataFormat ( int  format)

Set the readout data form for all initialized modules.

Parameters
formatData Format
  • 0: Standard Format - No data words suppressed
  • 1: Intermediate compression - Event headers suppressed if no data
  • 2: Full compression - Only first event header in the block.

References faSetDataFormat(), faSlot(), and nfadc.

◆ faGSetHistoryBufferThreshold()

void faGSetHistoryBufferThreshold ( int  thres)

Set the threshold to trigger for the history buffer to be saved for readout for all initialized fADC250s.

Parameters
thresHistory Buffer Threshold

References faSetHistoryBufferThreshold(), faSlot(), and nfadc.

◆ faGSetHitbitsMode()

void faGSetHitbitsMode ( int  enable)

Enable/Disable Hitbits mode for all initialized fADC250s.

Parameters
enable
  • 0: Disable
  • >0: Enable

References faSetHitbitsMode(), faSlot(), and nfadc.

◆ faGSetProcMode()

void faGSetProcMode ( int  pmode,
unsigned int  PL,
unsigned int  PTW,
int  NSB,
unsigned int  NSA,
unsigned int  NP,
unsigned int  NPED,
unsigned int  MAXPED,
unsigned int  NSAT 
)

Configure the processing type/mode for all initialized fADC250s.

Parameters
idSlot number
pmodeProcessing Mode
  • 9 - Pulse Parameter Mode
  • 10 - Debug Mode (9 + Raw Samples)
PLWindow Latency
PTWWindow Width
NSBIf NSB > 0: Number of samples before pulse over threshold included in sum NSB < 0: Number of samples after threshold excluded from sum
NSANumber of samples after pulse over threshold to be included in sum
NPNumber of pulses processed per window
NPEDNumber of samples to sum for pedestal
MAXPEDMaximum value of sample to be included in pedestal sum
NSATNumber of consecutive samples over threshold for valid pulse

Note:

  • PL must be greater than PTW
  • NSA+NSB must be an odd number
  • NPED must be less than PTW and 4 <= NPED <= 15
Returns
OK if successful, otherwise ERROR.

References fadcID, faSetProcMode(), and nfadc.

◆ faGSetTriggerPathSamples()

void faGSetTriggerPathSamples ( unsigned int  TNSA,
unsigned int  TNSAT 
)

Set the number of samples that are included before and after threshold crossing that are sent through the trigger path for all initialized fADC250s.

Parameters
NSBNumber of samples before threshold crossing
NSANumber of samples after threshold crossing
See also
faSetTriggerPathSamples

References fadcID, faSetTriggerPathSamples(), and nfadc.

◆ faGSetTriggerPathThreshold()

void faGSetTriggerPathThreshold ( unsigned int  TPT)

Set the threshold used to determine what samples are sent through the trigger path for all initialized fADC250s.

Parameters
thresholdTrigger Path Threshold
See also
faSetTriggerPathThreshold

References fadcID, faSetTriggerPathThreshold(), and nfadc.

◆ faGSuppressTriggerTime()

int faGSuppressTriggerTime ( int  suppress)

Suppress all, or just the MSB, of the trigger time words from the datastream.

Parameters
suppressSuppression Parameter
   0 - Trigger Time not suppressed
   1 - Suppress MSB of trigger time
   2 - Suppress all trigger time words.
Returns
OK if successful. Otherwise ERROR.

References faSlot(), faSuppressTriggerTime(), and nfadc.

◆ faInit()

STATUS faInit ( UINT32  addr,
UINT32  addr_inc,
int  nadc,
int  iFlag 
)

Initialize JLAB FADC Library.

Parameters
addr
  • A24 VME Address of the fADC250
addr_inc
  • Amount to increment addr to find the next fADC250
nadc
  • Number of times to increment
iFlag18 bit integer
      Low 6 bits - Specifies the default Signal distribution (clock,trigger) 
                   sources for the board (Internal, FrontPanel, VXS, VME(Soft))
      bit    0:  defines Sync Reset source
                    0  VME (Software Sync-Reset)
                    1  Front Panel/VXS/P2 (Depends on Clk/Trig source selection)
      bits 3-1:  defines Trigger source
              0 0 0  VME (Software Triggers)
              0 0 1  Front Panel Input
              0 1 0  VXS (P0) 
              1 0 0  Internal Trigger Logic (HITSUM FPGA)
              (all others Undefined - default to VME/Software)
      bits 5-4:  defines Clock Source
          0 0  Internal 250MHz Clock
          0 1  Front Panel 
          1 0  VXS (P0)
          1 1  P2 Connector (Backplane)
      Common Modes of Operation:
          Value = 0  CLK (Int)  TRIG (Soft)   SYNC (Soft)    (Debug/Test Mode)
                  2  CLK (Int)  TRIG (FP)     SYNC (Soft)    (Single Board
                  3  CLK (Int)  TRIG (FP)     SYNC (FP)         Modes)
               0x10  CLK (FP)   TRIG (Soft)   SYNC (Soft)
               0x13  CLK (FP)   TRIG (FP)     SYNC (FP)      (VME SDC Mode)
               0x20  CLK (VXS)  TRIG (Soft)   SYNC (Soft)
               0x25  CLK (VXS)  TRIG (VXS)    SYNC (VXS)     (VXS SD Mode)
     High 10bits - A16 Base address of FADC Signal Distribution Module
                   This board can control up to 7 FADC Boards.
                   Clock Source must be set to Front Panel (bit4 = 1)
     bit 16:  Exit before board initialization
            0 Initialize FADC (default behavior)
            1 Skip initialization (just setup register map pointers)
     bit 17:  Use fadcAddrList instead of addr and addr_inc
              for VME addresses.
            0 Initialize with addr and addr_inc
            1 Use fadcAddrList
     bit 18:  Skip firmware check.  Useful for firmware updating.
            0 Perform firmware check
            1 Skip firmware check
Returns
OK, or ERROR if the address is invalid or a board is not present.

References fadc_struct::adc_status, fadc_struct::csr, fadc_sdc_struct::ctrl, FA_A32_ENABLE, FA_ADC_VERSION_MASK, FA_BOARD_ID, FA_BOARD_MASK, FA_CSR_HARD_RESET, FA_ENABLE_INTERNAL_CLK, FA_ENABLE_SOFT_SRESET, FA_ENABLE_SOFT_TRIG, FA_FIRST_BOARD, FA_INIT_SKIP, FA_INIT_SKIP_FIRMWARE_CHECK, FA_INIT_USE_ADDRLIST, FA_LAST_BOARD, FA_MAX_A32_MEM, FA_MAX_A32MB_SIZE, FA_MGT_RESET, FA_REF_CLK_FP, FA_REF_CLK_INTERNAL, FA_REF_CLK_P0, FA_RELEASE_MGT_RESET, FA_RESET_ADC_FIFO1, FA_RESET_ADC_FPGA1, FA_RESET_ALL, FA_RESET_DAC, FA_RESET_EXT_RAM_PT, FA_SDC_ADR_MASK, FA_SLOT_ID_MASK, FA_SOURCE_MASK, FA_SOURCE_SDC, FA_SOURCE_VXS, FA_SRESET_FP_ISYNC, FA_SRESET_P0_ISYNC, FA_SRESET_VME, FA_SUPPORTED_CTRL_FIRMWARE, FA_SUPPORTED_CTRL_FIRMWARE_NUMBER, FA_SUPPORTED_PROC_FIRMWARE, FA_SUPPORTED_PROC_FIRMWARE_NUMBER, FA_TRIG_FP_ISYNC, FA_TRIG_INTERNAL, FA_TRIG_P0_ISYNC, FA_TRIG_VME, FA_VERSION_MASK, FA_VME_INT_LEVEL, FA_VME_INT_VEC, faCheckThreshold(), fadcA16Offset, fadcA24Offset, fadcA32Base, fadcA32Offset, fadcAddrList, fadcBlockLevel, fadcChanDisable, fadcID, fadcInited, fadcIntArg, fadcIntID, fadcIntLevel, fadcIntRoutine, fadcIntRunning, fadcIntVec, fadcMaxSlot, fadcMinSlot, fadcProcRev, fadcRev, fadcSource, fadcUseSDC, FAp, FApd, FApmb, faSDC_Config(), FASDC_CSR_INIT, fadc_struct::intr, nfadc, and fadc_struct::version.

◆ faLatchScalers()

int faLatchScalers ( int  id)

Latch the current scaler count.

Parameters
idSlot number
Returns
OK if successful, otherwise ERROR.

References FA_SCALER_CTRL_ENABLE, FA_SCALER_CTRL_LATCH, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::scaler_ctrl.

◆ faPPGDisable()

void faPPGDisable ( int  id)

Disable the programmable pulse generator.

Parameters
idSlot number
See also
faSetPPG faPPGEnable

References fadc_struct::adc_config, FA_PPG_ENABLE, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faPPGEnable()

void faPPGEnable ( int  id)

Enable the programmable pulse generator.

Parameters
idSlot number
See also
faSetPPG faPPGDisable

References fadc_struct::adc_config, FA_PPG_ENABLE, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faReset()

void faReset ( int  id,
int  iFlag 
)

Perform a hard reset.

Parameters
idSlot number
iFlagDecision to restore A32 readout after reset.
  • 0: Restore A32 readout after reset.
  • !0: Do not restore A32 readout after reset. (Useful for configuration changes)

References fadc_struct::adr32, fadc_struct::adr_mb, fadc_struct::csr, FA_CSR_HARD_RESET, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faResetToken()

void faResetToken ( int  id)

Reset the token.

A call to this routine will cause the module to have the token if it has been configured to the the FIRST module in the MultiBlock chain. This routine has no effect on any other module in the chain.

Parameters
idSlot number

References FA_RESET_TOKEN, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::reset.

◆ faResetTriggerCount()

int faResetTriggerCount ( int  id)

Reset the trigger count for the module.

Parameters
idSlot number
Returns
OK if successful, otherwise ERROR.

References FA_TRIG_SCAL_RESET, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::trig_scal.

◆ faSetAlignmentDebugMode()

int faSetAlignmentDebugMode ( int  enable)

Enable/Disable the alignment sequence that is sent to the CTP for debugging.

Parameters
enable
  • 0: Disable
  • >0: Enable
Returns
1 if enabled, 0 if disabled

References fadcAlignmentDebug.

◆ faSetBlockLevel()

int faSetBlockLevel ( int  id,
int  level 
)

Set the block level for the module.

Parameters
idSlot number
levelblock level
Returns
OK if successful, otherwise ERROR.

References fadc_struct::blk_level, FA_BLOCK_LEVEL_MASK, fadcBlockLevel, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faSetChannelDisable()

int faSetChannelDisable ( int  id,
int  channel 
)

Disable the specified channel.

Parameters
idSlot number
channelChannel Number to Disable
Returns
OK if successful, otherwise ERROR.

References fadc_struct::adc_config, FA_MAX_ADC_CHANNELS, fadcChanDisable, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faSetChannelDisableMask()

int faSetChannelDisableMask ( int  id,
unsigned short  cmask 
)

Disable all channels in the specified mask.

Parameters
idSlot number
cmaskChannel mask of channels to disable
Returns
OK if successful, otherwise ERROR.

References fadc_struct::adc_config, fadcChanDisable, fadcID, FALOCK, FAp, and FAUNLOCK.

Referenced by faChanDisable().

◆ faSetChannelEnable()

int faSetChannelEnable ( int  id,
int  channel 
)

Enable the specified channel.

Parameters
idSlot number
channelChannel Number to Enable
Returns
OK if successful, otherwise ERROR.

References fadc_struct::adc_config, FA_MAX_ADC_CHANNELS, fadcChanDisable, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faSetChannelEnableMask()

int faSetChannelEnableMask ( int  id,
unsigned short  enMask 
)

Enable all channels in the specified mask.

Parameters
idSlot number
cmaskChannel mask of channels to Enable
Returns
OK if successful, otherwise ERROR.

References fadc_struct::adc_config, FA_ADC_CHAN_MASK, fadcChanDisable, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faSetChannelPedestal()

int faSetChannelPedestal ( int  id,
unsigned int  chan,
unsigned int  ped 
)

Set the pedestal value of specified channel.

The pedestal is the value that will be subtracted from specified channel for each sample before it is sent through the trigger path

Parameters
idSlot number
chanChannel Number
pedPedestal value
Returns
OK if successful, otherwise ERROR.

References fadc_struct::adc_pedestal, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faSetClkSource()

int faSetClkSource ( int  id,
int  source 
)

Set the Clock Source for the module.

Parameters
idSlot number
sourceClock Source
  • 0: internal
  • 1: front panel
  • 2: P0/VXS
Returns
OK if successful, otherwise ERROR.

References fadc_struct::ctrl1, FA_REF_CLK_INTERNAL, FA_REF_CLK_SEL_MASK, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faSetClockSource()

int faSetClockSource ( int  id,
int  clkSrc 
)

Set the clock source.

This routine should be used in the case that the source clock is NOT set in faInit (and defaults to Internal). Such is the case when clocks are synchronized in a many crate system. The clock source of the FADC should ONLY be set AFTER those clocks have been set and synchronized.

Parameters
idSlot Number
clkSrc2 bit integer
      bits 1-0:  defines Clock Source
          0 0  Internal 250MHz Clock
          0 1  Front Panel 
          1 0  VXS (P0)
          1 1  VXS (P0)
Returns
OK if successful, otherwise ERROR.

References FA_ENABLE_INTERNAL_CLK, FA_REF_CLK_FP, FA_REF_CLK_INTERNAL, FA_REF_CLK_MASK, FA_REF_CLK_P0, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faSetDAC()

int faSetDAC ( int  id,
unsigned short  dvalue,
unsigned short  chmask 
)

Set the DAC value of the specified channel mask.

Parameters
idSlot number
dvalueDAC Value
chmaskMask of channels to set
Returns
OK if successful, otherwise ERROR.

References fadc_struct::dac, FA_DAC_VALUE_MASK, FA_DAC_WRITE_TIMEOUT_ERROR, FA_MAX_ADC_CHANNELS, fadcID, FALOCK, FAp, and FAUNLOCK.

Referenced by faSetDACandCheck().

◆ faSetDACandCheck()

int faSetDACandCheck ( int  id,
unsigned short  dvalue,
unsigned short  chmask 
)

Set the DAC value of the specified channel mask and readback and check that it was written properly.

Parameters
idSlot number
dvalueDAC Value
chmaskMask of channels to set
Returns
OK if successful, otherwise ERROR.

References FA_MAX_ADC_CHANNELS, fadcID, faGetDAC(), FAp, and faSetDAC().

◆ faSetDataFormat()

int faSetDataFormat ( int  id,
int  format 
)

Set the readout data form which allows for suppression of repetitious data words.

Parameters
idSlot number
formatData Format
  • 0: Standard Format - No data words suppressed
  • 1: Intermediate compression - Event headers suppressed if no data
  • 2: Full compression - Only first event header in the block.
Returns
OK if successful, otherwise ERROR.

References fadc_struct::ctrl1, FA_CTRL1_DATAFORMAT_MASK, fadcID, FALOCK, FAp, and FAUNLOCK.

Referenced by faGSetDataFormat().

◆ faSetHistoryBufferThreshold()

int faSetHistoryBufferThreshold ( int  id,
int  thres 
)

Set the threshold to trigger for the history buffer to be saved for readout.

Parameters
idSlot number
thresHistory Buffer Threshold
Returns
OK if successful, otherwise ERROR.

References FA_SUM_THRESHOLD_MASK, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::sum_threshold.

Referenced by faGSetHistoryBufferThreshold().

◆ faSetHitbitsMode()

int faSetHitbitsMode ( int  id,
int  enable 
)

Enable/Disable Hitbits mode on the module.

Parameters
idSlot number
enable
  • 0: Disable
  • >0: Enable
Returns
OK if successful, otherwise ERROR.

References FA_MGT_HITBITS_TO_CTP, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::mgt_ctrl.

Referenced by faGSetHitbitsMode().

◆ faSetInvertedMode()

void faSetInvertedMode ( int  id)

Configure the ADC Processing in "Inverted (positive polarity) Mode".

Call this routine to invert the digital output of the ADC chips for each channel. This routine MUST be called after faSetProcMode.

See also
faSetProcMode
Parameters
idSlot number

References fadcID, FALOCK, and FAp.

◆ faSetNormalMode()

void faSetNormalMode ( int  id,
int  opt 
)

Configure the ADC Processing in "Normal Mode".

This routine is called in faSetProcMode

Parameters
idSlot number
optNot Used

References fadc_struct::adc_config, fadcID, FALOCK, and FAp.

◆ faSetPPG()

int faSetPPG ( int  id,
int  pmode,
unsigned short *  sdata,
int  nsamples 
)

Setup FADC Progammable Pulse Generator.

Parameters
idSlot number
pmodeNot used
sdataArray of sample data to be programmed
nsamplesNumber of samples contained in sdata
See also
faPPGEnable faPPGDisable
Returns
OK if successful, otherwise ERROR.

References fadc_struct::adc_test_data, FA_PPG_MAX_SAMPLES, FA_PPG_SAMPLE_MASK, FA_PPG_WRITE_VALUE, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faSetProcMode()

int faSetProcMode ( int  id,
int  pmode,
unsigned int  PL,
unsigned int  PTW,
int  NSB,
unsigned int  NSA,
unsigned int  NP,
unsigned int  NPED,
unsigned int  MAXPED,
unsigned int  NSAT 
)

Configure the processing type/mode.

Parameters
idSlot number
pmodeProcessing Mode
  • 9 - Pulse Parameter Mode
  • 10 - Debug Mode (9 + Raw Samples)
PLWindow Latency
PTWWindow Width
NSBIf NSB > 0: Number of samples before pulse over threshold included in sum NSB < 0: Number of samples after threshold excluded from sum
NSANumber of samples after pulse over threshold to be included in sum
NPNumber of pulses processed per window
NPEDNumber of samples to sum for pedestal
MAXPEDMaximum value of sample to be included in pedestal sum
NSATNumber of consecutive samples over threshold for valid pulse

Note:

  • PL must be greater than PTW
  • NSA+NSB must be an odd number
  • NPED must be less than PTW and 4 <= NPED <= 15
Returns
OK if successful, otherwise ERROR.

References fadc_struct::adc_config, fadc_struct::adc_nsa, fadc_struct::adc_nsb, fadc_struct::adc_pl, fadc_struct::adc_ptw, fadc_struct::config3, fadc_struct::config7, FA_ADC_CONFIG1_TNSAT_MASK, FA_ADC_DEFAULT_TPT, FA_ADC_MAX_MAXPED, FA_ADC_MAX_NP, FA_ADC_MAX_NPED, FA_ADC_MAX_NSA, FA_ADC_MAX_NSAT, FA_ADC_MAX_NSB, FA_ADC_MAX_PL, FA_ADC_MAX_PTW, FA_ADC_MIN_MAXPED, FA_ADC_MIN_NP, FA_ADC_MIN_NPED, FA_ADC_MIN_NSA, FA_ADC_MIN_NSAT, FA_ADC_MIN_NSB, FA_ADC_MIN_PL, FA_ADC_MIN_PTW, FA_ADC_NSB_NEGATIVE, FA_ADC_PROC_ENABLE, FA_ADC_PROC_MODE_PULSE_PARAM, FA_ADC_PROC_MODE_RAW_PULSE_PARAM, FA_ADC_TNSA_MASK, FA_SUPPORTED_MODES, FA_SUPPORTED_NMODES, faCalcMaxUnAckTriggers(), fadcChanDisable, fadcID, FALOCK, FAp, faSetTriggerBusyCondition(), faSetTriggerStopCondition(), and FAUNLOCK.

Referenced by faGSetProcMode().

◆ faSetScalerBlockInterval()

int faSetScalerBlockInterval ( int  id,
unsigned int  nblock 
)

Set the block interval of scaler data insertion.

Data from scalers may be inserted into the readout data stream at regular event count intervals. The interval is specified in multiples of blocks. Note: Scalers are NOT reset after their values are captured.

Parameters
idSlot number
nblock
  • 0: No insertion of scaler data into the data stream
  • >=1: The current scaler values are appended to the last event of the appropriate n'th block of events.
Returns
OK if successful, otherwise ERROR.

References FA_SCALER_INTERVAL_MASK, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::scaler_interval.

◆ faSetSyncSource()

int faSetSyncSource ( int  id,
int  source 
)

Set the SyncReset source for the module.

Parameters
idSlot number
source
  • 0: FP
  • 1: FP (synchronized)
  • 2: P0/VXS
  • 3: P0/VXS (synchronized)
  • 4: Not used
  • 5: Not used
  • 6: Software
  • 7: No Source
Returns
OK if successful, otherwise ERROR.

References fadc_struct::ctrl1, FA_SRESET_FP_ISYNC, FA_SRESET_SEL_MASK, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faSetThreshold()

int faSetThreshold ( int  id,
unsigned short  tvalue,
unsigned short  chmask 
)

Set the readout threshold value for specified channel mask.

Parameters
idSlot number
tvalueThreshold value
chmaskMask of channels to set
Returns
OK if successful, otherwise ERROR.

References fadc_struct::adc_thres, FA_MAX_ADC_CHANNELS, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faSetTrig21Delay()

int faSetTrig21Delay ( int  id,
int  delay 
)

Configure the delay between the software playback trigger and trigger.

Parameters
idSlot number
delayDelay between the playback trigger and trigger in units of 4 ns
See also
faEnableInternalPlaybackTrigger
Returns
OK if successful, otherwise ERROR.

References FA_TRIG21_DELAY_MASK, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::trig21_delay.

◆ faSetTriggerBusyCondition()

int faSetTriggerBusyCondition ( int  id,
int  trigger_max 
)

Set the maximum number of unacknowledged triggers before module asserts BUSY.

Parameters
idSlot number
trigger_maxLimit for maximum number of unacknowledged triggers If 0, disables the condition
Returns
OK if successful, otherwise ERROR.

References FA_TRIGCTL_BUSY_EN, FA_TRIGCTL_MAX1_MASK, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::trigger_control.

Referenced by faSetProcMode().

◆ faSetTriggerPathSamples()

int faSetTriggerPathSamples ( int  id,
unsigned int  TNSA,
unsigned int  TNSAT 
)

Set the number of samples that are included before and after threshold crossing that are sent through the trigger path.

Parameters
idSlot number
NSBNumber of samples before threshold crossing
NSANumber of samples after threshold crossing
Returns
OK if successful, otherwise ERROR.

References fadc_struct::adc_config, fadc_struct::adc_nsa, FA_ADC_CONFIG1_TNSAT_MASK, FA_ADC_DEFAULT_TNSA, FA_ADC_DEFAULT_TNSAT, FA_ADC_MAX_TNSA, FA_ADC_MAX_TNSAT, FA_ADC_MIN_TNSA, FA_ADC_MIN_TNSAT, FA_ADC_NSA_READBACK_MASK, fadcID, fadcProcRev, FALOCK, FAp, and FAUNLOCK.

Referenced by faGSetTriggerPathSamples().

◆ faSetTriggerPathThreshold()

int faSetTriggerPathThreshold ( int  id,
unsigned int  TPT 
)

Set the threshold used to determine what samples are sent through the trigger path.

Parameters
idSlot number
thresholdTrigger Path Threshold
Returns
OK if successful, otherwise ERROR.

References fadc_struct::config3, FA_ADC_CONFIG3_TPT_MASK, FA_ADC_MAX_TPT, fadcID, fadcProcRev, FALOCK, FAp, and FAUNLOCK.

Referenced by faGSetTriggerPathThreshold().

◆ faSetTriggerStopCondition()

int faSetTriggerStopCondition ( int  id,
int  trigger_max 
)

Set the maximum number of unacknowledged triggers before module stops accepting incoming triggers.

Parameters
idSlot number
trigger_maxLimit for maximum number of unacknowledged triggers. If 0, disables the condition.
Returns
OK if successful, otherwise ERROR.

References FA_TRIGCTL_MAX2_MASK, FA_TRIGCTL_TRIGSTOP_EN, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::trigger_control.

Referenced by faSetProcMode().

◆ faSetTrigOut()

int faSetTrigOut ( int  id,
int  trigout 
)

Set trigger output options.

Parameters
idSlot number
trigoutbits:
     0  1  0  Enable Front Panel Trigger Output
     1  0  0  Enable VXS Trigger Output
Returns
OK if successful, otherwise ERROR.

References fadc_struct::ctrl1, FA_TRIGOUT_MASK, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faSetTrigSource()

int faSetTrigSource ( int  id,
int  source 
)

Set the trigger source for the module.

Parameters
idSlot number
sourceTrigger Source
  • 0: Front Panel
  • 1: Front Panel (Synchronized)
  • 2: P0/VXS
  • 3: P0/VXS (Synchronized)
  • 4: Not used
  • 5: Software (with playback)
  • 6: Software
Returns
OK if successful, otherwise ERROR.

References fadc_struct::ctrl1, FA_TRIG_FP_ISYNC, FA_TRIG_SEL_MASK, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faSlot()

int faSlot ( unsigned int  i)

Convert an index into a slot number, where the index is the element of an array of FADCs in the order in which they were initialized.

Parameters
iInitialization number
Returns
Slot number if Successfull, otherwise ERROR.

References fadcID, and nfadc.

Referenced by faGArmHistoryBuffer(), faGDACReset(), faGDataInsertAdcParameters(), faGDataSuppressTriggerTime(), faGProcPedConfig(), faGReset(), faGSampleConfig(), faGSetClockSource(), faGSetDataFormat(), faGSetHistoryBufferThreshold(), faGSetHitbitsMode(), faGStatus(), faGSuppressTriggerTime(), and faGTokenStatus().

◆ faSoftReset()

void faSoftReset ( int  id,
int  cflag 
)

Perform either a soft clear or soft reset.

Parameters
idSlot number
cflag
  • 0: Soft Clear
  • >0: Soft Reset

References fadc_struct::csr, FA_CSR_SOFT_CLEAR, FA_CSR_SOFT_RESET, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faStateArmBuffer()

int faStateArmBuffer ( int  id,
int  enable 
)

Enable/Disable Buffer to store state machine diagnostics.

Parameters
idSlot number
enableIf enable != 0, enable buffer, otherwise disable.
Returns
OK successful, otherwise ERROR.

References FA250_STATE_REGS::csr, FA_STATE_CSR_ARM_BUFFER, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::state.

◆ faSuppressTriggerTime()

int faSuppressTriggerTime ( int  id,
int  suppress 
)

Suppress all, or just the MSB, of the trigger time words from the datastream.

Parameters
idSlot number
suppressSuppression Parameter
   0 - Trigger Time not suppressed
   1 - Suppress MSB of trigger time
   2 - Suppress all trigger time words.
Returns
OK if successful. Otherwise ERROR.

References fadc_struct::ctrl1, FA_CTRL1_SUPPRESS_TT, FA_CTRL1_SUPPRESS_TT2, fadcID, FALOCK, FAp, and FAUNLOCK.

Referenced by faGSuppressTriggerTime().

◆ faSync()

void faSync ( int  id)

Pulse a software SyncReset.

Parameters
idSlot number

References fadc_struct::csr, fadc_struct::ctrl1, FA_CSR_SYNC, FA_ENABLE_SOFT_SRESET, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faTestResetSyncCounter()

void faTestResetSyncCounter ( int  id)

Reset the counter of the SyncReset scaler.

Available only in System Test Mode

See also
faTestSetSystemTestMode
Parameters
idSlot number

References FA_SYNCP0COUNT_RESET, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::syncp0count.

◆ faTestResetTrig1Counter()

void faTestResetTrig1Counter ( int  id)

Reset the counter of the trig1 scaler.

Available only in System Test Mode

See also
faTestSetSystemTestMode
Parameters
idSlot number

References FA_TRIG1P0COUNT_RESET, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::trig1p0count.

◆ faTestResetTrig2Counter()

void faTestResetTrig2Counter ( int  id)

Reset the counter of the trig2 scaler.

Available only in System Test Mode

See also
faTestSetSystemTestMode
Parameters
idSlot number

References FA_TRIG2P0COUNT_RESET, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::trig2p0count.

◆ faTestSetBusyOut()

void faTestSetBusyOut ( int  id,
int  mode 
)

Set the level of Busy Out to the SD.

Available only in System Test Mode

See also
faTestSetSystemTestMode
Parameters
idSlot number
mode
  • 0: Not asserted
  • >0: Asserted

References FA_TESTBIT_BUSYOUT, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::testBit.

◆ faTestSetSdLink()

void faTestSetSdLink ( int  id,
int  mode 
)

Set the level of the SD Link.

Available only in System Test Mode

See also
faTestSetSystemTestMode
Parameters
idSlot number
mode
  • 0: Not asserted
  • >0: Asserted

References FA_TESTBIT_SDLINKOUT, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::testBit.

◆ faTestSetSystemTestMode()

void faTestSetSystemTestMode ( int  id,
int  mode 
)

Enable/Disable System test mode.

Parameters
idSlot number
mode
  • 0: Disable Test Mode
  • >0: Enable Test Mode

References fadc_struct::ctrl1, FA_CTRL1_SYSTEM_TEST_MODE, fadcID, FALOCK, FAp, and FAUNLOCK.

◆ faTestSetTokenOut()

void faTestSetTokenOut ( int  id,
int  mode 
)

Set the level of Token Out to the SD.

Available only in System Test Mode

See also
faTestSetSystemTestMode
Parameters
idSlot number
mode
  • 0: Not asserted
  • >0: Asserted

References FA_TESTBIT_TOKENOUT, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::testBit.

◆ faTestSetTrigOut()

void faTestSetTrigOut ( int  id,
int  mode 
)

Set the level of Trig Out to the SD.

Available only in System Test Mode

See also
faTestSetSystemTestMode
Parameters
idSlot number
mode
  • 0: Not asserted
  • >0: Asserted

References FA_TESTBIT_TRIGOUT, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::testBit.