Line data Source code
1 : /**
2 : * @file endpoint.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/EndpointNode.hpp"
10 : #include "timing/HSINode.hpp"
11 :
12 : #include <pybind11/pybind11.h>
13 : #include <pybind11/stl.h>
14 :
15 : namespace py = pybind11;
16 :
17 : namespace dunedaq {
18 : namespace timing {
19 : namespace python {
20 :
21 : void
22 0 : register_endpoint(py::module& m)
23 : {
24 :
25 0 : py::class_<timing::HSINode, uhal::Node>(m, "HSINode")
26 0 : .def(py::init<const uhal::Node&>())
27 0 : .def("get_status", &timing::HSINode::get_status, py::arg("print_out") = false)
28 0 : .def("configure_hsi",
29 0 : &timing::HSINode::configure_hsi,
30 0 : py::arg("src"),
31 0 : py::arg("re_mask"),
32 0 : py::arg("fe_mask"),
33 0 : py::arg("inv_mask"),
34 0 : py::arg("rate"),
35 0 : py::arg("clock_frequency_hz"),
36 0 : py::arg("dispatch") = true)
37 0 : .def("start_hsi", &timing::HSINode::start_hsi, py::arg("dispatch") = true)
38 0 : .def("stop_hsi", &timing::HSINode::stop_hsi, py::arg("dispatch") = true)
39 0 : .def("reset_hsi", &timing::HSINode::reset_hsi, py::arg("dispatch") = true)
40 0 : .def("get_data_buffer_table",
41 0 : &timing::HSINode::get_data_buffer_table,
42 0 : py::arg("read_all") = false,
43 0 : py::arg("print_out") = false)
44 0 : .def("read_buffer_warning", &timing::HSINode::read_buffer_warning)
45 0 : .def("read_buffer_error", &timing::HSINode::read_buffer_error)
46 0 : .def<uhal::ValVector<uint32_t> (timing::HSINode::*)(uint16_t&, bool, bool) const>("read_data_buffer", &timing::HSINode::read_data_buffer);
47 :
48 0 : py::class_<timing::EndpointNode, uhal::Node>(m, "EndpointNode")
49 0 : .def(py::init<const uhal::Node&>())
50 0 : .def("disable", &timing::EndpointNode::disable)
51 0 : .def("enable", &timing::EndpointNode::enable, py::arg("address") = 0, py::arg("partition") = 0)
52 0 : .def("reset", &timing::EndpointNode::reset, py::arg("address") = 0, py::arg("partition") = 0)
53 0 : .def("get_status", &timing::EndpointNode::get_status, py::arg("print_out") = false);
54 0 : }
55 :
56 : } // namespace python
57 : } // namespace timing
58 : } // namespace dunedaq
|