DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
hsi.cpp
Go to the documentation of this file.
1
9
10#include <pybind11/pybind11.h>
11#include <pybind11/stl.h>
12
13namespace py = pybind11;
14
16
17void
18register_hsi(py::module& m)
19{
20
21 py::class_<HSIFrame> (m, "HSIFrame", py::buffer_protocol())
22 .def(py::init())
23 .def(py::init([](py::capsule capsule) {
24 auto hsfp = *static_cast<HSIFrame*>(capsule.get_pointer());
25 return hsfp;
26 } ))
27 .def(py::init([](py::bytes bytes){
28 py::buffer_info info(py::buffer(bytes).request());
29 auto wfp = *static_cast<HSIFrame*>(info.ptr);
30 return wfp;
31 }))
32 .def("get_timestamp", &HSIFrame::get_timestamp)
33 .def_property_readonly("version", [](const HSIFrame& self) -> uint64_t {return self.version;})
34 .def_property_readonly("detector_id", [](const HSIFrame& self) -> uint64_t {return self.detector_id;})
35 .def_property_readonly("crate", [](const HSIFrame& self) -> uint64_t {return self.crate;})
36 .def_property_readonly("slot", [](const HSIFrame& self) -> uint64_t {return self.slot;})
37 .def_property_readonly("link", [](const HSIFrame& self) -> uint64_t {return self.link;})
38 .def_property_readonly("input_low", [](const HSIFrame& self) -> uint64_t {return self.input_low;})
39 .def_property_readonly("input_high", [](const HSIFrame& self) -> uint64_t {return self.input_high;})
40 .def_property_readonly("trigger", [](const HSIFrame& self) -> uint64_t {return self.trigger;})
41 .def_property_readonly("sequence", [](const HSIFrame& self) -> uint64_t {return self.sequence;})
42 .def_static("sizeof", [](){ return sizeof(HSIFrame); })
43 ;
44}
45
46} // namespace dunedaq::detdataformats::python
void register_hsi(py::module &m)
Definition hsi.cpp:18