Functions

API that allows full control of XSPRESS3 algorithm, used from xspress3.server, but probably not required if xsp3_restore_settings is being used.

Functions

int xsp3_get_aux1_mode (int path, int chan, int *aux1_mode, int *aux1_thres)
 Get auxilliary data 1 mode as set by xsp3_format_run.
int xsp3_get_max_ave (int path, int chan)
 Get maximum number of samples used in the running average.
int xsp3_set_trigger_b (int path, int chan, Xspress3_TriggerB *trig_b)
 Set the trigger B details.
int xsp3_set_trigger_c (int path, int chan, Xspress3_TriggerC *trig_c)
 Set the trigger C details.
int xsp3_get_trigger_b (int path, int chan, Xspress3_TriggerB *trig_b)
 Get the trigger B settings.
int xsp3_get_trigger_c (int path, int chan, Xspress3_TriggerC *trig_c)
 Get the trigger C settings.
int xsp3_set_trigger_b_ringing (int path, int chan, double scale_a, int delay_a, double scale_b, int delay_b)
 Set the trigger B ringing removal filter.
int xsp3_get_trigger_b_ringing (int path, int chan, double *scale_a, int *delay_a, double *scale_b, int *delay_b)
 Get the trigger B ringing removal filter.
int xsp3_set_chan_cont (int path, int chan, u_int32_t chan_cont)
 Set the channel control register.
int xsp3_set_reset (int path, int chan, u_int32_t resetA, u_int32_t resetB, u_int32_t resetC)
 Set the reset registers A,B & C.
int xsp3_set_glitch (int path, int chan, u_int32_t glitchA, u_int32_t glitchB)
 Set the two glitch registers A and B.
int xsp3_set_servo (int path, int chan, u_int32_t servoA, u_int32_t servoB, u_int32_t servoC)
 Set the three servo registers A, B and C.
int xsp3_get_good_thres (int path, int chan, u_int32_t *good_thres)
 Get the good event threshold.
int xsp3_get_chan_cont (int path, int chan, u_int32_t *chan_cont)
 Get the channel control register.
int xsp3_get_reset (int path, int chan, u_int32_t *resetA, u_int32_t *resetB, u_int32_t *resetC)
 Get the reset registers A, B and C.
int xsp3_get_glitch (int path, int chan, u_int32_t *glitchA, u_int32_t *glitchB)
 Get the glitch registers A & B.
int xsp3_get_servo (int path, int chan, u_int32_t *servoA, u_int32_t *servoB, u_int32_t *servoC)
 Get the servo control registers.
int xsp3_get_clock_control (int path, int card, u_int32_t *clock)
 Get the global clock control register.
int xsp3_bram_init (int path, int chan, int region, double scaling)
 Initialise the contents of the BRAM registers.
int xsp3_register_init (int path, int chan)
 Initialise the contents of the Channel Registers to as power up.
int xsp3_set_data_mux_cont (int path, int card, u_int32_t mux_cont)
 Set the ADC Data Mux register.
int xsp3_get_data_mux_cont (int path, int card, u_int32_t *mux_cont)
 Get the ADC Data Mux register.
int xsp3_write_fem_config (int path, int card, int offset, int size, u_int8_t *value)
 Write a series of values into the FEM Config data structure.
int xsp3_read_fem_config (int path, int card, int offset, int size, u_int8_t *value)
 Read a series of values from the FEM Config data structure for the specified card.
int xsp3_build_pileup_time (int path, int chan, int num, XSP3_PileupTimes *pileup_time, char *fname)
 Build the Pileup time lookup table for use in firmware or in software processing.
int xsp3_set_global_reset_gen (int path, int card, int enable, int sync_mode, int det_reset_width, int hold_off_time, int gr_active_del, int gr_active_wid, int circ_offset)
 Configure the detector global reset generator.
int xsp3_set_cal_events (int path, int chan, int enable, int period, int avoid)
 Setup the Calibration event trigger generator.
