#include <LTC2945Node.hpp>
|
| LTC2945Node (const I2CMasterNode *i2c_master, uint8_t i2c_device_address, double sense_resistance) |
|
virtual | ~LTC2945Node () |
|
double | read_v_in () const |
| Read V in [V].
|
|
double | read_delta_sense_v () const |
| Read delta sense voltage [V].
|
|
double | read_power () const |
| Read power [W].
|
|
virtual | ~I2CSlave () |
|
uint8_t | get_i2c_address () const |
|
uint8_t | read_i2c (uint32_t i2c_device_address, uint32_t i2c_reg_address) const |
| comodity functions
|
|
uint8_t | read_i2c (uint32_t i2c_reg_address) const |
|
uint8_t | read_i2c_atomic (uint32_t i2c_device_address, uint32_t i2c_reg_address) const |
|
uint8_t | read_i2c_atomic (uint32_t i2c_reg_address) const |
|
void | write_i2c (uint32_t i2c_device_address, uint32_t i2c_reg_address, uint8_t data, bool send_stop=true) const |
|
void | write_i2c (uint32_t i2c_reg_address, uint8_t data, bool send_stop=true) const |
|
std::vector< uint8_t > | read_i2cArray (uint32_t i2c_device_address, uint32_t i2c_reg_address, uint32_t number_of_words) const |
|
std::vector< uint8_t > | read_i2cArray (uint32_t i2c_reg_address, uint32_t number_of_words) const |
|
std::vector< uint8_t > | read_i2cArray_atomic (uint32_t i2c_reg_address, uint32_t number_of_words) const |
|
std::vector< uint8_t > | read_i2cArray_atomic (uint32_t i2c_device_address, uint32_t i2c_reg_address, uint32_t number_of_words) const |
|
void | write_i2cArray (uint32_t i2c_device_address, uint32_t i2c_reg_address, std::vector< uint8_t > data, bool send_stop=true) const |
|
void | write_i2cArray (uint32_t i2c_reg_address, std::vector< uint8_t > data, bool send_stop=true) const |
|
std::vector< uint8_t > | read_i2cPrimitive (uint32_t number_of_bytes) const |
|
void | write_i2cPrimitive (const std::vector< uint8_t > &data, bool send_stop=true) const |
|
bool | ping () const |
|
std::string | get_master_id () const |
|
Definition at line 26 of file LTC2945Node.hpp.
◆ LTC2945Node()
dunedaq::timing::LTC2945Node::LTC2945Node |
( |
const I2CMasterNode * | i2c_master, |
|
|
uint8_t | i2c_device_address, |
|
|
double | sense_resistance ) |
Definition at line 23 of file LTC2945Node.cpp.
26{}
I2CSlave(const I2CMasterNode *i2c_master, uint8_t i2c_device_address)
double m_sense_resistance
◆ ~LTC2945Node()
dunedaq::timing::LTC2945Node::~LTC2945Node |
( |
| ) |
|
|
virtual |
◆ combine_adc_data()
uint16_t dunedaq::timing::LTC2945Node::combine_adc_data |
( |
uint8_t | msb_byte, |
|
|
uint8_t | lsb_byte ) |
|
staticprivate |
Definition at line 116 of file LTC2945Node.cpp.
117{
118 uint16_t adc = (uint16_t)msb_byte << 4;
119 adc = adc | (lsb_byte >> 4);
120 return adc;
121}
◆ combine_power_data()
uint32_t dunedaq::timing::LTC2945Node::combine_power_data |
( |
uint8_t | msb_byte_2, |
|
|
uint8_t | msb_byte_1, |
|
|
uint8_t | lsb_byte ) |
|
staticprivate |
Definition at line 126 of file LTC2945Node.cpp.
127{
128 uint32_t power = (uint32_t)msb_byte_2 << 16;
129 power = power | ((uint16_t)msb_byte_1 << 8);
130 power = power | lsb_byte;
131 return power;
132}
◆ read_delta_sense_v()
double dunedaq::timing::LTC2945Node::read_delta_sense_v |
( |
| ) |
const |
Read delta sense voltage [V].
Definition at line 84 of file LTC2945Node.cpp.
85{
89
90 TLOG_DEBUG(13) <<
"LTC2945 deltaSense V data - "
91 << "raw bytes: 0x" << std::hex << (uint)v_bytes[0] << ", 0x" << (uint)v_bytes[1]
92 << ", combined word: 0x" << v_raw
93 <<
", detlaSense V [mV]: " <<
v*1000;
95}
std::vector< uint8_t > read_i2cArray_atomic(uint32_t i2c_reg_address, uint32_t number_of_words) const
static constexpr float delta_sense_v_resolution
static uint16_t combine_adc_data(uint8_t msb_byte, uint8_t lsb_byte)
#define TLOG_DEBUG(lvl,...)
◆ read_power()
double dunedaq::timing::LTC2945Node::read_power |
( |
| ) |
const |
Read power [W].
Definition at line 100 of file LTC2945Node.cpp.
101{
103 uint32_t power_raw =
combine_power_data(power_bytes[0], power_bytes[1], power_bytes[2]);
105
107 << "raw bytes: 0x" << std::hex << (uint)power_bytes[0] << ", 0x" << (uint)power_bytes[1] << ", 0x" << (uint)power_bytes[2]
108 << ", combined word: 0x" << power_raw
109 << ", power [mW]: " << power*1000;
110 return power;
111}
static uint32_t combine_power_data(uint8_t msb_byte_2, uint8_t msb_byte_1, uint8_t lsb_byte)
static constexpr float v_in_resolution
◆ read_v_in()
double dunedaq::timing::LTC2945Node::read_v_in |
( |
| ) |
const |
Read V in [V].
Definition at line 68 of file LTC2945Node.cpp.
69{
73
75 << "raw bytes: 0x" << std::hex << (uint)v_in_bytes[0] << ", 0x" << (uint)v_in_bytes[1]
76 << ", combined word: 0x" << v_in_raw
77 << ", Vin [V]: " << v_in;
78 return v_in;
79}
◆ delta_sense_v_resolution
float dunedaq::timing::LTC2945Node::delta_sense_v_resolution = 0.000025 |
|
staticconstexprprivate |
◆ m_sense_resistance
double dunedaq::timing::LTC2945Node::m_sense_resistance |
|
protected |
◆ v_in_resolution
float dunedaq::timing::LTC2945Node::v_in_resolution = 0.025 |
|
staticconstexprprivate |
The documentation for this class was generated from the following files: