From 1a4d7e1489721c0cbcfe4174b43562c77938aaaa Mon Sep 17 00:00:00 2001 From: Lane Kolbly Date: Mon, 25 Oct 2021 15:54:43 -0500 Subject: host: python: Add gpio_voltage python API --- host/lib/rfnoc/rfnoc_python.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'host') diff --git a/host/lib/rfnoc/rfnoc_python.hpp b/host/lib/rfnoc/rfnoc_python.hpp index f19ce8fa7..09bd98c0a 100644 --- a/host/lib/rfnoc/rfnoc_python.hpp +++ b/host/lib/rfnoc/rfnoc_python.hpp @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include #include #include @@ -223,6 +225,13 @@ void export_rfnoc(py::module& m) .def("synchronize_devices", &rfnoc_graph::synchronize_devices) .def("get_tree", &rfnoc_graph::get_tree); + py::class_(m, "gpio_power") + .def("get_supported_voltages", &uhd::features::gpio_power_iface::get_supported_voltages) + .def("set_port_voltage", &uhd::features::gpio_power_iface::set_port_voltage) + .def("get_port_voltage", &uhd::features::gpio_power_iface::get_port_voltage) + .def("set_external_power", &uhd::features::gpio_power_iface::set_external_power) + .def("get_external_power_status", &uhd::features::gpio_power_iface::get_external_power_status); + py::class_(m, "mb_controller") .def("get_num_timekeepers", &mb_controller::get_num_timekeepers) .def("get_timekeeper", &mb_controller::get_timekeeper) @@ -250,7 +259,8 @@ void export_rfnoc(py::module& m) .def("get_gpio_banks", &mb_controller::get_gpio_banks) .def("get_gpio_srcs", &mb_controller::get_gpio_srcs) .def("get_gpio_src", &mb_controller::get_gpio_src) - .def("set_gpio_src", &mb_controller::set_gpio_src); + .def("set_gpio_src", &mb_controller::set_gpio_src) + .def("get_gpio_power", [](mb_controller& self){ return &self.get_feature(); }, py::return_value_policy::reference_internal); py::class_(m, "timekeeper") // Methods -- cgit v1.2.3