int xsp3_clocks_setup_int (int path, int card, int clk_src, int flags, int tp_type, int adc_clk_delay, int fpga_clk_delay)
 Set up ADC data processing clocks source with full control over delays.
int xsp3_dma_read_status (int path, int card, u_int32_t stream_mask)
 Get the DMA status.
int xsp3_system_start (int path, int card)
 Start the xspress3 system.
int xsp3_system_arm (int path, int card)
 Arm the xspress3 system, but in software time frame mode, counting is disabled.
int xsp3_dma_check_desc (int path, int card, u_int32_t stream, XSP3_DMA_MsgCheckDesc *msg)
 This is called typically on an RX DMA Stream e.g.
int xsp3_getDeadtimeCorrectionParameters (int path, int chan, int *flags, double *processDeadTimeAllEventGradient, double *processDeadTimeAllEventOffset, double *processDeadTimeInWindowOffset, double *processDeadTimeInWindowGradient)
 Get the parameters for dead time energy correction.
int xsp3_setDeadtimeCorrectionParameters (int path, int chan, int flags, double processDeadTimeAllEventGradient, double processDeadTimeAllEventOffset, double processDeadTimeInWindowOffset, double processDeadTimeInWindowGradient)
 Set the parameters for dead time energy correction.
int xsp3_getDeadtimeCorrectionFlags (int path, int chan, int *flags)
 Get the flags only for dead time energy correction.
int xsp3_calculateDeadtimeCorrectionFactors (int path, u_int32_t *hardwareScalerReadings, double *dtcFactors, double *inpEst, int num_tf, int first_chan, int num_chan)
 Calculate the dead time correction factors from the scalers.
int xsp3_nbits_aux1 (int path, int aux1_mode)
 Get number of bits used by given aux1 special debug mode.
int xsp3_nbits_adc (int path, int adc_cont)
 Get the number of bits of ADC.
int xsp3_trigger_b_get_diff_params (int path, int *sep_offset, int *sep_max)
 Get the trigger B hardware limits determined by use of BRAM or SRL32 for diff1 and diff2 delay.
int xsp3_trigger_b_get_ringing_params (int path, int *min_delay, int *max_delay)
 Get the trigger B ringing subtractor hardware limits.
int xsp3_has_bram (int path, int chan, int region_num)
 Determine if the Firmware has a given BRAM.
int xsp3_has_soft_lut (int path, int chan, int region_num)
 Determine if the software processing has a given LUT/BRAM.
int xsp3_get_has_soft_scalers (int path)
 Determine whether firmware requires scalers in software.
int xsp3_get_features (int path, int card, Xspress3_features *features)
 Return structure describing the hardware features enabled in the current firmware build.
int xsp3_bram_size (int path, int chan, int region_num)
 Determine if the size of the given BRAM.
int xsp3_has_lead_tail_corr_width (int path, int chan, int region_num, int *num_t, int *num_wid)
 Determine the option code for event lead and tail correction type and and return layout.
int xsp3_has_lead_corr (int path, int card)
 Determine if the firmware has event lead-in corection configured.
int xsp3_has_servo_bi_linear_time (int path, int chan)
 Determine the option code for the bi-linear time version(s) of PWL servo.

Function Documentation

int xsp3_bram_init ( int  path,
int  chan,
int  region,
double  scaling 
)

Initialise the contents of the BRAM registers.

This can be used to initialise all or 1 BRAM regions on 1 or all channels. For systems where some processing is in the PC, the appropriate software lookup table are initialised instead. The regions are specified as: xspress3.h XSP3_REGIONS

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1)
region an offset from the channel (0 ... XSP3_REGION_RAM_MAX). If region is negative then initialisation is performed on all regions.
scaling a gain adjustment to scale the output energy bin to be used when initialising the quotient registers. Values are typically 0.5 to 2.0.
Returns:
XSP3_OK or a negative error code.
int xsp3_bram_size ( int  path,
int  chan,
int  region_num 
)

