DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
I2C9546SwitchNode.hpp
Go to the documentation of this file.
1
12#ifndef TIMING_INCLUDE_TIMING_I2C9546SWITCHNODE_HPP_
13#define TIMING_INCLUDE_TIMING_I2C9546SWITCHNODE_HPP_
14
16#include "timing/I2CSlave.hpp"
17
18#include "logging/Logging.hpp" // NOTE: if ISSUES ARE DECLARED BEFORE include logging/Logging.hpp, TLOG_DEBUG<<issue wont work.
19
20#include <map>
21#include <string>
22#include <vector>
23
24namespace dunedaq {
25ERS_DECLARE_ISSUE(timing, I2C9546SwitchSlaveChannelError, " Invalid channel: " << channel, ((std::string)channel))
26
27namespace timing {
28
36class I2C9546SwitchSlave : public I2CSlave
37{
38public:
39 I2C9546SwitchSlave(const I2CMasterNode* i2c_master, uint8_t i2c_device_address); // NOLINT(build/unsigned)
40 virtual ~I2C9546SwitchSlave();
41
47 void enable_channel(uint8_t channel) const; // NOLINT(build/unsigned)
48
54 void disable_channel(uint8_t channel) const; // NOLINT(build/unsigned)
55
61 uint8_t read_channels_states() const; // NOLINT(build/unsigned)
62
68 void set_channels_states(uint8_t channels) const; // NOLINT(build/unsigned)
69
70private:
71 void ensure_valid_channel(uint8_t channel) const; // NOLINT(build/unsigned)
72
73};
74
75} // namespace timing
76} // namespace dunedaq
77
78#endif // TIMING_INCLUDE_TIMING_I2C9546SWITCHNODE_HPP_
#define ERS_DECLARE_ISSUE(namespace_name, class_name, message, attributes)
OpenCode I2C interface to a ipbus node.
Class to provide OpenCode I2C interface to a ipbus node.
Including Qt Headers.