Line data Source code
1 : /**
2 : * @file MasterNodeInterface.cpp
3 : *
4 : * This is part of the DUNE DAQ Software Suite, copyright 2020.
5 : * Licensing/copyright details are in the COPYING file that you should have
6 : * received with this code.
7 : */
8 :
9 : #include "timing/MasterNodeInterface.hpp"
10 :
11 : #include <string>
12 :
13 : namespace dunedaq {
14 : namespace timing {
15 :
16 : //-----------------------------------------------------------------------------
17 0 : MasterNodeInterface::MasterNodeInterface(const uhal::Node& node)
18 0 : : TimingNode(node)
19 0 : {}
20 : //-----------------------------------------------------------------------------
21 :
22 : //-----------------------------------------------------------------------------
23 0 : MasterNodeInterface::~MasterNodeInterface() {}
24 : //-----------------------------------------------------------------------------
25 :
26 : //-----------------------------------------------------------------------------
27 : void
28 0 : MasterNodeInterface::apply_endpoint_delay(const ActiveEndpointConfig& ept_config, bool measure_rtt) const
29 : {
30 0 : std::string lEptIdD = ept_config.id;
31 0 : uint32_t ept_address = ept_config.adr; // NOLINT(build/unsigned)
32 0 : uint32_t coarse_Delay = ept_config.cdelay; // NOLINT(build/unsigned)
33 0 : uint32_t fine_delay = ept_config.fdelay; // NOLINT(build/unsigned)
34 0 : uint32_t phase_delay = ept_config.pdelay; // NOLINT(build/unsigned)
35 0 : apply_endpoint_delay(ept_address, coarse_Delay, fine_delay, phase_delay, measure_rtt);
36 0 : }
37 : //-----------------------------------------------------------------------------
38 :
39 : //-----------------------------------------------------------------------------
40 : void
41 0 : MasterNodeInterface::enable_periodic_fl_cmd(uint32_t channel, double rate, bool poisson, uint32_t clock_frequency_hz) const // NOLINT(build/unsigned)
42 : {
43 0 : enable_periodic_fl_cmd(0x8+channel, channel, rate, poisson, clock_frequency_hz);
44 0 : }
45 : //-----------------------------------------------------------------------------
46 :
47 : //-----------------------------------------------------------------------------
48 : void
49 0 : MasterNodeInterface::enable_periodic_fl_cmd(uint32_t command, uint32_t channel, double rate, bool poisson, uint32_t clock_frequency_hz) const // NOLINT(build/unsigned)
50 : {
51 :
52 0 : getNode<FLCmdGeneratorNode>("scmd_gen").enable_periodic_fl_cmd(command, channel, rate, poisson, clock_frequency_hz);
53 0 : }
54 : //-----------------------------------------------------------------------------
55 :
56 : //-----------------------------------------------------------------------------
57 : void
58 0 : MasterNodeInterface::disable_periodic_fl_cmd(uint32_t channel) const // NOLINT(build/unsigned)
59 : {
60 0 : getNode<FLCmdGeneratorNode>("scmd_gen").disable_fake_trigger(channel);
61 0 : }
62 : //------------------------------------------------------------------------------
63 :
64 : } // namespace timing
65 : } // namespace dunedaq
|