Determine if the size of the given BRAM.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan channel number.
region_num Region number as xspress3.h XSP3_REGIONS
Returns:
0 on success or <0 if error.
int xsp3_build_pileup_time ( int  path,
int  chan,
int  num,
XSP3_PileupTimes pileup_time,
char *  fname 
)

Build the Pileup time lookup table for use in firmware or in software processing.

To determine pileup, the hardware measures an Over threshold Discriminator time, depending on trigger-b settings, usually from when the 1st differential reaches the arm threshold until it drops to below 50 % of the maximum gradietn (1st derivative). This is compared to the pileup time. Events wider than this time can be marked as pileup and discarded.

The maximum event width can be speficied as an single width or can be a function of energy. For a fixed maximum width pass a single XSP3_PileupTimes element with eng=0 and width set as required. To give a variation with energy provide an array of XSP3_PileupTimes with energy in bins and maximum widths. The code linearly interpolates between these.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan a channel number in the system or -1 to copy to all channels.
num is the number of energy/maximum width structures provided to describe the variation with photon energy
pileup_time pointer to array for XSP3_PileupTime structures containing eneergy (0..4095) and maximum event width in cycles (0..127)
fname a filename to store the table created, NULL to omit saving the file.
Returns:
XSP3_OK or a negative error code.
int xsp3_calculateDeadtimeCorrectionFactors ( int  path,
u_int32_t *  hardwareScalerReadings,
double *  dtcFactors,
double *  inpEst,
int  num_tf,
int  first_chan,
int  num_chan 
)

Calculate the dead time correction factors from the scalers.

Given an array of the hardwareScalerReadings (8 values per channel) for a group of channels and frames, this calculates the dead-time correction factor for each element. It assumes the hardwareScalerReadings are in the order returned by xsp3_scaler_read

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
hardwareScalerReadings scaler data assumes all scalers are read from first_chan, for num_chan, repeated for num_tf
dtcFactors returns the dead time correction factors.
inpEst returns the corrected estimate of the ttoal input counts.
num_tf number of time frames of data.
first_chan First channel to be processed.
num_chan Number of channels to be processed.
Returns:
XSP3_OK or a negative error code.
int xsp3_clocks_setup_int ( int  path,
int  card,
int  clk_src,
int  flags,
int  tp_type,
int  adc_clk_delay,
int  fpga_clk_delay 
)

Set up ADC data processing clocks source with full control over delays.

The clock source can come from various places. At power up and from some debugging teh clock source can be from the FPGA board clocks. However, for normal operation the data processing clock has to be from the ADC board. This is setup by this command. It shouldbedoneafter xsp3_config, but before anything else. Note that xsp3_restore_settings cannot resotore the clock configuration.

The following definitions describe the valid values for the parameter clk_src xspress3.h XSP3_CLOCK_SRC The following definitions describe the valid values for flags which are or'ed together to make the flags parameter. xspress3.h XSP3_CLOCK_FLAGS

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
card is the number of the card in the xspress3 system, 0 for a single card system and up to (xsp3_get_num_cards() - 1) for a multi-card system, where this value has been passed to xsp3_config() at xspress3 system configuration. If card is less than 0 then all cards are selected.
clk_src clock source
flags setup flags (see definition)
tp_type test pattern type in the IO spartan FPGAs
adc_clk_delay Delay in ADC Clk outputs of the clock chip 0...15 in 150 ps. or -1 to use default
fpga_clk_delay Delay in FPGA Clk outputs of the clock chip 0...15 in 150 ps.
Returns:
XSP3_OK or a negative error code.
int xsp3_dma_check_desc ( int  path,
int  card,
u_int32_t  stream,
XSP3_DMA_MsgCheckDesc msg 
)

This is called typically on an RX DMA Stream e.g.

XSP3_DMA_STREAM_BNUM_SCALERS, XSP3_DMA_STREAM_BNUM_SCOPE0, XSP3_DMA_STREAM_BNUM_SCOPE1 or XSP3_DMA_STREAM_BNUM_10G_TO_DRAM to see how much data has been received. It returns the number of complete DMA descriptors that have been received. For XSP3_DMA_STREAM_BNUM_SCALERS this is the number of time frames of scalers that have been received.

