JLab fADC250-V2 Library  0x42
fadcLib.c File Reference

Macros

#define FALOCK   if(pthread_mutex_lock(&faMutex)<0) perror("pthread_mutex_lock");
 
#define FAUNLOCK   if(pthread_mutex_unlock(&faMutex)<0) perror("pthread_mutex_unlock");
 
#define FASDCLOCK   if(pthread_mutex_lock(&fasdcMutex)<0) perror("pthread_mutex_lock");
 
#define FASDCUNLOCK   if(pthread_mutex_unlock(&fasdcMutex)<0) perror("pthread_mutex_unlock");
 

Functions

STATUS faInit (UINT32 addr, UINT32 addr_inc, int nadc, int iFlag)
 Initialize JLAB FADC Library. More...
 
int faCheckAddresses (int id)
 
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...
 
void faStatus (int id, int sflag)
 Print Status of fADC250 to standard out. More...
 
void faGStatus (int sflag)
 Print a summary of all initialized fADC250s. More...
 
unsigned int faGetFirmwareVersions (int id, int pflag)
 Get the firmware versions of each FPGA. 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...
 
int faReadBlock (int id, volatile UINT32 *data, int nwrds, int rflag)
 General Data readout routine. More...
 
int faGetBlockError (int pflag)
 Return the type of error that occurred while attempting a block read from faReadBlock. More...
 
int faReadBlockStatus (int id, volatile UINT32 *data, int nwrds, int rflag)
 For asychronous calls to faReadBlock, this routine completes the block transfer. More...
 
int faPrintBlock (int id, int rflag)
 Print the current available block to standard out. More...
 
unsigned int faReadCSR (int id)
 Get the value of the Control/Status Register. 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 faTokenStatus (int id)
 Return the status of the token. More...
 
int faGTokenStatus ()
 Return the slotmask of those modules that have the token. More...
 
unsigned int faGetTokenStatus (int pflag)
 Return slot mask of modules with token. More...
 
void faSetCalib (int id, unsigned short sdelay, unsigned short tdelay)
 Set the SyncReset and Trigger Delay. 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...
 
int faGetChannelMask (int id, int type)
 Get the Enabled/Disabled Channel 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...
 
void faTrig (int id)
 Pulse a software trigger to the module. More...
 
void faGTrig ()
 Pulse a software trigger to all initialized fADC250s. More...
 
void faTrig2 (int id)
 Pulse a software playback trigger to the module. More...
 
void faGTrig2 ()
 Pulse a software playback trigger to all initialized fADC250s. More...
 
int faSetTrig21Delay (int id, int delay)
 Configure the delay between the software playback trigger and trigger. More...
 
int faGetTrig21Delay (int id)
 Return the value of 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 faDready (int id, int dflag)
 Return Event/Block count. More...
 
int faBready (int id)
 Return a Block Ready status. More...
 
unsigned int faGBready ()
 Return a Block Ready status mask for all initialized fADC250s. More...
 
unsigned int faGBlockReady (unsigned int slotmask, int nloop)
 Return a Block Ready status mask for fADCs indicated in supplied slotmask. More...
 
unsigned int faScanMask ()
 Return the vme slot mask of all initialized fADC250s. More...
 
int faBusyLevel (int id, unsigned int val, int bflag)
 Set/Readback Busy Level. More...
 
int faBusy (int id)
 Get the busy status. 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 faPrintThreshold (int id)
 Print the thresholds of all channels to standard out. More...
 
int faProcPedConfig (int id, int nsamples, int maxvalue)
 Configure pedestal parameters to be used by processing algorythm. More...
 
int faGProcPedConfig (int nsamples, int maxvalue)
 Configure pedestal parameters to be used by processing algorythm for all initialized modules. More...
 
int faSampleConfig (int id, int nsamples, int maxvalue)
 Configure output of sample data from . More...
 
int faGSampleConfig (int nsamples, int maxvalue)
 Configure output of sample data from for all initialized modules. More...
 
int faReadAllChannelSamples (int id, volatile unsigned int *data)
 Read the current sample data from the specified channel and module. 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...
 
void faPrintDAC (int id)
 Print DAC values for each channel to standard out. 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 faGetChannelPedestal (int id, unsigned int chan)
 Get the pedestal value of specified channel. More...
 
