From 4dd85b0389bc8019a7501ce0e6e87981f6f34f43 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 9 May 2017 10:41:15 -0700 Subject: rfnoc radio: Made GPIO functions not pure virtual Default implementations simply throw an exception. Makes it easier to write new radio controls that do not implement GPIO features. --- host/lib/rfnoc/radio_ctrl_impl.cpp | 19 +++++++++++++++++++ host/lib/rfnoc/radio_ctrl_impl.hpp | 9 +++++++++ 2 files changed, 28 insertions(+) (limited to 'host/lib/rfnoc') diff --git a/host/lib/rfnoc/radio_ctrl_impl.cpp b/host/lib/rfnoc/radio_ctrl_impl.cpp index 5504efbb0..69c9fb68c 100644 --- a/host/lib/rfnoc/radio_ctrl_impl.cpp +++ b/host/lib/rfnoc/radio_ctrl_impl.cpp @@ -450,3 +450,22 @@ std::vector radio_ctrl_impl::get_clock_sources() return _tree->access>("clock_source/options").get(); } + +std::vector radio_ctrl_impl::get_gpio_banks() const +{ + return std::vector(); +} + +void radio_ctrl_impl::set_gpio_attr( + const std::string &bank, + const std::string &attr, + const uint32_t value, + const uint32_t mask +) { + throw uhd::not_implemented_error("set_gpio_attr was not defined for this radio"); +} + +uint32_t radio_ctrl_impl::get_gpio_attr(const std::string &bank, const std::string &attr) +{ + throw uhd::not_implemented_error("get_gpio_attr was not defined for this radio"); +} diff --git a/host/lib/rfnoc/radio_ctrl_impl.hpp b/host/lib/rfnoc/radio_ctrl_impl.hpp index 21d7da1f1..6f0c82504 100644 --- a/host/lib/rfnoc/radio_ctrl_impl.hpp +++ b/host/lib/rfnoc/radio_ctrl_impl.hpp @@ -96,6 +96,15 @@ public: virtual std::string get_clock_source(); virtual std::vector get_clock_sources(); + virtual std::vector get_gpio_banks() const; + virtual void set_gpio_attr( + const std::string &bank, + const std::string &attr, + const uint32_t value, + const uint32_t mask + ); + virtual uint32_t get_gpio_attr(const std::string &bank, const std::string &attr); + /*********************************************************************** * Block control API calls **********************************************************************/ -- cgit v1.2.3