The following describes the layout of the structure. xspress3_dma_protocol.h XSP3_DMA_MSG_CHECK_DESC

option=0 => do default checks for the specified stream and is usually appropriate For more control set options as: xspress3_dma_protocol.h XSP3_DMA_MSG_CHECK_DESC

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
card is the number of the card in the xspress3 system, 0 for a single card system and up to (xsp3_get_num_cards() - 1) for a multi-card system, where this value has been passed to xsp3_config() at xspress3 system configuration.
stream Stream number check descriptors for defined in XSP3_DMA_STREAM_NUMBER.
msg 
Returns:
XSP3_OK or a negative error code.
int xsp3_dma_read_status ( int  path,
int  card,
u_int32_t  stream_mask 
)

Get the DMA status.

Instruct PPC1 in the Virtex-5 to read and return the status of the specified DMA stream. All specified streams are read and copied to the status block shared between PPC1 and PPC2. The last (or only) status read is returned.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
card is the number of the card in the xspress3 system, 0 for a single card system and up to (xsp3_get_num_cards() - 1) for a multi-card system, where this value has been passed to xsp3_config() at xspress3 system configuration.
stream_mask Stream to read status. See XSP3_DMA_STREAM_MASK
Returns:
XSP3_OK or a negative error code.
int xsp3_get_aux1_mode ( int  path,
int  chan,
int *  aux1_mode,
int *  aux1_thres 
)

Get auxilliary data 1 mode as set by xsp3_format_run.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1)
aux1_mode return special debug mode aux1
aux1_thres return threshold for special debug mode
Returns:
XSP3_OK or a negative error code.
int xsp3_get_chan_cont ( int  path,
int  chan,
u_int32_t *  chan_cont 
)

Get the channel control register.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1)
chan_cont the channel control register
Returns:
XSP3_OK or a negative error code.
int xsp3_get_clock_control ( int  path,
int  card,
u_int32_t *  clock 
)

Get the global clock control register.



The following definitions describe the layout of the global clock register xspress3.h XSP3_GLOBAL_CLOCK

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
card is the number of the card in the xspress3 system, 0 for a single card system and up to (xsp3_get_num_cards() - 1) for a multi-card system, where this value has been passed to xsp3_config() at xspress3 system configuration.
clock the clock control register
Returns:
XSP3_OK or a negative error code.
int xsp3_get_data_mux_cont ( int  path,
int  card,
u_int32_t *  mux_cont 
)

Get the ADC Data Mux register.



Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
card is the number of the card in the xspress3 system, 0 for a single card system and up to (xsp3_get_num_cards() - 1) for a multi-card system, where this value has been passed to xsp3_config() at xspress3 system configuration.
mux_cont pointer to the Mux control register
Returns:
XSP3_OK or a negative error code.
int xsp3_get_features ( int  path,
int  card,
Xspress3_features features 
)

Return structure describing the hardware features enabled in the current firmware build.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
card Card number.
feaures Pointer to Xspress3_features to return a copy of the feature structure into.
Returns:
0 => hardware scalers > 1 => sofscaler mode(s) <0 => ERROR
int xsp3_get_glitch ( int  path,
int  chan,
u_int32_t *  glitchA,
u_int32_t *  glitchB 
)

Get the glitch registers A & B.



The following definitions describe the layout of the glitch A register. xspress3.h XSP3_GLITCH_A_REGISTER The following definitions describe the layout of the glitch B register. xspress3.h XSP3_GLITCH_B_REGISTER

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1)
glitchA the glitch A register.
glitchB the glitch B register.
Returns:
XSP3_OK or a negative error code.
int xsp3_get_good_thres ( int  path,
int  chan,
u_int32_t *  good_thres 
)

Get the good event threshold.

Retrieve the good event scaler energy threshold set by xsp3_set_good_thres

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1)
good_thres good event threshold
Returns:
XSP3_OK or a negative error code.
int xsp3_get_has_soft_scalers ( int  path  ) 

