diff options
author | Tom Rondeau | 2011-05-02 11:25:17 +0100 |
---|---|---|
committer | Tom Rondeau | 2011-05-02 11:25:17 +0100 |
commit | 7a91b8226f71d75b027beb466f965bbba97c07a8 (patch) | |
tree | d61974e19b00628084bc613cf8b7b1ae3c15b3be /gr-uhd | |
parent | e1558e1c529d7840a7f6abd366b023cffe3d630e (diff) | |
parent | 517bee34087044336f83c4717734d3d1f5ff5b02 (diff) | |
download | gnuradio-7a91b8226f71d75b027beb466f965bbba97c07a8.tar.gz gnuradio-7a91b8226f71d75b027beb466f965bbba97c07a8.tar.bz2 gnuradio-7a91b8226f71d75b027beb466f965bbba97c07a8.zip |
Merge branch 'mergeme/uhd/gain_names'
Diffstat (limited to 'gr-uhd')
-rw-r--r-- | gr-uhd/include/gr_uhd_usrp_sink.h | 32 | ||||
-rw-r--r-- | gr-uhd/include/gr_uhd_usrp_source.h | 32 | ||||
-rw-r--r-- | gr-uhd/lib/gr_uhd_usrp_sink.cc | 16 | ||||
-rw-r--r-- | gr-uhd/lib/gr_uhd_usrp_source.cc | 16 | ||||
-rw-r--r-- | gr-uhd/swig/uhd_swig.i | 3 |
5 files changed, 98 insertions, 1 deletions
diff --git a/gr-uhd/include/gr_uhd_usrp_sink.h b/gr-uhd/include/gr_uhd_usrp_sink.h index 0475957de..320d07d41 100644 --- a/gr-uhd/include/gr_uhd_usrp_sink.h +++ b/gr-uhd/include/gr_uhd_usrp_sink.h @@ -101,6 +101,14 @@ public: virtual void set_gain(double gain, size_t chan = 0) = 0; /*! + * Set the named gain on the dboard. + * \param gain the gain in dB + * \param name the name of the gain stage + * \param chan the channel index 0 to N-1 + */ + virtual void set_gain(double gain, const std::string &name, size_t chan = 0) = 0; + + /*! * Get the actual dboard gain setting. * \param chan the channel index 0 to N-1 * \return the actual gain in dB @@ -108,6 +116,22 @@ public: virtual double get_gain(size_t chan = 0) = 0; /*! + * Get the actual dboard gain setting of named stage. + * \param name the name of the gain stage + * \param chan the channel index 0 to N-1 + * \return the actual gain in dB + */ + virtual double get_gain(const std::string &name, size_t chan = 0) = 0; + + /*! + * Get the actual dboard gain setting of named stage. + * \param name the name of the gain stage + * \param chan the channel index 0 to N-1 + * \return the actual gain in dB + */ + virtual std::vector<std::string> get_gain_names(size_t chan = 0) = 0; + + /*! * Get the settable gain range. * \param chan the channel index 0 to N-1 * \return the gain range in dB @@ -115,6 +139,14 @@ public: virtual uhd::gain_range_t get_gain_range(size_t chan = 0) = 0; /*! + * Get the settable gain range. + * \param name the name of the gain stage + * \param chan the channel index 0 to N-1 + * \return the gain range in dB + */ + virtual uhd::gain_range_t get_gain_range(const std::string &name, size_t chan = 0) = 0; + + /*! * Set the antenna to use. * \param ant the antenna string * \param chan the channel index 0 to N-1 diff --git a/gr-uhd/include/gr_uhd_usrp_source.h b/gr-uhd/include/gr_uhd_usrp_source.h index 038f9a91e..36331f782 100644 --- a/gr-uhd/include/gr_uhd_usrp_source.h +++ b/gr-uhd/include/gr_uhd_usrp_source.h @@ -101,6 +101,14 @@ public: virtual void set_gain(double gain, size_t chan = 0) = 0; /*! + * Set the named gain on the dboard. + * \param gain the gain in dB + * \param name the name of the gain stage + * \param chan the channel index 0 to N-1 + */ + virtual void set_gain(double gain, const std::string &name, size_t chan = 0) = 0; + + /*! * Get the actual dboard gain setting. * \param chan the channel index 0 to N-1 * \return the actual gain in dB @@ -108,6 +116,22 @@ public: virtual double get_gain(size_t chan = 0) = 0; /*! + * Get the actual dboard gain setting of named stage. + * \param name the name of the gain stage + * \param chan the channel index 0 to N-1 + * \return the actual gain in dB + */ + virtual double get_gain(const std::string &name, size_t chan = 0) = 0; + + /*! + * Get the actual dboard gain setting of named stage. + * \param name the name of the gain stage + * \param chan the channel index 0 to N-1 + * \return the actual gain in dB + */ + virtual std::vector<std::string> get_gain_names(size_t chan = 0) = 0; + + /*! * Get the settable gain range. * \param chan the channel index 0 to N-1 * \return the gain range in dB @@ -115,6 +139,14 @@ public: virtual uhd::gain_range_t get_gain_range(size_t chan = 0) = 0; /*! + * Get the settable gain range. + * \param name the name of the gain stage + * \param chan the channel index 0 to N-1 + * \return the gain range in dB + */ + virtual uhd::gain_range_t get_gain_range(const std::string &name, size_t chan = 0) = 0; + + /*! * Set the antenna to use. * \param ant the antenna string * \param chan the channel index 0 to N-1 diff --git a/gr-uhd/lib/gr_uhd_usrp_sink.cc b/gr-uhd/lib/gr_uhd_usrp_sink.cc index d44af25ab..ce9d89d8d 100644 --- a/gr-uhd/lib/gr_uhd_usrp_sink.cc +++ b/gr-uhd/lib/gr_uhd_usrp_sink.cc @@ -76,14 +76,30 @@ public: return _dev->set_tx_gain(gain, chan); } + void set_gain(double gain, const std::string &name, size_t chan){ + return _dev->set_tx_gain(gain, name, chan); + } + double get_gain(size_t chan){ return _dev->get_tx_gain(chan); } + double get_gain(const std::string &name, size_t chan){ + return _dev->get_tx_gain(name, chan); + } + + std::vector<std::string> get_gain_names(size_t chan){ + return _dev->get_tx_gain_names(chan); + } + uhd::gain_range_t get_gain_range(size_t chan){ return _dev->get_tx_gain_range(chan); } + uhd::gain_range_t get_gain_range(const std::string &name, size_t chan){ + return _dev->get_tx_gain_range(name, chan); + } + void set_antenna(const std::string &ant, size_t chan){ return _dev->set_tx_antenna(ant, chan); } diff --git a/gr-uhd/lib/gr_uhd_usrp_source.cc b/gr-uhd/lib/gr_uhd_usrp_source.cc index fed8e6624..9983489c3 100644 --- a/gr-uhd/lib/gr_uhd_usrp_source.cc +++ b/gr-uhd/lib/gr_uhd_usrp_source.cc @@ -78,14 +78,30 @@ public: return _dev->set_rx_gain(gain, chan); } + void set_gain(double gain, const std::string &name, size_t chan){ + return _dev->set_rx_gain(gain, name, chan); + } + double get_gain(size_t chan){ return _dev->get_rx_gain(chan); } + double get_gain(const std::string &name, size_t chan){ + return _dev->get_rx_gain(name, chan); + } + + std::vector<std::string> get_gain_names(size_t chan){ + return _dev->get_rx_gain_names(chan); + } + uhd::gain_range_t get_gain_range(size_t chan){ return _dev->get_rx_gain_range(chan); } + uhd::gain_range_t get_gain_range(const std::string &name, size_t chan){ + return _dev->get_rx_gain_range(name, chan); + } + void set_antenna(const std::string &ant, size_t chan){ return _dev->set_rx_antenna(ant, chan); } diff --git a/gr-uhd/swig/uhd_swig.i b/gr-uhd/swig/uhd_swig.i index 3ffcc7aea..9bdb962c9 100644 --- a/gr-uhd/swig/uhd_swig.i +++ b/gr-uhd/swig/uhd_swig.i @@ -100,6 +100,7 @@ //////////////////////////////////////////////////////////////////////// %include stdint.i %include <uhd/types/serial.hpp> +%template(byte_vector_t) std::vector<uint8_t>; %include <uhd/usrp/dboard_iface.hpp> %template(dboard_iface_sptr) boost::shared_ptr<uhd::usrp::dboard_iface>; @@ -129,6 +130,6 @@ static const size_t ALL_MBOARDS; %goops %{ (use-modules (gnuradio gnuradio_core_runtime)) %} -#endif /* SWIGGUILE */ +#endif /* SWIGGUILE */ #endif /* GR_HAVE_UHD */ |