aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/rfnoc
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-12-05 11:30:12 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-06 10:59:28 -0800
commitcc86cc5a6a713788cc58add7fd76486b8a8fa141 (patch)
treec796c703e333864229e66be6939443b77d1ed7c9 /host/lib/rfnoc
parent77adcffe0689f120fee71854ec0f627a32991f79 (diff)
downloaduhd-cc86cc5a6a713788cc58add7fd76486b8a8fa141.tar.gz
uhd-cc86cc5a6a713788cc58add7fd76486b8a8fa141.tar.bz2
uhd-cc86cc5a6a713788cc58add7fd76486b8a8fa141.zip
rfnoc: Added TX LO APIs to radio_ctrl
Also added stubs in the default impl. Reviewed-By: Ashish Chaudhari <ashish@ettus.com> Reviewed-By: Derek Kozel <derek.kozel@ettus.com>
Diffstat (limited to 'host/lib/rfnoc')
-rw-r--r--host/lib/rfnoc/radio_ctrl_impl.cpp71
-rw-r--r--host/lib/rfnoc/radio_ctrl_impl.hpp15
2 files changed, 84 insertions, 2 deletions
diff --git a/host/lib/rfnoc/radio_ctrl_impl.cpp b/host/lib/rfnoc/radio_ctrl_impl.cpp
index 85ad6ed92..81bc0600b 100644
--- a/host/lib/rfnoc/radio_ctrl_impl.cpp
+++ b/host/lib/rfnoc/radio_ctrl_impl.cpp
@@ -244,7 +244,10 @@ double radio_ctrl_impl::get_rx_bandwidth(const size_t chan) /* const */
{
return _rx_bandwidth[chan];
}
-
+
+/******************************************************************************
+ * LO controls
+ *****************************************************************************/
std::vector<std::string> radio_ctrl_impl::get_rx_lo_names(const size_t /* chan */)
{
return std::vector<std::string>();
@@ -290,6 +293,72 @@ double radio_ctrl_impl::get_rx_lo_freq(const std::string & /* name */, const siz
return 0;
}
+std::vector<std::string> radio_ctrl_impl::get_tx_lo_names(
+ const size_t /* chan */
+) {
+ return std::vector<std::string>();
+}
+
+std::vector<std::string> radio_ctrl_impl::get_tx_lo_sources(
+ const std::string & /* name */,
+ const size_t /* chan */
+) {
+ return std::vector<std::string>();
+}
+
+freq_range_t radio_ctrl_impl::get_tx_lo_freq_range(
+ const std::string & /* name */,
+ const size_t /* chan */
+) {
+ return freq_range_t();
+}
+
+void radio_ctrl_impl::set_tx_lo_source(
+ const std::string & /* src */,
+ const std::string & /* name */,
+ const size_t /* chan */
+) {
+ throw uhd::not_implemented_error("set_tx_lo_source is not supported on this radio");
+}
+
+const std::string radio_ctrl_impl::get_tx_lo_source(
+ const std::string & /* name */,
+ const size_t /* chan */
+) {
+ return "internal";
+}
+
+void radio_ctrl_impl::set_tx_lo_export_enabled(
+ const bool /* enabled */,
+ const std::string & /* name */,
+ const size_t /* chan */
+) {
+ throw uhd::not_implemented_error("set_tx_lo_export_enabled is not supported on this radio");
+}
+
+bool radio_ctrl_impl::get_tx_lo_export_enabled(
+ const std::string & /* name */,
+ const size_t /* chan */
+) {
+ return false; // Not exporting non-existant LOs
+}
+
+double radio_ctrl_impl::set_tx_lo_freq(
+ const double /* freq */,
+ const std::string & /* name */,
+ const size_t /* chan */
+) {
+ throw uhd::not_implemented_error(
+ "set_tx_lo_freq is not supported on this radio");
+}
+
+double radio_ctrl_impl::get_tx_lo_freq(
+ const std::string & /* name */,
+ const size_t chan
+) {
+ return get_tx_frequency(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 6f0c82504..dc4ab114e 100644
--- a/host/lib/rfnoc/radio_ctrl_impl.hpp
+++ b/host/lib/rfnoc/radio_ctrl_impl.hpp
@@ -81,9 +81,22 @@ public:
virtual void set_rx_lo_export_enabled(bool enabled, const std::string &name, const size_t chan);
virtual bool get_rx_lo_export_enabled(const std::string &name, const size_t chan);
- virtual double set_rx_lo_freq(double freq, const std::string &name, const size_t chan);
+ virtual double set_rx_lo_freq(const double freq, const std::string &name, const size_t chan);
virtual double get_rx_lo_freq(const std::string &name, const size_t chan);
+ virtual std::vector<std::string> get_tx_lo_names(const size_t chan);
+ virtual std::vector<std::string> get_tx_lo_sources(const std::string &name, const size_t chan);
+ virtual freq_range_t get_tx_lo_freq_range(const std::string &name, const size_t chan);
+
+ virtual void set_tx_lo_source(const std::string &src, const std::string &name, const size_t chan);
+ virtual const std::string get_tx_lo_source(const std::string &name, const size_t chan);
+
+ virtual void set_tx_lo_export_enabled(const bool enabled, const std::string &name, const size_t chan);
+ virtual bool get_tx_lo_export_enabled(const std::string &name, const size_t chan);
+
+ virtual double set_tx_lo_freq(const double freq, const std::string &name, const size_t chan);
+ virtual double get_tx_lo_freq(const std::string &name, const size_t chan);
+
void set_time_now(const time_spec_t &time_spec);
void set_time_next_pps(const time_spec_t &time_spec);
void set_time_sync(const uhd::time_spec_t &time);