diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-05-09 10:41:15 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-05-26 16:18:50 -0700 |
commit | 4dd85b0389bc8019a7501ce0e6e87981f6f34f43 (patch) | |
tree | 18b013f75ff81a149782beac75062659a5f79077 /host/lib/rfnoc | |
parent | 8ead0805c63f357db605566c7447bf2937e0a026 (diff) | |
download | uhd-4dd85b0389bc8019a7501ce0e6e87981f6f34f43.tar.gz uhd-4dd85b0389bc8019a7501ce0e6e87981f6f34f43.tar.bz2 uhd-4dd85b0389bc8019a7501ce0e6e87981f6f34f43.zip |
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.
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r-- | host/lib/rfnoc/radio_ctrl_impl.cpp | 19 | ||||
-rw-r--r-- | host/lib/rfnoc/radio_ctrl_impl.hpp | 9 |
2 files changed, 28 insertions, 0 deletions
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<std::string> radio_ctrl_impl::get_clock_sources() return _tree->access<std::vector<std::string>>("clock_source/options").get(); } + +std::vector<std::string> radio_ctrl_impl::get_gpio_banks() const +{ + return std::vector<std::string>(); +} + +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<std::string> get_clock_sources(); + virtual std::vector<std::string> 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 **********************************************************************/ |