aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-08-11 12:32:57 -0700
committerJosh Blum <josh@joshknows.com>2010-08-11 12:32:57 -0700
commit3f25b6fee4a7788ffea0224cb79bb6334b621992 (patch)
tree5aeda83c192662e5968aa23642dc37247c27aa5c /host/lib
parent457ee4f8bd5f9ade6d4fbcbafb8b0adbe769ae3c (diff)
downloaduhd-3f25b6fee4a7788ffea0224cb79bb6334b621992.tar.gz
uhd-3f25b6fee4a7788ffea0224cb79bb6334b621992.tar.bz2
uhd-3f25b6fee4a7788ffea0224cb79bb6334b621992.zip
usrp-e: filled in properties and logic for subdev spec
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/usrp_e/dboard_impl.cpp1
-rw-r--r--host/lib/usrp/usrp_e/mboard_impl.cpp36
-rw-r--r--host/lib/usrp/usrp_e/usrp_e_impl.hpp2
3 files changed, 38 insertions, 1 deletions
diff --git a/host/lib/usrp/usrp_e/dboard_impl.cpp b/host/lib/usrp/usrp_e/dboard_impl.cpp
index 4d3f70dfe..809b6f06b 100644
--- a/host/lib/usrp/usrp_e/dboard_impl.cpp
+++ b/host/lib/usrp/usrp_e/dboard_impl.cpp
@@ -17,7 +17,6 @@
#include "usrp_e_impl.hpp"
#include "usrp_e_regs.hpp"
-#include "../dsp_utils.hpp"
#include <uhd/utils/assert.hpp>
#include <uhd/usrp/dboard_props.hpp>
#include <uhd/usrp/subdev_props.hpp>
diff --git a/host/lib/usrp/usrp_e/mboard_impl.cpp b/host/lib/usrp/usrp_e/mboard_impl.cpp
index e27c1964a..822f1571d 100644
--- a/host/lib/usrp/usrp_e/mboard_impl.cpp
+++ b/host/lib/usrp/usrp_e/mboard_impl.cpp
@@ -17,6 +17,8 @@
#include "usrp_e_impl.hpp"
#include "usrp_e_regs.hpp"
+#include "../dsp_utils.hpp"
+#include "../misc_utils.hpp"
#include <uhd/utils/assert.hpp>
#include <uhd/usrp/mboard_props.hpp>
#include <boost/bind.hpp>
@@ -38,6 +40,10 @@ void usrp_e_impl::mboard_init(void){
_clock_config.pps_source = clock_config_t::PPS_SMA;
//TODO poke the clock config regs
+
+ //set default subdev specs
+ this->mboard_set(MBOARD_PROP_RX_SUBDEV_SPEC, subdev_spec_t());
+ this->mboard_set(MBOARD_PROP_TX_SUBDEV_SPEC, subdev_spec_t());
}
/***********************************************************************
@@ -98,6 +104,14 @@ void usrp_e_impl::mboard_get(const wax::obj &key_, wax::obj &val){
val = _clock_config;
return;
+ case MBOARD_PROP_RX_SUBDEV_SPEC:
+ val = _rx_subdev_spec;
+ return;
+
+ case MBOARD_PROP_TX_SUBDEV_SPEC:
+ val = _tx_subdev_spec;
+ return;
+
default: UHD_THROW_PROP_GET_ERROR();
}
}
@@ -123,6 +137,28 @@ void usrp_e_impl::mboard_set(const wax::obj &key, const wax::obj &val){
}
return;
+ case MBOARD_PROP_RX_SUBDEV_SPEC:
+ _rx_subdev_spec = val.as<subdev_spec_t>();
+ verify_rx_subdev_spec(_rx_subdev_spec, this->get_link());
+ //sanity check
+ UHD_ASSERT_THROW(_rx_subdev_spec.size() == 1);
+ //set the mux
+ _iface->poke32(UE_REG_DSP_RX_MUX, dsp_type1::calc_rx_mux_word(
+ _dboard_manager->get_rx_subdev(_rx_subdev_spec.front().sd_name)[SUBDEV_PROP_CONNECTION].as<subdev_conn_t>()
+ ));
+ return;
+
+ case MBOARD_PROP_TX_SUBDEV_SPEC:
+ _tx_subdev_spec = val.as<subdev_spec_t>();
+ verify_tx_subdev_spec(_tx_subdev_spec, this->get_link());
+ //sanity check
+ UHD_ASSERT_THROW(_tx_subdev_spec.size() == 1);
+ //set the mux
+ _iface->poke32(UE_REG_DSP_TX_MUX, dsp_type1::calc_tx_mux_word(
+ _dboard_manager->get_tx_subdev(_tx_subdev_spec.front().sd_name)[SUBDEV_PROP_CONNECTION].as<subdev_conn_t>()
+ ));
+ return;
+
default: UHD_THROW_PROP_SET_ERROR();
}
}
diff --git a/host/lib/usrp/usrp_e/usrp_e_impl.hpp b/host/lib/usrp/usrp_e/usrp_e_impl.hpp
index 4bbe100c1..e3249e9de 100644
--- a/host/lib/usrp/usrp_e/usrp_e_impl.hpp
+++ b/host/lib/usrp/usrp_e/usrp_e_impl.hpp
@@ -20,6 +20,7 @@
#include "codec_ctrl.hpp"
#include <uhd/device.hpp>
#include <uhd/utils/pimpl.hpp>
+#include <uhd/usrp/subdev_spec.hpp>
#include <uhd/usrp/dboard_eeprom.hpp>
#include <uhd/types/clock_config.hpp>
#include <uhd/types/stream_cmd.hpp>
@@ -119,6 +120,7 @@ private:
void mboard_get(const wax::obj &, wax::obj &);
void mboard_set(const wax::obj &, const wax::obj &);
wax_obj_proxy::sptr _mboard_proxy;
+ uhd::usrp::subdev_spec_t _rx_subdev_spec, _tx_subdev_spec;
//xx dboard functions and settings
void dboard_init(void);