diff options
| -rw-r--r-- | Makefile.am | 1 | ||||
| -rw-r--r-- | Makefile.common | 4 | ||||
| -rw-r--r-- | include/usrp_uhd/usrp/dboard/base.hpp | 6 | ||||
| -rw-r--r-- | include/usrp_uhd/usrp/dboard/interface.hpp | 6 | ||||
| -rw-r--r-- | include/usrp_uhd/usrp/dboard/manager.hpp | 6 | ||||
| -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 | 
9 files changed, 109 insertions, 25 deletions
| diff --git a/Makefile.am b/Makefile.am index 84f1bf68d..950b5a89a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,6 +14,7 @@ pkgconfig_DATA = usrp_uhd.pc  EXTRA_DIST = $(srcdir)/usrp_uhd.pc.in  BUILT_SOURCES = usrp_uhd.pc +MOSTLYCLEANFILES = $(BUILT_SOURCES)  usrp_uhd.pc: $(srcdir)/usrp_uhd.pc.in Makefile  	$(SED) \ diff --git a/Makefile.common b/Makefile.common index 91958e393..8972e4f42 100644 --- a/Makefile.common +++ b/Makefile.common @@ -2,9 +2,9 @@  # Copyright 2010 Ettus Research LLC  # -USRP_UHD_LA = $(top_srcdir)/lib/libusrp_uhd.la +USRP_UHD_LA = $(abs_top_builddir)/lib/libusrp_uhd.la -USRP_UHD_USRP_DBOARD_LA = $(top_srcdir)/lib/usrp/dboard/lib.la +USRP_UHD_USRP_DBOARD_LA = $(abs_top_builddir)/lib/usrp/dboard/lib.la  GENERAL_CPPFLAGS = \  	-I$(top_srcdir)/include \ diff --git a/include/usrp_uhd/usrp/dboard/base.hpp b/include/usrp_uhd/usrp/dboard/base.hpp index 23ae4a4fe..86ab7dde6 100644 --- a/include/usrp_uhd/usrp/dboard/base.hpp +++ b/include/usrp_uhd/usrp/dboard/base.hpp @@ -2,8 +2,8 @@  // Copyright 2010 Ettus Research LLC  // -#ifndef INCLUDED_USRP_UHD_USRP_DBOARD_BASE_H -#define INCLUDED_USRP_UHD_USRP_DBOARD_BASE_H +#ifndef INCLUDED_USRP_UHD_USRP_DBOARD_BASE_HPP +#define INCLUDED_USRP_UHD_USRP_DBOARD_BASE_HPP  #include <usrp_uhd/wax.hpp>  #include <boost/utility.hpp> @@ -77,4 +77,4 @@ public:  }}} //namespace -#endif /* INCLUDED_USRP_UHD_USRP_DBOARD_BASE_H */ +#endif /* INCLUDED_USRP_UHD_USRP_DBOARD_BASE_HPP */ diff --git a/include/usrp_uhd/usrp/dboard/interface.hpp b/include/usrp_uhd/usrp/dboard/interface.hpp index f9e4c96b4..e6fdd9ad1 100644 --- a/include/usrp_uhd/usrp/dboard/interface.hpp +++ b/include/usrp_uhd/usrp/dboard/interface.hpp @@ -2,8 +2,8 @@  // Copyright 2010 Ettus Research LLC  // -#ifndef INCLUDED_USRP_UHD_USRP_DBOARD_INTERFACE_H -#define INCLUDED_USRP_UHD_USRP_DBOARD_INTERFACE_H +#ifndef INCLUDED_USRP_UHD_USRP_DBOARD_INTERFACE_HPP +#define INCLUDED_USRP_UHD_USRP_DBOARD_INTERFACE_HPP  #include <boost/shared_ptr.hpp>  #include <stdint.h> @@ -144,4 +144,4 @@ public:  }}} //namespace -#endif /* INCLUDED_USRP_UHD_USRP_DBOARD_INTERFACE_H */ +#endif /* INCLUDED_USRP_UHD_USRP_DBOARD_INTERFACE_HPP */ diff --git a/include/usrp_uhd/usrp/dboard/manager.hpp b/include/usrp_uhd/usrp/dboard/manager.hpp index 565411371..29aca83f0 100644 --- a/include/usrp_uhd/usrp/dboard/manager.hpp +++ b/include/usrp_uhd/usrp/dboard/manager.hpp @@ -2,8 +2,8 @@  // Copyright 2010 Ettus Research LLC  // -#ifndef INCLUDED_USRP_UHD_USRP_DBOARD_MANAGER_H -#define INCLUDED_USRP_UHD_USRP_DBOARD_MANAGER_H +#ifndef INCLUDED_USRP_UHD_USRP_DBOARD_MANAGER_HPP +#define INCLUDED_USRP_UHD_USRP_DBOARD_MANAGER_HPP  #include <vector>  #include <usrp_uhd/wax.hpp> @@ -44,4 +44,4 @@ private:  }}} //namespace -#endif /* INCLUDED_USRP_UHD_USRP_DBOARD_MANAGER_H */ +#endif /* INCLUDED_USRP_UHD_USRP_DBOARD_MANAGER_HPP */ 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;      }  } | 