int faSetMGTTestMode (int id, unsigned int mode)
 Set the fa250 operation when Sync Reset is received. More...
 
int faSetAlignmentDebugMode (int enable)
 Enable/Disable the alignment sequence that is sent to the CTP for debugging. More...
 
int faGetAlignmentDebugMode ()
 Return whether or not the module will send the alignment sequence to the CTP. 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 faGetHitbitsMode (int id)
 Get the enabled/disabled status of hitbits mode for the module. More...
 
int faReadScalers (int id, volatile unsigned int *data, unsigned int chmask, int rflag)
 Scaler Data readout routine. More...
 
int faPrintScalers (int id, int rflag)
 Scaler Print Out routine. 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...
 
unsigned int faGetA32 (int id)
 Return the base address of the A32 for specified module. More...
 
unsigned int faGetA32M ()
 Return the base address of the A32 Multiblock. More...
 
unsigned int faGetMinA32MB (int id)
 Get the minimum address used for multiblock. More...
 
unsigned int faGetMaxA32MB (int id)
 Get the maximum address used for multiblock. 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...
 
unsigned int faGetCtrlFPGAData (int id)
 Return raw register data from the Control FPGA containing the temperature, core voltage, and auxiliary voltage. More...
 
unsigned int faGetProcFPGAData (int id)
 Return raw register data from the Processing FPGA containing the temperature. More...
 
float faGetCtrlFPGATemp (int id, int pflag)
 Return the value of the Control FPGA temperature (in degrees Celsius) More...
 
float faGetCtrlFPGAVoltage (int id, int vtype, int pflag)
 Return the value of specified Control FPGA voltage. More...
 
float faGetProcFPGATemp (int id, int pflag)
 Return the value of the Processing FPGA temperature (in degrees Celsius) More...
 
void faPrintAuxScal (int id)
 Print to standard out some auxillary scalers. More...
 
void faPrintFifoStatus (int id)
 Print the status of the FIFO to standard out. More...
 
void faDataDecode (unsigned int data)
 Decode a data word from an fADC250 and print to standard out. 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...
 
int faTestGetStatBitB (int id)
 Get the level of the StatBitB to the SD. More...
 
int faTestGetTokenIn (int id)
 Get the level of the Token In from the SD. More...
 
int faTestGetClock250CounterStatus (int id)
 Return the status of the 250Mhz Clock Counter. More...
 
unsigned int faTestGetClock250Counter (int id)
 Return the value of the 250Mhz Clock scaler. More...
 
unsigned int faTestGetSyncCounter (int id)
 Return the value of the SyncReset scaler. More...
 
unsigned int faTestGetTrig1Counter (int id)
 Return the value of the trig1 scaler. More...
 
unsigned int faTestGetTrig2Counter (int id)
 Return the value of the trig2 scaler. More...
 
void faTestResetClock250Counter (int id)
 Reset the counter of the 250MHz Clock scaler. 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...
 
unsigned int faTestGetTestBitReg (int id)
 Return the current value of the testBit register. More...
 
int faGetSerialNumber (int id, char **rval, int snfix)
 Fills 'rval' with a character array containing the fa250 serial number. More...
 
int faSetScalerBlockInterval (int id, unsigned int nblock)
 Set the block interval of scaler data insertion. More...
 
int faGetScalerBlockInterval (int id)
 
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 faGetHistoryBufferThreshold (int id)
 Get the history buffer threshold. 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 faHistoryBufferDReady (int id)
 Return whether or not the history buffer has been triggered. More...
 
int faReadHistoryBuffer (int id, volatile unsigned int *data, int nwrds)
 Read out history buffer from the module. More...
 
int faStateArmBuffer (int id, int enable)
 Enable/Disable Buffer to store state machine diagnostics. More...
 
int faStateReadBuffer (int id, volatile unsigned int *data, int nwords)
 Read state machine buffer. More...
 
int faStateMap (unsigned int state_value)
 Convert state value to mapped identifier. More...
 
int faStatePrintBuffer (int id)
 Print the contents of the State Machine buffer to standard out. More...
 
int faSDC_Config (unsigned short cFlag, unsigned short bMask)
 Configure the Signal Distribution Card (SDC) More...
 
void faSDC_Status (int sFlag)
 Print status of SDC to standard out. More...
 
