JLab fADC125 Library
1.2.1
|
Modules | |
Pulser Initialization/Configuration | |
Functions | |
int | fa125Init (UINT32 addr, UINT32 addr_inc, int nadc, int iFlag) |
Initialize the fa125 Library. More... | |
int | fa125Slot (unsigned int i) |
Convert an index into a slot number, where the index is the element of an array of fA125s in the order in which they were initialized. More... | |
int | fa125SetProcMode (int id, int pmode, unsigned int PL, unsigned int PTW, unsigned int NSB, unsigned int NSA, unsigned int NP) |
Configure the processing type/mode. More... | |
int | fa125PowerOff (int id) |
Power Off the fADC125. More... | |
int | fa125PowerOn (int id) |
Power On the fADC125. More... | |
int | fa125SetOffset (int id, int chan, int dacData) |
Set the DAC offset for a specific fADC125 Channel. More... | |
int | fa125SetOffsetFromFile (int id, char *filename) |
Set the DAC offset for a specific fADC125 Channel from a specified file. More... | |
int | fa125SetThreshold (int id, unsigned short tvalue, unsigned short chan) |
Set the readout threshold for a specific fADC125 Channel. More... | |
int | fa125SetChannelDisable (int id, int channel) |
Disable a specific fADC125 Channel. More... | |
int | fa125SetChannelDisableMask (int id, unsigned int cmask0, unsigned int cmask1, unsigned int cmask2) |
Disable specific fADC125 Channels using three separate channel masks. More... | |
int | fa125SetChannelEnable (int id, int channel) |
Enable a specific fADC125 Channel. More... | |
int | fa125SetChannelEnableMask (int id, unsigned int cmask0, unsigned int cmask1, unsigned int cmask2) |
Enable specific fADC125 Channels using three separate channel masks. More... | |
int | fa125SetCommonThreshold (int id, unsigned short tvalue) |
Set a common readout threshold for all fADC125 Channels. More... | |
void | fa125GSetCommonThreshold (unsigned short tvalue) |
Set a common readout threshold for all fADC125 Channels for all initialized modules. More... | |
int | fa125SetPulserAmplitude (int id, int chan, int dacData) |
Set the output Pulser Amplitude for the specified connector. More... | |
int | fa125SetClockSource (int id, int clksrc) |
Set the clock source for the specified fADC125. More... | |
int | fa125SetTriggerSource (int id, int trigsrc) |
Set the trigger source for the specified fADC125. More... | |
int | fa125SetSyncResetSource (int id, int srsrc) |
Set the Sync Reset source for the specified fADC125. More... | |
int | fa125Enable (int id) |
Enable buffers and FIFOs for data acquisition. More... | |
int | fa125Disable (int id) |
Disable buffers and FIFOs for data acquisition. More... | |
int | fa125Reset (int id, int reset) |
Perform the selected Reset to a specific fADC125. More... | |
int | fa125ResetCounters (int id) |
Reset all counters (trigger count, clock count, sync reset count, trig2 count) More... | |
int | fa125ResetToken (int id) |
Returns the token to the first module This routine only has an effect on the first module of the Multiblock setup. More... | |
int | fa125SetBlocklevel (int id, int blocklevel) |
Set the number of events in the block. More... | |
int | fa125SetPPG (int id, int fe_chip, unsigned short *sdata, int nsamples) |
Setup fADC125 Progammable Pulse Generator. More... | |
int | fa125PPGEnable (int id) |
Enable the programmable pulse generator. More... | |
int | fa125PPGDisable (int id) |
Disable the programmable pulse generator. More... | |
int fa125Disable | ( | int | id | ) |
Disable buffers and FIFOs for data acquisition.
id | Slot number |
References FA125_FE_TEST_COLLECT_ON, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::fe.
int fa125Enable | ( | int | id | ) |
Enable buffers and FIFOs for data acquisition.
id | Slot number |
References FA125_FE_TEST_COLLECT_ON, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::fe.
void fa125GSetCommonThreshold | ( | unsigned short | tvalue | ) |
Set a common readout threshold for all fADC125 Channels for all initialized modules.
tvalue | Threshold Value |
References fa125SetCommonThreshold(), fa125Slot(), and nfa125.
int fa125Init | ( | UINT32 | addr, |
UINT32 | addr_inc, | ||
int | nadc, | ||
int | iFlag | ||
) |
Initialize the fa125 Library.
addr |
|
addr_inc |
|
nadc |
|
iFlag | 17 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 VXS (P0) 1 VME (software) bits 2-1: defines Trigger source (0) 0 0 VXS (P0) (1) 0 1 Internal Timer (2) 1 0 Internal Multiplicity Sum (3) 1 1 P2 Connector (Backplane) bit 3: NOT USED WITH THIS FIRMWARE VERSION bits 5-4: defines Clock Source (0) 0 0 P2 Connector (Backplane) (1) 0 1 VXS (P0) (2) 1 0 Internal 125MHz Clock bit 16: Exit before board initialization (just map structure pointer) 0: Initialize fa125(s) 1: Skip initialization bit 17: Use fa125AddrList instead of addr and addr_inc for VME addresses. 0: Initialize with addr and addr_inc 1: Use fa125AddrList bit 18: Skip firmware check. Useful for firmware updating. 0: Perform firmware check :1 Skip firmware check |
References FA125_ADR32_ENABLE, FA125_ADRMB_ENABLE, FA125_CTRL1_ENABLE_BERR, FA125_CTRL1_ENABLE_MULTIBLOCK, FA125_CTRL1_FIRST_BOARD, FA125_CTRL1_LAST_BOARD, FA125_FE_SUPPORTED_FIRMWARE, FA125_ID, FA125_INIT_SKIP, FA125_INIT_SKIP_FIRMWARE_CHECK, FA125_INIT_USE_ADDRLIST, FA125_MAIN_SUPPORTED_FIRMWARE, FA125_MAX_A32_MEM, FA125_MAX_A32MB_SIZE, FA125_PROC_SUPPORTED_FIRMWARE, fa125A24Offset, fa125A32Base, fa125A32Offset, fa125AddrList, fa125Clear(), fa125ID, fa125MaxSlot, fa125MinSlot, fa125p, fa125pd, FA125pmb, fa125SetClockSource(), fa125SetSyncResetSource(), fa125SetTriggerSource(), fa125TriggerSource, fa125_a24::fe, fa125_a24_main::id, fa125_a24::main, nfa125, fa125_a24::proc, fa125_a24_main::slot_ga, fa125_a24_main::version, fa125_a24_fe::version, and fa125_a24_proc::version.
int fa125PowerOff | ( | int | id | ) |
Power Off the fADC125.
id | Slot number |
References fa125ID, FA125LOCK, fa125p, FA125UNLOCK, fa125_a24_main::id, fa125_a24::main, and fa125_a24_main::pwrctl.
int fa125PowerOn | ( | int | id | ) |
Power On the fADC125.
id | Slot number |
References FA125_PWRCTL_KEY_ON, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, fa125_a24_main::id, fa125_a24::main, and fa125_a24_main::pwrctl.
int fa125PPGDisable | ( | int | id | ) |
Disable the programmable pulse generator.
id | Slot number |
References FA125_FE_CONFIG1_PLAYBACK_ENABLE, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::fe.
int fa125PPGEnable | ( | int | id | ) |
Enable the programmable pulse generator.
id | Slot number |
References FA125_FE_CONFIG1_PLAYBACK_ENABLE, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::fe.
int fa125Reset | ( | int | id, |
int | reset | ||
) |
Perform the selected Reset to a specific fADC125.
id | Slot number |
reset | Type of reset to perform
|
References fa125_a24_main::blockCSR, FA125_BLOCKCSR_PULSE_HARD_RESET, FA125_BLOCKCSR_PULSE_SOFT_RESET, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::main.
int fa125ResetCounters | ( | int | id | ) |
Reset all counters (trigger count, clock count, sync reset count, trig2 count)
id | Slot number |
References fa125_a24_proc::clock125_count, FA125_PROC_CLOCK125COUNT_RESET, FA125_PROC_SYNCCOUNT_RESET, FA125_PROC_TRIG2COUNT_RESET, FA125_PROC_TRIGCOUNT_RESET, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, fa125_a24::proc, fa125_a24_proc::sync_count, fa125_a24_proc::trig2_count, and fa125_a24_proc::trig_count.
int fa125ResetToken | ( | int | id | ) |
Returns the token to the first module This routine only has an effect on the first module of the Multiblock setup.
id | Slot number |
References fa125_a24_main::blockCSR, FA125_BLOCKCSR_TAKE_TOKEN, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::main.
int fa125SetBlocklevel | ( | int | id, |
int | blocklevel | ||
) |
Set the number of events in the block.
id | Slot number |
blocklevel | Number of events per block |
References fa125_a24_proc::blocklevel, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::proc.
int fa125SetChannelDisable | ( | int | id, |
int | channel | ||
) |
Disable a specific fADC125 Channel.
id | Slot number |
chan | Channel Number |
References FA125_FE_CONFIG2_CH_MASK, FA125_MAX_ADC_CHANNELS, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::fe.
int fa125SetChannelDisableMask | ( | int | id, |
unsigned int | cmask0, | ||
unsigned int | cmask1, | ||
unsigned int | cmask2 | ||
) |
Disable specific fADC125 Channels using three separate channel masks.
id | Slot number |
cmask0 | Disable channel mask for channels 0-23 |
cmask1 | Disable channel mask for channels 24-47 |
cmask2 | Disable channel mask for channels 48-71 |
References FA125_FE_CONFIG2_CH_MASK, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::fe.
int fa125SetChannelEnable | ( | int | id, |
int | channel | ||
) |
Enable a specific fADC125 Channel.
id | Slot number |
chan | Channel Number |
References FA125_FE_CONFIG2_CH_MASK, FA125_MAX_ADC_CHANNELS, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::fe.
int fa125SetChannelEnableMask | ( | int | id, |
unsigned int | cmask0, | ||
unsigned int | cmask1, | ||
unsigned int | cmask2 | ||
) |
Enable specific fADC125 Channels using three separate channel masks.
id | Slot number |
cmask0 | Enable channel mask for channels 0-23 |
cmask1 | Enable channel mask for channels 24-47 |
cmask2 | Enable channel mask for channels 48-71 |
References FA125_FE_CONFIG2_CH_MASK, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::fe.
int fa125SetClockSource | ( | int | id, |
int | clksrc | ||
) |
Set the clock source for the specified fADC125.
id | Slot number |
clksrc | Defines Clock Source 0 P2 Clock 1 VXS (P0) 2 Internal 125MHz Clock |
References fa125_a24_main::clock, FA125_CLOCK_INTERNAL, FA125_CLOCK_P0, FA125_CLOCK_P2, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::main.
Referenced by fa125Init().
int fa125SetCommonThreshold | ( | int | id, |
unsigned short | tvalue | ||
) |
Set a common readout threshold for all fADC125 Channels.
id | Slot number |
tvalue | Threshold Value |
References FA125_MAX_ADC_CHANNELS, and fa125SetThreshold().
Referenced by fa125GSetCommonThreshold().
int fa125SetOffset | ( | int | id, |
int | chan, | ||
int | dacData | ||
) |
Set the DAC offset for a specific fADC125 Channel.
id | Slot number |
chan | Channel Number |
dacData | DAC value to set |
References fa125ID, and fa125p.
Referenced by fa125SetOffsetFromFile().
int fa125SetOffsetFromFile | ( | int | id, |
char * | filename | ||
) |
Set the DAC offset for a specific fADC125 Channel from a specified file.
id | Slot number |
filename | Name of file from which to read DAC offsets Format must be of the type: dac0 dac1 dac2 ... dac71 |
References fa125ID, fa125p, and fa125SetOffset().
int fa125SetPPG | ( | int | id, |
int | fe_chip, | ||
unsigned short * | sdata, | ||
int | nsamples | ||
) |
Setup fADC125 Progammable Pulse Generator.
id | Slot number |
fe_chip | Front End FPGA to write to |
sdata | Array of sample data to be programmed |
nsamples | Number of samples contained in sdata |
References FA125_FE_TEST_WAVEFORM_PPG_DATA_MASK, FA125_FE_TEST_WAVEFORM_WRITE_PPG_DATA, FA125_PPG_MAX_SAMPLES, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::fe.
int fa125SetProcMode | ( | int | id, |
int | pmode, | ||
unsigned int | PL, | ||
unsigned int | PTW, | ||
unsigned int | NSB, | ||
unsigned int | NSA, | ||
unsigned int | NP | ||
) |
Configure the processing type/mode.
id | Slot number |
pmode | Processing Mode
|
PL | Window Latency |
PTW | Window Width |
NSB | Number of samples before pulse over threshold |
NSA | Number of samples after pulse over threshold |
NP | Number of pulses processed per window |
Note:
References FA125_DEFAULT_NP, FA125_DEFAULT_NSA, FA125_DEFAULT_NSB, FA125_DEFAULT_PL, FA125_DEFAULT_PTW, FA125_FE_CONFIG1_ENABLE, FA125_MAX_NSA, FA125_MAX_NSB, FA125_MAX_PL, FA125_MAX_PTW, FA125_PROC_MODE_RAWWINDOW, FA125_SUPPORTED_MODES, FA125_SUPPORTED_NMODES, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::fe.
int fa125SetPulserAmplitude | ( | int | id, |
int | chan, | ||
int | dacData | ||
) |
int fa125SetSyncResetSource | ( | int | id, |
int | srsrc | ||
) |
Set the Sync Reset source for the specified fADC125.
id | Slot number |
srsrc | Sync Reset source
|
References fa125_a24_proc::ctrl2, FA125_FE_TEST_SYNCRESET_ENABLE, FA125_PROC_CTRL2_SYNCRESET_P0, FA125_PROC_CTRL2_SYNCRESET_SOURCE_MASK, FA125_PROC_CTRL2_SYNCRESET_VME, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, fa125_a24::fe, and fa125_a24::proc.
Referenced by fa125Init().
int fa125SetThreshold | ( | int | id, |
unsigned short | tvalue, | ||
unsigned short | chan | ||
) |
Set the readout threshold for a specific fADC125 Channel.
id | Slot number |
tvalue | Threshold Value |
chan | Channel Number |
References FA125_FE_THRESHOLD_MASK, FA125_MAX_ADC_CHANNELS, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, and fa125_a24::fe.
Referenced by fa125SetCommonThreshold().
int fa125SetTriggerSource | ( | int | id, |
int | trigsrc | ||
) |
Set the trigger source for the specified fADC125.
id | Slot number |
trigsrc | Defines Trigger Source 0 P0 (VXS) 1 Software (VME) 2 Internal Sum 3 P2 |
References FA125_TRIGSRC_TRIGGER_INTERNAL_SUM, FA125_TRIGSRC_TRIGGER_P0, FA125_TRIGSRC_TRIGGER_P2, FA125_TRIGSRC_TRIGGER_SOFTWARE, fa125ID, FA125LOCK, fa125p, FA125UNLOCK, fa125_a24::proc, and fa125_a24_proc::trigsrc.
Referenced by fa125Init().
int fa125Slot | ( | unsigned int | i | ) |
Convert an index into a slot number, where the index is the element of an array of fA125s in the order in which they were initialized.
i | Initialization number |
References fa125ID, and nfa125.
Referenced by fa125FirmwareGCheckErrors(), fa125FirmwareGEraseFull(), fa125FirmwareGVerifyFull(), fa125FirmwareGWriteFull(), fa125GetTokenMask(), fa125GSetCommonThreshold(), and fa125GStatus().