aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/cores
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/cores')
-rw-r--r--host/lib/usrp/cores/rx_dsp_core_200.cpp1
-rw-r--r--host/lib/usrp/cores/rx_dsp_core_3000.cpp21
-rw-r--r--host/lib/usrp/cores/rx_dsp_core_3000.hpp10
-rw-r--r--host/lib/usrp/cores/tx_dsp_core_3000.cpp21
-rw-r--r--host/lib/usrp/cores/tx_dsp_core_3000.hpp8
5 files changed, 58 insertions, 3 deletions
diff --git a/host/lib/usrp/cores/rx_dsp_core_200.cpp b/host/lib/usrp/cores/rx_dsp_core_200.cpp
index 6a36e8fa1..b899085c0 100644
--- a/host/lib/usrp/cores/rx_dsp_core_200.cpp
+++ b/host/lib/usrp/cores/rx_dsp_core_200.cpp
@@ -295,6 +295,7 @@ public:
_iface->poke32(REG_RX_CTRL_FORMAT, format_word);
}
+
private:
wb_iface::sptr _iface;
const size_t _dsp_base, _ctrl_base;
diff --git a/host/lib/usrp/cores/rx_dsp_core_3000.cpp b/host/lib/usrp/cores/rx_dsp_core_3000.cpp
index 8a131ffb4..18dabade0 100644
--- a/host/lib/usrp/cores/rx_dsp_core_3000.cpp
+++ b/host/lib/usrp/cores/rx_dsp_core_3000.cpp
@@ -46,6 +46,9 @@ template <class T> T ceil_log2(T num){
using namespace uhd;
+const double rx_dsp_core_3000::DEFAULT_CORDIC_FREQ = 0.0;
+const double rx_dsp_core_3000::DEFAULT_RATE = 1e6;
+
rx_dsp_core_3000::~rx_dsp_core_3000(void){
/* NOP */
}
@@ -263,6 +266,24 @@ public:
this->update_scalar();
}
+ void populate_subtree(property_tree::sptr subtree)
+ {
+ subtree->create<meta_range_t>("rate/range")
+ .publish(boost::bind(&rx_dsp_core_3000::get_host_rates, this))
+ ;
+ subtree->create<double>("rate/value")
+ .set(DEFAULT_RATE)
+ .coerce(boost::bind(&rx_dsp_core_3000::set_host_rate, this, _1))
+ ;
+ subtree->create<double>("freq/value")
+ .set(DEFAULT_CORDIC_FREQ)
+ .coerce(boost::bind(&rx_dsp_core_3000::set_freq, this, _1))
+ ;
+ subtree->create<meta_range_t>("freq/range")
+ .publish(boost::bind(&rx_dsp_core_3000::get_freq_range, this))
+ ;
+ }
+
private:
wb_iface::sptr _iface;
const size_t _dsp_base;
diff --git a/host/lib/usrp/cores/rx_dsp_core_3000.hpp b/host/lib/usrp/cores/rx_dsp_core_3000.hpp
index 89059e953..65801de1d 100644
--- a/host/lib/usrp/cores/rx_dsp_core_3000.hpp
+++ b/host/lib/usrp/cores/rx_dsp_core_3000.hpp
@@ -21,14 +21,18 @@
#include <uhd/config.hpp>
#include <uhd/stream.hpp>
#include <uhd/types/ranges.hpp>
-#include <boost/utility.hpp>
-#include <boost/shared_ptr.hpp>
#include <uhd/types/stream_cmd.hpp>
#include <uhd/types/wb_iface.hpp>
+#include <uhd/property_tree.hpp>
+#include <boost/utility.hpp>
+#include <boost/shared_ptr.hpp>
#include <string>
class rx_dsp_core_3000 : boost::noncopyable{
public:
+ static const double DEFAULT_CORDIC_FREQ;
+ static const double DEFAULT_RATE;
+
typedef boost::shared_ptr<rx_dsp_core_3000> sptr;
virtual ~rx_dsp_core_3000(void) = 0;
@@ -56,6 +60,8 @@ public:
virtual double set_freq(const double freq) = 0;
virtual void setup(const uhd::stream_args_t &stream_args) = 0;
+
+ virtual void populate_subtree(uhd::property_tree::sptr subtree) = 0;
};
#endif /* INCLUDED_LIBUHD_USRP_RX_DSP_CORE_3000_HPP */
diff --git a/host/lib/usrp/cores/tx_dsp_core_3000.cpp b/host/lib/usrp/cores/tx_dsp_core_3000.cpp
index 736205402..93b70435f 100644
--- a/host/lib/usrp/cores/tx_dsp_core_3000.cpp
+++ b/host/lib/usrp/cores/tx_dsp_core_3000.cpp
@@ -37,6 +37,9 @@ template <class T> T ceil_log2(T num){
using namespace uhd;
+const double tx_dsp_core_3000::DEFAULT_CORDIC_FREQ = 0.0;
+const double tx_dsp_core_3000::DEFAULT_RATE = 1e6;
+
tx_dsp_core_3000::~tx_dsp_core_3000(void){
/* NOP */
}
@@ -200,6 +203,24 @@ public:
this->update_scalar();
}
+ void populate_subtree(property_tree::sptr subtree)
+ {
+ subtree->create<meta_range_t>("rate/range")
+ .publish(boost::bind(&tx_dsp_core_3000::get_host_rates, this))
+ ;
+ subtree->create<double>("rate/value")
+ .set(DEFAULT_RATE)
+ .coerce(boost::bind(&tx_dsp_core_3000::set_host_rate, this, _1))
+ ;
+ subtree->create<double>("freq/value")
+ .set(DEFAULT_CORDIC_FREQ)
+ .coerce(boost::bind(&tx_dsp_core_3000::set_freq, this, _1))
+ ;
+ subtree->create<meta_range_t>("freq/range")
+ .publish(boost::bind(&tx_dsp_core_3000::get_freq_range, this))
+ ;
+ }
+
private:
wb_iface::sptr _iface;
const size_t _dsp_base;
diff --git a/host/lib/usrp/cores/tx_dsp_core_3000.hpp b/host/lib/usrp/cores/tx_dsp_core_3000.hpp
index a51cb2803..fbc43add6 100644
--- a/host/lib/usrp/cores/tx_dsp_core_3000.hpp
+++ b/host/lib/usrp/cores/tx_dsp_core_3000.hpp
@@ -21,12 +21,16 @@
#include <uhd/config.hpp>
#include <uhd/stream.hpp>
#include <uhd/types/ranges.hpp>
+#include <uhd/types/wb_iface.hpp>
+#include <uhd/property_tree.hpp>
#include <boost/utility.hpp>
#include <boost/shared_ptr.hpp>
-#include <uhd/types/wb_iface.hpp>
class tx_dsp_core_3000 : boost::noncopyable{
public:
+ static const double DEFAULT_CORDIC_FREQ;
+ static const double DEFAULT_RATE;
+
typedef boost::shared_ptr<tx_dsp_core_3000> sptr;
virtual ~tx_dsp_core_3000(void) = 0;
@@ -51,6 +55,8 @@ public:
virtual double set_freq(const double freq) = 0;
virtual void setup(const uhd::stream_args_t &stream_args) = 0;
+
+ virtual void populate_subtree(uhd::property_tree::sptr subtree) = 0;
};
#endif /* INCLUDED_LIBUHD_USRP_TX_DSP_CORE_3000_HPP */