void faSDC_Enable (int nsync)
 Enable Triggers and/or SyncReset on the SDC. More...
 
void faSDC_Disable ()
 Disable Triggers and SyncReset on the SDC. More...
 
void faSDC_Sync ()
 Perform a SyncReset from the SDC. More...
 
void faSDC_Trig ()
 Perform a trigger pulse from the SDC. More...
 
int faSDC_Busy ()
 Return Busy status of the SDC. More...
 

Variables

pthread_mutex_t faMutex = PTHREAD_MUTEX_INITIALIZER
 
pthread_mutex_t fasdcMutex = PTHREAD_MUTEX_INITIALIZER
 
BOOL fadcIntRunning = FALSE
 
int fadcIntID = -1
 
LOCAL VOIDFUNCPTR fadcIntRoutine = NULL
 
LOCAL int fadcIntArg = 0
 
LOCAL UINT32 fadcIntLevel = FA_VME_INT_LEVEL
 
LOCAL UINT32 fadcIntVec = FA_VME_INT_VEC
 
int nfadc = 0
 
unsigned int fadcA32Base = 0x08000000
 
unsigned long fadcA32Offset = 0x08000000
 
unsigned long fadcA24Offset = 0x0
 
unsigned long fadcA16Offset = 0x0
 
volatile struct fadc_structFAp [(FA_MAX_BOARDS+1)]
 
volatile struct fadc_sdc_structFASDCp
 
volatile unsigned int * FApd [(FA_MAX_BOARDS+1)]
 
volatile unsigned int * FApmb
 
int fadcID [FA_MAX_BOARDS]
 
unsigned int fadcAddrList [FA_MAX_BOARDS]
 
int fadcRev [(FA_MAX_BOARDS+1)]
 
int fadcProcRev [(FA_MAX_BOARDS+1)]
 
unsigned short fadcChanDisable [(FA_MAX_BOARDS+1)]
 
int fadcInited =0
 
int fadcMaxSlot =0
 
int fadcMinSlot =0
 
int fadcSource =0
 
int fadcBlockLevel =0
 
int fadcIntCount = 0
 
int fadcUseSDC =0
 
struct fadc_data_struct fadc_data
 
int fadcBlockError =FA_BLOCKERROR_NO_ERROR
 
int fadcAlignmentDebug =0
 
const char * fa_mode_names [FA_MAX_PROC_MODE+1]
 

Macro Definition Documentation

◆ FALOCK

#define FALOCK   if(pthread_mutex_lock(&faMutex)<0) perror("pthread_mutex_lock");

