diff options
-rw-r--r-- | host/include/uhd/usrp/CMakeLists.txt | 9 | ||||
-rw-r--r-- | host/include/uhd/usrp/dboard/CMakeLists.txt | 25 | ||||
-rw-r--r-- | host/include/uhd/usrp/dboard_base.hpp (renamed from host/include/uhd/usrp/dboard/base.hpp) | 46 | ||||
-rw-r--r-- | host/include/uhd/usrp/dboard_id.hpp (renamed from host/include/uhd/usrp/dboard/id.hpp) | 6 | ||||
-rw-r--r-- | host/include/uhd/usrp/dboard_interface.hpp (renamed from host/include/uhd/usrp/dboard/interface.hpp) | 20 | ||||
-rw-r--r-- | host/include/uhd/usrp/dboard_manager.hpp (renamed from host/include/uhd/usrp/dboard/manager.hpp) | 26 | ||||
-rw-r--r-- | host/include/uhd/usrp/mboard/CMakeLists.txt | 23 | ||||
-rw-r--r-- | host/include/uhd/usrp/mboard_base.hpp (renamed from host/include/uhd/usrp/mboard/base.hpp) | 14 | ||||
-rw-r--r-- | host/include/uhd/usrp/usrp.hpp | 4 | ||||
-rw-r--r-- | host/include/uhd/usrp/usrp2.hpp (renamed from host/include/uhd/usrp/mboard/usrp2.hpp) | 8 | ||||
-rw-r--r-- | host/lib/CMakeLists.txt | 22 | ||||
-rw-r--r-- | host/lib/device.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/dboard/basic.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/dboard/dboards.hpp | 16 | ||||
-rw-r--r-- | host/lib/usrp/dboard_base.cpp (renamed from host/lib/usrp/dboard/base.cpp) | 52 | ||||
-rw-r--r-- | host/lib/usrp/dboard_id.cpp (renamed from host/lib/usrp/dboard/id.cpp) | 6 | ||||
-rw-r--r-- | host/lib/usrp/dboard_interface.cpp (renamed from host/lib/usrp/dboard/interface.cpp) | 14 | ||||
-rw-r--r-- | host/lib/usrp/dboard_manager.cpp (renamed from host/lib/usrp/dboard/manager.cpp) | 62 | ||||
-rw-r--r-- | host/lib/usrp/mboard_base.cpp (renamed from host/lib/usrp/mboard/base.cpp) | 8 | ||||
-rw-r--r-- | host/lib/usrp/usrp.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/usrp2.cpp (renamed from host/lib/usrp/mboard/usrp2.cpp) | 4 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/dboard_impl.cpp (renamed from host/lib/usrp/mboard/usrp2/dboard_impl.cpp) | 12 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/dboard_interface.cpp (renamed from host/lib/usrp/mboard/usrp2/dboard_interface.cpp) | 58 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/dboard_interface.hpp (renamed from host/lib/usrp/mboard/usrp2/dboard_interface.hpp) | 8 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/dsp_impl.cpp (renamed from host/lib/usrp/mboard/usrp2/dsp_impl.cpp) | 0 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/fw_common.h (renamed from host/lib/usrp/mboard/usrp2/fw_common.h) | 0 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/mboard_impl.cpp (renamed from host/lib/usrp/mboard/usrp2/mboard_impl.cpp) | 0 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_impl.cpp (renamed from host/lib/usrp/mboard/usrp2/usrp2_impl.cpp) | 1 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_impl.hpp (renamed from host/lib/usrp/mboard/usrp2/usrp2_impl.hpp) | 4 |
29 files changed, 207 insertions, 253 deletions
diff --git a/host/include/uhd/usrp/CMakeLists.txt b/host/include/uhd/usrp/CMakeLists.txt index d3040c3cc..4b49e315f 100644 --- a/host/include/uhd/usrp/CMakeLists.txt +++ b/host/include/uhd/usrp/CMakeLists.txt @@ -16,10 +16,13 @@ # -ADD_SUBDIRECTORY(dboard) -ADD_SUBDIRECTORY(mboard) - INSTALL(FILES + dboard_base.hpp + dboard_id.hpp + dboard_interface.hpp + dboard_manager.hpp + mboard_base.hpp + usrp2.hpp usrp.hpp DESTINATION ${HEADER_DIR}/uhd/usrp ) diff --git a/host/include/uhd/usrp/dboard/CMakeLists.txt b/host/include/uhd/usrp/dboard/CMakeLists.txt deleted file mode 100644 index e1ecc3b70..000000000 --- a/host/include/uhd/usrp/dboard/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright 2010 Ettus Research LLC -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# - - -INSTALL(FILES - base.hpp - id.hpp - interface.hpp - manager.hpp - DESTINATION ${HEADER_DIR}/uhd/usrp/dboard -) diff --git a/host/include/uhd/usrp/dboard/base.hpp b/host/include/uhd/usrp/dboard_base.hpp index 111820a8b..b5c0d40ed 100644 --- a/host/include/uhd/usrp/dboard/base.hpp +++ b/host/include/uhd/usrp/dboard_base.hpp @@ -22,26 +22,26 @@ #include <boost/utility.hpp> #include <boost/shared_ptr.hpp> #include <boost/tuple/tuple.hpp> -#include <uhd/usrp/dboard/id.hpp> -#include <uhd/usrp/dboard/interface.hpp> +#include <uhd/usrp/dboard_id.hpp> +#include <uhd/usrp/dboard_interface.hpp> -namespace uhd{ namespace usrp{ namespace dboard{ +namespace uhd{ namespace usrp{ /*! - * A daughter board base class for all dboards. - * Only other dboard base classes should inherit this. + * A daughter board dboard_base class for all dboards. + * Only other dboard dboard_base classes should inherit this. */ -class base : boost::noncopyable{ +class dboard_base : boost::noncopyable{ public: - typedef boost::shared_ptr<base> sptr; + typedef boost::shared_ptr<dboard_base> sptr; //the constructor args consist of a subdev name and an interface - //derived classes should pass the args into the base class ctor + //derived classes should pass the args into the dboard_base class ctor //but should not have to deal with the internals of the args - typedef boost::tuple<std::string, interface::sptr, dboard_id_t, dboard_id_t> ctor_args_t; + typedef boost::tuple<std::string, dboard_interface::sptr, dboard_id_t, dboard_id_t> ctor_args_t; //structors - base(ctor_args_t const&); - virtual ~base(void); + dboard_base(ctor_args_t const&); + virtual ~dboard_base(void); //interface virtual void rx_get(const wax::obj &key, wax::obj &val) = 0; @@ -51,13 +51,13 @@ public: protected: std::string get_subdev_name(void); - interface::sptr get_interface(void); + dboard_interface::sptr get_interface(void); dboard_id_t get_rx_id(void); dboard_id_t get_tx_id(void); private: std::string _subdev_name; - interface::sptr _dboard_interface; + dboard_interface::sptr _dboard_interface; dboard_id_t _rx_id, _tx_id; }; @@ -65,27 +65,27 @@ private: * A xcvr daughter board implements rx and tx methods * Sub classes for xcvr boards should inherit this. */ -class xcvr_base : public base{ +class xcvr_dboard_base : public dboard_base{ public: /*! * Create a new xcvr dboard object, override in subclasses. */ - xcvr_base(ctor_args_t const&); - virtual ~xcvr_base(void); + xcvr_dboard_base(ctor_args_t const&); + virtual ~xcvr_dboard_base(void); }; /*! * A rx daughter board only implements rx methods. * Sub classes for rx-only boards should inherit this. */ -class rx_base : public base{ +class rx_dboard_base : public dboard_base{ public: /*! * Create a new rx dboard object, override in subclasses. */ - rx_base(ctor_args_t const&); + rx_dboard_base(ctor_args_t const&); - virtual ~rx_base(void); + virtual ~rx_dboard_base(void); //override here so the derived classes cannot void tx_get(const wax::obj &key, wax::obj &val); @@ -96,20 +96,20 @@ public: * A tx daughter board only implements tx methods. * Sub classes for rx-only boards should inherit this. */ -class tx_base : public base{ +class tx_dboard_base : public dboard_base{ public: /*! * Create a new rx dboard object, override in subclasses. */ - tx_base(ctor_args_t const&); + tx_dboard_base(ctor_args_t const&); - virtual ~tx_base(void); + virtual ~tx_dboard_base(void); //override here so the derived classes cannot void rx_get(const wax::obj &key, wax::obj &val); void rx_set(const wax::obj &key, const wax::obj &val); }; -}}} //namespace +}} //namespace #endif /* INCLUDED_UHD_USRP_DBOARD_BASE_HPP */ diff --git a/host/include/uhd/usrp/dboard/id.hpp b/host/include/uhd/usrp/dboard_id.hpp index a890ee096..8e904ff33 100644 --- a/host/include/uhd/usrp/dboard/id.hpp +++ b/host/include/uhd/usrp/dboard_id.hpp @@ -20,7 +20,7 @@ #ifndef INCLUDED_UHD_USRP_DBOARD_ID_HPP #define INCLUDED_UHD_USRP_DBOARD_ID_HPP -namespace uhd{ namespace usrp{ namespace dboard{ +namespace uhd{ namespace usrp{ enum dboard_id_t{ ID_NONE = 0xffff, @@ -28,10 +28,10 @@ enum dboard_id_t{ ID_BASIC_RX = 0x0001 }; -struct id{ +struct dboard_id{ static std::string to_string(const dboard_id_t &id); }; -}}} //namespace +}} //namespace #endif /* INCLUDED_UHD_USRP_DBOARD_ID_HPP */ diff --git a/host/include/uhd/usrp/dboard/interface.hpp b/host/include/uhd/usrp/dboard_interface.hpp index 7c48f4d2b..84e1f5b22 100644 --- a/host/include/uhd/usrp/dboard/interface.hpp +++ b/host/include/uhd/usrp/dboard_interface.hpp @@ -22,17 +22,17 @@ #include <vector> #include <stdint.h> -namespace uhd{ namespace usrp{ namespace dboard{ +namespace uhd{ namespace usrp{ /*! - * The daughter board interface to be subclassed. - * A dboard instance interfaces with the mboard though this api. - * This interface provides i2c, spi, gpio, atr, aux dac/adc access. - * Each mboard should have a specially tailored dboard interface. + * The daughter board dboard_interface to be subclassed. + * A dboard instance dboard_interfaces with the mboard though this api. + * This dboard_interface provides i2c, spi, gpio, atr, aux dac/adc access. + * Each mboard should have a specially tailored dboard dboard_interface. */ -class interface{ +class dboard_interface{ public: - typedef boost::shared_ptr<interface> sptr; + typedef boost::shared_ptr<dboard_interface> sptr; typedef std::vector<uint8_t> byte_vector_t; //tells the host which unit to use @@ -66,8 +66,8 @@ public: }; //structors - interface(void); - virtual ~interface(void); + dboard_interface(void); + virtual ~dboard_interface(void); /*! * Write to an aux dac. @@ -202,6 +202,6 @@ private: ) = 0; }; -}}} //namespace +}} //namespace #endif /* INCLUDED_UHD_USRP_DBOARD_INTERFACE_HPP */ diff --git a/host/include/uhd/usrp/dboard/manager.hpp b/host/include/uhd/usrp/dboard_manager.hpp index e53ba8e52..d927f6231 100644 --- a/host/include/uhd/usrp/dboard/manager.hpp +++ b/host/include/uhd/usrp/dboard_manager.hpp @@ -23,22 +23,22 @@ #include <uhd/props.hpp> #include <boost/utility.hpp> #include <boost/shared_ptr.hpp> -#include <uhd/usrp/dboard/base.hpp> -#include <uhd/usrp/dboard/id.hpp> +#include <uhd/usrp/dboard_base.hpp> +#include <uhd/usrp/dboard_id.hpp> -namespace uhd{ namespace usrp{ namespace dboard{ +namespace uhd{ namespace usrp{ /*! - * A daughter board subdev manager class. + * A daughter board subdev dboard_manager class. * Create subdev instances for each subdev on a dboard. * Provide wax::obj access to the subdevs inside. */ -class manager : boost::noncopyable{ +class dboard_manager : boost::noncopyable{ public: //dboard constructor (each dboard should have a ::make with this signature) - typedef base::sptr(*dboard_ctor_t)(base::ctor_args_t const&); + typedef dboard_base::sptr(*dboard_ctor_t)(dboard_base::ctor_args_t const&); /*! * Register subdevices for a given dboard id. @@ -54,29 +54,29 @@ public: ); public: - typedef boost::shared_ptr<manager> sptr; + typedef boost::shared_ptr<dboard_manager> sptr; //structors - manager( + dboard_manager( dboard_id_t rx_dboard_id, dboard_id_t tx_dboard_id, - interface::sptr dboard_interface + dboard_interface::sptr interface ); - ~manager(void); + ~dboard_manager(void); - //interface + //dboard_interface prop_names_t get_rx_subdev_names(void); prop_names_t get_tx_subdev_names(void); wax::obj get_rx_subdev(const std::string &subdev_name); wax::obj get_tx_subdev(const std::string &subdev_name); private: - //list of rx and tx dboards in this manager + //list of rx and tx dboards in this dboard_manager //each dboard here is actually a subdevice proxy //the subdevice proxy is internal to the cpp file uhd::dict<std::string, wax::obj> _rx_dboards; uhd::dict<std::string, wax::obj> _tx_dboards; }; -}}} //namespace +}} //namespace #endif /* INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP */ diff --git a/host/include/uhd/usrp/mboard/CMakeLists.txt b/host/include/uhd/usrp/mboard/CMakeLists.txt deleted file mode 100644 index 2cdb55143..000000000 --- a/host/include/uhd/usrp/mboard/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# -# Copyright 2010 Ettus Research LLC -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -# - - -INSTALL(FILES - base.hpp - usrp2.hpp - DESTINATION ${HEADER_DIR}/uhd/usrp/mboard -) diff --git a/host/include/uhd/usrp/mboard/base.hpp b/host/include/uhd/usrp/mboard_base.hpp index a8de81a7e..498a46681 100644 --- a/host/include/uhd/usrp/mboard/base.hpp +++ b/host/include/uhd/usrp/mboard_base.hpp @@ -22,16 +22,16 @@ #include <boost/utility.hpp> #include <boost/shared_ptr.hpp> -namespace uhd{ namespace usrp{ namespace mboard{ +namespace uhd{ namespace usrp{ /*! - * A base class for usrp mboard objects. + * A mboard_base class for usrp mboard objects. */ -class base : boost::noncopyable, public wax::obj{ +class mboard_base : boost::noncopyable, public wax::obj{ public: - typedef boost::shared_ptr<base> sptr; - base(void); - ~base(void); + typedef boost::shared_ptr<mboard_base> sptr; + mboard_base(void); + ~mboard_base(void); //TODO other api calls @@ -40,6 +40,6 @@ private: virtual void set(const wax::obj &, const wax::obj &) = 0; }; -}}} //namespace +}} //namespace #endif /* INCLUDED_UHD_USRP_MBOARD_BASE_HPP */ diff --git a/host/include/uhd/usrp/usrp.hpp b/host/include/uhd/usrp/usrp.hpp index 98c357b77..cc5ed601e 100644 --- a/host/include/uhd/usrp/usrp.hpp +++ b/host/include/uhd/usrp/usrp.hpp @@ -16,7 +16,7 @@ // #include <uhd/device.hpp> -#include <uhd/usrp/mboard/base.hpp> +#include <uhd/usrp/mboard_base.hpp> #include <uhd/dict.hpp> #ifndef INCLUDED_UHD_USRP_USRP_HPP @@ -43,7 +43,7 @@ private: void get(const wax::obj &, wax::obj &); void set(const wax::obj &, const wax::obj &); - uhd::dict<std::string, mboard::base::sptr> _mboards; + uhd::dict<std::string, mboard_base::sptr> _mboards; boost::function<void(const std::vector<boost::asio::const_buffer> &)> _send_raw_cb; boost::function<uhd::shared_iovec(void)> _recv_raw_cb; }; diff --git a/host/include/uhd/usrp/mboard/usrp2.hpp b/host/include/uhd/usrp/usrp2.hpp index 5da9f874d..68d4c513c 100644 --- a/host/include/uhd/usrp/mboard/usrp2.hpp +++ b/host/include/uhd/usrp/usrp2.hpp @@ -18,15 +18,15 @@ #ifndef INCLUDED_UHD_USRP_MBOARD_USRP2_HPP #define INCLUDED_UHD_USRP_MBOARD_USRP2_HPP -#include <uhd/usrp/mboard/base.hpp> +#include <uhd/usrp/mboard_base.hpp> #include <uhd/device_addr.hpp> -namespace uhd{ namespace usrp{ namespace mboard{ +namespace uhd{ namespace usrp{ /*! * The usrp2 mboard class. */ -class usrp2 : public base{ +class usrp2 : public mboard_base{ public: /*! * Discover usrp2 devices over the ethernet. @@ -46,6 +46,6 @@ private: wax::obj _impl; }; -}}} //namespace +}} //namespace #endif /* INCLUDED_UHD_USRP_MBOARD_USRP2_HPP */ diff --git a/host/lib/CMakeLists.txt b/host/lib/CMakeLists.txt index 94dffa113..5bafc206d 100644 --- a/host/lib/CMakeLists.txt +++ b/host/lib/CMakeLists.txt @@ -26,17 +26,17 @@ SET(libuhd_sources transport/udp.cpp usrp/usrp.cpp usrp/dboard/basic.cpp - usrp/dboard/base.cpp - usrp/dboard/id.cpp - usrp/dboard/interface.cpp - usrp/dboard/manager.cpp - usrp/mboard/base.cpp - usrp/mboard/usrp2.cpp - usrp/mboard/usrp2/dboard_impl.cpp - usrp/mboard/usrp2/dboard_interface.cpp - usrp/mboard/usrp2/dsp_impl.cpp - usrp/mboard/usrp2/mboard_impl.cpp - usrp/mboard/usrp2/usrp2_impl.cpp + usrp/dboard_base.cpp + usrp/dboard_id.cpp + usrp/dboard_interface.cpp + usrp/dboard_manager.cpp + usrp/mboard_base.cpp + usrp/usrp2.cpp + usrp/usrp2/dboard_impl.cpp + usrp/usrp2/dboard_interface.cpp + usrp/usrp2/dsp_impl.cpp + usrp/usrp2/mboard_impl.cpp + usrp/usrp2/usrp2_impl.cpp ) ADD_LIBRARY(uhd SHARED ${libuhd_sources}) diff --git a/host/lib/device.cpp b/host/lib/device.cpp index 822733217..be27ac1ae 100644 --- a/host/lib/device.cpp +++ b/host/lib/device.cpp @@ -16,7 +16,7 @@ // #include <uhd/usrp/usrp.hpp> -#include <uhd/usrp/mboard/usrp2.hpp> +#include <uhd/usrp/usrp2.hpp> //TODO remove and call discover from usrp #include <uhd/device.hpp> #include <boost/format.hpp> #include <stdexcept> @@ -34,7 +34,7 @@ device_addrs_t device::discover(const device_addr_t &hint){ device_addrs.push_back(test_device_addr); } else if (hint["type"] == "udp"){ - std::vector<device_addr_t> usrp2_addrs = usrp::mboard::usrp2::discover(hint); + std::vector<device_addr_t> usrp2_addrs = usrp::usrp2::discover(hint); device_addrs.insert(device_addrs.begin(), usrp2_addrs.begin(), usrp2_addrs.end()); } return device_addrs; diff --git a/host/lib/usrp/dboard/basic.cpp b/host/lib/usrp/dboard/basic.cpp index 35512aa5f..f39ebff2f 100644 --- a/host/lib/usrp/dboard/basic.cpp +++ b/host/lib/usrp/dboard/basic.cpp @@ -20,7 +20,7 @@ /*********************************************************************** * Basic RX dboard **********************************************************************/ -basic_rx::basic_rx(ctor_args_t const& args) : rx_base(args){ +basic_rx::basic_rx(ctor_args_t const& args) : rx_dboard_base(args){ /* NOP */ } @@ -39,7 +39,7 @@ void basic_rx::rx_set(const wax::obj &, const wax::obj &){ /*********************************************************************** * Basic TX dboard **********************************************************************/ -basic_tx::basic_tx(ctor_args_t const& args) : tx_base(args){ +basic_tx::basic_tx(ctor_args_t const& args) : tx_dboard_base(args){ /* NOP */ } diff --git a/host/lib/usrp/dboard/dboards.hpp b/host/lib/usrp/dboard/dboards.hpp index 0e740856f..79b90d593 100644 --- a/host/lib/usrp/dboard/dboards.hpp +++ b/host/lib/usrp/dboard/dboards.hpp @@ -18,17 +18,17 @@ #ifndef INCLUDED_LOCAL_DBOARDS_HPP #define INCLUDED_LOCAL_DBOARDS_HPP -#include <uhd/usrp/dboard/base.hpp> +#include <uhd/usrp/dboard_base.hpp> -using namespace uhd::usrp::dboard; +using namespace uhd::usrp; /*********************************************************************** * The basic boards: **********************************************************************/ -class basic_rx : public rx_base{ +class basic_rx : public rx_dboard_base{ public: - static base::sptr make(ctor_args_t const& args){ - return base::sptr(new basic_rx(args)); + static dboard_base::sptr make(ctor_args_t const& args){ + return dboard_base::sptr(new basic_rx(args)); } basic_rx(ctor_args_t const& args); ~basic_rx(void); @@ -37,10 +37,10 @@ public: void rx_set(const wax::obj &key, const wax::obj &val); }; -class basic_tx : public tx_base{ +class basic_tx : public tx_dboard_base{ public: - static base::sptr make(ctor_args_t const& args){ - return base::sptr(new basic_tx(args)); + static dboard_base::sptr make(ctor_args_t const& args){ + return dboard_base::sptr(new basic_tx(args)); } basic_tx(ctor_args_t const& args); ~basic_tx(void); diff --git a/host/lib/usrp/dboard/base.cpp b/host/lib/usrp/dboard_base.cpp index 92a886407..6dd41cfd8 100644 --- a/host/lib/usrp/dboard/base.cpp +++ b/host/lib/usrp/dboard_base.cpp @@ -15,103 +15,103 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include <uhd/usrp/dboard/base.hpp> +#include <uhd/usrp/dboard_base.hpp> #include <boost/format.hpp> #include <stdexcept> -using namespace uhd::usrp::dboard; +using namespace uhd::usrp; /*********************************************************************** - * base dboard base class + * dboard_base dboard dboard_base class **********************************************************************/ -base::base(ctor_args_t const& args){ +dboard_base::dboard_base(ctor_args_t const& args){ boost::tie(_subdev_name, _dboard_interface, _rx_id, _tx_id) = args; } -base::~base(void){ +dboard_base::~dboard_base(void){ /* NOP */ } -std::string base::get_subdev_name(void){ +std::string dboard_base::get_subdev_name(void){ return _subdev_name; } -interface::sptr base::get_interface(void){ +dboard_interface::sptr dboard_base::get_interface(void){ return _dboard_interface; } -dboard_id_t base::get_rx_id(void){ +dboard_id_t dboard_base::get_rx_id(void){ return _rx_id; } -dboard_id_t base::get_tx_id(void){ +dboard_id_t dboard_base::get_tx_id(void){ return _tx_id; } /*********************************************************************** - * xcvr dboard base class + * xcvr dboard dboard_base class **********************************************************************/ -xcvr_base::xcvr_base(ctor_args_t const& args) : base(args){ +xcvr_dboard_base::xcvr_dboard_base(ctor_args_t const& args) : dboard_base(args){ if (get_rx_id() == ID_NONE){ throw std::runtime_error(str(boost::format( "cannot create xcvr board when the rx id is \"%s\"" - ) % id::to_string(ID_NONE))); + ) % dboard_id::to_string(ID_NONE))); } if (get_tx_id() == ID_NONE){ throw std::runtime_error(str(boost::format( "cannot create xcvr board when the tx id is \"%s\"" - ) % id::to_string(ID_NONE))); + ) % dboard_id::to_string(ID_NONE))); } } -xcvr_base::~xcvr_base(void){ +xcvr_dboard_base::~xcvr_dboard_base(void){ /* NOP */ } /*********************************************************************** - * rx dboard base class + * rx dboard dboard_base class **********************************************************************/ -rx_base::rx_base(ctor_args_t const& args) : base(args){ +rx_dboard_base::rx_dboard_base(ctor_args_t const& args) : dboard_base(args){ if (get_tx_id() != ID_NONE){ throw std::runtime_error(str(boost::format( "cannot create rx board when the tx id is \"%s\"" " -> expected a tx id of \"%s\"" - ) % id::to_string(get_tx_id()) % id::to_string(ID_NONE))); + ) % dboard_id::to_string(get_tx_id()) % dboard_id::to_string(ID_NONE))); } } -rx_base::~rx_base(void){ +rx_dboard_base::~rx_dboard_base(void){ /* NOP */ } -void rx_base::tx_get(const wax::obj &, wax::obj &){ +void rx_dboard_base::tx_get(const wax::obj &, wax::obj &){ throw std::runtime_error("cannot call tx_get on a rx dboard"); } -void rx_base::tx_set(const wax::obj &, const wax::obj &){ +void rx_dboard_base::tx_set(const wax::obj &, const wax::obj &){ throw std::runtime_error("cannot call tx_set on a rx dboard"); } /*********************************************************************** - * tx dboard base class + * tx dboard dboard_base class **********************************************************************/ -tx_base::tx_base(ctor_args_t const& args) : base(args){ +tx_dboard_base::tx_dboard_base(ctor_args_t const& args) : dboard_base(args){ if (get_rx_id() != ID_NONE){ throw std::runtime_error(str(boost::format( "cannot create tx board when the rx id is \"%s\"" " -> expected a rx id of \"%s\"" - ) % id::to_string(get_rx_id()) % id::to_string(ID_NONE))); + ) % dboard_id::to_string(get_rx_id()) % dboard_id::to_string(ID_NONE))); } } -tx_base::~tx_base(void){ +tx_dboard_base::~tx_dboard_base(void){ /* NOP */ } -void tx_base::rx_get(const wax::obj &, wax::obj &){ +void tx_dboard_base::rx_get(const wax::obj &, wax::obj &){ throw std::runtime_error("cannot call rx_get on a tx dboard"); } -void tx_base::rx_set(const wax::obj &, const wax::obj &){ +void tx_dboard_base::rx_set(const wax::obj &, const wax::obj &){ throw std::runtime_error("cannot call rx_set on a tx dboard"); } diff --git a/host/lib/usrp/dboard/id.cpp b/host/lib/usrp/dboard_id.cpp index b62e469de..d2ef7cd7d 100644 --- a/host/lib/usrp/dboard/id.cpp +++ b/host/lib/usrp/dboard_id.cpp @@ -15,13 +15,13 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include <uhd/usrp/dboard/id.hpp> +#include <uhd/usrp/dboard_id.hpp> #include <boost/format.hpp> #include <uhd/dict.hpp> -using namespace uhd::usrp::dboard; +using namespace uhd::usrp; -std::string id::to_string(const dboard_id_t &id){ +std::string dboard_id::to_string(const dboard_id_t &id){ //map the dboard ids to string representations uhd::dict<dboard_id_t, std::string> id_to_str; id_to_str[ID_NONE] = "none"; diff --git a/host/lib/usrp/dboard/interface.cpp b/host/lib/usrp/dboard_interface.cpp index b8f6724ba..f6d6b6456 100644 --- a/host/lib/usrp/dboard/interface.cpp +++ b/host/lib/usrp/dboard_interface.cpp @@ -15,19 +15,19 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include <uhd/usrp/dboard/interface.hpp> +#include <uhd/usrp/dboard_interface.hpp> -using namespace uhd::usrp::dboard; +using namespace uhd::usrp; -interface::interface(void){ +dboard_interface::dboard_interface(void){ /* NOP */ } -interface::~interface(void){ +dboard_interface::~dboard_interface(void){ /* NOP */ } -void interface::write_spi( +void dboard_interface::write_spi( spi_dev_t dev, spi_push_t push, const byte_vector_t &buf @@ -35,7 +35,7 @@ void interface::write_spi( transact_spi(dev, SPI_LATCH_RISE, push, buf, false); //dont readback } -interface::byte_vector_t interface::read_spi( +dboard_interface::byte_vector_t dboard_interface::read_spi( spi_dev_t dev, spi_latch_t latch, size_t num_bytes @@ -44,7 +44,7 @@ interface::byte_vector_t interface::read_spi( return transact_spi(dev, latch, SPI_PUSH_RISE, buf, true); //readback } -interface::byte_vector_t interface::read_write_spi( +dboard_interface::byte_vector_t dboard_interface::read_write_spi( spi_dev_t dev, spi_latch_t latch, spi_push_t push, diff --git a/host/lib/usrp/dboard/manager.cpp b/host/lib/usrp/dboard_manager.cpp index 337c31ad6..4d52f82e8 100644 --- a/host/lib/usrp/dboard/manager.cpp +++ b/host/lib/usrp/dboard_manager.cpp @@ -15,16 +15,16 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include <uhd/usrp/dboard/manager.hpp> +#include <uhd/usrp/dboard_manager.hpp> #include <uhd/utils.hpp> #include <boost/assign/list_of.hpp> #include <boost/tuple/tuple.hpp> #include <boost/format.hpp> #include <boost/foreach.hpp> -#include "dboards.hpp" +#include "dboard/dboards.hpp" using namespace uhd; -using namespace uhd::usrp::dboard; +using namespace uhd::usrp; using namespace boost::assign; /*********************************************************************** @@ -36,7 +36,7 @@ using namespace boost::assign; * * This function will be called before new boards are registered. * This allows for internal boards to be externally overridden. - * This function will also be called when creating a new manager + * This function will also be called when creating a new dboard_manager * to ensure that the maps are filled with the entries below. **********************************************************************/ static void register_internal_dboards(void){ @@ -44,19 +44,19 @@ static void register_internal_dboards(void){ static bool called = false; if (called) return; called = true; //register the known dboards (dboard id, constructor, subdev names) - manager::register_subdevs(ID_BASIC_TX, &basic_tx::make, list_of("")); - manager::register_subdevs(ID_BASIC_RX, &basic_rx::make, list_of("a")("b")("ab")); + dboard_manager::register_subdevs(ID_BASIC_TX, &basic_tx::make, list_of("")); + dboard_manager::register_subdevs(ID_BASIC_RX, &basic_rx::make, list_of("a")("b")("ab")); } /*********************************************************************** * storage and registering for dboards **********************************************************************/ -typedef boost::tuple<manager::dboard_ctor_t, prop_names_t> args_t; +typedef boost::tuple<dboard_manager::dboard_ctor_t, prop_names_t> args_t; //map a dboard id to a dboard constructor static uhd::dict<dboard_id_t, args_t> id_to_args_map; -void manager::register_subdevs( +void dboard_manager::register_subdevs( dboard_id_t dboard_id, dboard_ctor_t dboard_ctor, const prop_names_t &subdev_names @@ -78,7 +78,7 @@ public: enum type_t{RX_TYPE, TX_TYPE}; //structors - subdev_proxy(base::sptr subdev, type_t type) + subdev_proxy(dboard_base::sptr subdev, type_t type) : _subdev(subdev), _type(type){ /* NOP */ } @@ -88,8 +88,8 @@ public: } private: - base::sptr _subdev; - type_t _type; + dboard_base::sptr _subdev; + type_t _type; //forward the get calls to the rx or tx void get(const wax::obj &key, wax::obj &val){ @@ -109,7 +109,7 @@ private: }; /*********************************************************************** - * dboard manager methods + * dboard dboard_manager methods **********************************************************************/ static args_t get_dboard_args( dboard_id_t dboard_id, @@ -136,10 +136,10 @@ static args_t get_dboard_args( return id_to_args_map[dboard_id]; } -manager::manager( +dboard_manager::dboard_manager( dboard_id_t rx_dboard_id, dboard_id_t tx_dboard_id, - interface::sptr dboard_interface + dboard_interface::sptr interface ){ register_internal_dboards(); //always call first @@ -150,21 +150,21 @@ manager::manager( boost::tie(tx_dboard_ctor, tx_subdevs) = get_dboard_args(tx_dboard_id, "tx"); //initialize the gpio pins before creating subdevs - dboard_interface->set_gpio_ddr(interface::GPIO_RX_BANK, 0x0000, 0xffff); //all inputs - dboard_interface->set_gpio_ddr(interface::GPIO_TX_BANK, 0x0000, 0xffff); + interface->set_gpio_ddr(dboard_interface::GPIO_RX_BANK, 0x0000, 0xffff); //all inputs + interface->set_gpio_ddr(dboard_interface::GPIO_TX_BANK, 0x0000, 0xffff); - dboard_interface->write_gpio(interface::GPIO_RX_BANK, 0x0000, 0xffff); //all zeros - dboard_interface->write_gpio(interface::GPIO_TX_BANK, 0x0000, 0xffff); + interface->write_gpio(dboard_interface::GPIO_RX_BANK, 0x0000, 0xffff); //all zeros + interface->write_gpio(dboard_interface::GPIO_TX_BANK, 0x0000, 0xffff); - dboard_interface->set_atr_reg(interface::GPIO_RX_BANK, 0x0000, 0x0000, 0x0000); //software controlled - dboard_interface->set_atr_reg(interface::GPIO_TX_BANK, 0x0000, 0x0000, 0x0000); + interface->set_atr_reg(dboard_interface::GPIO_RX_BANK, 0x0000, 0x0000, 0x0000); //software controlled + interface->set_atr_reg(dboard_interface::GPIO_TX_BANK, 0x0000, 0x0000, 0x0000); //make xcvr subdevs (make one subdev for both rx and tx dboards) if (rx_dboard_ctor == tx_dboard_ctor){ ASSERT_THROW(rx_subdevs == tx_subdevs); BOOST_FOREACH(std::string name, rx_subdevs){ - base::sptr xcvr_dboard = rx_dboard_ctor( - base::ctor_args_t(name, dboard_interface, rx_dboard_id, tx_dboard_id) + dboard_base::sptr xcvr_dboard = rx_dboard_ctor( + dboard_base::ctor_args_t(name, interface, rx_dboard_id, tx_dboard_id) ); //create a rx proxy for this xcvr board _rx_dboards[name] = subdev_proxy::sptr( @@ -181,8 +181,8 @@ manager::manager( else{ //make the rx subdevs BOOST_FOREACH(std::string name, rx_subdevs){ - base::sptr rx_dboard = rx_dboard_ctor( - base::ctor_args_t(name, dboard_interface, rx_dboard_id, ID_NONE) + dboard_base::sptr rx_dboard = rx_dboard_ctor( + dboard_base::ctor_args_t(name, interface, rx_dboard_id, ID_NONE) ); //create a rx proxy for this rx board _rx_dboards[name] = subdev_proxy::sptr( @@ -191,8 +191,8 @@ manager::manager( } //make the tx subdevs BOOST_FOREACH(std::string name, tx_subdevs){ - base::sptr tx_dboard = tx_dboard_ctor( - base::ctor_args_t(name, dboard_interface, ID_NONE, tx_dboard_id) + dboard_base::sptr tx_dboard = tx_dboard_ctor( + dboard_base::ctor_args_t(name, interface, ID_NONE, tx_dboard_id) ); //create a tx proxy for this tx board _tx_dboards[name] = subdev_proxy::sptr( @@ -202,19 +202,19 @@ manager::manager( } } -manager::~manager(void){ +dboard_manager::~dboard_manager(void){ /* NOP */ } -prop_names_t manager::get_rx_subdev_names(void){ +prop_names_t dboard_manager::get_rx_subdev_names(void){ return _rx_dboards.get_keys(); } -prop_names_t manager::get_tx_subdev_names(void){ +prop_names_t dboard_manager::get_tx_subdev_names(void){ return _tx_dboards.get_keys(); } -wax::obj manager::get_rx_subdev(const std::string &subdev_name){ +wax::obj dboard_manager::get_rx_subdev(const std::string &subdev_name){ if (not _rx_dboards.has_key(subdev_name)) throw std::invalid_argument( str(boost::format("Unknown rx subdev name %s") % subdev_name) ); @@ -222,7 +222,7 @@ wax::obj manager::get_rx_subdev(const std::string &subdev_name){ return wax::cast<subdev_proxy::sptr>(_rx_dboards[subdev_name])->get_link(); } -wax::obj manager::get_tx_subdev(const std::string &subdev_name){ +wax::obj dboard_manager::get_tx_subdev(const std::string &subdev_name){ if (not _tx_dboards.has_key(subdev_name)) throw std::invalid_argument( str(boost::format("Unknown tx subdev name %s") % subdev_name) ); diff --git a/host/lib/usrp/mboard/base.cpp b/host/lib/usrp/mboard_base.cpp index f4f0324f3..ccf50794a 100644 --- a/host/lib/usrp/mboard/base.cpp +++ b/host/lib/usrp/mboard_base.cpp @@ -15,15 +15,15 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include <uhd/usrp/mboard/base.hpp> +#include <uhd/usrp/mboard_base.hpp> #include <stdexcept> -using namespace uhd::usrp::mboard; +using namespace uhd::usrp; -base::base(void){ +mboard_base::mboard_base(void){ /* NOP */ } -base::~base(void){ +mboard_base::~mboard_base(void){ /* NOP */ } diff --git a/host/lib/usrp/usrp.cpp b/host/lib/usrp/usrp.cpp index 9b1603a4a..d4bae1694 100644 --- a/host/lib/usrp/usrp.cpp +++ b/host/lib/usrp/usrp.cpp @@ -16,7 +16,7 @@ // #include <uhd/usrp/usrp.hpp> -#include <uhd/usrp/mboard/usrp2.hpp> +#include <uhd/usrp/usrp2.hpp> #include <boost/format.hpp> #include <boost/bind.hpp> #include <stdexcept> @@ -48,7 +48,7 @@ usrp::usrp(const device_addr_t &device_addr){ //TODO nothing } else if (device_addr["type"] == "udp"){ - _mboards[""] = mboard::base::sptr(new mboard::usrp2(device_addr)); + _mboards[""] = mboard_base::sptr(new usrp2(device_addr)); } } diff --git a/host/lib/usrp/mboard/usrp2.cpp b/host/lib/usrp/usrp2.cpp index f79ae851b..1ff363ae1 100644 --- a/host/lib/usrp/mboard/usrp2.cpp +++ b/host/lib/usrp/usrp2.cpp @@ -15,7 +15,7 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include <uhd/usrp/mboard/usrp2.hpp> +#include <uhd/usrp/usrp2.hpp> #include <uhd/device.hpp> #include <uhd/transport/udp.hpp> #include <boost/lexical_cast.hpp> @@ -24,7 +24,7 @@ #include <netinet/in.h> #include "usrp2/usrp2_impl.hpp" -using namespace uhd::usrp::mboard; +using namespace uhd::usrp; /*********************************************************************** * Discovery over the udp transport diff --git a/host/lib/usrp/mboard/usrp2/dboard_impl.cpp b/host/lib/usrp/usrp2/dboard_impl.cpp index d127c7f87..b38a51b04 100644 --- a/host/lib/usrp/mboard/usrp2/dboard_impl.cpp +++ b/host/lib/usrp/usrp2/dboard_impl.cpp @@ -36,19 +36,19 @@ void usrp2_impl::dboard_init(void){ % ntohs(in_data.data.dboard_ids.tx_id) << std::endl; //extract the dboard ids an convert them to enums - dboard::dboard_id_t rx_dboard_id = static_cast<dboard::dboard_id_t>( + dboard_id_t rx_dboard_id = static_cast<dboard_id_t>( ntohs(in_data.data.dboard_ids.rx_id) ); - dboard::dboard_id_t tx_dboard_id = static_cast<dboard::dboard_id_t>( + dboard_id_t tx_dboard_id = static_cast<dboard_id_t>( ntohs(in_data.data.dboard_ids.tx_id) ); //create a new dboard interface and manager - dboard::interface::sptr _dboard_interface( - new dboard_interface(this) + dboard_interface::sptr _dboard_interface( + new usrp2_dboard_interface(this) ); - dboard::manager::sptr _dboard_manager( - new dboard::manager(rx_dboard_id, tx_dboard_id, _dboard_interface) + dboard_manager::sptr _dboard_manager( + new dboard_manager(rx_dboard_id, tx_dboard_id, _dboard_interface) ); //load dboards diff --git a/host/lib/usrp/mboard/usrp2/dboard_interface.cpp b/host/lib/usrp/usrp2/dboard_interface.cpp index eb1caaa69..f12b101f3 100644 --- a/host/lib/usrp/mboard/usrp2/dboard_interface.cpp +++ b/host/lib/usrp/usrp2/dboard_interface.cpp @@ -19,27 +19,27 @@ #include "dboard_interface.hpp" #include "usrp2_impl.hpp" -using namespace uhd::usrp::dboard; +using namespace uhd::usrp; /*********************************************************************** * Structors **********************************************************************/ -dboard_interface::dboard_interface(usrp2_impl *impl){ +usrp2_dboard_interface::usrp2_dboard_interface(usrp2_impl *impl){ _impl = impl; } -dboard_interface::~dboard_interface(void){ +usrp2_dboard_interface::~usrp2_dboard_interface(void){ /* NOP */ } /*********************************************************************** * Clock Rates **********************************************************************/ -double dboard_interface::get_rx_clock_rate(void){ +double usrp2_dboard_interface::get_rx_clock_rate(void){ return _impl->get_master_clock_freq(); } -double dboard_interface::get_tx_clock_rate(void){ +double usrp2_dboard_interface::get_tx_clock_rate(void){ return _impl->get_master_clock_freq(); } @@ -52,15 +52,15 @@ double dboard_interface::get_tx_clock_rate(void){ * \param bank the dboard interface gpio bank enum * \return an over the wire representation */ -static uint8_t gpio_bank_to_otw(interface::gpio_bank_t bank){ +static uint8_t gpio_bank_to_otw(dboard_interface::gpio_bank_t bank){ switch(bank){ - case uhd::usrp::dboard::interface::GPIO_TX_BANK: return USRP2_DIR_TX; - case uhd::usrp::dboard::interface::GPIO_RX_BANK: return USRP2_DIR_RX; + case uhd::usrp::dboard_interface::GPIO_TX_BANK: return USRP2_DIR_TX; + case uhd::usrp::dboard_interface::GPIO_RX_BANK: return USRP2_DIR_RX; } throw std::invalid_argument("unknown gpio bank type"); } -void dboard_interface::set_gpio_ddr(gpio_bank_t bank, uint16_t value, uint16_t mask){ +void usrp2_dboard_interface::set_gpio_ddr(gpio_bank_t bank, uint16_t value, uint16_t mask){ //setup the out data usrp2_ctrl_data_t out_data; out_data.id = htonl(USRP2_CTRL_ID_USE_THESE_GPIO_DDR_SETTINGS_BRO); @@ -73,7 +73,7 @@ void dboard_interface::set_gpio_ddr(gpio_bank_t bank, uint16_t value, uint16_t m ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_GOT_THE_GPIO_DDR_SETTINGS_DUDE); } -void dboard_interface::write_gpio(gpio_bank_t bank, uint16_t value, uint16_t mask){ +void usrp2_dboard_interface::write_gpio(gpio_bank_t bank, uint16_t value, uint16_t mask){ //setup the out data usrp2_ctrl_data_t out_data; out_data.id = htonl(USRP2_CTRL_ID_SET_YOUR_GPIO_PIN_OUTS_BRO); @@ -86,7 +86,7 @@ void dboard_interface::write_gpio(gpio_bank_t bank, uint16_t value, uint16_t mas ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_I_SET_THE_GPIO_PIN_OUTS_DUDE); } -uint16_t dboard_interface::read_gpio(gpio_bank_t bank){ +uint16_t usrp2_dboard_interface::read_gpio(gpio_bank_t bank){ //setup the out data usrp2_ctrl_data_t out_data; out_data.id = htonl(USRP2_CTRL_ID_GIVE_ME_YOUR_GPIO_PIN_VALS_BRO); @@ -98,7 +98,7 @@ uint16_t dboard_interface::read_gpio(gpio_bank_t bank){ return ntohs(in_data.data.gpio_config.value); } -void dboard_interface::set_atr_reg(gpio_bank_t bank, uint16_t tx_value, uint16_t rx_value, uint16_t mask){ +void usrp2_dboard_interface::set_atr_reg(gpio_bank_t bank, uint16_t tx_value, uint16_t rx_value, uint16_t mask){ //setup the out data usrp2_ctrl_data_t out_data; out_data.id = htonl(USRP2_CTRL_ID_USE_THESE_ATR_SETTINGS_BRO); @@ -121,10 +121,10 @@ void dboard_interface::set_atr_reg(gpio_bank_t bank, uint16_t tx_value, uint16_t * \param dev the dboard interface spi dev enum * \return an over the wire representation */ -static uint8_t spi_dev_to_otw(interface::spi_dev_t dev){ +static uint8_t spi_dev_to_otw(dboard_interface::spi_dev_t dev){ switch(dev){ - case uhd::usrp::dboard::interface::SPI_TX_DEV: return USRP2_DIR_TX; - case uhd::usrp::dboard::interface::SPI_RX_DEV: return USRP2_DIR_RX; + case uhd::usrp::dboard_interface::SPI_TX_DEV: return USRP2_DIR_TX; + case uhd::usrp::dboard_interface::SPI_RX_DEV: return USRP2_DIR_RX; } throw std::invalid_argument("unknown spi device type"); } @@ -135,10 +135,10 @@ static uint8_t spi_dev_to_otw(interface::spi_dev_t dev){ * \param latch the dboard interface spi latch enum * \return an over the wire representation */ -static uint8_t spi_latch_to_otw(interface::spi_latch_t latch){ +static uint8_t spi_latch_to_otw(dboard_interface::spi_latch_t latch){ switch(latch){ - case uhd::usrp::dboard::interface::SPI_LATCH_RISE: return USRP2_CLK_EDGE_RISE; - case uhd::usrp::dboard::interface::SPI_LATCH_FALL: return USRP2_CLK_EDGE_FALL; + case uhd::usrp::dboard_interface::SPI_LATCH_RISE: return USRP2_CLK_EDGE_RISE; + case uhd::usrp::dboard_interface::SPI_LATCH_FALL: return USRP2_CLK_EDGE_FALL; } throw std::invalid_argument("unknown spi latch type"); } @@ -149,15 +149,15 @@ static uint8_t spi_latch_to_otw(interface::spi_latch_t latch){ * \param push the dboard interface spi push enum * \return an over the wire representation */ -static uint8_t spi_push_to_otw(interface::spi_push_t push){ +static uint8_t spi_push_to_otw(dboard_interface::spi_push_t push){ switch(push){ - case uhd::usrp::dboard::interface::SPI_PUSH_RISE: return USRP2_CLK_EDGE_RISE; - case uhd::usrp::dboard::interface::SPI_PUSH_FALL: return USRP2_CLK_EDGE_FALL; + case uhd::usrp::dboard_interface::SPI_PUSH_RISE: return USRP2_CLK_EDGE_RISE; + case uhd::usrp::dboard_interface::SPI_PUSH_FALL: return USRP2_CLK_EDGE_FALL; } throw std::invalid_argument("unknown spi push type"); } -interface::byte_vector_t dboard_interface::transact_spi( +dboard_interface::byte_vector_t usrp2_dboard_interface::transact_spi( spi_dev_t dev, spi_latch_t latch, spi_push_t push, @@ -197,7 +197,7 @@ interface::byte_vector_t dboard_interface::transact_spi( /*********************************************************************** * I2C **********************************************************************/ -void dboard_interface::write_i2c(int i2c_addr, const byte_vector_t &buf){ +void usrp2_dboard_interface::write_i2c(int i2c_addr, const byte_vector_t &buf){ //setup the out data usrp2_ctrl_data_t out_data; out_data.id = htonl(USRP2_CTRL_ID_WRITE_THESE_I2C_VALUES_BRO); @@ -217,7 +217,7 @@ void dboard_interface::write_i2c(int i2c_addr, const byte_vector_t &buf){ ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_COOL_IM_DONE_I2C_WRITE_DUDE); } -interface::byte_vector_t dboard_interface::read_i2c(int i2c_addr, size_t num_bytes){ +dboard_interface::byte_vector_t usrp2_dboard_interface::read_i2c(int i2c_addr, size_t num_bytes){ //setup the out data usrp2_ctrl_data_t out_data; out_data.id = htonl(USRP2_CTRL_ID_DO_AN_I2C_READ_FOR_ME_BRO); @@ -249,15 +249,15 @@ interface::byte_vector_t dboard_interface::read_i2c(int i2c_addr, size_t num_byt * \param unit the dboard interface unit type enum * \return an over the wire representation */ -static uint8_t spi_dev_to_otw(interface::unit_type_t unit){ +static uint8_t spi_dev_to_otw(dboard_interface::unit_type_t unit){ switch(unit){ - case uhd::usrp::dboard::interface::UNIT_TYPE_TX: return USRP2_DIR_TX; - case uhd::usrp::dboard::interface::UNIT_TYPE_RX: return USRP2_DIR_RX; + case uhd::usrp::dboard_interface::UNIT_TYPE_TX: return USRP2_DIR_TX; + case uhd::usrp::dboard_interface::UNIT_TYPE_RX: return USRP2_DIR_RX; } throw std::invalid_argument("unknown unit type type"); } -void dboard_interface::write_aux_dac(interface::unit_type_t unit, int which, int value){ +void usrp2_dboard_interface::write_aux_dac(dboard_interface::unit_type_t unit, int which, int value){ //setup the out data usrp2_ctrl_data_t out_data; out_data.id = htonl(USRP2_CTRL_ID_WRITE_THIS_TO_THE_AUX_DAC_BRO); @@ -270,7 +270,7 @@ void dboard_interface::write_aux_dac(interface::unit_type_t unit, int which, int ASSERT_THROW(htonl(in_data.id) == USRP2_CTRL_ID_DONE_WITH_THAT_AUX_DAC_DUDE); } -int dboard_interface::read_aux_adc(interface::unit_type_t unit, int which){ +int usrp2_dboard_interface::read_aux_adc(dboard_interface::unit_type_t unit, int which){ //setup the out data usrp2_ctrl_data_t out_data; out_data.id = htonl(USRP2_CTRL_ID_READ_FROM_THIS_AUX_ADC_BRO); diff --git a/host/lib/usrp/mboard/usrp2/dboard_interface.hpp b/host/lib/usrp/usrp2/dboard_interface.hpp index 1040e53ba..a06359e5e 100644 --- a/host/lib/usrp/mboard/usrp2/dboard_interface.hpp +++ b/host/lib/usrp/usrp2/dboard_interface.hpp @@ -15,18 +15,18 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include <uhd/usrp/dboard/interface.hpp> +#include <uhd/usrp/dboard_interface.hpp> #ifndef INCLUDED_DBOARD_INTERFACE_HPP #define INCLUDED_DBOARD_INTERFACE_HPP class usrp2_impl; //dummy class declaration -class dboard_interface : public uhd::usrp::dboard::interface{ +class usrp2_dboard_interface : public uhd::usrp::dboard_interface{ public: - dboard_interface(usrp2_impl *impl); + usrp2_dboard_interface(usrp2_impl *impl); - ~dboard_interface(void); + ~usrp2_dboard_interface(void); void write_aux_dac(unit_type_t, int, int); diff --git a/host/lib/usrp/mboard/usrp2/dsp_impl.cpp b/host/lib/usrp/usrp2/dsp_impl.cpp index 22c00d99a..22c00d99a 100644 --- a/host/lib/usrp/mboard/usrp2/dsp_impl.cpp +++ b/host/lib/usrp/usrp2/dsp_impl.cpp diff --git a/host/lib/usrp/mboard/usrp2/fw_common.h b/host/lib/usrp/usrp2/fw_common.h index 3def8ddaa..3def8ddaa 100644 --- a/host/lib/usrp/mboard/usrp2/fw_common.h +++ b/host/lib/usrp/usrp2/fw_common.h diff --git a/host/lib/usrp/mboard/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp index 2e4a0715f..2e4a0715f 100644 --- a/host/lib/usrp/mboard/usrp2/mboard_impl.cpp +++ b/host/lib/usrp/usrp2/mboard_impl.cpp diff --git a/host/lib/usrp/mboard/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index 39be8938e..dbf740f2b 100644 --- a/host/lib/usrp/mboard/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -15,7 +15,6 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // -#include <uhd/usrp/dboard/manager.hpp> #include <boost/format.hpp> #include <boost/bind.hpp> #include <uhd/utils.hpp> diff --git a/host/lib/usrp/mboard/usrp2/usrp2_impl.hpp b/host/lib/usrp/usrp2/usrp2_impl.hpp index 42fe46099..be457a91c 100644 --- a/host/lib/usrp/mboard/usrp2/usrp2_impl.hpp +++ b/host/lib/usrp/usrp2/usrp2_impl.hpp @@ -22,7 +22,7 @@ #include <boost/shared_ptr.hpp> #include <boost/function.hpp> #include <uhd/transport/udp.hpp> -#include <uhd/usrp/dboard/manager.hpp> +#include <uhd/usrp/dboard_manager.hpp> #include "fw_common.h" #ifndef INCLUDED_USRP2_IMPL_HPP @@ -116,7 +116,7 @@ private: uhd::dict<std::string, usrp2_ref_source_t> _ref_source_dict; //rx and tx dboard methods and objects - uhd::usrp::dboard::manager::sptr _dboard_manager; + uhd::usrp::dboard_manager::sptr _dboard_manager; void dboard_init(void); //properties interface for rx dboard |