47#include "ExportTypes.h"
59#define FERSLIB_STR_HELPER_(S) #S
60#define FERSLIB_STR(S) FERSLIB_STR_HELPER_(S)
63#define f_sprintf sprintf_s
64#define f_fopen fopen_s
116#define FERSLIB_VERSION_MAJOR 1
117#define FERSLIB_VERSION_MINOR 3
118#define FERSLIB_VERSION_PATCH 0
119#define FERSLIB_RELEASE_NUM (FERSLIB_VERSION_MAJOR * 10000) + (FERSLIB_VERSION_MINOR * 100) + (FERSLIB_VERSION_PATCH)
120#define FERSLIB_RELEASE_STRING FERSLIB_STR(FERSLIB_VERSION_MAJOR) "." FERSLIB_STR(FERSLIB_VERSION_MINOR) "." FERSLIB_STR(FERSLIB_VERSION_PATCH)
121#define FERSLIB_RELEASE_DATE "14/01/2026"
124#define THROUGHPUT_METER 0
126#define INVALID_TEMP 999
134#define FERSLIB_MAX_NCNC 4
135#define FERSLIB_MAX_NBRD 128
136#define FERSLIB_MAX_NCH 128
137#define FERSLIB_MAX_NCH_5202 64
138#define FERSLIB_MAX_NCH_5203 128
139#define FERSLIB_MAX_NCH_5204 64
140#define PICOTDC_NCH 64
141#define FERSLIB_MAX_NTDL 8
142#define FERSLIB_MAX_NNODES 16
152#define DBLOG_FERSLIB_MSG 0x0001
153#define DBLOG_RAW_DATA_OUTFILE 0x0002
154#define DBLOG_LL_DATADUMP 0x0004
155#define DBLOG_LL_MSGDUMP 0x0008
156#define DBLOG_QUEUES 0x0010
157#define DBLOG_RAW_DECODE 0x0020
158#define DBLOG_LL_READDUMP 0x0040
159#define DBLOG_PARAMS 0x0080
160#define DBLOG_CONFIG 0x0100
161#define ENABLE_FERSLIB_LOGMSG 1
229#define ACQMODE_SPECT 0x01
230#define ACQMODE_TSPECT 0x03
231#define ACQMODE_TIMING_CSTART 0x02
232#define ACQMODE_TIMING_GATED 0x02
233#define ACQMODE_TIMING_CSTOP 0x12
234#define ACQMODE_TIMING_STREAMING 0x22
235#define ACQMODE_COMMON_START 0x02
236#define ACQMODE_COMMON_STOP 0x12
237#define ACQMODE_STREAMING 0x22
238#define ACQMODE_TRG_MATCHING 0x32
239#define ACQMODE_TEST_MODE 0x01
240#define ACQMODE_COUNT 0x04
241#define ACQMODE_WAVE 0x08
250#define DTQ_SPECT 0x01
251#define DTQ_TIMING 0x02
252#define DTQ_COUNT 0x04
254#define DTQ_TSPECT 0x03
255#define DTQ_SERVICE 0x2F
257#define DTQ_START 0x0F
285#define NODATA_TIMEOUT 100
286#define STOP_TIMEOUT 500
287#define FERS_CONNECT_TIMEOUT 3
295#define TDL_COMMAND_DELAY 1000000
296#define CLK_PERIOD_5202 8
297#define CLK_PERIOD_5203 12.8
298#define CLK_PERIOD_5204 12.8
307#define TDC_CLK_PERIOD (CLK_PERIOD_5203*2)
308#define TDC_PULSER_CLK_PERIOD (TDC_CLK_PERIOD / 32)
309#define TDC_LSB_ps (TDC_CLK_PERIOD / 8 / 1.024)
318#define MAX_WAVEFORM_LENGTH 2048
319#define MAX_LIST_SIZE 2048
320#define MAX_TEST_NWORDS 4
321#define MAX_SERV_NWORDS 6
330#define MEASMODE_LEAD_ONLY 0x01
331#define MEASMODE_LEAD_TRAIL 0x03
332#define MEASMODE_LEAD_TOT8 0x05
333#define MEASMODE_LEAD_TOT11 0x09
334#define MEASMODE_OWLT(m) (((m) == MEASMODE_LEAD_TOT8) || ((m) == MEASMODE_LEAD_TOT11))
352#define STOPRUN_MANUAL 0
353#define STOPRUN_PRESET_TIME 1
354#define STOPRUN_PRESET_COUNTS 2
356#define EVBLD_DISABLED 0
357#define EVBLD_TRGTIME_SORTING 1
358#define EVBLD_TRGID_SORTING 2
361#define CITIROC_CFG_FROM_REGS 0
362#define CITIROC_CFG_FROM_FILE 1
369#define ENERGY_NBIT 14
371#define TOA_LSB_ns 0.5
405#define EEPROM_BIC_SIZE 44
406#define EEPROM_BIC_PAGE 0
407#define EEPROM_CAL_PAGE 256
408#define EEPROM_CAL_SIZE 256
417#define FLASH_PAGE_SIZE 528
418#define FLASH_BIC_PAGE 0
420#define FLASH_PEDCALIB_PAGE 4
421#define FLASH_PEDCALIB_BCK_PAGE 5
423#define FLASH_THR_OFFS_PAGE 4
424#define FLASH_THR_OFFS_BCK_PAGE 5
433#define A5256_EEPROM 1
443#define FERS_INDEX(handle) ((handle) & 0xFF)
444#define FERS_CONNECTIONTYPE(handle) ((handle) & 0xF0000)
445#define FERS_CONNECTIONTYPE_ETH 0x00000
446#define FERS_CONNECTIONTYPE_USB 0x10000
447#define FERS_CONNECTIONTYPE_TDL 0x20000
448#define FERS_CONNECTIONTYPE_CNC 0x80000
449#define FERS_NODE(handle) ((handle >> 20) & 0xF)
450#define FERS_CHAIN(handle) ((handle >> 24) & 0xF)
451#define FERS_CNCINDEX(handle) ((handle >> 30) & 0xF)
452#define FERS_CNC_HANDLE(handle) (0x80000 | ((handle >> 30) & 0xF))
461#define FUP_BA 0xFF000000
462#define FUP_CONTROL_REG 1023
463#define FUP_PARAM_REG 1022
464#define FUP_RESULT_REG 1021
465#define FUP_CMD_READ_VERSION 0xFF
466#define POLY 0x82f63b78
470#define FERSLIB_MAX_GW 20
472#define OUTFILE_RAW_LL 0x0001
493#define max(a,b) ((a) > (b) ? (a) : (b))
496#define min(a,b) ((a) < (b) ? (a) : (b))
696#define A5256_CH0_POSITIVE 0
697#define A5256_CH0_NEGATIVE 1
698#define A5256_CH0_DUAL 2
701#define ADAPTER_NONE 0x0000
702#define ADAPTER_A5255 0x0000
703#define ADAPTER_A5256 0x0002
704#define ADAPTER_A5256_REV0_POS 0x0100
705#define ADAPTER_A5256_REV0_NEG 0x0101
710#define A5256_DAC_LSB ((float)2500/4095)
711#define A5256_mV_to_DAC(mV) (uint32_t)round((1250 - (mV)) / A5256_DAC_LSB)
712#define A5256_DAC_to_mV(lsb) (1250 - (float)((lsb) * A5256_DAC_LSB))
726 extern uint16_t CommonPedestal;
727 extern int EnablePedCal;
731 extern uint8_t ProcessRawData;
733 extern uint8_t EnableSubRun;
737 extern int FERS_Offline;
739 extern int FERS_RunningCnt;
740 extern int FERS_ReadoutStatus;
741 extern int FERS_TotalAllocatedMem;
742 extern uint32_t DebugLogs;
991 CAEN_FERS_DLLAPI
int FERS_WriteRegisterSlice(
int handle, uint32_t address, uint32_t start_bit, uint32_t stop_bit, uint32_t data);
1050 CAEN_FERS_DLLAPI
int FERS_I2C_WriteRegisterSlice(
int handle, uint32_t i2c_dev_addr, uint32_t address, uint32_t start_bit, uint32_t stop_bit, uint32_t data);
1424 CAEN_FERS_DLLAPI
int FERS_HV_WriteReg(
int handle, uint32_t reg_addr, uint32_t dtype, uint32_t reg_data);
1436 CAEN_FERS_DLLAPI
int FERS_HV_ReadReg(
int handle, uint32_t reg_addr, uint32_t dtype, uint32_t* reg_data);
1630 CAEN_FERS_DLLAPI
int FERS_SetParam(
int handle,
const char* param_name,
const char* value_original);
1642 CAEN_FERS_DLLAPI
int FERS_GetParam(
int handle,
const char* param_name,
char* value);
1733 CAEN_FERS_DLLAPI
int FERS_GetEvent(
int* handle,
int* bindex,
int* DataQualifier,
double* tstamp_us,
void** Event,
int* nb);
1922 CAEN_FERS_DLLAPI
int FERS_ReadThrCalib(
int handle,
int npts,
int MemThrDest,
char* date,
float* ThrOffset);
1978 CAEN_FERS_DLLAPI
int FERS_CalibThresholdOffset(
int handle,
float min_thr,
float max_thr,
int* done,
float* ThrOffset,
float* RMSnoise,
void(*ptr)(
char* msg,
int progress));
int ConfigureProbe(int handle)
int FERS_TDC_Config(int handle, int tdc_id, int StartSrc, int StopSrc)
int FERS_TDC_ReadReg(int handle, int tdc_id, uint32_t addr, uint32_t *data)
int FERS_SetEnergyBitsRange(uint16_t EnergyRange)
int FERS_TDC_DoStartStopMeasurement(int handle, int tdc_id, double *tof_ns)
int FERS_TDC_WriteReg(int handle, int tdc_id, uint32_t addr, uint32_t data)
int FERS_GetChannelPedestalBeforeCalib(int handle, int ch, uint16_t *PedLG, uint16_t *PedHG)
void _setLastLocalError(const char *description,...)
FERSLIB_HRClockModes
High resolution clock modes.
FERSLIB_ErrorCodes
Error codes.
FERSLIB_EvtBuildingModes
Event Building modes.
FERSLIB_ServEventsMode
Service event Modes.
FERSLIB_RxThreadSatatus
Status of the data RX thread.
FERSLIB_GlitchFilterModes
Glitch filter modes.
FERSLIB_ReadoutStatus
Readout status.
FERSLIB_StartMode
Start/Stop modes.
@ FERSLIB_ERR_INVALID_FWFILE
@ FERSLIB_ERR_INVALID_PARAM_UNIT
@ FERSLIB_ERR_PEDCALIB_NOT_FOUND
@ FERSLIB_ERR_INVALID_PATH
@ FERSLIB_ERR_MAX_NBOARD_REACHED
@ FERSLIB_ERR_INVALID_PARAM_VALUE
@ FERSLIB_ERR_INVALID_CLK_SETTING
@ FERSLIB_ERR_READOUT_NOT_INIT
@ FERSLIB_ERR_INVALID_PARAM
@ FERSLIB_ERR_QUEUE_OVERRUN
@ FERSLIB_ERR_UPGRADE_ERROR
@ FERSLIB_ERR_COMMUNICATION
@ FERSLIB_ERR_TDL_CHAIN_DOWN
@ FERSLIB_ERR_OPER_NOT_ALLOWED
@ FERSLIB_ERR_MALLOC_BUFFERS
@ FERSLIB_ERR_READOUT_ERROR
@ FERSLIB_ERR_TDL_CHAIN_BROKEN
@ FERSLIB_ERR_START_STOP_ERROR
@ FERSLIB_ERR_NOT_APPLICABLE
@ FERSLIB_ERR_INVALID_BIC
@ FERSLIB_ERR_DEVICE_ALREADY_OPENED
@ FERSLIB_ERR_CALIB_NOT_FOUND
@ FERSLIB_ERR_INVALID_HANDLE
@ GLITCHFILTERMODE_LEADING
@ GLITCHFILTERMODE_TRAILING
@ GLITCHFILTERMODE_DISABLED
@ RAWDATA_REPROCESS_FINISHED
#define FERSLIB_MAX_NNODES
#define FERSLIB_MAX_NCH_5202
int FERS_DisableThrCalib(int handle)
Disable threshold calibration.
int FERS_DumpBoardRegister(int handle)
Dump the board register information to a file.
int FERS_DumpCfgSaved(int handle)
Dump the saved configuration.
char * FERS_GetLibReleaseDate()
Get the release date of the library.
char * FERS_GetLibReleaseNum()
Get the release number of the library.
int FERS_GetLastError(char description[1024])
Get the last message error of library.
int FERS_LibMsg(char *fmt,...)
Write on FERSlib log file.
int FERS_OpenRawDataFile(int *handle, int RunNum, int NumBrd)
Open raw data file, to be done before starting the run.
int FERS_CloseRawDataFile(int *handle, int NumBrd)
Close raw data file after run stops.
float FERS_GetClockPeriod(int handle)
Get the clock of the FERS board.
int FERS_OpenDevice(char *path, int *handle)
Open a device (either FERS board, concentrator or offline)
int FERS_InitTDLchains(int handle, float DelayAdjust[8][16])
Send a sync broadcast command via TDL.
bool FERS_TDLchainsInitialized(int handle)
Check if TDL chains are initialized.
int FERS_TotalAllocatedMemory()
Return the total size of the allocated buffers for the readout of all boards.
int FERS_CloseDevice(int handle)
Cloase a device (either FERS board or concentrator)
uint16_t FERS_GetNumBrdConnected()
Get the number of boards connected.
int FERS_Get_CncPath(char *dev_path, char *cnc_path)
Find the path of the concentrator to which a device is connected.
int FERS_IsOpenByHandle(int handle, char *path)
Check if a device is already opened, with handle.
int FERS_IsOpen(char *path)
Check if a device is already opened.
int FERS_Reset_IPaddress(int handle)
Restore the factory IP address (192.168.50.3) of the device. The board must be connected through the ...
int FERS_SendCommand(int handle, uint32_t cmd)
Send a command to the board
int FERS_XROC_WriteRegisterSilce(int handle, int page_addr, int sub_addr, uint32_t start_bit, uint32_t stop_bit, uint8_t data)
Write a register slice of the XROC ASIC chip via I2C.
int FERS_ReadRegister(int handle, uint32_t address, uint32_t *data)
Read a register of a FERS board.
int FERS_I2C_ReadRegister(int handle, uint32_t i2c_dev_addr, uint32_t reg_addr, uint32_t *reg_data)
Read a register of an I2C register (picoTDC, PLL, ...)
int FERS_SendCommandBroadcast(int *handle, uint32_t cmd, uint32_t delay)
Send a broadcast command to multiple boards connected to a concentrator.
int FERS_XROC_ReadRegister(int handle, int page_addr, int sub_addr, uint8_t *data)
Read a register of the XROC ASIC chip via I2C.
int FERS_WriteRegister(int handle, uint32_t address, uint32_t data)
Write a register of a FERS board.
int FERS_XROC_WriteRegister(int handle, int page_addr, int sub_addr, uint8_t data)
Write a register of the XROC ASIC chip via I2C.
int FERS_I2C_WriteRegisterSlice(int handle, uint32_t i2c_dev_addr, uint32_t address, uint32_t start_bit, uint32_t stop_bit, uint32_t data)
Write a slice of a register of an I2C device.
int FERS_ReadFlashPage(int handle, int pagenum, int size, uint8_t *data)
Read a page from the flash memory.
int FERS_I2C_WriteRegister(int handle, uint32_t i2c_dev_addr, uint32_t reg_addr, uint32_t reg_data)
Write a register of an I2C register (picoTDC, PLL, ...)
int FERS_WriteRegisterSlice(int handle, uint32_t address, uint32_t start_bit, uint32_t stop_bit, uint32_t data)
Write a slice of a register of a FERS board.
int FERS_WriteBoardInfo(int handle, FERS_BoardInfo_t binfo)
Write Board info into the relevant flash memory page.
int FERS_ReadConcentratorInfo(int handle, FERS_CncInfo_t *cinfo)
Read concentrator info from the device.
int FERS_WriteFlashPage(int handle, int pagenum, int size, uint8_t *data)
Write a page of the flash memory.
int FERS_ReadPedestalsFromFlash(int handle, char *date, uint16_t *PedLG, uint16_t *PedHG, uint16_t *dco)
Read pedestal calibration and DC offset.
int FERS_WritePedestals(int handle, uint16_t *PedLG, uint16_t *PedHG, uint16_t *dco)
Write Pedestal calibration.
int FERS_SetCommonPedestal(int handle, uint16_t Pedestal)
Set a common pedestal (applied to all channels after pedestal calibration)
int FERS_EnablePedestalCalibration(int handle, int enable)
Enable / Disabled pedestal calibration.
int FERS_PedestalBackupPage(int handle, int EnBckPage)
Switch to pedestal backup page.
uint32_t FERS_FPGA_FWrev(int handle)
Get the FPGA firmware revision of the FERS board.
char * FERS_ModelName(int handle)
Get the model name of the FERS board.
uint32_t FERS_pid(int handle)
Get the board PID.
int FERS_GetCncInfo(int handle, FERS_CncInfo_t *BrdInfo)
Get concentrator info saved into the library structure.
int FERS_GetBoardInfo(int handle, FERS_BoardInfo_t *BrdInfo)
Get board info saved into the library structure.
uint16_t FERS_Code(int handle)
Get the code of the FERS board.
uint16_t FERS_NumChannels(int handle)
Get the number of channels of the FERS board.
uint32_t FERS_FPGA_FW_MinorRev(int handle)
Get the minor revision of the FPGA firmware.
bool FERS_IsXROC(int handle)
Check if the board mounts an XROC ASIC chip.
uint32_t FERS_FPGA_FW_MajorRev(int handle)
Get the major revision of the FPGA firmware.
uint8_t FERS_PCB_Rev(int handle)
Get the PCB revision of the FERS board.
uint32_t FERS_uC_FWrev(int handle)
Get them microcontroller firmware revision.
int FERS_Get_TDC0_Temp(int handle, float *temp)
Get the temperature from picoTDC0 (on the board)
int FERS_Get_FPGA_Temp(int handle, float *temp)
Get FPGA die temperature.
int FERS_Get_Board_Temp(int handle, float *temp)
Get Board temperature, between PIC and FPGA.
int FERS_Get_TDC1_Temp(int handle, float *temp)
Get the temperature from picoTDC1 (on the mezzanine)
int FERS_HV_Get_Vmon(int handle, float *vmon)
Get HV output voltage (HV read back with internal ADC)
int FERS_HV_Get_Status(int handle, int *OnOff, int *Ramping, int *OvC, int *OvV)
Get the status of the high voltage module.
int FERS_HV_Set_Tsens_Coeff(int handle, float Tsens_coeff[3])
Set coefficients for external temperature sensor. T = V*V*c2 + V*c1 + c0.
int FERS_HV_ReadReg(int handle, uint32_t reg_addr, uint32_t dtype, uint32_t *reg_data)
Read a register of HV.
int FERS_HV_Set_OnOff(int handle, int OnOff)
Turn the high voltage module ON or OFF.
int FERS_HV_Init(int handle)
Initialize the HV communication bus (I2C)
int FERS_HV_Get_Imon(int handle, float *imon)
Get the output monitored current flowing into the detector.
int FERS_HV_Get_IntTemp(int handle, float *temp)
Get the internal temperature of the HV module.
int FERS_HV_Set_TempFeedback(int handle, int enable, float Tsens_coeff)
Set coefficient for Vbias temperature feedback.
int FERS_HV_Get_Imax(int handle, float *imax)
Get the maximum allowed current of the high voltage module.
int FERS_HV_Get_Vbias(int handle, float *vbias)
Get the output bias voltage set.
int FERS_HV_Get_SerNum(int handle, int *sernum)
Get the serial number of the high voltage module.
int FERS_HV_WriteReg(int handle, uint32_t reg_addr, uint32_t dtype, uint32_t reg_data)
Write a value of the HV.
int FERS_HV_Get_DetectorTemp(int handle, float *temp)
Get external temperature (of the detector). Temp sensor must be connected to dedicated lines.
int FERS_HV_Set_Vbias(int handle, float vbias)
Set HV output voltage (bias)
int FERS_HV_Get_FWVer(int handle, uint32_t *FWver)
Get the Firmware Version of the high voltage module.
int FERS_HV_Set_Imax(int handle, float imax)
Set the maximum output current from the high voltage module.
int FERS_configure(int handle, int mode)
Configures a FERS board.
int FERS_GetParam(int handle, const char *param_name, char *value)
Get the value of a parameter. The function reads the value from the relevant parameter in the FERScfg...
int FERS_LoadConfigFile(char *filepath)
Loads a configuration file.
int FERS_SetParam(int handle, const char *param_name, const char *value_original)
Set a parameter by name. The function assigns the value to the relevant parameter in the FERScfg stru...
int FERS_GetEventFromBoard(int handle, int *DataQualifier, double *tstamp_us, void **Event, int *nb)
Read and decode one event from a specific board.
int FERS_CloseReadout(int handle)
De-init readoout (free buffers)
int FERS_FlushData(int handle)
Flush the data buffer (Read and discard data until the RX buffer is empty)
int FERS_GetCrcErrorCnt(int cnc_handle, uint32_t *errcnt)
Get the number of CRC errors detected by the concentrator since the last start of run.
int FERS_StopAcquisition(int *handle, int NumBrd, int StartMode, int RunNum)
Send the stop command to the boards (according to the same mode used to start them)
int FERS_StartAcquisition(int *handle, int NumBrd, int StartMode, int RunNum)
Start data acquisition. Set ReadoutState = RUNNING, wait until all threads are running,...
int FERS_InitReadout(int handle, int ROmode, int *AllocatedSize)
Init readout for one board (allocate buffers and initialize variables)
int FERS_GetEvent(int *handle, int *bindex, int *DataQualifier, double *tstamp_us, void **Event, int *nb)
Read and decode one event from the readout buffers. There are two readout modes: sorted or unsorted....
int FERS_FirmwareBootApplication_ethusb(int handle)
Reboot the firmware application via Ethernet/USB.
int FERS_CheckBootloaderVersion(int handle, int *isInBootloader, uint32_t *version, uint32_t *release)
Check if the FPGA is in "bootloader mode" and read the bootloader version.
int FERS_FirmwareBootApplication_tdl(int *handle)
Reboot the firmware application via TDL.
int FERS_FirmwareUpgrade(int handle, char filen[200], void(*ptr)(char *msg, int progress))
Upgrade the firmware of the board.
int FERS_checkA5256presence(int handle, FERS_A5256_Info_t *tinfo)
Check A5256 presence.
int FERS_WriteEEPROMBlock(int handle, int start_address, int size, uint8_t *data)
Writes a block of data to the EEPROM.
int FERS_WriteA5256EEPROMInfo(int handle, FERS_A5256_Info_t binfo)
Write Adapter A5256 info into the relevant EEPROM memory page.
int FERS_ReadEEPROMBlock(int handle, int start_address, int size, uint8_t *data)
Reads a block of data from the EEPROM.
int FERS_ReadA5256EEPROMInfo(int handle, FERS_A5256_Info_t *binfo)
Read Adapter A5256 info into the relevant EEPROM memory page.
int FERS_ChMask_ada2tdc(uint32_t AdapterMask, uint32_t *ChMask0, uint32_t *ChMask1, int brd)
Remap bits of adapter channel mask to the picoTDC channel mask.
int FERS_ChIndex_ada2tdc(int Adapter_ch, int *TDC_ch, int brd)
Remap Adapter channel to TDC channel.
int FERS_AdapterNch(int brd)
Get the number of channels for the adapter.
int FERS_ChIndex_tdc2ada(int TDC_ch, int *Adapter_ch, int brd)
Remap TDC channel to Adapter channel.
int FERS_Set_DiscrThreshold(int handle, int Adapter_ch, float thr_mv, int brd)
Set the discriminator threshold.
int FERS_CalibThresholdOffset(int handle, float min_thr, float max_thr, int *done, float *ThrOffset, float *RMSnoise, void(*ptr)(char *msg, int progress))
Calibate the threshold offset of A5256 adapter.
int FERS_ReadThrCalib(int handle, int npts, int MemThrDest, char *date, float *ThrOffset)
Read threshold calibration offsets from flash memory.
int FERS_FindMemThrDest(int handle)
Find the source where calibration is stored (if present EEPROM is default)
int FERS_WriteThrCalib(int handle, int npts, int MemThrDest, float *ThrOffset)
Write Threshold offset calibration of A5256 adapter to flash.
TDL chain information structure.
Concentrator board information structure.
char MACaddr_10GbE[20]
MAC address of 10 GbE.
char ModelName[16]
Model name, e.g. DT5215.
char FPGA_FWrev[20]
FPGA FW revision.
FERS_TDL_ChainInfo_t ChainInfo[8]
TDL Chain info.
char ModelCode[16]
Model code, e.g. WDT5215XAAAA.
char SW_rev[20]
Software Revision (embedded ARM)
char PCBrevision[16]
PCB revision.
uint16_t NumLink
Number of links.
uint32_t pid
Board PID (5 decimal digits)
FERS board information structure.
uint16_t NumCh
Number of channels.
char ModelName[16]
Model name, e.g. A5202.
uint16_t FERSCode
FERS code, e.g. 5202.
uint32_t FPGA_FWrev
FPGA FW revision.
uint8_t PCBrevision
PCB revision.
char ModelCode[16]
Model code, e.g. WA5202XAAAAA.
uint32_t uC_FWrev
Microcontroller (uC) FW revision.
uint32_t pid
Board PID (5 decimal digits)
uint8_t FormFactor
Form factor (0=naked version (A52XX), 1=boxed version (DT52XX)
A5256 adapter information structure.
uint16_t NumCh
Number of channels.
char ModelName[16]
Model name, e.g. A5256.
uint16_t AdapterCode
Adapter code, e.g. 5256.
uint8_t PCBrevision
PCB revision.
char ModelCode[16]
Model code, e.g. WA5256XAAAAA.
uint32_t pid
Adapter PID (5 decimal digits)
Spectroscopy Event data structure (with or without timing)
double rel_tstamp_us
Relative timestamp in us, reset by Tref.
uint64_t Tref_tstamp
Timestamp of reference time signal (5202 only)
double tstamp_us
Timestamp in us.
uint16_t energyLG[64]
Low-gain energy values per channel.
uint16_t energyHG[64]
High-gain energy values per channel.
uint16_t ToT[64]
ToT values (used in TSPEC mode only) per channel.
uint64_t chmask
Channel Mask.
uint64_t trigger_id
Trigger ID.
uint32_t tstamp[64]
ToAs (used in TSPEC mode only) per channel.
uint64_t tstamp_clk
Timestamp in LSB.
Counting Event data structure.
double rel_tstamp_us
Relative timestamp in us, reset by Tref.
uint32_t q_or_counts
Q-OR counts.
double tstamp_us
Timestamp in us.
uint64_t chmask
Channel Mask from zero suppression.
uint64_t trigger_id
Trigger ID.
uint32_t t_or_counts
T-OR counts.
uint32_t counts[64]
Counts per channel.
Waveform Event data structure.
uint8_t * dig_probes
Digital probes samples.
double tstamp_us
Timestamp in us.
uint16_t * wave_hg
High-gain waveform samples.
uint16_t * wave_lg
Low-gain waveform samples.
uint64_t trigger_id
Trigger ID.
List Event data structure for timing mode.
uint32_t header1[8]
PicoTDC header 1.
uint16_t nhits
Number of hits.
uint64_t Tref_tstamp
Timestamp of reference time signal (5202 only)
double tstamp_us
Timestamp in microseconds.
uint32_t header2[8]
PicoTDC header 2.
uint32_t trailer[8]
PicoTDC trailer.
uint32_t ToA[2048]
List of ToA in LSB (other board)
uint32_t ow_trailer
PicoTDC one-word trailer.
uint16_t ToT[2048]
List of ToT in LSB.
uint8_t channel[2048]
List of channels.
uint8_t edge[2048]
List of associated edges.
uint64_t trigger_id
Trigger ID.
uint64_t tstamp_clk
Timestamp in LSB (5203 only)
uint32_t tstamp[2048]
List of ToA in LSB (5202 only)
Service Event data structure, common to all FERS module.
uint32_t ReadoutFlags
Readout Flags from picoTDC and FPGA.
float tempTDC[2]
Temperature of TDC0 and TDC1.
uint32_t SupprTrg_cnt
Zero suppressed triggers counter.
uint8_t hv_status_ovv
HV over-voltage status.
uint8_t hv_status_on
HV status ON/OFF.
float hv_Vmon
HV voltage monitor.
double tstamp_us
Time stamp of service event.
uint32_t t_or_cnt
T-OR counts value.
uint32_t q_or_cnt
Q-OR counts value.
float tempHV
High-voltage module temperature.
float tempDetector
Detector temperature (referred to ?)
uint8_t format
Event Format.
uint16_t TDCROStatus
TDC Readout Status Register.
uint64_t update_time
Update time (epoch, ms)
uint8_t version
Service event version.
float hv_Imon
HV current monitor.
float tempFPGA
FPGA core temperature.
uint32_t TotTrg_cnt
Total triggers counter.
uint32_t RejTrg_cnt
Rejected triggers counter.
uint16_t Status
Status Register.
uint8_t hv_status_ovc
HV over-current status.
uint8_t hv_status_ramp
HV ramp status.
uint64_t ChAlmFullFlags[2]
Channel Almost Full flag (from picoTDC)
uint16_t pkt_size
Event size.
float tempBoard
Board temperature (near uC PIC)
Test Mode Event data structure.
uint32_t test_data[4]
Test data words.
double tstamp_us
Timestamp in us.
uint16_t nwords
Number of words.
uint64_t trigger_id
Trigger ID.