diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2013-04-17 15:31:44 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2013-04-17 15:31:44 -0700 |
commit | 669614b0f048de145ec41350f641f4af9c9b0d86 (patch) | |
tree | fa9582a8899652c24f835bf2ca554b0ce61cad24 | |
parent | 066f711a0361c665b06689e8a9e8964617ea533c (diff) | |
parent | 39c8fd8c335bac7b4f878473656c965c6d9c2c73 (diff) |
Merge remote-tracking branch 'jblum/uhd_work'
-rw-r--r-- | gr-uhd/grc/gen_uhd_usrp_blocks.py | 9 | ||||
-rw-r--r-- | gr-uhd/include/gr_uhd_usrp_sink.h | 14 | ||||
-rw-r--r-- | gr-uhd/include/gr_uhd_usrp_source.h | 14 | ||||
-rw-r--r-- | gr-uhd/lib/gr_uhd_usrp_sink.cc | 8 | ||||
-rw-r--r-- | gr-uhd/lib/gr_uhd_usrp_source.cc | 8 |
5 files changed, 52 insertions, 1 deletions
diff --git a/gr-uhd/grc/gen_uhd_usrp_blocks.py b/gr-uhd/grc/gen_uhd_usrp_blocks.py index 25b0a4c467..e392f6a606 100644 --- a/gr-uhd/grc/gen_uhd_usrp_blocks.py +++ b/gr-uhd/grc/gen_uhd_usrp_blocks.py @@ -25,6 +25,7 @@ MAIN_TMPL = """\ <key>uhd_usrp_$(sourk)</key> <throttle>1</throttle> <import>from gnuradio import uhd</import> + <import>import time</import> <make>uhd.usrp_$(sourk)( device_addr=\$dev_addr, stream_args=uhd.stream_args( @@ -56,8 +57,10 @@ self.\$(id).set_subdev_spec(\$sd_spec$(m), $m) \#end if ######################################################################## #end for -\#if \$sync() +\#if \$sync() == 'sync' self.\$(id).set_time_unknown_pps(uhd.time_spec()) +\#elif \$sync() == 'pc_clock' +self.\$(id).set_time_now(uhd.time_spec(time.time()), uhd.ALL_MBOARDS) \#end if self.\$(id).set_samp_rate(\$samp_rate) #for $n in range($max_nchan) @@ -166,6 +169,10 @@ self.\$(id).set_bandwidth(\$bw$(n), $n) <key>sync</key> </option> <option> + <name>PC Clock</name> + <key>pc_clock</key> + </option> + <option> <name>don't sync</name> <key></key> </option> diff --git a/gr-uhd/include/gr_uhd_usrp_sink.h b/gr-uhd/include/gr_uhd_usrp_sink.h index eaf60fb777..9cea6f3e28 100644 --- a/gr-uhd/include/gr_uhd_usrp_sink.h +++ b/gr-uhd/include/gr_uhd_usrp_sink.h @@ -290,6 +290,20 @@ public: virtual void set_bandwidth(double bandwidth, size_t chan = 0) = 0; /*! + * Get the bandpass filter setting on the RF frontend. + * \param chan the channel index 0 to N-1 + * \return bandwidth of the filter in Hz + */ + virtual double get_bandwidth(size_t chan = 0) = 0; + + /*! + * Get the bandpass filter range of the RF frontend. + * \param chan the channel index 0 to N-1 + * \return the range of the filter bandwidth in Hz + */ + virtual uhd::freq_range_t get_bandwidth_range(size_t chan = 0) = 0; + + /*! * Set a constant DC offset value. * The value is complex to control both I and Q. * \param offset the dc offset (1.0 is full-scale) diff --git a/gr-uhd/include/gr_uhd_usrp_source.h b/gr-uhd/include/gr_uhd_usrp_source.h index 1243ddcc2f..4d15bf1606 100644 --- a/gr-uhd/include/gr_uhd_usrp_source.h +++ b/gr-uhd/include/gr_uhd_usrp_source.h @@ -300,6 +300,20 @@ public: virtual void set_bandwidth(double bandwidth, size_t chan = 0) = 0; /*! + * Get the bandpass filter setting on the RF frontend. + * \param chan the channel index 0 to N-1 + * \return bandwidth of the filter in Hz + */ + virtual double get_bandwidth(size_t chan = 0) = 0; + + /*! + * Get the bandpass filter range of the RF frontend. + * \param chan the channel index 0 to N-1 + * \return the range of the filter bandwidth in Hz + */ + virtual uhd::freq_range_t get_bandwidth_range(size_t chan = 0) = 0; + + /*! * Enable/disable the automatic DC offset correction. * The automatic correction subtracts out the long-run average. * diff --git a/gr-uhd/lib/gr_uhd_usrp_sink.cc b/gr-uhd/lib/gr_uhd_usrp_sink.cc index 6216c94a83..99d8e03c33 100644 --- a/gr-uhd/lib/gr_uhd_usrp_sink.cc +++ b/gr-uhd/lib/gr_uhd_usrp_sink.cc @@ -157,6 +157,14 @@ public: return _dev->set_tx_bandwidth(bandwidth, chan); } + double get_bandwidth(size_t chan){ + return _dev->get_tx_bandwidth(chan); + } + + uhd::freq_range_t get_bandwidth_range(size_t chan){ + return _dev->get_tx_bandwidth_range(chan); + } + void set_dc_offset(const std::complex<double> &offset, size_t chan){ #ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API return _dev->set_tx_dc_offset(offset, chan); diff --git a/gr-uhd/lib/gr_uhd_usrp_source.cc b/gr-uhd/lib/gr_uhd_usrp_source.cc index 3813673b4b..c6c82d56cf 100644 --- a/gr-uhd/lib/gr_uhd_usrp_source.cc +++ b/gr-uhd/lib/gr_uhd_usrp_source.cc @@ -168,6 +168,14 @@ public: return _dev->set_rx_bandwidth(bandwidth, chan); } + double get_bandwidth(size_t chan){ + return _dev->get_rx_bandwidth(chan); + } + + uhd::freq_range_t get_bandwidth_range(size_t chan){ + return _dev->get_rx_bandwidth_range(chan); + } + void set_auto_dc_offset(const bool enable, size_t chan){ #ifdef UHD_USRP_MULTI_USRP_FRONTEND_CAL_API return _dev->set_rx_dc_offset(enable, chan); |