diff options
Diffstat (limited to 'lib/usrp/dboard')
-rw-r--r-- | lib/usrp/dboard/Makefile.am | 6 | ||||
-rw-r--r-- | lib/usrp/dboard/basic.cpp | 45 | ||||
-rw-r--r-- | lib/usrp/dboard/dboards.hpp | 34 | ||||
-rw-r--r-- | lib/usrp/dboard/manager.cpp | 26 |
4 files changed, 97 insertions, 14 deletions
diff --git a/lib/usrp/dboard/Makefile.am b/lib/usrp/dboard/Makefile.am index 7bbf4e4f8..20d28c9ed 100644 --- a/lib/usrp/dboard/Makefile.am +++ b/lib/usrp/dboard/Makefile.am @@ -10,11 +10,15 @@ AM_CPPFLAGS = $(GENERAL_CPPFLAGS) noinst_LTLIBRARIES = lib.la +dboard_sources = \ + basic.cpp + lib_la_SOURCES = \ + $(dboard_sources) \ base.cpp \ interface.cpp \ manager.cpp lib_la_LIBADD = $(GENERAL_LDDFLAGS) -noinst_HEADERS = +noinst_HEADERS = dboards.hpp diff --git a/lib/usrp/dboard/basic.cpp b/lib/usrp/dboard/basic.cpp new file mode 100644 index 000000000..120b637b2 --- /dev/null +++ b/lib/usrp/dboard/basic.cpp @@ -0,0 +1,45 @@ +// +// Copyright 2010 Ettus Research LLC +// + +#include "dboards.hpp" + +/*********************************************************************** + * Basic RX dboard + **********************************************************************/ +basic_rx::basic_rx(size_t subdev_index, interface::sptr dboard_interface) +: rx_base(subdev_index, dboard_interface){ + /* NOP */ +} + +basic_rx::~basic_rx(void){ + /* NOP */ +} + +void basic_rx::rx_get(const wax::type &key, wax::type &val){ + /* TODO */ +} + +void basic_rx::rx_set(const wax::type &key, const wax::type &val){ + /* TODO */ +} + +/*********************************************************************** + * Basic TX dboard + **********************************************************************/ +basic_tx::basic_tx(size_t subdev_index, interface::sptr dboard_interface) +: tx_base(subdev_index, dboard_interface){ + /* NOP */ +} + +basic_tx::~basic_tx(void){ + /* NOP */ +} + +void basic_tx::tx_get(const wax::type &key, wax::type &val){ + /* TODO */ +} + +void basic_tx::tx_set(const wax::type &key, const wax::type &val){ + /* TODO */ +} diff --git a/lib/usrp/dboard/dboards.hpp b/lib/usrp/dboard/dboards.hpp new file mode 100644 index 000000000..0a54ec948 --- /dev/null +++ b/lib/usrp/dboard/dboards.hpp @@ -0,0 +1,34 @@ +// +// Copyright 2010 Ettus Research LLC +// + +#ifndef INCLUDED_LOCAL_DBOARDS_HPP +#define INCLUDED_LOCAL_DBOARDS_HPP + +#include <usrp_uhd/usrp/dboard/base.hpp> + +using namespace usrp_uhd::usrp::dboard; + +/*********************************************************************** + * The basic boards: + **********************************************************************/ +class basic_rx : public rx_base{ +public: + basic_rx(size_t subdev_index, interface::sptr dboard_interface); + ~basic_rx(void); + + void rx_get(const wax::type &key, wax::type &val); + void rx_set(const wax::type &key, const wax::type &val); +}; + +class basic_tx : public tx_base{ +public: + basic_tx(size_t subdev_index, interface::sptr dboard_interface); + ~basic_tx(void); + + void tx_get(const wax::type &key, wax::type &val); + void tx_set(const wax::type &key, const wax::type &val); + +}; + +#endif /* INCLUDED_LOCAL_DBOARDS_HPP */ diff --git a/lib/usrp/dboard/manager.cpp b/lib/usrp/dboard/manager.cpp index 1ed563777..4ceaf0b56 100644 --- a/lib/usrp/dboard/manager.cpp +++ b/lib/usrp/dboard/manager.cpp @@ -19,8 +19,8 @@ public: enum type_t{RX_TYPE, TX_TYPE}; //structors - subdev_proxy(xcvr_base::sptr dboard, type_t type) - : _dboard(dboard), _type(type){ + subdev_proxy(xcvr_base::sptr subdev, type_t type) + : _subdev(subdev), _type(type){ /* NOP */ } @@ -29,22 +29,22 @@ public: } private: - xcvr_base::sptr _dboard; + xcvr_base::sptr _subdev; type_t _type; //forward the get calls to the rx or tx void get(const wax::type &key, wax::type &val){ switch(_type){ - case RX_TYPE: return _dboard->rx_get(key, val); - case TX_TYPE: return _dboard->tx_get(key, val); + case RX_TYPE: return _subdev->rx_get(key, val); + case TX_TYPE: return _subdev->tx_get(key, val); } } //forward the set calls to the rx or tx void set(const wax::type &key, const wax::type &val){ switch(_type){ - case RX_TYPE: return _dboard->rx_set(key, val); - case TX_TYPE: return _dboard->tx_set(key, val); + case RX_TYPE: return _subdev->rx_set(key, val); + case TX_TYPE: return _subdev->tx_set(key, val); } } }; @@ -52,8 +52,8 @@ private: /*********************************************************************** * dboard manager methods **********************************************************************/ -//include dboard derived classes: -//TODO #inlude "basic.hpp" +//include dboard derived classes (local include) +#include "dboards.hpp" #define MAKE_DBOARD_ID_WORD(rx_id, tx_id) \ ((uint32_t(rx_id) << 16) | (uint32_t(tx_id) << 0)) @@ -67,10 +67,10 @@ manager::manager( //xcvrs will be added to both vectors switch(MAKE_DBOARD_ID_WORD(rx_dboard_id, tx_dboard_id)){ default: - //_rx_dboards.push_back(xcvr_base::sptr(new basic_rx(0, dboard_interface))); - //_rx_dboards.push_back(xcvr_base::sptr(new basic_rx(1, dboard_interface))); - //_rx_dboards.push_back(xcvr_base::sptr(new basic_rx(2, dboard_interface))); - //_tx_dboards.push_back(xcvr_base::sptr(new basic_tx(0, dboard_interface))); + _rx_dboards.push_back(xcvr_base::sptr(new basic_rx(0, dboard_interface))); + _rx_dboards.push_back(xcvr_base::sptr(new basic_rx(1, dboard_interface))); + _rx_dboards.push_back(xcvr_base::sptr(new basic_rx(2, dboard_interface))); + _tx_dboards.push_back(xcvr_base::sptr(new basic_tx(0, dboard_interface))); break; } } |