diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-05-09 10:30:31 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-05-24 10:41:23 -0700 |
commit | 91dff1fbdd5bf7c1afd83182ddce43ed2bec63da (patch) | |
tree | a8294daf38fc611312d3c3045f05853a5220a192 /host/include | |
parent | 4fc9efd1f5f39caddfb40dd3daffcfb08854f9e0 (diff) | |
download | uhd-91dff1fbdd5bf7c1afd83182ddce43ed2bec63da.tar.gz uhd-91dff1fbdd5bf7c1afd83182ddce43ed2bec63da.tar.bz2 uhd-91dff1fbdd5bf7c1afd83182ddce43ed2bec63da.zip |
rfnoc: Backported GPIO controls on radio blocks
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/rfnoc/radio_ctrl.hpp | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/host/include/uhd/rfnoc/radio_ctrl.hpp b/host/include/uhd/rfnoc/radio_ctrl.hpp index 984ddf864..be22c6e5e 100644 --- a/host/include/uhd/rfnoc/radio_ctrl.hpp +++ b/host/include/uhd/rfnoc/radio_ctrl.hpp @@ -120,11 +120,13 @@ public: */ virtual double get_rx_frequency(const size_t chan) /* const */ = 0; - /*! Tune the RX LO for channel \p. + /*! Tune the RX LO for channel \p chan. * * This function will attempt to tune as close as possible, and return a * coerced value of the actual tuning result. * + * \param freq Requested LO frequency + * \param chan Channel number. * \return The actual LO frequency. */ virtual double set_rx_frequency(const double freq, const size_t chan) = 0; @@ -211,6 +213,51 @@ public: */ virtual time_spec_t get_time_last_pps() = 0; + /*! Returns the list of GPIO banks that are associated with this radio. + * + * \returns list of GPIO bank names + */ + virtual std::vector<std::string> get_gpio_banks() const = 0; + + /*! + * Set a GPIO attribute on a particular GPIO bank. + * Possible attribute names: + * - CTRL - 1 for ATR mode 0 for GPIO mode + * - DDR - 1 for output 0 for input + * - OUT - GPIO output level (not ATR mode) + * - ATR_0X - ATR idle state + * - ATR_RX - ATR receive only state + * - ATR_TX - ATR transmit only state + * - ATR_XX - ATR full duplex state + * \param bank the name of a GPIO bank (e.g., FP0) + * \param attr the name of a GPIO attribute (e.g., CTRL) + * \param value the new value for this GPIO bank + * \param mask the bit mask to effect which pins are changed + */ + virtual void set_gpio_attr( + const std::string &bank, + const std::string &attr, + const uint32_t value, + const uint32_t mask + ) = 0; + + /*! + * Get a GPIO attribute on a particular GPIO bank. + * Possible attribute names: + * - CTRL - 1 for ATR mode 0 for GPIO mode + * - DDR - 1 for output 0 for input + * - OUT - GPIO output level (not ATR mode) + * - ATR_0X - ATR idle state + * - ATR_RX - ATR receive only state + * - ATR_TX - ATR transmit only state + * - ATR_XX - ATR full duplex state + * - READBACK - readback input GPIOs + * \param bank the name of a GPIO bank + * \param attr the name of a GPIO attribute + * \return the value set for this attribute + */ + virtual uint32_t get_gpio_attr(const std::string &bank, const std::string &attr) = 0; + /*! * Get a list of possible LO stage names * \param chan the channel index 0 to N-1 |