Determine whether firmware requires scalers in software.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
Returns:
0 => hardware scalers > 1 => sofscaler mode(s) <0 => ERROR
int xsp3_get_max_ave ( int  path,
int  chan 
)

Get maximum number of samples used in the running average.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1)
Returns:
maximium number of samples used in the running average or a negative error code.
int xsp3_get_reset ( int  path,
int  chan,
u_int32_t *  resetA,
u_int32_t *  resetB,
u_int32_t *  resetC 
)

Get the reset registers A, B and C.



The following definitions describe the layout of the reset A register xspress3.h XSP3_RESET_A_REGISTER The following definitions describe the layout of the reset B register xspress3.h XSP3_RESET_B_REGISTER The following definitions describe the layout of the reset C register xspress3.h XSP3_RESET_C_REGISTER

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1)
resetA the reset A register.
resetB the reset B register.
resetC the reset C register.
Returns:
XSP3_OK or a negative error code.
int xsp3_get_servo ( int  path,
int  chan,
u_int32_t *  servoA,
u_int32_t *  servoB,
u_int32_t *  servoC 
)

Get the servo control registers.



The following definitions describe the layout of the servo A register xspress3.h XSP3_SERVO_A_REGISTER The following definitions describe the layout of the servo B register xspress3.h XSP3_SERVO_B_REGISTER The following definitions describe the layout of the servo C register xspress3.h XSP3_SERVO_C_REGISTER

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1)
servoA the servo A register.
servoB the servo B register.
servoC the servo C register.
Returns:
XSP3_OK or a negative error code.
int xsp3_get_trigger_b ( int  path,
int  chan,
Xspress3_TriggerB trig_b 
)

Get the trigger B settings.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1).
trig_b a structure defining the settings for the trigger B registers.
Returns:
XSP3_OK or a negative error code.
int xsp3_get_trigger_b_ringing ( int  path,
int  chan,
double *  scale_a,
int *  delay_a,
double *  scale_b,
int *  delay_b 
)

Get the trigger B ringing removal filter.

The following definitions describe the layout of the reinging removal register xspress3.h XSP3_TRIGGER_B_RINGING_REGISTER

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1) if chan is less than 0 then all channels are selected.
scale_a Pointer to Scaling for 1st correction point.
delay_a Pointer to Delay for 1st correction point
scale_b Pointer to Scaling for 2nd correction point.
delay_b Pointer to Delay for 2nd correction point
Returns:
XSP3_OK or a negative error code.
int xsp3_get_trigger_c ( int  path,
int  chan,
Xspress3_TriggerC trig_c 
)

Get the trigger C settings.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1).
trig_c a structure defining the settings for the trigger C registers.
Returns:
XSP3_OK or a negative error code.
int xsp3_getDeadtimeCorrectionFlags ( int  path,
int  chan,
int *  flags 
)

Get the flags only for dead time energy correction.

These are often restored by xsp3_restore_settings so may not need to be handled by the user code.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1) if chan is less than 0 then all channels are selected
flags 
Returns:
XSP3_OK or a negative error code.
int xsp3_getDeadtimeCorrectionParameters ( int  path,
int  chan,
int *  flags,
double *  processDeadTimeAllEventGradient,
double *  processDeadTimeAllEventOffset,
double *  processDeadTimeInWindowOffset,
double *  processDeadTimeInWindowGradient 
)

Get the parameters for dead time energy correction.

These are often restored by xsp3_restore_settings so may not need to be handled by the user code.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1) if chan is less than 0 then all channels are selected
flags 
processDeadTimeAllEventGradient 
processDeadTimeAllEventOffset 
processDeadTimeInWindowOffset 
processDeadTimeInWindowGradient 
Returns:
XSP3_OK or a negative error code.
int xsp3_has_bram ( int  path,
int  chan,
int  region_num 
)

Determine if the Firmware has a given BRAM.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan channel number.
region_num Region number as xspress3.h XSP3_REGIONS
Returns:
0 on success or <0 if error.
int xsp3_has_lead_corr ( int  path,
int  card 
)