Referenced by faArmHistoryBuffer(), faBready(), faBusy(), faBusyLevel(), faCheckThreshold(), faClear(), faClearError(), faClearScalers(), faDACReset(), faDataInsertAdcParameters(), faDataSuppressTriggerTime(), faDisable(), faDisableBusError(), faDisableClk(), faDisableMultiBlock(), faDisableScalers(), faDisableSoftSync(), faDisableSoftTrig(), faDready(), faEnable(), faEnableBusError(), faEnableClk(), faEnableFP(), faEnableInternalPlaybackTrigger(), faEnableMultiBlock(), faEnableScalers(), faEnableSoftSync(), faEnableSoftTrig(), faEnableSyncSrc(), faEnableTriggerOut(), faForceEndOfBlock(), faGBlockReady(), faGBready(), faGClear(), faGClearError(), faGDACReset(), faGEnableBusError(), faGetChannelDAC(), faGetChannelMask(), faGetChannelPedestal(), faGetCtrlFPGAData(), faGetCtrlFPGATemp(), faGetCtrlFPGAVoltage(), faGetDAC(), faGetFirmwareVersions(), faGetHistoryBufferThreshold(), faGetHitbitsMode(), faGetMaxA32MB(), faGetMinA32MB(), faGetProcFPGAData(), faGetProcFPGATemp(), faGetScalerBlockInterval(), faGetSerialNumber(), faGetTrig21Delay(), faGReset(), faGSetBlockLevel(), faGSetClockSource(), faGStatus(), faHistoryBufferDReady(), faLatchScalers(), faPPGDisable(), faPPGEnable(), faPrintAuxScal(), faPrintBlock(), faPrintDAC(), faPrintFifoStatus(), faPrintScalers(), faPrintThreshold(), faProcPedConfig(), faReadAllChannelSamples(), faReadBlock(), faReadBlockStatus(), faReadCSR(), faReadHistoryBuffer(), faReadScalers(), faReset(), faResetToken(), faResetTriggerCount(), faSampleConfig(), faSetBlockLevel(), faSetCalib(), faSetChannelDisable(), faSetChannelDisableMask(), faSetChannelEnable(), faSetChannelEnableMask(), faSetChannelPedestal(), faSetClkSource(), faSetClockSource(), faSetDAC(), faSetDataFormat(), faSetHistoryBufferThreshold(), faSetHitbitsMode(), faSetInvertedMode(), faSetMGTTestMode(), faSetNormalMode(), faSetPPG(), faSetProcMode(), faSetScalerBlockInterval(), faSetSyncSource(), faSetThreshold(), faSetTrig21Delay(), faSetTriggerBusyCondition(), faSetTriggerPathSamples(), faSetTriggerPathThreshold(), faSetTriggerStopCondition(), faSetTrigOut(), faSetTrigSource(), faSoftReset(), faStateArmBuffer(), faStateReadBuffer(), faStatus(), faSuppressTriggerTime(), faSync(), faTestGetClock250Counter(), faTestGetClock250CounterStatus(), faTestGetStatBitB(), faTestGetSyncCounter(), faTestGetTestBitReg(), faTestGetTokenIn(), faTestGetTrig1Counter(), faTestGetTrig2Counter(), faTestResetClock250Counter(), faTestResetSyncCounter(), faTestResetTrig1Counter(), faTestResetTrig2Counter(), faTestSetBusyOut(), faTestSetSdLink(), faTestSetSystemTestMode(), faTestSetTokenOut(), faTestSetTrigOut(), faTokenStatus(), faTrig(), and faTrig2().

◆ FASDCLOCK

#define FASDCLOCK   if(pthread_mutex_lock(&fasdcMutex)<0) perror("pthread_mutex_lock");

◆ FASDCUNLOCK

#define FASDCUNLOCK   if(pthread_mutex_unlock(&fasdcMutex)<0) perror("pthread_mutex_unlock");

◆ FAUNLOCK

#define FAUNLOCK   if(pthread_mutex_unlock(&faMutex)<0) perror("pthread_mutex_unlock");

Referenced by faArmHistoryBuffer(), faBready(), faBusy(), faBusyLevel(), faCheckThreshold(), faClear(), faClearError(), faClearScalers(), faDACReset(), faDataInsertAdcParameters(), faDataSuppressTriggerTime(), faDisable(), faDisableBusError(), faDisableClk(), faDisableMultiBlock(), faDisableScalers(), faDisableSoftSync(), faDisableSoftTrig(), faDready(), faEnable(), faEnableBusError(), faEnableClk(), faEnableFP(), faEnableInternalPlaybackTrigger(), faEnableMultiBlock(), faEnableScalers(), faEnableSoftSync(), faEnableSoftTrig(), faEnableSyncSrc(), faEnableTriggerOut(), faForceEndOfBlock(), faGBlockReady(), faGBready(), faGClear(), faGClearError(), faGDACReset(), faGEnableBusError(), faGetChannelDAC(), faGetChannelMask(), faGetChannelPedestal(), faGetCtrlFPGAData(), faGetCtrlFPGATemp(), faGetCtrlFPGAVoltage(), faGetDAC(), faGetFirmwareVersions(), faGetHistoryBufferThreshold(), faGetHitbitsMode(), faGetMaxA32MB(), faGetMinA32MB(), faGetProcFPGAData(), faGetProcFPGATemp(), faGetScalerBlockInterval(), faGetSerialNumber(), faGetTrig21Delay(), faGReset(), faGSetBlockLevel(), faGSetClockSource(), faGStatus(), faHistoryBufferDReady(), faLatchScalers(), faPPGDisable(), faPPGEnable(), faPrintAuxScal(), faPrintBlock(), faPrintDAC(), faPrintFifoStatus(), faPrintScalers(), faPrintThreshold(), faProcPedConfig(), faReadAllChannelSamples(), faReadBlock(), faReadBlockStatus(), faReadCSR(), faReadHistoryBuffer(), faReadScalers(), faReset(), faResetToken(), faResetTriggerCount(), faSampleConfig(), faSetBlockLevel(), faSetCalib(), faSetChannelDisable(), faSetChannelDisableMask(), faSetChannelEnable(), faSetChannelEnableMask(), faSetChannelPedestal(), faSetClkSource(), faSetClockSource(), faSetDAC(), faSetDataFormat(), faSetHistoryBufferThreshold(), faSetHitbitsMode(), faSetMGTTestMode(), faSetPPG(), faSetProcMode(), faSetScalerBlockInterval(), faSetSyncSource(), faSetThreshold(), faSetTrig21Delay(), faSetTriggerBusyCondition(), faSetTriggerPathSamples(), faSetTriggerPathThreshold(), faSetTriggerStopCondition(), faSetTrigOut(), faSetTrigSource(), faSoftReset(), faStateArmBuffer(), faStateReadBuffer(), faStatus(), faSuppressTriggerTime(), faSync(), faTestGetClock250Counter(), faTestGetClock250CounterStatus(), faTestGetStatBitB(), faTestGetSyncCounter(), faTestGetTestBitReg(), faTestGetTokenIn(), faTestGetTrig1Counter(), faTestGetTrig2Counter(), faTestResetClock250Counter(), faTestResetSyncCounter(), faTestResetTrig1Counter(), faTestResetTrig2Counter(), faTestSetBusyOut(), faTestSetSdLink(), faTestSetSystemTestMode(), faTestSetTokenOut(), faTestSetTrigOut(), faTokenStatus(), faTrig(), and faTrig2().

