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 <string>
14#include <vector>
15
17
18// @brief A bool
19using BoolData = bool;
20
21// @brief A double
22using DoubleData = double;
23
24// @brief An int
25using IntData = int32_t;
26
27// @brief A PLL register bit(s) value
28using UintData = uint32_t; // NOLINT
29
30// @brief Endpoint location data
32{
33
34 // @brief Fanout slot of the endpoint
36
37 // @brief SFP slot of the endpoint
39
40 // @brief Address of the endpoint
42};
43
44// @brief Structure for payload of hsi configure commands
46{
47
48 // @brief Rising edge mask for HSI triggering
50
51 // @brief Falling edge mask for HSI triggering
53
54 // @brief Invert edge mask for HSI triggering
56
57 // @brief Source of data for HSI triggering
59
60 // @brief Source of data for HSI triggering in emulation (bit 0)
62};
63
64// @brief Name of a target instance of a kind
65using String = std::string;
66
67// @brief Structure for io reset commands
69{
70
71 // @brief Path of clock config file
73
74 // @brief Soft reset
75 BoolData soft = false;
76
77 // @brief Clock source, 0 for PLL input 0, 1 for in 1, etc.. 255 for free run mode
79};
80
81// @brief Structure for io reset commands
83{
84
85 // @brief Timestamp source, 0 for upstream, 1 for software, 2 for mixed
87};
88
89// @brief Structure for payload of endpoint commands
91{
92
93 // @brief ID of target endpoint
95};
96
97// @brief Structure for payload of endpoint configure commands
99{
100
101 // @brief ID of target endpoint
103
104 // @brief Endpoint address
106
107 // @brief Endpoint partition
109};
110
111// @brief A vector of endpoint locations
112using TimingEndpointLocations = std::vector<dunedaq::timinglibs::timingcmd::EndpointLocation>;
113
114// @brief The timing hw cmd name. FIXME: this should be an enum!
115using TimingHwCmdId = std::string;
116
117// @brief Generic structure for timing hw cmd payloads
118using TimingHwCmdPayload = nlohmann::json;
119
120// @brief Timing hw cmd structure
122{
123
124 // @brief ID of hw cmd
126
127 // @brief Cmd target
129
130 // @brief Hw cmd payload
132};
133
134// @brief Structure for payloads of endpoint scan configure commands
136{
137
138 // @brief List of target endpoint
140};
141
142// @brief Structure for payload of endpoint configure commands
144{
145
146 // @brief ID of target endpoint
148
149 // @brief Channel on which to send command
151
152 // @brief How many commands to send
154};
155
156// @brief Structure for payload of timing master set endpoint delay command
158{
159
160 // @brief Endpoint address
162
163 // @brief Endpoint coarse delay
165
166 // @brief Endpoint fine delay
168
169 // @brief Endpoint phase delay
171
172 // @brief Measure round trip time after delay setting
174
175 // @brief Control SFP or not
177
178 // @brief Mux to endpoint (or not)
180};
181
182// @brief Structure for payload of partition commands
184{
185
186 // @brief ID of target partition
188};
189
190// @brief Structure for payload of partition configure commands
192{
193
194 // @brief ID of target partition
196
197 // @brief Trigger mask for fixed length cmd distribution
199
200 // @brief Spill interface on
202
203 // @brief Rate control on
205};
206
207} // namespace dunedaq::timinglibs::timingcmd
208
209#endif // DUNEDAQ_TIMINGLIBS_TIMINGCMD_STRUCTS_HPP
std::vector< dunedaq::timinglibs::timingcmd::EndpointLocation > TimingEndpointLocations
Definition Structs.hpp:112
nlohmann::json TimingHwCmdPayload
Definition Structs.hpp:118
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