JLab fADC250-V2 Library
0x42
|
Modules | |
SDC Status | |
Functions | |
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 | faGetBlockError (int pflag) |
Return the type of error that occurred while attempting a block read from faReadBlock. More... | |
unsigned int | faReadCSR (int id) |
Get the value of the Control/Status Register. 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... | |
int | faGetChannelMask (int id, int type) |
Get the Enabled/Disabled Channel Mask. More... | |
int | faGetTrig21Delay (int id) |
Return the value of the delay between the software playback trigger and trigger. More... | |
unsigned int | faScanMask () |
Return the vme slot mask of all initialized fADC250s. More... | |
int | faBusy (int id) |
Get the busy status. More... | |
int | faPrintThreshold (int id) |
Print the thresholds of all channels to standard out. More... | |
void | faPrintDAC (int id) |
Print DAC values for each channel to standard out. More... | |
int | faGetChannelPedestal (int id, unsigned int chan) |
Get the pedestal value of specified channel. More... | |
int | faGetAlignmentDebugMode () |
Return whether or not the module will send the alignment sequence to the CTP. More... | |
int | faGetHitbitsMode (int id) |
Get the enabled/disabled status of hitbits mode for the module. 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... | |
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... | |
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... | |
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 | faGetScalerBlockInterval (int id) |
int | faGetHistoryBufferThreshold (int id) |
Get the history buffer threshold. 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 faBusy | ( | int | id | ) |
Get the busy status.
id | Slot number |
References fadc_struct::busy_level, FA_BUSY_LEVEL_MASK, FA_RAM_DATA_MASK, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::ram_word_count.
void faDataDecode | ( | unsigned int | data | ) |
Decode a data word from an fADC250 and print to standard out.
data | 32bit fADC250 data word |
References fadc_data_struct::adc_1, fadc_data_struct::adc_2, fadc_data_struct::adc_sum, fadc_data_struct::blk_num, fadc_data_struct::chan, fadc_data_struct::evt_num_1, fadc_data_struct::evt_of_blk, fadc_data, fadc_data_struct::integral, fadc_data_struct::modID, fadc_data_struct::n_evts, fadc_data_struct::n_words, fadc_data_struct::new_type, fadc_data_struct::NSA, fadc_data_struct::nsa_ext, fadc_data_struct::NSB, fadc_data_struct::over, fadc_data_struct::ped_sum, fadc_data_struct::PL, fadc_data_struct::pulse_num, fadc_data_struct::quality, fadc_data_struct::quality2, fadc_data_struct::samp_ov_thres, fadc_data_struct::scaler_data_words, fadc_data_struct::slot_id_hd, fadc_data_struct::slot_id_tr, fadc_data_struct::thres_bin, fadc_data_struct::time, fadc_data_struct::time_1, fadc_data_struct::time_2, fadc_data_struct::time_3, fadc_data_struct::time_4, fadc_data_struct::time_coarse, fadc_data_struct::time_fine, fadc_data_struct::time_low_10, fadc_data_struct::time_now, fadc_data_struct::type, fadc_data_struct::under, fadc_data_struct::valid_1, fadc_data_struct::valid_2, fadc_data_struct::vpeak, and fadc_data_struct::width.
Referenced by faPrintBlock().
unsigned int faGetA32 | ( | int | id | ) |
Return the base address of the A32 for specified module.
id |
|
References fadcA32Offset, and FApd.
unsigned int faGetA32M | ( | ) |
Return the base address of the A32 Multiblock.
References fadcA32Offset, and FApmb.
int faGetAlignmentDebugMode | ( | ) |
Return whether or not the module will send the alignment sequence to the CTP.
References fadcAlignmentDebug.
int faGetBlockError | ( | int | pflag | ) |
Return the type of error that occurred while attempting a block read from faReadBlock.
pflag |
|
References FA_BLOCKERROR_NO_ERROR, FA_BLOCKERROR_NTYPES, and fadcBlockError.
int faGetChannelMask | ( | int | id, |
int | type | ||
) |
Get the Enabled/Disabled Channel Mask.
id | Slot number |
type |
|
References fadc_struct::adc_config, FA_ADC_CHAN_MASK, fadcChanDisable, fadcID, FALOCK, FAp, and FAUNLOCK.
int faGetChannelPedestal | ( | int | id, |
unsigned int | chan | ||
) |
Get the pedestal value of specified channel.
id | Slot number |
chan | Channel Number |
References fadc_struct::adc_pedestal, FA_ADC_PEDESTAL_MASK, fadcID, FALOCK, FAp, and FAUNLOCK.
unsigned int faGetCtrlFPGAData | ( | int | id | ) |
Return raw register data from the Control FPGA containing the temperature, core voltage, and auxiliary voltage.
id | Slot number |
References fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::system_monitor.
float faGetCtrlFPGATemp | ( | int | id, |
int | pflag | ||
) |
Return the value of the Control FPGA temperature (in degrees Celsius)
id | Slot number |
pflag | Print Flag
|
References FA_SYSMON_CTRL_TEMP_MASK, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::system_monitor.
Referenced by faGStatus(), and faStatus().
float faGetCtrlFPGAVoltage | ( | int | id, |
int | vtype, | ||
int | pflag | ||
) |
Return the value of specified Control FPGA voltage.
id | Slot number |
vtype | Voltage type
|
pflag | Print flag
|
References FA_SYSMON_FPGA_AUX_V_MASK, FA_SYSMON_FPGA_CORE_V_MASK, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::system_monitor.
Referenced by faGStatus(), and faStatus().
unsigned int faGetFirmwareVersions | ( | int | id, |
int | pflag | ||
) |
Get the firmware versions of each FPGA.
id | Slot number |
pval |
|
References fadc_struct::adc_status, FA_ADC_VERSION_MASK, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::version.
int faGetHistoryBufferThreshold | ( | int | id | ) |
Get the history buffer threshold.
id | Slot number |
References FA_SUM_THRESHOLD_MASK, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::sum_threshold.
int faGetHitbitsMode | ( | int | id | ) |
Get the enabled/disabled status of hitbits mode for the module.
id | Slot number |
References FA_MGT_HITBITS_TO_CTP, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::mgt_ctrl.
unsigned int faGetMaxA32MB | ( | int | id | ) |
Get the maximum address used for multiblock.
id | Slot number |
References fadc_struct::adr_mb, FA_AMB_MAX_MASK, fadcID, FALOCK, FAp, and FAUNLOCK.
unsigned int faGetMinA32MB | ( | int | id | ) |
Get the minimum address used for multiblock.
id | Slot number |
References fadc_struct::adr_mb, FA_AMB_MIN_MASK, fadcID, FALOCK, FAp, and FAUNLOCK.
unsigned int faGetProcFPGAData | ( | int | id | ) |
Return raw register data from the Processing FPGA containing the temperature.
id | Slot number |
References fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::status3.
float faGetProcFPGATemp | ( | int | id, |
int | pflag | ||
) |
Return the value of the Processing FPGA temperature (in degrees Celsius)
id | Slot number |
pflag | Print Flag
|
References FA_STATUS3_PROC_TEMP_MASK, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::status3.
Referenced by faGStatus(), and faStatus().
int faGetScalerBlockInterval | ( | int | id | ) |
id | Slot number |
References FA_SCALER_INTERVAL_MASK, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::scaler_interval.
int faGetSerialNumber | ( | int | id, |
char ** | rval, | ||
int | snfix | ||
) |
Fills 'rval' with a character array containing the fa250 serial number.
id | Slot number |
rval | Where to return Serial number string |
snfix | If snfix >= 1, will attempt to format the serial number to maintain consistency between serials made by the same vendor. e.g. Advanced Assembly: snfix=0: B21595-02R B2159515R1 snfix=1: B21595-02R B21595-15R1 e.g. ACDI snfix=0: ACDI002 snfix=1: ACDI-002 * |
References FA_SERIAL_NUMBER_ACDI, FA_SERIAL_NUMBER_ACDI_BOARDID_MASK, FA_SERIAL_NUMBER_ADV_ASSEM, FA_SERIAL_NUMBER_ADV_ASSEM_MASK, FA_SERIAL_NUMBER_ADV_MNFID1, FA_SERIAL_NUMBER_ADV_MNFID2, FA_SERIAL_NUMBER_ADV_MNFID2_MASK, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::serial_number.
unsigned int faGetTokenStatus | ( | int | pflag | ) |
Return slot mask of modules with token.
pflag | Option to print status to standard out. |
References fadcID, faGTokenStatus(), and nfadc.
Referenced by faReadBlock().
int faGetTrig21Delay | ( | int | id | ) |
Return the value of the delay between the software playback trigger and trigger.
id | Slot number |
References FA_TRIG21_DELAY_MASK, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::trig21_delay.
void faGStatus | ( | int | sflag | ) |
Print a summary of all initialized fADC250s.
sflag | Not yet used |
References fadc_struct::adc_config, fadc_struct::adc_nsa, fadc_struct::adc_nsb, fadc_struct::adc_pl, fadc_struct::adc_ptw, fadc_struct::adc_status, fadc_struct::adr32, fadc_struct::adr_mb, fadc_struct::berr_module_scal, fadc_struct::blk_count, fadc_struct::blk_level, fadc_struct::config3, fadc_struct::config6, fadc_struct::config7, fadc_struct::csr, fadc_struct::ctrl1, fadc_struct::ctrl2, FA_A32_ADDR_MASK, FA_A32_ENABLE, FA_ADC_CHAN_MASK, FA_ADC_CONFIG1_NSAT_MASK, FA_ADC_CONFIG1_TNSAT_MASK, FA_ADC_CONFIG7_MAXPED_MASK, FA_ADC_CONFIG7_NPED_MASK, FA_ADC_NS_PER_CLK, FA_ADC_NSA_READBACK_MASK, FA_ADC_NSB_NEGATIVE, FA_ADC_NSB_READBACK_MASK, FA_ADC_PEAK_MASK, FA_ADC_PLAYBACK_MODE, FA_ADC_PROC_MASK, FA_ADC_TNSA_MASK, FA_ADC_TPT_MASK, FA_ADC_VERSION_MASK, FA_AMB_ENABLE, FA_AMB_MAX_MASK, FA_AMB_MIN_MASK, FA_BLOCK_COUNT_MASK, FA_BLOCK_LEVEL_MASK, FA_CSR_BLOCK_READY, FA_CSR_CTRL_FPGA_HIGH_TEMP, FA_CSR_ERROR_MASK, FA_CSR_PROC_FPGA_HIGH_TEMP, FA_CTRL_ENABLE_MASK, FA_ENABLE_BERR, FA_ENABLE_MULTIBLOCK, FA_FIRST_BOARD, FA_LAST_BOARD, FA_MB_TOKEN_VIA_P0, FA_MB_TOKEN_VIA_P2, FA_MGT_GTX1_HARD_ERROR, FA_MGT_GTX1_SOFT_ERROR, FA_MGT_GTX2_HARD_ERROR, FA_MGT_GTX2_SOFT_ERROR, FA_RAM_DATA_MASK, FA_REF_CLK_FP, FA_REF_CLK_INTERNAL, FA_REF_CLK_MASK, FA_REF_CLK_P0, FA_SRESET_FP, FA_SRESET_FP_ISYNC, FA_SRESET_MASK, FA_SRESET_P0, FA_SRESET_P0_ISYNC, FA_SRESET_VME, FA_TRIG_FP, FA_TRIG_FP_ISYNC, FA_TRIG_INTERNAL, FA_TRIG_MASK, FA_TRIG_P0, FA_TRIG_P0_ISYNC, FA_TRIG_VME, fadcA24Offset, faGetCtrlFPGATemp(), faGetCtrlFPGAVoltage(), faGetProcFPGATemp(), FALOCK, FAp, faSlot(), FAUNLOCK, fadc_struct::lost_trig_scal, fadc_struct::mgt_status, nfadc, fadc_struct::ram_word_count, fadc_struct::syncreset_scal, fadc_struct::trig2_scal, fadc_struct::trig_scal, and fadc_struct::version.
int faGTokenStatus | ( | ) |
Return the slotmask of those modules that have the token.
References faSlot(), faTokenStatus(), and nfadc.
Referenced by faGetTokenStatus().
void faPrintAuxScal | ( | int | id | ) |
Print to standard out some auxillary scalers.
Prints out
id | Slot number |
References fadcID, FALOCK, FAp, FAUNLOCK, fadc_struct::header_scal, fadc_struct::lost_trig_scal, fadc_struct::proc_words_scal, and fadc_struct::trailer_scal.
void faPrintDAC | ( | int | id | ) |
Print DAC values for each channel to standard out.
id | Slot number |
References fadc_struct::dac, FA_DAC_VALUE_MASK, FA_MAX_ADC_CHANNELS, fadcID, FALOCK, FAp, and FAUNLOCK.
void faPrintFifoStatus | ( | int | id | ) |
Print the status of the FIFO to standard out.
id | Slot number |
References fadc_struct::dataflow_status, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::status.
int faPrintThreshold | ( | int | id | ) |
Print the thresholds of all channels to standard out.
id | Slot number |
References fadc_struct::adc_thres, FA_MAX_ADC_CHANNELS, fadcID, FALOCK, FAp, and FAUNLOCK.
unsigned int faReadCSR | ( | int | id | ) |
Get the value of the Control/Status Register.
id | Slot number |
References fadc_struct::csr, fadcID, FALOCK, FAp, and FAUNLOCK.
unsigned int faScanMask | ( | ) |
int faStateMap | ( | unsigned int | state_value | ) |
Convert state value to mapped identifier.
state_value | State Value to convert |
Referenced by faStatePrintBuffer().
int faStatePrintBuffer | ( | int | id | ) |
Print the contents of the State Machine buffer to standard out.
state_value | State Value to convert |
References fadcID, FAp, faStateMap(), and faStateReadBuffer().
int faStateReadBuffer | ( | int | id, |
volatile unsigned int * | data, | ||
int | nwords | ||
) |
Read state machine buffer.
id | Slot number |
data | local memory address to place data |
nwrds | Max number of words to transfer |
References FA250_STATE_REGS::csr, FA_STATE_CSR_BUFFER_WORDS_MASK, FA_STATE_VALUE_MASK, fadcID, FALOCK, FAp, FAUNLOCK, fadc_struct::state, and FA250_STATE_REGS::value.
Referenced by faStatePrintBuffer().
void faStatus | ( | int | id, |
int | sflag | ||
) |
Print Status of fADC250 to standard out.
id | Slot Number |
sflag | Not yet used. |
References fadc_sdc_struct::csr, FA_A32_ADDR_MASK, FA_A32_ENABLE, FA_ADC_CHAN_MASK, FA_ADC_CONFIG1_NSAT_MASK, FA_ADC_CONFIG1_TNSAT_MASK, FA_ADC_CONFIG7_MAXPED_MASK, FA_ADC_CONFIG7_NPED_MASK, FA_ADC_NS_PER_CLK, FA_ADC_NSA_READBACK_MASK, FA_ADC_NSB_NEGATIVE, FA_ADC_NSB_READBACK_MASK, FA_ADC_PEAK_MASK, FA_ADC_PLAYBACK_MODE, FA_ADC_PROC_ENABLE, FA_ADC_PROC_MASK, FA_ADC_TNSA_MASK, FA_ADC_TPT_MASK, FA_ADC_VERSION_MASK, FA_AMB_ENABLE, FA_AMB_MAX_MASK, FA_AMB_MIN_MASK, FA_BLOCK_COUNT_MASK, FA_BLOCK_LEVEL_MASK, FA_BOARD_MASK, FA_CONTROL2_MASK, FA_CONTROL_MASK, FA_CSR_BLOCK_READY, FA_CSR_ERROR_MASK, FA_CSR_EVENT_AVAILABLE, FA_CSR_MASK, FA_CTRL1_SUPPRESS_TT, FA_CTRL1_SUPPRESS_TT2, FA_CTRL_ENABLE_MASK, FA_CTRL_ENABLED, FA_ENABLE_BERR, FA_ENABLE_BLKLVL_INT, FA_ENABLE_INTERNAL_CLK, FA_ENABLE_MULTIBLOCK, FA_ENABLE_SOFT_SRESET, FA_ENABLE_SOFT_TRIG, FA_EVENT_COUNT_MASK, FA_FIRST_BOARD, FA_INT_ENABLE_MASK, FA_INT_LEVEL_MASK, FA_INT_VEC_MASK, FA_LAST_BOARD, FA_MB_TOKEN_VIA_P0, FA_MB_TOKEN_VIA_P2, FA_MGT_GTX1_HARD_ERROR, FA_MGT_GTX1_SOFT_ERROR, FA_MGT_GTX2_HARD_ERROR, FA_MGT_GTX2_SOFT_ERROR, fa_mode_names, FA_RAM_DATA_MASK, FA_REF_CLK_FP, FA_REF_CLK_INTERNAL, FA_REF_CLK_MASK, FA_REF_CLK_P0, FA_SCALER_INTERVAL_MASK, FA_SRESET_FP, FA_SRESET_FP_ISYNC, FA_SRESET_MASK, FA_SRESET_P0, FA_SRESET_P0_ISYNC, FA_SRESET_VME, FA_TRIG_FP, FA_TRIG_FP_ISYNC, FA_TRIG_INTERNAL, FA_TRIG_MASK, FA_TRIG_P0, FA_TRIG_P0_ISYNC, FA_TRIG_VME, FA_TRIGCTL_BUSY_EN, FA_TRIGCTL_MAX1_MASK, FA_TRIGCTL_MAX2_MASK, FA_TRIGCTL_TRIGSTOP_EN, FA_VERSION_MASK, fadcA24Offset, fadcID, fadcUseSDC, faGetCtrlFPGATemp(), faGetCtrlFPGAVoltage(), faGetProcFPGATemp(), FALOCK, FAp, FApd, and FAUNLOCK.
unsigned int faTestGetClock250Counter | ( | int | id | ) |
Return the value of the 250Mhz Clock scaler.
Available only in System Test Mode
id | Slot number |
References fadc_struct::clock250count, fadcID, FALOCK, FAp, and FAUNLOCK.
int faTestGetClock250CounterStatus | ( | int | id | ) |
Return the status of the 250Mhz Clock Counter.
Available only in System Test Mode
id | Slot number |
References FA_TESTBIT_CLOCK250_STATUS, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::testBit.
int faTestGetStatBitB | ( | int | id | ) |
Get the level of the StatBitB to the SD.
Available only in System Test Mode
id | Slot number |
References FA_TESTBIT_STATBITB, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::testBit.
unsigned int faTestGetSyncCounter | ( | int | id | ) |
Return the value of the SyncReset scaler.
Available only in System Test Mode
id | Slot number |
References fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::syncp0count.
unsigned int faTestGetTestBitReg | ( | int | id | ) |
Return the current value of the testBit register.
Available only in System Test Mode
id | Slot number |
References fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::testBit.
int faTestGetTokenIn | ( | int | id | ) |
Get the level of the Token In from the SD.
Available only in System Test Mode
id | Slot number |
References FA_TESTBIT_TOKENIN, fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::testBit.
unsigned int faTestGetTrig1Counter | ( | int | id | ) |
Return the value of the trig1 scaler.
Available only in System Test Mode
id | Slot number |
References fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::trig1p0count.
unsigned int faTestGetTrig2Counter | ( | int | id | ) |
Return the value of the trig2 scaler.
Available only in System Test Mode
id | Slot number |
References fadcID, FALOCK, FAp, FAUNLOCK, and fadc_struct::trig2p0count.
void faTestResetClock250Counter | ( | int | id | ) |
Reset the counter of the 250MHz Clock scaler.
Available only in System Test Mode
id | Slot number |
References fadc_struct::clock250count, FA_CLOCK250COUNT_RESET, FA_CLOCK250COUNT_START, fadcID, FALOCK, FAp, and FAUNLOCK.
int faTokenStatus | ( | int | id | ) |
Return the status of the token.
id | Slot number |
References fadc_struct::csr, FA_CSR_TOKEN_STATUS, fadcID, FALOCK, FAp, and FAUNLOCK.
Referenced by faGTokenStatus().