Function Documentation

◆ faCheckAddresses()

int faCheckAddresses ( int  id)

References fadcID, and FAp.

Variable Documentation

◆ fa_mode_names

const char* fa_mode_names[FA_MAX_PROC_MODE+1]
Initial value:
=
{
"NOT DEFINED",
"NOT DEFINED",
"NOT DEFINED",
"NOT DEFINED",
"NOT DEFINED",
"NOT DEFINED",
"NOT DEFINED",
"NOT DEFINED",
"NOT DEFINED",
"PULSE PARAMETER",
"RAW + PULSE PARAMETER"
}

Referenced by faStatus().

◆ fadc_data

struct fadc_data_struct fadc_data

Referenced by faDataDecode().

◆ fadcA16Offset

unsigned long fadcA16Offset = 0x0

Referenced by faInit(), and faSDC_Status().

◆ fadcA24Offset

unsigned long fadcA24Offset = 0x0

Referenced by faGStatus(), faInit(), and faStatus().

◆ fadcA32Base

unsigned int fadcA32Base = 0x08000000

Referenced by faInit().

◆ fadcA32Offset

unsigned long fadcA32Offset = 0x08000000

◆ fadcAddrList

unsigned int fadcAddrList[FA_MAX_BOARDS]

Referenced by faInit().

◆ fadcAlignmentDebug

int fadcAlignmentDebug =0

◆ fadcBlockError

int fadcBlockError =FA_BLOCKERROR_NO_ERROR

Referenced by faGetBlockError(), and faReadBlock().

◆ fadcBlockLevel

int fadcBlockLevel =0

◆ fadcChanDisable

◆ fadcID

int fadcID[FA_MAX_BOARDS]

