From 568ee85778bcf0ef304b5f330ee71c113f403ed8 Mon Sep 17 00:00:00 2001 From: Lane Kolbly Date: Mon, 25 Oct 2021 15:54:25 -0500 Subject: host: Add gpio_voltage discoverable feature --- .../uhdlib/usrp/common/mpmd_mb_controller.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'host/lib/include/uhdlib/usrp/common') diff --git a/host/lib/include/uhdlib/usrp/common/mpmd_mb_controller.hpp b/host/lib/include/uhdlib/usrp/common/mpmd_mb_controller.hpp index 2d751a4e5..f4f6e0ba7 100644 --- a/host/lib/include/uhdlib/usrp/common/mpmd_mb_controller.hpp +++ b/host/lib/include/uhdlib/usrp/common/mpmd_mb_controller.hpp @@ -6,6 +6,7 @@ #pragma once +#include #include #include #include @@ -13,6 +14,7 @@ #include #include #include +#include #include namespace uhd { namespace rfnoc { @@ -169,9 +171,28 @@ public: uhd::usrp::mpmd_rpc_iface::sptr _rpcc; }; + class gpio_power : public uhd::features::gpio_power_iface + { + public: + using sptr = std::shared_ptr; + + gpio_power(uhd::usrp::dio_rpc_iface::sptr rpcc, const std::vector& ports); + + std::vector get_supported_voltages(const std::string& port) const override; + void set_port_voltage(const std::string& port, const std::string& voltage) override; + std::string get_port_voltage(const std::string& port) const override; + void set_external_power(const std::string& port, bool enable) override; + std::string get_external_power_status(const std::string& port) const override; + + private: + uhd::usrp::dio_rpc_iface::sptr _rpcc; + const std::vector _ports; + }; + fpga_onload::sptr _fpga_onload; ref_clk_calibration::sptr _ref_clk_cal; trig_io_mode::sptr _trig_io_mode; + gpio_power::sptr _gpio_power; }; }} // namespace uhd::rfnoc -- cgit v1.2.3