diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-11-14 13:17:25 -0800 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2020-01-23 11:37:51 -0800 |
commit | 90a72e8cd4cd1d4971c0e09d9813c9fc43371062 (patch) | |
tree | 28245b9cf24fd6ab53b17da3681d1446a4ff3f13 /host/lib | |
parent | 0cf54ce07335f60642a14df7e6107422a5aeb9a0 (diff) | |
download | uhd-90a72e8cd4cd1d4971c0e09d9813c9fc43371062.tar.gz uhd-90a72e8cd4cd1d4971c0e09d9813c9fc43371062.tar.bz2 uhd-90a72e8cd4cd1d4971c0e09d9813c9fc43371062.zip |
multi_usrp: Amend APIs for GPIO source control
This adds a new API call to multi_usrp: get_gpio_src_banks(). This
returns a list of GPIO banks who's source can be controlled through the
motherboard controller.
The remaining GPIO source methods' docstrings are improved, to explain
the difference between GPIO banks for set_gpio_attr() and
set_gpio_src(). The former controls the actual value on a GPIO bank, and
the latter who drives it. These can be different banks.
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/usrp/multi_usrp.cpp | 8 | ||||
-rw-r--r-- | host/lib/usrp/multi_usrp_rfnoc.cpp | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp index db21255ae..202f8b2df 100644 --- a/host/lib/usrp/multi_usrp.cpp +++ b/host/lib/usrp/multi_usrp.cpp @@ -2249,7 +2249,13 @@ public: )); } - // The next three methods are only for RFNoC devices + // The next four methods are only for RFNoC devices + std::vector<std::string> get_gpio_src_banks(const size_t) + { + throw uhd::not_implemented_error( + "get_gpio_src_banks() not implemented for this motherboard!"); + } + std::vector<std::string> get_gpio_srcs(const std::string&, const size_t) { throw uhd::not_implemented_error( diff --git a/host/lib/usrp/multi_usrp_rfnoc.cpp b/host/lib/usrp/multi_usrp_rfnoc.cpp index 99c07dc8c..b2070c53d 100644 --- a/host/lib/usrp/multi_usrp_rfnoc.cpp +++ b/host/lib/usrp/multi_usrp_rfnoc.cpp @@ -1956,6 +1956,11 @@ public: return radio_bank_pair.first->get_gpio_attr(radio_bank_pair.second, attr); } + std::vector<std::string> get_gpio_src_banks(const size_t mboard) + { + return get_mbc(mboard)->get_gpio_banks(); + } + std::vector<std::string> get_gpio_srcs(const std::string& bank, const size_t mboard) { return get_mbc(mboard)->get_gpio_srcs(bank); |