Referenced by faArmHistoryBuffer(), faBready(), faBusy(), faBusyLevel(), faCheckAddresses(), faCheckThreshold(), faClear(), faClearError(), faClearScalers(), faDACReset(), faDataInsertAdcParameters(), faDataSuppressTriggerTime(), faDisable(), faDisableBusError(), faDisableClk(), faDisableMultiBlock(), faDisableScalers(), faDisableSoftSync(), faDisableSoftTrig(), faDready(), faEnable(), faEnableBusError(), faEnableClk(), faEnableFP(), faEnableInternalPlaybackTrigger(), faEnableMultiBlock(), faEnableScalers(), faEnableSoftSync(), faEnableSoftTrig(), faEnableSyncSrc(), faEnableTriggerOut(), faForceEndOfBlock(), faGBlockReady(), faGBready(), faGClear(), faGClearError(), faGDisable(), faGEnable(), faGEnableBusError(), faGEnableSoftTrig(), faGEnableSyncSrc(), faGetChannelDAC(), faGetChannelMask(), faGetChannelPedestal(), faGetCtrlFPGAData(), faGetCtrlFPGATemp(), faGetCtrlFPGAVoltage(), faGetDAC(), faGetFirmwareVersions(), faGetHistoryBufferThreshold(), faGetHitbitsMode(), faGetMaxA32MB(), faGetMinA32MB(), faGetProcFPGAData(), faGetProcFPGATemp(), faGetScalerBlockInterval(), faGetSerialNumber(), faGetTokenStatus(), faGetTrig21Delay(), faGForceEndOfBlock(), faGSetBlockLevel(), faGSetProcMode(), faGSetTriggerPathSamples(), faGSetTriggerPathThreshold(), faGTrig(), faGTrig2(), faHistoryBufferDReady(), faInit(), faLatchScalers(), faPPGDisable(), faPPGEnable(), faPrintAuxScal(), faPrintBlock(), faPrintDAC(), faPrintFifoStatus(), faPrintScalers(), faPrintThreshold(), faProcPedConfig(), faReadAllChannelSamples(), faReadBlock(), faReadBlockStatus(), faReadCSR(), faReadHistoryBuffer(), faReadScalers(), faReset(), faResetToken(), faResetTriggerCount(), faSampleConfig(), faScanMask(), faSetBlockLevel(), faSetCalib(), faSetChannelDisable(), faSetChannelDisableMask(), faSetChannelEnable(), faSetChannelEnableMask(), faSetChannelPedestal(), faSetClkSource(), faSetClockSource(), faSetDAC(), faSetDACandCheck(), faSetDataFormat(), faSetHistoryBufferThreshold(), faSetHitbitsMode(), faSetInvertedMode(), faSetMGTTestMode(), faSetNormalMode(), faSetPPG(), faSetProcMode(), faSetScalerBlockInterval(), faSetSyncSource(), faSetThreshold(), faSetTrig21Delay(), faSetTriggerBusyCondition(), faSetTriggerPathSamples(), faSetTriggerPathThreshold(), faSetTriggerStopCondition(), faSetTrigOut(), faSetTrigSource(), faSlot(), faSoftReset(), faStateArmBuffer(), faStatePrintBuffer(), faStateReadBuffer(), faStatus(), faSuppressTriggerTime(), faSync(), faTestGetClock250Counter(), faTestGetClock250CounterStatus(), faTestGetStatBitB(), faTestGetSyncCounter(), faTestGetTestBitReg(), faTestGetTokenIn(), faTestGetTrig1Counter(), faTestGetTrig2Counter(), faTestResetClock250Counter(), faTestResetSyncCounter(), faTestResetTrig1Counter(), faTestResetTrig2Counter(), faTestSetBusyOut(), faTestSetSdLink(), faTestSetSystemTestMode(), faTestSetTokenOut(), faTestSetTrigOut(), faTokenStatus(), faTrig(), and faTrig2().

◆ fadcInited

int fadcInited =0

Referenced by faInit().

◆ fadcIntArg

LOCAL int fadcIntArg = 0

Referenced by faInit().

◆ fadcIntCount

int fadcIntCount = 0

◆ fadcIntID

int fadcIntID = -1

Referenced by faInit().

◆ fadcIntLevel

LOCAL UINT32 fadcIntLevel = FA_VME_INT_LEVEL

Referenced by faInit().

◆ fadcIntRoutine

LOCAL VOIDFUNCPTR fadcIntRoutine = NULL

Referenced by faInit().

◆ fadcIntRunning

BOOL fadcIntRunning = FALSE

Referenced by faInit().

◆ fadcIntVec

LOCAL UINT32 fadcIntVec = FA_VME_INT_VEC

Referenced by faInit().

◆ fadcMaxSlot

int fadcMaxSlot =0

◆ fadcMinSlot

int fadcMinSlot =0

Referenced by faEnableMultiBlock(), and faInit().

◆ fadcProcRev

◆ fadcRev

int fadcRev[(FA_MAX_BOARDS+1)]

Referenced by faInit().

◆ fadcSource

int fadcSource =0

Referenced by faInit().

◆ fadcUseSDC

int fadcUseSDC =0

◆ faMutex

