DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
I2CSFPNode.hpp
Go to the documentation of this file.
1
12#ifndef TIMING_INCLUDE_TIMING_I2CSFPNODE_HPP_
13#define TIMING_INCLUDE_TIMING_I2CSFPNODE_HPP_
14
15#include "TimingIssues.hpp"
17#include "timing/I2CSlave.hpp"
18#include "timing/toolbox.hpp"
19
20#include "ers/Issue.hpp"
21
22#include <map>
23#include <string>
24#include <utility>
25#include <vector>
26
27namespace dunedaq {
28namespace timing {
29
37class I2CSFPSlave : public I2CSlave
38{
39
40public:
41 I2CSFPSlave(const I2CMasterNode* i2c_master, uint8_t i2c_device_address); // NOLINT(build/unsigned)
42 virtual ~I2CSFPSlave();
43
48 void sfp_reachable() const;
49
54 void ddm_available() const;
55
60 std::pair<double, double> read_calibration_parameter_pair(
61 uint32_t calib_parameter_id) const; // NOLINT(build/unsigned)
62
67 double read_temperature_raw() const;
68
73 double read_temperature() const;
74
79 double read_voltage_raw() const;
80
85 double read_voltage() const;
86
91 double read_rx_power_raw() const;
92
97 double read_rx_ower() const;
98
103 double read_tx_power_raw() const;
104
109 double read_tx_power() const;
110
115 double read_current_raw() const;
116
121 double read_current() const;
122
127 std::string read_vendor_name() const;
128
133 std::string read_vendor_part_number() const;
134
139 std::string read_serial_number() const;
140
145 bool read_ddm_support_bit() const;
146
152
157 bool read_soft_tx_control_state() const;
158
163 bool read_tx_disable_pin_state() const;
164
170 bool read_i2c_reg_addressSwapBit() const;
171
176 void switch_soft_tx_control_bit(bool turn_on) const;
177
181 std::string get_status(bool print_out = false) const;
182
183 // /**
184 // * @brief Get and fill SFP hardware data
185 // */
186 // void get_info(timinghardwareinfo::TimingSFPMonitorData& mon_data) const;
187
188
189protected:
190 const std::vector<uint32_t> m_calibration_parameter_start_addresses; // NOLINT(build/unsigned)
191};
192
202 : public I2CMasterNode
203 , public I2CSFPSlave
204{
205 UHAL_DERIVEDNODE(I2CSFPNode)
206public:
207 explicit I2CSFPNode(const uhal::Node& node);
208 I2CSFPNode(const I2CSFPNode& node);
209 virtual ~I2CSFPNode();
210};
211
212} // namespace timing
213} // namespace dunedaq
214
215#endif // TIMING_INCLUDE_TIMING_I2CSFPNODE_HPP_
I2CSFPNode(const uhal::Node &node)
I2C slave class to control SFP transceivers.
double read_temperature_raw() const
Read the raw SFP temperature.
double read_rx_power_raw() const
Read the raw SFP temperature.
double read_tx_power_raw() const
Read the raw SFP tx power.
I2CSFPSlave(const I2CMasterNode *i2c_master, uint8_t i2c_device_address)
std::string read_serial_number() const
Read the SFP serial number.
bool read_tx_disable_pin_state() const
Read the state of the tx disable control pin.
void sfp_reachable() const
Check if SFP responds.
std::string read_vendor_part_number() const
Read the vendor name.
bool read_ddm_support_bit() const
Find out if SFP supports DDM.
void switch_soft_tx_control_bit(bool turn_on) const
Switch on or off the SFP tx laser via the soft control bit.
double read_rx_ower() const
Read the raw SFP temperature.
double read_temperature() const
Read the calibrated SFP temperature.
bool read_soft_tx_control_support_bit() const
Find out if SFP supports soft tx laser disable.
std::string get_status(bool print_out=false) const
Get SFP status.
bool read_i2c_reg_addressSwapBit() const
Read whether the SFP has seperate I2C addresses, or if a special I2C address swap is required....
double read_voltage_raw() const
Read the raw SFP voltage.
const std::vector< uint32_t > m_calibration_parameter_start_addresses
Get and fill SFP hardware data.
double read_current_raw() const
Read the raw SFP current.
void ddm_available() const
Check if DDM is supported.
std::string read_vendor_name() const
Read the vendor name.
std::pair< double, double > read_calibration_parameter_pair(uint32_t calib_parameter_id) const
Read the raw SFP temperature.
double read_tx_power() const
Read the calibrated SFP tx power.
bool read_soft_tx_control_state() const
Read the value of the soft tx disable control bit.
double read_voltage() const
Read the calibrated SFP voltage.
double read_current() const
Read the calibrated SFP current.
Including Qt Headers.