DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
HSIFrame.hpp
Go to the documentation of this file.
1
10
11#ifndef DETDATAFORMATS_INCLUDE_DETDATAFORMATS_HSIFRAME_HPP_
12#define DETDATAFORMATS_INCLUDE_DETDATAFORMATS_HSIFRAME_HPP_
13
14#include <cstdint> // For uint32_t etc
15#include <limits>
16
18
20{
21public:
22 // The definition of the format is in terms of 32-bit words
23 using word_t = uint32_t; // NOLINT
24
25 word_t version : 6, detector_id : 6, crate : 10, slot : 4, link : 6;
26 word_t timestamp_low{ std::numeric_limits<word_t>::max() };
27 word_t timestamp_high{ std::numeric_limits<word_t>::max() };
28 word_t input_low{ std::numeric_limits<word_t>::max() };
29 word_t input_high{ std::numeric_limits<word_t>::max() };
30 word_t trigger{ std::numeric_limits<word_t>::max() };
31 word_t sequence{ std::numeric_limits<word_t>::max() };
32
33 uint64_t get_timestamp() const // NOLINT(build/unsigned)
34 {
35 return static_cast<uint64_t>(timestamp_low) | // NOLINT(build/unsigned)
36 (static_cast<uint64_t>(timestamp_high) << 32); // NOLINT(build/unsigned)
37 }
38
39 void set_timestamp(uint64_t ts) // NOLINT(build/unsigned)
40 {
41 timestamp_low = ts;
42 timestamp_high = ts >> 32;
43 }
44};
45
46} // namespace dunedaq::detdataformats
47
48#include "detail/HSIFrame.hxx"
49
50#endif // DETDATAFORMATS_INCLUDE_DETDATAFORMATS_HSIFRAME_HPP_
void set_timestamp(uint64_t ts)
Definition HSIFrame.hpp:39