DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
Structs.hpp
Go to the documentation of this file.
1/*
2 * This file is 100% generated. Any manual edits will likely be lost.
3 *
4 * This contains struct and other type definitions for shema in
5 * namespace dunedaq::timinglibs::timingcmd.
6 */
7#ifndef DUNEDAQ_TIMINGLIBS_TIMINGCMD_STRUCTS_HPP
8#define DUNEDAQ_TIMINGLIBS_TIMINGCMD_STRUCTS_HPP
9
10#include <cstdint>
11
12#include <nlohmann/json.hpp>
13#include <vector>
14#include <string>
15
17
18 // @brief A bool
19 using BoolData = bool;
20
21 // @brief A double
22 using DoubleData = double;
23
24
25 // @brief An int
26 using IntData = int32_t;
27
28
29 // @brief A PLL register bit(s) value
30 using UintData = uint32_t; // NOLINT
31
32
33 // @brief Endpoint location data
35 {
36
37 // @brief Fanout slot of the endpoint
38 IntData fanout_slot = 0;
39
40 // @brief SFP slot of the endpoint
41 IntData sfp_slot = 0;
42
43 // @brief Address of the endpoint
45 };
46
47 // @brief Structure for payload of hsi configure commands
49 {
50
51 // @brief Rising edge mask for HSI triggering
53
54 // @brief Falling edge mask for HSI triggering
56
57 // @brief Invert edge mask for HSI triggering
59
60 // @brief Source of data for HSI triggering
62
63 // @brief Source of data for HSI triggering in emulation (bit 0)
65 };
66
67 // @brief Name of a target instance of a kind
68 using String = std::string;
69
70 // @brief Structure for io reset commands
72 {
73
74 // @brief Path of clock config file
76
77 // @brief Soft reset
78 BoolData soft = false;
79
80 // @brief Clock source, 0 for PLL input 0, 1 for in 1, etc.. 255 for free run mode
82 };
83
84 // @brief Structure for io reset commands
86 {
87
88 // @brief Timestamp source, 0 for upstream, 1 for software, 2 for mixed
90 };
91
92 // @brief Structure for payload of endpoint commands
94 {
95
96 // @brief ID of target endpoint
98 };
99
100 // @brief Structure for payload of endpoint configure commands
102 {
103
104 // @brief ID of target endpoint
106
107 // @brief Endpoint address
109
110 // @brief Endpoint partition
112 };
113
114 // @brief A vector of endpoint locations
115 using TimingEndpointLocations = std::vector<dunedaq::timinglibs::timingcmd::EndpointLocation>;
116
117 // @brief The timing hw cmd name. FIXME: this should be an enum!
118 using TimingHwCmdId = std::string;
119
120 // @brief Generic structure for timing hw cmd payloads
121 using TimingHwCmdPayload = nlohmann::json;
122
123 // @brief Timing hw cmd structure
125 {
126
127 // @brief ID of hw cmd
129
130 // @brief Cmd target
132
133 // @brief Hw cmd payload
135 };
136
137 // @brief Structure for payloads of endpoint scan configure commands
139 {
140
141 // @brief List of target endpoint
143 };
144
145 // @brief Structure for payload of endpoint configure commands
147 {
148
149 // @brief ID of target endpoint
151
152 // @brief Channel on which to send command
154
155 // @brief How many commands to send
157 };
158
159 // @brief Structure for payload of timing master set endpoint delay command
161 {
162
163 // @brief Endpoint address
165
166 // @brief Endpoint coarse delay
168
169 // @brief Endpoint fine delay
171
172 // @brief Endpoint phase delay
174
175 // @brief Measure round trip time after delay setting
176 BoolData measure_rtt = false;
177
178 // @brief Control SFP or not
179 BoolData control_sfp = false;
180
181 // @brief Mux to endpoint (or not)
182 IntData sfp_mux = 0;
183 };
184
185 // @brief Structure for payload of partition commands
187 {
188
189 // @brief ID of target partition
191 };
192
193 // @brief Structure for payload of partition configure commands
195 {
196
197 // @brief ID of target partition
199
200 // @brief Trigger mask for fixed length cmd distribution
202
203 // @brief Spill interface on
204 BoolData spill_gate_enabled = false;
205
206 // @brief Rate control on
207 BoolData rate_control_enabled = false;
208 };
209
210} // namespace dunedaq::timinglibs::timingcmd
211
212#endif // DUNEDAQ_TIMINGLIBS_TIMINGCMD_STRUCTS_HPP
std::vector< dunedaq::timinglibs::timingcmd::EndpointLocation > TimingEndpointLocations
Definition Structs.hpp:115
nlohmann::json TimingHwCmdPayload
Definition Structs.hpp:121
Unknown serialization type<< t,((char) t)) template< typename T > inline std::string datatype_to_string() { return "Unknown";} namespace serialization { template< typename T > struct is_serializable :std::false_type {};enum SerializationType { kMsgPack };inline SerializationType from_string(const std::string s) { if(s=="msgpack") return kMsgPack;throw UnknownSerializationTypeString(ERS_HERE, s);} constexpr uint8_t serialization_type_byte(SerializationType stype) { switch(stype) { case kMsgPack:return 'M';default:throw UnknownSerializationTypeEnum(ERS_HERE);} } constexpr SerializationType DEFAULT_SERIALIZATION_TYPE=kMsgPack;template< class T > std::vector< uint8_t > serialize(const T &obj, SerializationType stype=DEFAULT_SERIALIZATION_TYPE) { switch(stype) { case kMsgPack:{ msgpack::sbuffer buf;msgpack::pack(buf, obj);std::vector< uint8_t > ret(buf.size()+1);ret[0]=serialization_type_byte(stype);std::copy(buf.data(), buf.data()+buf.size(), ret.begin()+1);return ret;} default:throw UnknownSerializationTypeEnum(ERS_HERE);} } template< class T, typename CharType=unsigned char > T deserialize(const std::vector< CharType > &v) { switch(v[0]) { case serialization_type_byte(kMsgPack):{ try { msgpack::object_handle oh=msgpack::unpack(const_cast< char * >(reinterpret_cast< const char * >(v.data()+1)), v.size() - 1,[](msgpack::type::object_type, std::size_t, void *) -> bool