CDT I-BM API 1.0.0
Loading...
Searching...
No Matches
CdtHv Class Reference
Inheritance diagram for CdtHv:
Collaboration diagram for CdtHv:

Public Member Functions

 CdtHv (std::string name, TiaBoardVersion tia_board_version)
 
TiaBoardVersion getTiaBoardVersion () const
 
const std::string & getTiaBoardVersionLabel () const
 
void setHvTimeout (uint32_t val)
 
uint32_t getHvTimeout ()
 
bool isHVRampRunning () const
 Checks if the high-voltage (HV) ramp process is currently running.
 
void requestHVStop ()
 Requests to stop ongoing operations.
 
void resetHVStop ()
 Resets the stop request flag, allowing operations to continue.
 
double readHV (rmmStatus *status=NULL)
 Reads the measured voltage from the HV chip via I2C.
 
void writeHV (const double voltage, const double voltagePerSec)
 Writes a voltage value to the HV chip, ensuring proper enabling and smooth ramping.
 
bool isStopHVRequested () const
 Checks if a stop request has been issued.
 
- Public Member Functions inherited from CdtBaseBMAPI
 CdtBaseBMAPI (RMMAPI *rmmApi, int ring, int node, std::string name, FENRegMap additional_reg_map)
 Constructor for the CdtBm class.
 
void configAcquireTime (uint64_t cycles)
 Sets the acquisition time. Executed inside configFE right before starting the acquisition.
 
void measurementEnable (bool enable)
 Enables or disables the measurement process.
 
bool isMeasRunning ()
 Checks if the measurement is currently running.
 

Protected Member Functions

uint32_t calcDacForVoltage (const double voltage)
 Calculates the DAC value for a given voltage.
 
void jumpToVoltage (const double voltage)
 Jumps to a specific high voltage value.
 
bool isI2cRequestDone ()
 Checks if an I2C request has completed.
 
rmmStatus runI2cRequest (I2cRequestAction action, uint32_t dac_value=0xFF)
 Executes an I2C read or write request to the HV module.
 

Protected Attributes

std::atomic< uint32_t > previousDacValue {0}
 
TiaBoardVersion tiaVersion
 
std::string tiaBoardVersionLabel
 

Member Function Documentation

◆ calcDacForVoltage()

uint32_t CdtHv::calcDacForVoltage ( const double voltage)
protected

Calculates the DAC value for a given voltage.

Parameters
[in]voltageThe target voltage.
Returns
The DAC value corresponding to the voltage.

◆ getHvTimeout()

uint32_t CdtHv::getHvTimeout ( )

Gets the timeout in milliseconds used by CdtBm::runI2cRequest(). Default value is 1000 milliseconds.

Returns
timeout in milliseconds.

◆ isHVRampRunning()

bool CdtHv::isHVRampRunning ( ) const

Checks if the high-voltage (HV) ramp process is currently running.

Returns
True if the HV ramp process is running, false otherwise.

◆ isI2cRequestDone()

bool CdtHv::isI2cRequestDone ( )
protected

Checks if an I2C request has completed.

Returns
True if the I2C request is complete, false otherwise.

◆ isStopHVRequested()

bool CdtHv::isStopHVRequested ( ) const

Checks if a stop request has been issued.

Returns
True if a stop request has been issued, false otherwise.

◆ jumpToVoltage()

void CdtHv::jumpToVoltage ( const double voltage)
protected

Jumps to a specific high voltage value.

Converts the given voltage into the appropriate DAC value and sends an I2C request to update the HV chip.

Parameters
[in]voltageThe desired voltage to set.

◆ readHV()

double CdtHv::readHV ( rmmStatus * status = NULL)

Reads the measured voltage from the HV chip via I2C.

This method initiates an I2C request to read the measured voltage from the HV chip. It continuously checks the status register until the request is complete. The response is then processed to extract the voltage value.

Returns
The measured voltage in volts.

◆ runI2cRequest()

rmmStatus CdtHv::runI2cRequest ( I2cRequestAction action,
uint32_t dac_value = 0xFF )
protected

Executes an I2C read or write request to the HV module.

Writes an I2c request command and waits until the operation completes or a timeout occurs.

Parameters
[in]actionThe I2C request type (READ or WRITE).
[in]dac_valueDAC value used only for WRITE requests.
Returns
rmmSuccess on success, rmmError on failure or timeout.

◆ setHvTimeout()

void CdtHv::setHvTimeout ( uint32_t val)

Sets the timeout in milliseconds used by CdtBm::runI2cRequest(). Default value is 1000 milliseconds.

Parameters
valvalue to set.

◆ writeHV()

void CdtHv::writeHV ( const double voltage,
const double voltagePerSec )

Writes a voltage value to the HV chip, ensuring proper enabling and smooth ramping.

This method first determines whether the HV should be enabled or disabled based on the desired voltage. If the voltage is below 10V, the HV is disabled. Otherwise, the method ensures a smooth transition by checking the control register and writing the necessary values to safely apply the voltage.

Parameters
[in]voltageThe target voltage to set.
[in]voltagePerSecThe rate at which voltage should change (volts per second).

The documentation for this class was generated from the following files: