CDT I-BM API 1.0.0
Loading...
Searching...
No Matches
CdtIonBMAPI Class Reference

Class for managing the Ion Beam Monitor API (CdtIonBMAPI). More...

#include <cdtIbmApi.h>

Inheritance diagram for CdtIonBMAPI:
Collaboration diagram for CdtIonBMAPI:

Public Member Functions

 CdtIonBMAPI (RMMAPI *rmmApi, int ring, int node, std::string name, TiaBoardVersion tia_board_version)
 Constructor for the CdtIonBMAPI class.
 
void configFE ()
 Configures the FEN with default values.
 
uint32_t getFirmwareHash ()
 Retrieves the ESS firmware hash.
 
rmmStatus setSamplingPeriod (double sampling)
 Sets the sampling period in microseconds.
 
double getSamplingPeriod ()
 Retrieves the current sampling period.
 
rmmStatus setSumCounterStop (uint32_t value)
 Sets the TIA SERDES sum counter stop value.
 
rmmStatus setADCSummation (uint8_t value)
 Sets the summation over 'n' consecutive ADC samples.
 
uint8_t getADCSummation ()
 Retrieves the summation over 'n' ADC samples.
 
rmmStatus enableEmulateADCData (bool enable)
 Enables or disables emulation of ADC data.
 
rmmStatus setEmulatedADCValue (uint32_t value)
 Sets the emulated ADC value.
 
RMMResult isEmulatedADCDataEnabled ()
 Checks whether ADC data emulation is currently enabled.
 
RMMResult getEmulatedADCValue ()
 Retrieves the current emulated ADC value.
 
RMMResult setADCDataInjection (bool enable, uint32_t value)
 
- Public Member Functions inherited from CdtHv
 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.
 

Additional Inherited Members

- Protected Member Functions inherited from CdtHv
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 inherited from CdtHv
std::atomic< uint32_t > previousDacValue {0}
 
TiaBoardVersion tiaVersion
 
std::string tiaBoardVersionLabel
 

Detailed Description

Class for managing the Ion Beam Monitor API (CdtIonBMAPI).

The CdtIonBMAPI class is responsible for managing the front-end configuration and controlling high-voltage (HV) operations for the I-BM frontend node.

Constructor & Destructor Documentation

◆ CdtIonBMAPI()

CdtIonBMAPI::CdtIonBMAPI ( RMMAPI * rmmApi,
int ring,
int node,
std::string name,
TiaBoardVersion tia_board_version )

Constructor for the CdtIonBMAPI class.

Initializes a new instance of the CdtIonBMAPI class by calling the constructor of the FrontEndBase class to set up the base class parameters and configuration.

Parameters
[in]rmmApiPointer to the RMMAPI instance used for communication and management of the RMM
[in]ringThe ring number.
[in]nodeThe node number.
[in]versionVersion selector for tia board version:
  • 0: Use tia_board_version_3_0
  • 1: Use tia_board_version_3_2
[in]nameThe name to identify the front-end instance.

Member Function Documentation

◆ configFE()

void CdtIonBMAPI::configFE ( )

Configures the FEN with default values.

This function is used to configure the FEN by performing the setup tasks related to the system.

◆ enableEmulateADCData()

rmmStatus CdtIonBMAPI::enableEmulateADCData ( bool enable)

Enables or disables emulation of ADC data.

This method sets bit 31 of the tia_adc_control register to either enable or disable ADC data emulation. A value of true sets the bit to 1 (enabled), while false sets it to 0 (disabled).

Parameters
[in]enableSet to true to enable emulated ADC data; false to disable it.
Returns
rmmStatus indicating success or failure of the operation.

◆ getADCSummation()

uint8_t CdtIonBMAPI::getADCSummation ( )

Retrieves the summation over 'n' ADC samples.

Returns
Summation over 'n' ADC samples value.

◆ getEmulatedADCValue()

RMMResult CdtIonBMAPI::getEmulatedADCValue ( )

Retrieves the current emulated ADC value.

Reads bits 23 downto 0 of the tia_adc_control register to obtain the current emulated ADC value.

Returns
RMMResult containing the 24-bit emulated ADC value and the status of the read operation.

◆ getFirmwareHash()

uint32_t CdtIonBMAPI::getFirmwareHash ( )

Retrieves the ESS firmware hash.

Returns
A uint32_t hash value.

◆ getSamplingPeriod()

double CdtIonBMAPI::getSamplingPeriod ( )

Retrieves the current sampling period.

Reads the TIA SERDES sampling register and converts the value to microseconds.

Returns
The sampling period in microseconds, or -1.0 if the read fails.

◆ isEmulatedADCDataEnabled()

RMMResult CdtIonBMAPI::isEmulatedADCDataEnabled ( )

Checks whether ADC data emulation is currently enabled.

Reads bit 31 of the tia_adc_control field to determine the emulation status. A value of 1 indicates that emulation is enabled, while 0 means it is disabled.

Returns
RMMResult containing the bit value (1 or 0) and the status of the read operation.

◆ setADCSummation()

rmmStatus CdtIonBMAPI::setADCSummation ( uint8_t value)

Sets the summation over 'n' consecutive ADC samples.

The mca_sum_counter_stop field defines how many consecutive 24-bit ADC values are summed together. To avoid overflow, the maximum number of samples that can be safely accumulated is 32.

This method ensures the provided value is within the valid range [1, 32]. A value of 0 is considered invalid and will be rejected. Upon successful validation, the value is written to bits 32 downto 24 of the mca_base register.

Parameters
[in]valueThe number of consecutive samples to sum (must be in [1, 32]).
Returns
rmmStatus indicating success or failure of the operation.

◆ setEmulatedADCValue()

rmmStatus CdtIonBMAPI::setEmulatedADCValue ( uint32_t value)

Sets the emulated ADC value.

Writes the specified 24-bit value into bits 23 downto 0 of the tia_adc_control field. This value is used during ADC data emulation.

Parameters
[in]valueThe 24-bit ADC value to emulate.
Returns
rmmStatus indicating success or failure of the operation.

◆ setSamplingPeriod()

rmmStatus CdtIonBMAPI::setSamplingPeriod ( double sampling)

Sets the sampling period in microseconds.

This method ensures the provided value is within the valid range [1.2us, 132.2us]. Upon successful validation, the us is converted to uint16 value and written to bits 23 downto 8 of the tia_serdes_base register.

Parameters
[in]samplingSampling period in microseconds.
Returns
rmmStatus indicating success or failure.

◆ setSumCounterStop()

rmmStatus CdtIonBMAPI::setSumCounterStop ( uint32_t value)

Sets the TIA SERDES sum counter stop value.

Writes the specified value to bits 32 downto 24 of the tia_serdes_base register.

Parameters
[in]valueThe counter stop value to set.
Returns
rmmStatus indicating success or failure.

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