Defines | Functions | Variables

/scratch/npr78/temp/xspress3_api/det-software/none_vme/xspress3/lib/xspress3.c File Reference

Defines

#define XSP3_MAX_CONFIGS   10

Functions

int xsp3_config (int ncards, int num_tf, char *baseIPaddress, int basePort, char *baseMACaddress, int num_chan, int create_module, char *modname, int debug, int card_index)
 Configure and initialise the complete xspress3 system.
int xsp3_do_config (int ncards, int num_tf, char *baseIPaddress, int basePort, char *baseMACaddress, int num_chan, int create_module, char *modname, int debug, int card_index)
 Configure the complete xspress3 system.
int xsp3_config_tcp (char femHostName[][XSP3_MAX_IP_CHARS], int femPort, int ncards, int num_chan, int debug)
 Configure the xspress3 system and create a 1Gb TCP socket link to each card in the system.
char * xsp3_get_error_message ()
 Get the last error message that was generated by the xspress3 system.
int xsp3_close (int path)
 Close all open paths in the system.
int xsp3_set_num_chan (int path, int num_chan)
 Set the number of channels to be used in system.
int xsp3_get_revision (int path)
 Get firmware revision.
int xsp3_get_num_chan (int path)
 Get the number of channels currently configured in the system.
int xsp3_get_num_cards (int path)
 Get the number of xspress3 cards currently configured in the system.
int xsp3_get_chans_per_card (int path)
 Get the number of channels available per xspress3 card.
int xsp3_get_bins_per_mca (int path)
 Get the number of bins per MCA configured in the xspress3 system.
int xsp3_get_max_num_chan (int path)
 Get the maxmimum number of channels currently available in system.
int xsp3_set_data_buffer (int path, int chan, u_int32_t *buffer, u_int32_t bufsiz)
 Set the location of the histogram buffer and buffer size in the xspress3 system.
int xsp3_set_data_module (int path, int chan, MOD_IMAGE *module, u_int32_t *buffer, u_int32_t bufsiz)
 Set the location of the data module, histogram buffer and buffer size in the xspress3 system.
MOD_IMAGE * xsp3_get_data_module (int path, int chan)
 Get a pointer to the data module in which the histogram data is stored for a particular channel.
int xsp3_resolve_path (int path, int chan, int *thisPath, int *chanIdx)
 Determine which card and consequently the handle, a particular channel is configured on and the channel number within that card, given the top level system handle and the channel number.
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_format_run (int path, int chan, int aux1_mode, int aux1_thres, int aux2_cont, int flags, int aux2_mode, int nbits_eng)
 Set format of the data to be histogrammed.
int xsp3_get_format (int path, int chan, int *nbins_eng, int *nbins_aux1, int *nbins_aux2, int *nbins_tf)
 Get the format control parameters.
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_window (int path, int chan, int win, int low, int high)
 Set the scaler windows.
int xsp3_set_good_thres (int path, int chan, u_int32_t good_thres)
 Set the threshold for the good event scaler.
int xsp3_set_trigger_regs_b (int path, int chan, u_int32_t trigb_thres, u_int32_t trigb_timea, u_int32_t trigb_timeb)
 Set the raw trigger B registers, however the preferred method is to use xsp3_set_trigger_b.
int xsp3_set_trigger_regs_c (int path, int chan, u_int32_t trigc_otd_servo, u_int32_t trigc_thres)
 Set the raw trigger C registers, however the preferred method is to use xsp3_set_trigger_c.
int xsp3_set_chan_cont (int path, int chan, u_int32_t chan_cont)
 Set the channel control register.
int xsp3_set_format_reg (int path, int chan, u_int32_t format)
 Set the format 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_window (int path, int chan, int win, u_int32_t *low, u_int32_t *high)
 Get the scaler window settings.
int xsp3_get_good_thres (int path, int chan, u_int32_t *good_thres)
 Get the good event threshold.
int xsp3_get_trigger_regs_b (int path, int chan, u_int32_t *trigb_thres, u_int32_t *trigb_timea, u_int32_t *trigb_timeb)
 Get the raw trigger B registers, however the preferred method is to use xsp3_get_trigger_b.
int xsp3_get_trigger_regs_c (int path, int chan, u_int32_t *trigc_otd_servo, u_int32_t *trigc_thres)
 Get the raw trigger C registers, however the preferred method is to use xsp3_get_trigger_c.
int xsp3_get_chan_cont (int path, int chan, u_int32_t *chan_cont)
 Get the channel control register.
int xsp3_get_format_reg (int path, int chan, u_int32_t *format)
 Get the format 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_set_clock_control (int path, int card, u_int32_t clock)
 Set the global clock control register.
int xsp3_set_glob_timeA (int path, int card, u_int32_t time)
 Setup the triggering or time frame control register.
int xsp3_set_glob_timeFixed (int path, int card, u_int32_t time)
 Set the fixed time frame register.
