| CAEN FERS Library v1.1.4 SDK for FERS systems

Functions
High Voltage control
API
Collaboration diagram for High Voltage control:

## Functions
int | FERS_HV_Init (int handle)
| Initialize the HV communication bus (I2C) More...
int | FERS_HV_WriteReg (int handle, uint32_t reg_addr, uint32_t dtype, uint32_t reg_data)
| Write a value of the HV. More...
int | FERS_HV_ReadReg (int handle, uint32_t reg_addr, uint32_t dtype, uint32_t *reg_data)
| Read a register of HV. More...
int | FERS_HV_Set_OnOff (int handle, int OnOff)
| Turn the high voltage module ON or OFF. More...
int | FERS_HV_Get_Status (int handle, int *OnOff, int *Ramping, int *OvC, int *OvV)
| Get the status of the high voltage module. More...
int | FERS_HV_Get_SerNum (int handle, int *sernum)
| Get the serial number of the high voltage module. More...
int | FERS_HV_Set_Vbias (int handle, float vbias)
| Set HV output voltage (bias) More...
int | FERS_HV_Get_Vbias (int handle, float *vbias)
| Get the output bias voltage set. More...
int | FERS_HV_Get_Vmon (int handle, float *vmon)
| Get HV output voltage (HV read back with internal ADC) More...
int | FERS_HV_Set_Imax (int handle, float imax)
| Set the maximum output current from the high voltage module. More...
int | FERS_HV_Get_Imax (int handle, float *imax)
| Get the maximum allowed current of the high voltage module. More...
int | FERS_HV_Get_Imon (int handle, float *imon)
| Get the output monitored current flowing into the detector. More...
int | FERS_HV_Get_IntTemp (int handle, float *temp)
| Get the internal temperature of the HV module. More...
int | FERS_HV_Get_DetectorTemp (int handle, float *temp)
| Get external temperature (of the detector). Temp sensor must be connected to dedicated lines. More...
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. More...
int | FERS_HV_Set_TempFeedback (int handle, int enable, float Tsens_coeff)
| Set coefficient for Vbias temperature feedback. More...

## Detailed Description

## Function Documentation

## ◆ FERS_HV_Init()

int FERS_HV_Init | ( | int | handle | ) |

Initialize the HV communication bus (I2C)

Parameters

  [in] | handle | Handle to the FERS device

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_HV_WriteReg()

int FERS_HV_WriteReg | ( | int | handle,
|  | uint32_t | reg_addr,
|  | uint32_t | dtype,
|  | uint32_t | reg_data
| ) |  |

Write a value of the HV.

Parameters

  [in] | handle | Handle to the FERS device
  [in] | reg_addr | Address of the register
  [in] | dtype | Data type (0=signed int, 1=fixed point (Val*10000), 2=unsigned int, 3=float)
  [in] | reg_data | Data to write

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_HV_ReadReg()

int FERS_HV_ReadReg | ( | int | handle,
|  | uint32_t | reg_addr,
|  | uint32_t | dtype,
|  | uint32_t * | reg_data
| ) |  |

Read a register of HV.

Parameters

  [out] | reg_data | Pointer to the read value
  [in] | handle | Handle to the FERS device
  [in] | reg_addr | Address of the register
  [in] | dtype | Data type (0=signed int, 1=fixed point (Val*10000), 2=unsigned int, 3=float)

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_HV_Set_OnOff()

int FERS_HV_Set_OnOff | ( | int | handle,
|  | int | OnOff
| ) |  |

Turn the high voltage module ON or OFF.

Parameters

  [in] | handle | Handle to the FERS device
  [in] | OnOff | 1 to turn on, 0 to turn off

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_HV_Get_Status()

int FERS_HV_Get_Status | ( | int | handle,
|  | int * | OnOff,
|  | int * | Ramping,
|  | int * | OvC,
|  | int * | OvV
| ) |  |

Get the status of the high voltage module.

