DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
LTC2945Node.hpp
Go to the documentation of this file.
1
11#ifndef TIMING_INCLUDE_TIMING_LTC2945NODE_HPP_
12#define TIMING_INCLUDE_TIMING_LTC2945NODE_HPP_
13
15#include "timing/I2CSlave.hpp"
16
17#include "logging/Logging.hpp" // NOTE: if ISSUES ARE DECLARED BEFORE include logging/Logging.hpp, TLOG_DEBUG<<issue wont work.
18
19#include <map>
20#include <string>
21#include <vector>
22
23namespace dunedaq {
24namespace timing {
25
26class LTC2945Node : public I2CSlave
27{
28public:
29 LTC2945Node(const I2CMasterNode* i2c_master, uint8_t i2c_device_address, double sense_resistance); // NOLINT(build/unsigned)
30 virtual ~LTC2945Node();
31
36 double read_v_in() const;
37
42 double read_delta_sense_v() const;
43
48 double read_power() const;
49
50protected:
52private:
53 static uint16_t combine_adc_data(uint8_t msb_byte, uint8_t lsb_byte);
54 static uint32_t combine_power_data(uint8_t msb_byte_2, uint8_t msb_byte_1, uint8_t lsb_byte);
55
56 constexpr static float v_in_resolution = 0.025;
57 constexpr static float delta_sense_v_resolution = 0.000025;
58};
59
60} // namespace timing
61} // namespace dunedaq
62
63#endif // TIMING_INCLUDE_TIMING_LTC2945NODE_HPP_
static constexpr float delta_sense_v_resolution
static uint32_t combine_power_data(uint8_t msb_byte_2, uint8_t msb_byte_1, uint8_t lsb_byte)
LTC2945Node(const I2CMasterNode *i2c_master, uint8_t i2c_device_address, double sense_resistance)
double read_power() const
Read power [W].
double read_v_in() const
Read V in [V].
static uint16_t combine_adc_data(uint8_t msb_byte, uint8_t lsb_byte)
static constexpr float v_in_resolution
double read_delta_sense_v() const
Read delta sense voltage [V].
The DUNE-DAQ namespace.
Definition DataStore.hpp:57