int xsp3_get_clock_control (int path, int card, u_int32_t *clock)
 Get the global clock control register.
int xsp3_get_glob_timeA (int path, int card, u_int32_t *time)
 Get the time frame register.
int xsp3_get_glob_timeFixed (int path, int card, u_int32_t *time)
 Get fixed time frame register.
int xsp3_set_scope (int path, int card, u_int32_t scope_chn, u_int32_t scope_src, u_int32_t scope_nwd, u_int32_t scope_alt)
 Sets the scope mode registers.
int xsp3_get_scope (int path, int card, u_int32_t *scope_chn, u_int32_t *scope_src, u_int32_t *scope_nwd, u_int32_t *scope_alt)
 Get scope mode registers.
int xsp3_set_scope_stream (int path, int card, int stream, u_int32_t chan, u_int32_t src, u_int32_t alt)
 Setup individual scope stream.
int xsp3_set_scope_options (int path, int card, Xsp3ScopeOptions options)
 Setup scope mode options.
int xsp3_scope_settings_to_mod (int path)
 Get scope mode options.
int xsp3_scope_settings_from_mod (int path)
 Get scope settings from data module and write into hardware.
int xsp3_write_reg (int path, int chan, int region, int offset, int size, u_int32_t *value)
 Write a series of values into the region registers for all or each specified channel.
int xsp3_read_reg (int path, int chan, int region, int offset, int size, u_int32_t *value)
 Read a series of values from the region registers for each specified channel.
int xsp3_write_glob_reg (int path, int card, int offset, int size, u_int32_t *value)
 Write a series of values into the global region register for all or each specified card.
int xsp3_read_glob_reg (int path, int card, int offset, int size, u_int32_t *value)
 Read a series of values from the global region register for each specified card.
int xsp3_read_raw_reg (int path, int card, u_int32_t address, int size, u_int32_t *value)
 Read a series of values from an address for each specified card.
int xsp3_get_dma_status_block (int path, int card, XSP3_DMA_StatusBlock *statusBlock)
 Get the status and settings of all the DMA streams.
int xsp3_write_rdma_reg (int path, int card, int address, int size, u_int32_t *value)
 Write a series of values into the UDP core registers for all or each specified card.
int xsp3_read_rdma_reg (int path, int card, int address, int size, u_int32_t *value)
 Read a series of values from the UPD core registers for each specified card.
int xsp3_write_spi_reg (int path, int card, int address, int size, u_int32_t *value)
 Write a series of values into the SPI registers for all or each specified card.
int xsp3_read_spi_reg (int path, int card, int address, int size, u_int32_t *value)
 Read a series of values from the SPI registers for each specified card.
int xsp3_write_dram (int path, int card, int address, int size, u_int32_t *value)
 Write a series of values into DRAM memory for all or each specified card.
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_scope_search (int path, int chan, u_int32_t scope_search)
 Set the value of the scope search register for specialist factory debug.
int xsp3_get_scope_search (int path, int chan, u_int32_t *scope_search)
 Get the value of the scope search register for specialist factory debug.
int xsp3_init_roi (int path, int chan)
 Initialise the regions of interest.
int xsp3_set_roi (int path, int chan, int num_roi, XSP3Roi *roi)
 Sets the regions of interest.
int xsp3_get_glob_time_statA (int path, int card, u_int32_t *time)
 Get the timing status register A.
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_fan_cont (int path, int card, int offset, int size, u_int32_t *value)
 Write a series of values into the fan controller data structure.
int xsp3_read_fan_cont (int path, int card, int offset, int size, u_int32_t *value)
 Read a series of values from the fan control data structure for the specified card.
int xsp3_playback_load_x2 (int path, int card, char *filename, int do_test, int do_scale, int do_swap)
 Load Playback data from an XSPRESS2 scope mode file.
int xsp3_playback_load_x3 (int path, int card, char *filename, int src0, int src1, int file_streams, int str0dig)
 Load Playback data from an XSPRESS3 scope mode file.
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_write_soft_lut (int path, int chan, int region_num, int nwords, u_int32_t *data)
 Write Software lookup table equivalent to BRAM.
int xsp3_read_soft_lut (int path, int chan, int region_num, int nwords, u_int32_t *data)
 Read Software lookup table equivalent to BRAM.
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_get_disable_threading (int path)
 Get Disable multi threading flags.
int xsp3_set_disable_threading (int path, int flags)
 Set Disable multi threading flags.
int xsp3_set_cal_events (int path, int chan, int enable, int period, int avoid)
 Setup the Calibration event trigger generator.

Variables

XSP3Path Xsp3Sys [XSP3_MAX_PATH]
char error_message [XSP3_MAX_MSG_LEN+1]

Define Documentation

#define XSP3_MAX_CONFIGS   10

Variable Documentation

char error_message[XSP3_MAX_MSG_LEN+1]
XSP3Path Xsp3Sys[XSP3_MAX_PATH]