DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
SI534xNode.hpp
Go to the documentation of this file.
1
12#ifndef TIMING_INCLUDE_TIMING_SI534XNODE_HPP_
13#define TIMING_INCLUDE_TIMING_SI534XNODE_HPP_
14
18
21
22#include "ers/Issue.hpp"
23#include "logging/Logging.hpp" // NOTE: if ISSUES ARE DECLARED BEFORE include logging/Logging.hpp, TLOG_DEBUG<<issue wont work.
24
25#include <map>
26#include <string>
27#include <vector>
28#include <boost/tuple/tuple.hpp>
29
30namespace dunedaq {
32 SI534xConfigError,
33 " SI534xConfigError: " << message,
34 ((std::string)message)
35)
38 " Missing configuration section: " << tag,
39 ((std::string)tag)
40)
42 SI534xRegWriteFailed,
43 " Failed to write Si53xx reg: " << reg << "with data: " << data,
44 ((std::string)reg)((std::string)data)
45)
48 "Retry " << attempt << " for reg " << reg,
49 ((std::string)attempt)((std::string)reg)
50)
51namespace timing {
52
60class SI534xSlave : public SIChipSlave //TODO clockgeninterface
61{
62public:
63 SI534xSlave(const I2CMasterNode* i2c_master, uint8_t i2c_device_address); // NOLINT(build/unsigned)
64 virtual ~SI534xSlave();
65
66 void configure(const std::string& filename) const;
67
68 std::map<uint16_t, uint8_t> registers() const; // NOLINT(build/unsigned)
69
70 std::string read_config_id() const;
71
72 void get_info(timinghardwareinfo::TimingPLLMonitorData& mon_data) const;
73
77 std::string get_status(bool print_out=false) const;
78
79private:
80 typedef boost::tuple<uint16_t, uint8_t> RegisterSetting_t; // NOLINT(build/unsigned)
81
82 std::string seek_header(std::ifstream& file) const;
83 std::vector<RegisterSetting_t> read_config_section(std::ifstream& file, std::string tag) const;
84
85 void upload_config(const std::vector<SI534xSlave::RegisterSetting_t>& config) const;
86};
87
96class SI534xNode
97 : public I2CMasterNode
98 , public SI534xSlave
99{
100 UHAL_DERIVEDNODE(SI534xNode)
101public:
102 explicit SI534xNode(const uhal::Node& node);
103 SI534xNode(const SI534xNode& node);
104 virtual ~SI534xNode();
105};
106
107} // namespace timing
108} // namespace dunedaq
109
110#endif // TIMING_INCLUDE_TIMING_SI534XNODE_HPP_
#define ERS_DECLARE_ISSUE(namespace_name, class_name, message, attributes)
OpenCode I2C interface to a ipbus node.
Including Qt Headers.
SI534xMissingConfigSectionError
< Namespace
Missing configuration std::string tag SI534xRegWriteRetry
< Namespace