aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--host/include/uhd/rfnoc/radio_ctrl.hpp14
-rw-r--r--host/lib/rfnoc/radio_ctrl_impl.cpp10
-rw-r--r--host/lib/rfnoc/radio_ctrl_impl.hpp3
-rw-r--r--host/lib/usrp/x300/x300_radio_ctrl_impl.cpp14
-rw-r--r--host/lib/usrp/x300/x300_radio_ctrl_impl.hpp2
5 files changed, 43 insertions, 0 deletions
diff --git a/host/include/uhd/rfnoc/radio_ctrl.hpp b/host/include/uhd/rfnoc/radio_ctrl.hpp
index 1d7842051..fe9636b32 100644
--- a/host/include/uhd/rfnoc/radio_ctrl.hpp
+++ b/host/include/uhd/rfnoc/radio_ctrl.hpp
@@ -148,6 +148,20 @@ public:
*/
virtual double set_rx_gain(const double gain, const size_t chan) = 0;
+ /*! Return the analog filter bandwidth channel \p chan
+ *
+ * \return The actual bandwidth value
+ */
+ // virtual double get_rx_bandwidth(const double bandwidth, const size_t chan) = 0;
+
+ /*! Set the analog filter bandwidth channel \p chan
+ *
+ * This function will attempt to set the analog bandwidth.
+ *
+ * \return The actual bandwidth value
+ */
+ virtual double set_rx_bandwidth(const double bandwidth, const size_t chan) = 0;
+
/*! Sets the time in the radio's timekeeper to the given value.
*
* Note that there is a non-deterministic delay between calling this
diff --git a/host/lib/rfnoc/radio_ctrl_impl.cpp b/host/lib/rfnoc/radio_ctrl_impl.cpp
index 0dc5cd168..262f1eb73 100644
--- a/host/lib/rfnoc/radio_ctrl_impl.cpp
+++ b/host/lib/rfnoc/radio_ctrl_impl.cpp
@@ -193,6 +193,11 @@ double radio_ctrl_impl::set_rx_gain(const double gain, const size_t chan)
return _rx_gain[chan] = gain;
}
+double radio_ctrl_impl::set_rx_bandwidth(const double bandwidth, const size_t chan)
+{
+ return _rx_bandwidth[chan] = bandwidth;
+}
+
void radio_ctrl_impl::set_time_sync(const uhd::time_spec_t &time)
{
_time64->set_time_sync(time);
@@ -233,6 +238,11 @@ double radio_ctrl_impl::get_rx_gain(const size_t chan) /* const */
return _rx_gain[chan];
}
+double radio_ctrl_impl::get_rx_bandwidth(const size_t chan) /* const */
+{
+ return _rx_bandwidth[chan];
+}
+
/***********************************************************************
* RX Streamer-related methods (from source_block_ctrl_base)
**********************************************************************/
diff --git a/host/lib/rfnoc/radio_ctrl_impl.hpp b/host/lib/rfnoc/radio_ctrl_impl.hpp
index d6b402120..4946827d7 100644
--- a/host/lib/rfnoc/radio_ctrl_impl.hpp
+++ b/host/lib/rfnoc/radio_ctrl_impl.hpp
@@ -60,6 +60,7 @@ public:
virtual double set_rx_frequency(const double freq, const size_t chan);
virtual double set_tx_gain(const double gain, const size_t chan);
virtual double set_rx_gain(const double gain, const size_t chan);
+ virtual double set_rx_bandwidth(const double bandwidth, const size_t chan);
virtual double get_rate() const;
virtual std::string get_tx_antenna(const size_t chan) /* const */;
@@ -68,6 +69,7 @@ public:
virtual double get_rx_frequency(const size_t) /* const */;
virtual double get_tx_gain(const size_t) /* const */;
virtual double get_rx_gain(const size_t) /* const */;
+ virtual double get_rx_bandwidth(const size_t) /* const */;
void set_time_now(const time_spec_t &time_spec);
void set_time_next_pps(const time_spec_t &time_spec);
@@ -199,6 +201,7 @@ private:
std::map<size_t, double> _rx_freq;
std::map<size_t, double> _tx_gain;
std::map<size_t, double> _rx_gain;
+ std::map<size_t, double> _rx_bandwidth;
std::vector<bool> _continuous_streaming;
}; /* class radio_ctrl_impl */
diff --git a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp
index 90cb20ce3..c84b2ba44 100644
--- a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp
+++ b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp
@@ -228,6 +228,20 @@ double x300_radio_ctrl_impl::get_rx_frequency(const size_t chan)
).get();
}
+double x300_radio_ctrl_impl::set_rx_bandwidth(const double bandwidth, const size_t chan)
+{
+ return _tree->access<double>(
+ fs_path("dboards" / _radio_slot / "rx_frontends" / _rx_fe_map.at(chan).db_fe_name / "bandwidth" / "value")
+ ).set(bandwidth).get();
+}
+
+double x300_radio_ctrl_impl::get_rx_bandwidth(const size_t chan)
+{
+ return _tree->access<double>(
+ fs_path("dboards" / _radio_slot / "rx_frontends" / _rx_fe_map.at(chan).db_fe_name / "bandwidth" / "value")
+ ).get();
+}
+
double x300_radio_ctrl_impl::set_tx_gain(const double gain, const size_t chan)
{
//TODO: This is extremely hacky!
diff --git a/host/lib/usrp/x300/x300_radio_ctrl_impl.hpp b/host/lib/usrp/x300/x300_radio_ctrl_impl.hpp
index 6e17778bd..80cd94215 100644
--- a/host/lib/usrp/x300/x300_radio_ctrl_impl.hpp
+++ b/host/lib/usrp/x300/x300_radio_ctrl_impl.hpp
@@ -56,8 +56,10 @@ public:
double set_tx_frequency(const double freq, const size_t chan);
double set_rx_frequency(const double freq, const size_t chan);
+ double set_rx_bandwidth(const double bandwidth, const size_t chan);
double get_tx_frequency(const size_t chan);
double get_rx_frequency(const size_t chan);
+ double get_rx_bandwidth(const size_t chan);
double set_tx_gain(const double gain, const size_t chan);
double set_rx_gain(const double gain, const size_t chan);