Determine if the firmware has event lead-in corection configured.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
card card number.
Returns:
0 or 1 success or <0 if error.
int xsp3_has_lead_tail_corr_width ( int  path,
int  chan,
int  region_num,
int *  num_t,
int *  num_wid 
)

Determine the option code for event lead and tail correction type and and return layout.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan channel number.
region_num Region number as xspress3.h XSP3_REGIONS
Returns:
0 on success or <0 if error.
int xsp3_has_servo_bi_linear_time ( int  path,
int  chan 
)

Determine the option code for the bi-linear time version(s) of PWL servo.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan channel number.
Returns:
0 or 1 on success or <0 if error.
int xsp3_has_soft_lut ( int  path,
int  chan,
int  region_num 
)

Determine if the software processing has a given LUT/BRAM.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan channel number.
region_num Region number as xspress3.h XSP3_REGIONS
Returns:
0 on success or <0 if error.
int xsp3_nbits_adc ( int  path,
int  adc_cont 
)

Get the number of bits of ADC.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
adc_cont ADC multiplexer.
Returns:
number of bits of ADC or a negative error code.
int xsp3_nbits_aux1 ( int  path,
int  aux1_mode 
)

Get number of bits used by given aux1 special debug mode.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
aux1_mode special debug mode aux1
Returns:
number of bits or a negative error code.
int xsp3_read_fem_config ( int  path,
int  card,
int  offset,
int  size,
u_int8_t *  value 
)

Read a series of values from the FEM Config data structure for the specified card.

This specialist command allows the FEM MAC and IP address to be read for debug.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
card is the number of the card in the xspress3 system, 0 for a single card system and up to (xsp3_get_num_cards() - 1) for a multi-card system, where this value has been passed to xsp3_config() at xspress3 system configuration.
offset an address offset from the start of the fan control structure.
size the size of the array of values to read.
value an array to receive a series of 8 bit integer values.
Returns:
XSP3_OK or a negative error code.
int xsp3_register_init ( int  path,
int  chan 
)

Initialise the contents of the Channel Registers to as power up.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1)
Returns:
XSP3_OK or a negative error code.
int xsp3_set_cal_events ( int  path,
int  chan,
int  enable,
int  period,
int  avoid 
)

Setup the Calibration event trigger generator.



Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1) if chan is less than 0 then all channels are selected.
enable Enable the calibration event generator
period Period in cycles of calibration event generator
avoid Make calibration triggers avoid real events
Returns:
XSP3_OK or a negative error code.
int xsp3_set_chan_cont ( int  path,
int  chan,
u_int32_t  chan_cont 
)

Set the channel control register.



The following definitions describe the layout of the channel control register xspress3.h XSP3_CC_REGISTER

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1). If chan is less than 0 then all channels are selected.
chan_cont channel control register
Returns:
XSP3_OK or a negative error code.
int xsp3_set_data_mux_cont ( int  path,
int  card,
u_int32_t  mux_cont 
)

Set the ADC Data Mux register.



With te default setup, each channle processes data from its own ADC.i.e. ADC input 0 is processes by forware channel 0. However each channel set an alterante channel or the single shared multiplexer channel. See xsp3_set_chan_cont. This command sets the source for the data multiplexer channel.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
card is the number of the card in the xspress3 system, 0 for a single card system and up to (xsp3_get_num_cards() - 1) for a multi-card system, where this value has been passed to xsp3_config() at xspress3 system configuration. If card is less than 0 then all cards are selected.
mux_cont the Mux Control channle number.
Returns:
XSP3_OK or a negative error code.
int xsp3_set_glitch ( int  path,
int  chan,
u_int32_t  glitchA,
u_int32_t  glitchB 
)

Set the two glitch registers A and B.



