From e7d4233a94571a2479b21bc081567214c38cc155 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 15 Aug 2010 19:12:41 -0700 Subject: usrp1: add skeleton code for setting subdev spec --- host/lib/usrp/usrp1/dboard_iface.cpp | 3 ++- host/lib/usrp/usrp1/mboard_impl.cpp | 33 +++++++++++++++++++++++++++++++-- host/lib/usrp/usrp1/usrp1_impl.hpp | 2 ++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/host/lib/usrp/usrp1/dboard_iface.cpp b/host/lib/usrp/usrp1/dboard_iface.cpp index 82ef9e65b..142907e57 100644 --- a/host/lib/usrp/usrp1/dboard_iface.cpp +++ b/host/lib/usrp/usrp1/dboard_iface.cpp @@ -112,7 +112,7 @@ private: dboard_iface::sptr usrp1_impl::make_dboard_iface(usrp1_iface::sptr iface, usrp1_clock_ctrl::sptr clock, usrp1_codec_ctrl::sptr codec, - usrp1_impl::dboard_slot_t dboard_slot + dboard_slot_t dboard_slot ){ return dboard_iface::sptr(new usrp1_dboard_iface(iface, clock, codec, dboard_slot)); } @@ -221,6 +221,7 @@ void usrp1_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t atr, boost::uint16_t value) { if ((atr == ATR_REG_IDLE) || (atr == ATR_REG_FULL_DUPLEX)) { + //TODO probably just ignore these two atr settings because all dboards will try to set them std::cerr << "error: set_atr_reg(): unsupported state" << std::endl; return; } diff --git a/host/lib/usrp/usrp1/mboard_impl.cpp b/host/lib/usrp/usrp1/mboard_impl.cpp index e0a7fefb1..5e0285dfd 100644 --- a/host/lib/usrp/usrp1/mboard_impl.cpp +++ b/host/lib/usrp/usrp1/mboard_impl.cpp @@ -17,6 +17,7 @@ #include "usrp1_impl.hpp" #include "usrp_commands.h" +#include "../misc_utils.hpp" #include #include #include @@ -168,6 +169,14 @@ void usrp1_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(); } } @@ -184,8 +193,28 @@ void usrp1_impl::mboard_set(const wax::obj &key, const wax::obj &val) issue_stream_cmd(val.as()); return; - case MBOARD_PROP_TIME_NOW: - case MBOARD_PROP_TIME_NEXT_PPS: + case MBOARD_PROP_RX_SUBDEV_SPEC: + _rx_subdev_spec = val.as(); + verify_rx_subdev_spec(_rx_subdev_spec, this->get_link()); + //sanity check + UHD_ASSERT_THROW(_rx_subdev_spec.size() <= 2); + //set the mux and set the number of rx channels + //-------------------------------------------------- + // TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO + //-------------------------------------------------- + return; + + case MBOARD_PROP_TX_SUBDEV_SPEC: + _tx_subdev_spec = val.as(); + verify_tx_subdev_spec(_tx_subdev_spec, this->get_link()); + //sanity check + UHD_ASSERT_THROW(_tx_subdev_spec.size() <= 2); + //set the mux and set the number of tx channels + //-------------------------------------------------- + // TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO + //-------------------------------------------------- + return; + default: UHD_THROW_PROP_SET_ERROR(); } } diff --git a/host/lib/usrp/usrp1/usrp1_impl.hpp b/host/lib/usrp/usrp1/usrp1_impl.hpp index 84ec26827..5166f989f 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.hpp +++ b/host/lib/usrp/usrp1/usrp1_impl.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -131,6 +132,7 @@ private: //configuration shadows uhd::clock_config_t _clock_config; + uhd::usrp::subdev_spec_t _rx_subdev_spec, _tx_subdev_spec; //clock control usrp1_clock_ctrl::sptr _clock_ctrl; -- cgit v1.2.3