Orion
high-rate readout
pybind.hpp
Go to the documentation of this file.
1 
5 #pragma once
6 
7 #include <pybind11/pybind11.h>
8 #include <pybind11/stl.h>
9 #include <pybind11/stl_bind.h>
10 #include <pybind11/functional.h>
11 
12 
13 namespace py = pybind11;
14 
15 namespace itk::itkpix::emu {
16 
17 
23 template<typename T>
24 auto pybindEmulator(py::module_& m, const char* name = "Emulator") {
25 
26  return py::class_<T, std::shared_ptr<T>>(m, name)
27  .def(py::init<uint8_t>(), py::arg("chip_id"))
28  .def("reset", &T::reset)
29  .def("send_cmds", [](T &self, std::vector<uint16_t>& cmds) { self.send_cmds(cmds); }, py::arg("cmds"))
30  .def("callback_on_data", &T::callback_on_data, py::arg("on_data"))
31  .def("callback_on_service", &T::callback_on_service, py::arg("on_service"))
32  ; // Emulator
33 }
34 
35 } // itk::itkpix::emu
auto pybindEmulator(py::module_ &m, const char *name="Emulator")
Pybinding template for Emulator.
Definition: pybind.hpp:24