The following definitions describe the layout of the glitch A register xspress3.h XSP3_GLITCH_A_REGISTER The following definitions describe the layout of the glitch B register xspress3.h XSP3_GLITCH_B_REGISTER

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1). If chan is less than 0 then all channels are selected.
glitchA glitch register A.
glitchB glitch register B.
Returns:
XSP3_OK or a negative error code.
int xsp3_set_global_reset_gen ( int  path,
int  card,
int  enable,
int  sync_mode,
int  det_reset_width,
int  hold_off_time,
int  gr_active_del,
int  gr_active_wid,
int  circ_offset 
)

Configure the detector global reset generator.

For use with detectors which support a global reset input, the hardware can be cabled via the IDC34 connector to provide a wired OR. The firmware in all cards needs to provide global reset request. The firmware in at least the master card must inclued a gloabl reset generator. In the master card only, the global reset generator is enabled and will drive the global reset active signal onto the IDC bus. The global reset to the detector is currently driven by TTL_OUT(0), enabled using XSP3_ALT_TTL_TIMING_VETO_GR or XSP3_ALT_TTL_TIMING_ALL_GR in ( xsp3_set_glob_timeA()}

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
card the card number in the system or -1 to copy to all channels, though usually just to the master card.
sync_mode 0=> generator detector rest as soon as requested, 1=> Delay generator ion global reset until next beam circulation sync.
det_reset_width Width of detector reset pulse to detector in ADC clock cycles (80 MHz)
hold_off_time Hold off time from end of detector reset pulse until next searching for reset request in ADC clock cycles (80 MHz)
gr_active_del Delay from Detector reset to detetcor assert to Global Reset Active asserted to all cards. in ADC clock cycles (80 MHz)
gr_active_wid Width of Global Reset Active signal supplied to all cards in ADC clock cycles (80 MHz)
circ_offset Offset from beam circulation trigger to trigger point used in synchronised mode
Returns:
XSP3_OK or a negative error code.
int xsp3_set_reset ( int  path,
int  chan,
u_int32_t  resetA,
u_int32_t  resetB,
u_int32_t  resetC 
)

Set the reset registers A,B & C.



The following definitions describe the layout of the reset A register xspress3.h XSP3_RESET_A_REGISTER The following definitions describe the layout of the reset B register xspress3.h XSP3_RESET_B_REGISTER The following definitions describe the layout of the reset C register xspress3.h XSP3_RESET_C_REGISTER

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1). If chan is less than 0 then all channels are selected.
resetA the reset A register.
resetB the reset B register.
resetC the reset C register.
Returns:
XSP3_OK or a negative error code.
int xsp3_set_servo ( int  path,
int  chan,
u_int32_t  servoA,
u_int32_t  servoB,
u_int32_t  servoC 
)

Set the three servo registers A, B and C.



The following definitions describe the layout of the servo A register xspress3.h XSP3_SERVO_A_REGISTER The following definitions describe the layout of the servo B register xspress3.h XSP3_SERVO_B_REGISTER The following definitions describe the layout of the servo C register xspress3.h XSP3_SERVO_C_REGISTER

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1) if chan is less than 0 then all channels are selected.
servoA servo A register.
servoB servo B register.
servoC servo C register.
Returns:
XSP3_OK or a negative error code.
int xsp3_set_trigger_b ( int  path,
int  chan,
Xspress3_TriggerB trig_b 
)

Set the trigger B details.

Setpu the main event trigger using a full description of the thresholds and timings from the structure Xspress3_TriggerB.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1) if chan is less than 0 then all channels are selected.
trig_b a structure defining the settings for the trigger B registers
Returns:
XSP3_OK or a negative error code.
int xsp3_set_trigger_b_ringing ( int  path,
int  chan,
double  scale_a,
int  delay_a,
double  scale_b,
int  delay_b 
)

Set the trigger B ringing removal filter.

The following definitions describe the layout of the reinging removal register xspress3.h XSP3_TRIGGER_B_RINGING_REGISTER

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1) if chan is less than 0 then all channels are selected.
scale_a Scaling for 1st correction point.
delay_a Delay for 1st correction point.
scale_b Scaling for 2nd correction point.
delay_b Delay for 2nd correction point
Returns:
XSP3_OK or a negative error code.
int xsp3_set_trigger_c ( int  path,
int  chan,
Xspress3_TriggerC trig_c 
)