Parameters

  [out] | OnOff | Pointer to the on/off status (1 = on, 0 = off)
  [out] | Ramping | Pointer to the ramping status (1 = ramping, 0 = not ramping)
  [out] | OvC | Pointer to the overcurrent status (1 = fault, 0 = normal)
  [out] | OvV | Pointer to the overvoltage status (1 = fault, 0 = normal)
  [in] | handle | Handle to the FERS device

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_HV_Get_SerNum()

int FERS_HV_Get_SerNum | ( | int | handle,
|  | int * | sernum
| ) |  |

Get the serial number of the high voltage module.

Parameters

  [out] | sernum | Pointer to the Getd serial number
  [in] | handle | Handle to the FERS device

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_HV_Set_Vbias()

int FERS_HV_Set_Vbias | ( | int | handle,
|  | float | vbias
| ) |  |

Set HV output voltage (bias)

Parameters

  [in] | handle | Handle to the FERS device
  [in] | vbias | Output bias voltage in Volts

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_HV_Get_Vbias()

int FERS_HV_Get_Vbias | ( | int | handle,
|  | float * | vbias
| ) |  |

Get the output bias voltage set.

Parameters

  [out] | vbias | Pointer to the output voltage setting in Volts (read from register)
  [in] | handle | Handle to the FERS device

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_HV_Get_Vmon()

int FERS_HV_Get_Vmon | ( | int | handle,
|  | float * | vmon
| ) |  |

Get HV output voltage (HV read back with internal ADC)

Parameters

  [out] | vmon | Pointer to the monitored voltage in Volts
  [in] | handle | Handle to the FERS device

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_HV_Set_Imax()

int FERS_HV_Set_Imax | ( | int | handle,
|  | float | imax
| ) |  |

Set the maximum output current from the high voltage module.

Parameters

  [in] | handle | Handle to the FERS device
  [in] | imax | Maximum output current in mA

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_HV_Get_Imax()

int FERS_HV_Get_Imax | ( | int | handle,
|  | float * | imax
| ) |  |

Get the maximum allowed current of the high voltage module.

Parameters

  [out] | imax | Pointer to the maximum current
  [in] | handle | Handle to the FERS device

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_HV_Get_Imon()

int FERS_HV_Get_Imon | ( | int | handle,
|  | float * | imon
| ) |  |

Get the output monitored current flowing into the detector.

Parameters

  [out] | imon | Pointer to the output current in mA
  [in] | handle | Handle to the FERS device

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_HV_Get_IntTemp()

int FERS_HV_Get_IntTemp | ( | int | handle,
|  | float * | temp
| ) |  |

Get the internal temperature of the HV module.

Parameters

  [out] | temp | Pointer to the internal temperature in Celsius
  [in] | handle | Handle to the FERS device

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_HV_Get_DetectorTemp()

int FERS_HV_Get_DetectorTemp | ( | int | handle,
|  | float * | temp
| ) |  |

Get external temperature (of the detector). Temp sensor must be connected to dedicated lines.

Parameters

  [out] | temp | Pointer to the detector temperature in Celsius
  [in] | handle | Handle to the FERS device

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_HV_Set_Tsens_Coeff()

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.

Parameters

  [in] | handle | Handle to the FERS device
  [in] | Tsens_coeff | Coefficients array (c0=offset, c1=linear, c2=quadratic)

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes

## ◆ FERS_HV_Set_TempFeedback()

int FERS_HV_Set_TempFeedback | ( | int | handle,
|  | int | enable,
|  | float | Tsens_coeff
| ) |  |

Set coefficient for Vbias temperature feedback.

Parameters

  [in] | handle | Handle to the FERS device
  [in] | enable | 1 to enable, 0 to disable
  [in] | Tsens_coeff | Coefficients for temperature feedback (mV/C)

Returns
  0 on success, or a negative error code as defined in FERSLIB_ErrorCodes