pthread_mutex_t faMutex = PTHREAD_MUTEX_INITIALIZER

◆ FAp

volatile struct fadc_struct* FAp[(FA_MAX_BOARDS+1)]

Referenced by faArmHistoryBuffer(), faBready(), faBusy(), faBusyLevel(), faCheckAddresses(), faCheckThreshold(), faClear(), faClearError(), faClearScalers(), faDACReset(), faDataInsertAdcParameters(), faDataSuppressTriggerTime(), faDisable(), faDisableBusError(), faDisableClk(), faDisableMultiBlock(), faDisableScalers(), faDisableSoftSync(), faDisableSoftTrig(), faDready(), faEnable(), faEnableBusError(), faEnableClk(), faEnableFP(), faEnableInternalPlaybackTrigger(), faEnableMultiBlock(), faEnableScalers(), faEnableSoftSync(), faEnableSoftTrig(), faEnableSyncSrc(), faEnableTriggerOut(), faForceEndOfBlock(), faGBlockReady(), faGBready(), faGClear(), faGClearError(), faGDACReset(), faGEnableBusError(), faGetChannelDAC(), faGetChannelMask(), faGetChannelPedestal(), faGetCtrlFPGAData(), faGetCtrlFPGATemp(), faGetCtrlFPGAVoltage(), faGetDAC(), faGetFirmwareVersions(), faGetHistoryBufferThreshold(), faGetHitbitsMode(), faGetMaxA32MB(), faGetMinA32MB(), faGetProcFPGAData(), faGetProcFPGATemp(), faGetScalerBlockInterval(), faGetSerialNumber(), faGetTrig21Delay(), faGReset(), faGSetBlockLevel(), faGSetClockSource(), faGStatus(), faHistoryBufferDReady(), faInit(), faLatchScalers(), faPPGDisable(), faPPGEnable(), faPrintAuxScal(), faPrintBlock(), faPrintDAC(), faPrintFifoStatus(), faPrintScalers(), faPrintThreshold(), faProcPedConfig(), faReadAllChannelSamples(), faReadBlock(), faReadBlockStatus(), faReadCSR(), faReadHistoryBuffer(), faReadScalers(), faReset(), faResetToken(), faResetTriggerCount(), faSampleConfig(), faSetBlockLevel(), faSetCalib(), faSetChannelDisable(), faSetChannelDisableMask(), faSetChannelEnable(), faSetChannelEnableMask(), faSetChannelPedestal(), faSetClkSource(), faSetClockSource(), faSetDAC(), faSetDACandCheck(), faSetDataFormat(), faSetHistoryBufferThreshold(), faSetHitbitsMode(), faSetInvertedMode(), faSetMGTTestMode(), faSetNormalMode(), faSetPPG(), faSetProcMode(), faSetScalerBlockInterval(), faSetSyncSource(), faSetThreshold(), faSetTrig21Delay(), faSetTriggerBusyCondition(), faSetTriggerPathSamples(), faSetTriggerPathThreshold(), faSetTriggerStopCondition(), faSetTrigOut(), faSetTrigSource(), faSoftReset(), faStateArmBuffer(), faStatePrintBuffer(), faStateReadBuffer(), faStatus(), faSuppressTriggerTime(), faSync(), faTestGetClock250Counter(), faTestGetClock250CounterStatus(), faTestGetStatBitB(), faTestGetSyncCounter(), faTestGetTestBitReg(), faTestGetTokenIn(), faTestGetTrig1Counter(), faTestGetTrig2Counter(), faTestResetClock250Counter(), faTestResetSyncCounter(), faTestResetTrig1Counter(), faTestResetTrig2Counter(), faTestSetBusyOut(), faTestSetSdLink(), faTestSetSystemTestMode(), faTestSetTokenOut(), faTestSetTrigOut(), faTokenStatus(), faTrig(), and faTrig2().

◆ FApd

volatile unsigned int* FApd[(FA_MAX_BOARDS+1)]

◆ FApmb

volatile unsigned int* FApmb

Referenced by faGetA32M(), faInit(), and faReadBlock().

◆ fasdcMutex

pthread_mutex_t fasdcMutex = PTHREAD_MUTEX_INITIALIZER

◆ FASDCp

volatile struct fadc_sdc_struct* FASDCp

◆ nfadc