diff options
author | Josh Morman <mormjb@gmail.com> | 2020-04-23 08:57:13 -0400 |
---|---|---|
committer | Josh Morman <mormjb@gmail.com> | 2020-06-04 10:05:47 -0400 |
commit | ac45d95b4ee421b1e1a76ba199a490a603c15c6b (patch) | |
tree | 5ae672e16f30c63c5b27ddbcdc085eb0fa8b5926 /gr-fec/python/fec/bindings/tpc_common_python.cc | |
parent | a49a9cced34393f3f755f58797c970c171087fa5 (diff) |
fec: add pybind11 bindings
Diffstat (limited to 'gr-fec/python/fec/bindings/tpc_common_python.cc')
-rw-r--r-- | gr-fec/python/fec/bindings/tpc_common_python.cc | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/gr-fec/python/fec/bindings/tpc_common_python.cc b/gr-fec/python/fec/bindings/tpc_common_python.cc new file mode 100644 index 0000000000..112c5803b5 --- /dev/null +++ b/gr-fec/python/fec/bindings/tpc_common_python.cc @@ -0,0 +1,77 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/* This file is automatically generated using bindtool */ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/fec/tpc_common.h> +// pydoc.h is automatically generated in the build directory +#include <tpc_common_pydoc.h> + +void bind_tpc_common(py::module& m) +{ + + using tpc_common = ::gr::fec::tpc_common; + + + py::class_<tpc_common, std::shared_ptr<tpc_common>>(m, "tpc_common", D(tpc_common)) + + .def_static("parity_counter", + &tpc_common::parity_counter, + py::arg("symbol"), + py::arg("length"), + D(tpc_common, parity_counter)) + + + .def_static("rsc_enc_bit", + &tpc_common::rsc_enc_bit, + py::arg("input"), + py::arg("state_in"), + py::arg("g"), + py::arg("KK"), + py::arg("nn"), + py::arg("output"), + py::arg("nextStates"), + D(tpc_common, rsc_enc_bit)) + + + .def_static("precomputeStateTransitionMatrix_RSCPoly", + &tpc_common::precomputeStateTransitionMatrix_RSCPoly, + py::arg("numStates"), + py::arg("g"), + py::arg("KK"), + py::arg("nn"), + py::arg("output"), + py::arg("nextStates"), + D(tpc_common, precomputeStateTransitionMatrix_RSCPoly)) + + + .def_static("rsc_tail", + &tpc_common::rsc_tail, + py::arg("tail_p"), + py::arg("g"), + py::arg("max_states"), + py::arg("mm"), + D(tpc_common, rsc_tail)) + + + .def_static("itob", + &tpc_common::itob, + py::arg("binVec"), + py::arg("symbol"), + py::arg("length"), + D(tpc_common, itob)) + + ; +} |