From 23f4f8cf4ea72d59740afcb5663e4541f93e821a Mon Sep 17 00:00:00 2001 From: Brent Stapleton Date: Fri, 7 Jun 2019 13:22:05 -0700 Subject: rfnoc: Add multi_usrp_rfnoc, modify multi_usrp This adds a separate version of multi_usrp for RFNoC devices. It is compatible with RFNoC devices only, and prefers C++ APIs over property tree usage. The factory of multi_usrp is modified such that it picks the correct version, users of multi_usrp don't care about this change. This also introduces some API changes: - Removing redundant GPIO functions. Now all GPIO control, setting, and readback is done with uint32_t's. - Adding getter/setter for GPIO source. This was done to simplify the other GPIO settings, as the source for each pin is not always a binary. The CTRL mode, for example, can either be ATR or GPIO. However, the source can be controlled by various radios or "PS" or some other source. - Removing the mask from the RFNoC radio controllers' set_gpio_attr(). - Adding state caching to gpio_atr_3000, and a getter for it. Whenever an attribute is set, that value is cached, and can now be retreieved. - Remove low-level register API. Since UHD 3.10, there is no USRP that implements that API. Modifying the filter API in the following ways: - Splitting filter API getter/setter/list into separate RX and TX functions - Adding channel numbers as an argument - The filter name will no longer be a property tree path, but rather a filter name. For RFNoC devices, this will take the form `BLOCK_ID:FILTER_NAME`. For non-RFNoC devices, this will just be the filter name (e.g. `HB_1`) - Removing search mask from listing function. Users can do their own searching Co-Authored-By: Martin Braun --- host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp | 3 +-- host/lib/include/uhdlib/usrp/cores/gpio_atr_3000.hpp | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'host/lib/include/uhdlib') diff --git a/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp b/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp index fc0d19a0a..b3ef2db0b 100644 --- a/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp +++ b/host/lib/include/uhdlib/rfnoc/radio_control_impl.hpp @@ -147,8 +147,7 @@ public: 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); + const uint32_t value); virtual uint32_t get_gpio_attr(const std::string& bank, const std::string& attr); /************************************************************************** diff --git a/host/lib/include/uhdlib/usrp/cores/gpio_atr_3000.hpp b/host/lib/include/uhdlib/usrp/cores/gpio_atr_3000.hpp index c9585449f..2ab0cf4cf 100644 --- a/host/lib/include/uhdlib/usrp/cores/gpio_atr_3000.hpp +++ b/host/lib/include/uhdlib/usrp/cores/gpio_atr_3000.hpp @@ -96,6 +96,16 @@ public: */ virtual uint32_t read_gpio() = 0; + /*! + * Get a GPIO attribute + * This will likely returned a cached value, and not read the state from the physical + * GPIO controller. + * + * \param attr the attribute to read + * \return the current value of that attribute + */ + virtual uint32_t get_attr_reg(const gpio_attr_t attr) = 0; + /*! * Set a GPIO attribute * -- cgit v1.2.3