diff options
author | Derek Kozel <derek.kozel@ettus.com> | 2017-03-14 17:56:41 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-03-24 19:06:09 -0700 |
commit | 4d3572494e979bb94a929a0485813c0ba3fcc453 (patch) | |
tree | fa7f0fe771d0364c49a312f75e722da188d6f733 /host/include | |
parent | 51cbfdfd7e7c071914442005139894496ddf6039 (diff) | |
download | uhd-4d3572494e979bb94a929a0485813c0ba3fcc453.tar.gz uhd-4d3572494e979bb94a929a0485813c0ba3fcc453.tar.bz2 uhd-4d3572494e979bb94a929a0485813c0ba3fcc453.zip |
RFNoC: Exposed LO sharing functions in radio block
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/rfnoc/radio_ctrl.hpp | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/host/include/uhd/rfnoc/radio_ctrl.hpp b/host/include/uhd/rfnoc/radio_ctrl.hpp index 67ea4c069..d8e3d94e8 100644 --- a/host/include/uhd/rfnoc/radio_ctrl.hpp +++ b/host/include/uhd/rfnoc/radio_ctrl.hpp @@ -18,6 +18,7 @@ #ifndef INCLUDED_LIBUHD_RFNOC_RADIO_CTRL_HPP #define INCLUDED_LIBUHD_RFNOC_RADIO_CTRL_HPP +#include <uhd/types/ranges.hpp> #include <uhd/types/direction.hpp> #include <uhd/rfnoc/source_block_ctrl_base.hpp> #include <uhd/rfnoc/sink_block_ctrl_base.hpp> @@ -43,6 +44,16 @@ public: virtual ~radio_ctrl(){} + + //! A wildcard channel index + static const size_t ALL_CHANS = size_t(~0); + + //! A wildcard gain element name + static const std::string ALL_GAINS; + + //! A wildcard local oscillator element name + static const std::string ALL_LOS; + /************************************************************************ * API calls ***********************************************************************/ @@ -201,6 +212,90 @@ public: virtual time_spec_t get_time_last_pps() = 0; /*! + * Get a list of possible LO stage names + * \param chan the channel index 0 to N-1 + * \return a vector of strings for possible LO names + */ + virtual std::vector<std::string> get_rx_lo_names(const size_t chan) = 0; + + /*! + * Get a list of possible LO sources. + * Channels which do not have controllable LO sources + * will return "internal". + * \param name the name of the LO stage to query + * \param chan the channel index 0 to N-1 + * \return a vector of strings for possible settings + */ + virtual std::vector<std::string> get_rx_lo_sources(const std::string &name, const size_t chan) = 0; + + /*! + * Get the LO frequency range of the RX LO. + * If the channel does not have independently configurable LOs + * the rf frequency range will be returned. + * \param name the name of the LO stage to query + * \param chan the channel index 0 to N-1 + * \return a frequency range object + */ + virtual freq_range_t get_rx_lo_freq_range(const std::string &name, const size_t chan) = 0; + + /*! + * Set the LO source for a channel. + * For usrps that support selectable LOs, this function + * allows switching between them. + * Typical options for source: internal, external. + * \param src a string representing the LO source + * \param name the name of the LO stage to update + * \param chan the channel index 0 to N-1 + */ + virtual void set_rx_lo_source(const std::string &src, const std::string &name, const size_t chan) = 0; + + /*! + * Get the currently set LO source. + * Channels without controllable LO sources will return + * "internal" + * \param name the name of the LO stage to query + * \param chan the channel index 0 to N-1 + * \return the configured LO source + */ + virtual const std::string get_rx_lo_source(const std::string &name, const size_t chan) = 0; + + /*! + * Set whether the LO used by the usrp device is exported + * For usrps that support exportable LOs, this function + * configures if the LO used by chan is exported or not. + * \param enabled if true then export the LO + * \param name the name of the LO stage to update + * \param chan the channel index 0 to N-1 for the source channel + */ + virtual void set_rx_lo_export_enabled(bool enabled, const std::string &name, const size_t chan) = 0; + + /*! + * Returns true if the currently selected LO is being exported. + * \param name the name of the LO stage to query + * \param chan the channel index 0 to N-1 + */ + virtual bool get_rx_lo_export_enabled(const std::string &name, const size_t chan) = 0; + + /*! + * Set the RX LO frequency (Advanced). + * \param freq the frequency to set the LO to + * \param name the name of the LO stage to update + * \param chan the channel index 0 to N-1 + * \return a coerced LO frequency + */ + virtual double set_rx_lo_freq(double freq, const std::string &name, const size_t chan) = 0; + + /*! + * Get the current RX LO frequency (Advanced). + * If the channel does not have independently configurable LOs + * the current rf frequency will be returned. + * \param name the name of the LO stage to query + * \param chan the channel index 0 to N-1 + * \return the configured LO frequency + */ + virtual double get_rx_lo_freq(const std::string &name, const size_t chan) = 0; + + /*! * Set the time source for this radio. * * May affect other radio blocks. |