Set the trigger C details.

Setup the second (high sensitivity) trigger.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1) if chan is less than 0 then all channels are selected.
trig_c a structure defining the settings for the trigger C registers
Returns:
XSP3_OK or a negative error code.
int xsp3_setDeadtimeCorrectionParameters ( int  path,
int  chan,
int  flags,
double  processDeadTimeAllEventGradient,
double  processDeadTimeAllEventOffset,
double  processDeadTimeInWindowOffset,
double  processDeadTimeInWindowGradient 
)

Set the parameters for dead time energy correction.

These are often restored by xsp3_restore_settings so may not need to be handled by the user code.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
chan is the number of the channel in the xspress3 system, 0 to (xsp3_get_num_chan() - 1) if chan is less than 0 then all channels are selected
flags 
processDeadTimeAllEventGradient 
processDeadTimeAllEventOffset 
processDeadTimeInWindowOffset 
processDeadTimeInWindowGradient 
Returns:
XSP3_OK or a negative error code.
int xsp3_system_arm ( int  path,
int  card 
)

Arm the xspress3 system, but in software time frame mode, counting is disabled.

Call xsp3_histogram_continue() to enable counting and xsp3_histogram_pause() to pause counting. At the end of the expermient call xsp3_system_stop

If the run mode has been set to include playback, it is started. If the run mode include scope mode, the scope mode DMAs are started. See xsp3_set_run_flags. However, for full control of the histogramming threads and UDP ports it is usual to use xsp3_histogram_arm instead

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
card is the number of the card in the xspress3 system, 0 for a single card system and up to (xsp3_get_num_cards() - 1) for a multi-card system, where this value has been passed to xsp3_config() at xspress3 system configuration. If card is less than 0 then all cards are selected.
Returns:
XSP3_OK or a negative error code.
int xsp3_system_start ( int  path,
int  card 
)

Start the xspress3 system.

In software time frame mode, counting is enabled immediately. If the run mode has been set to include playback, it is started. If the run mode include scope mode, the scope mode DMAs are started. See xsp3_set_run_flags. However, for full control of the histogramming threads and UDP ports it is usual to use xsp3_histogram_start

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
card is the number of the card in the xspress3 system, 0 for a single card system and up to (xsp3_get_num_cards() - 1) for a multi-card system, where this value has been passed to xsp3_config() at xspress3 system configuration. If card is less than 0 then all cards are selected.
Returns:
XSP3_OK or a negative error code.
int xsp3_trigger_b_get_diff_params ( int  path,
int *  sep_offset,
int *  sep_max 
)

Get the trigger B hardware limits determined by use of BRAM or SRL32 for diff1 and diff2 delay.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
sep_offset Pointer to return the differentail separation acheived when the delay is set to 0
sep_max Pointer to return the max value that can be used for the delay value.
Returns:
0 on success or <0 if error.
int xsp3_trigger_b_get_ringing_params ( int  path,
int *  min_delay,
int *  max_delay 
)

Get the trigger B ringing subtractor hardware limits.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
min_delay Pointer to return the min delay value that can be used
max_delay Pointer to return the max delay value that can be used
Returns:
0 on success or <0 if error.
int xsp3_write_fem_config ( int  path,
int  card,
int  offset,
int  size,
u_int8_t *  value 
)

Write a series of values into the FEM Config data structure.

This specialist command allows the FEM MAC and IP address to be set for later saving to EEPROM.

Parameters:
path a handle to the top level of the xspress3 system returned from xsp3_config().
card is the number of the card in the xspress3 system, 0 for a single card system and up to (xsp3_get_num_cards() - 1) for a multi-card system, where this value has been passed to xsp3_config() at xspress3 system configuration. If card is less than 0 then all cards are selected.
offset a byte address offset from the start of the fan control region.
size the size in bytes of the array of values to write.
value an array of 8 bit integer values to write.
Returns:
XSP3_OK or a negative error code.