From 56f391ad6486d956740225b9aed9954865572bdd Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 4 Oct 2013 16:11:50 -0700 Subject: uhd: wb_iface is now a public interface --- host/lib/usrp/cores/CMakeLists.txt | 1 - host/lib/usrp/cores/gpio_core_200.hpp | 6 +-- host/lib/usrp/cores/i2c_core_100.hpp | 4 +- host/lib/usrp/cores/i2c_core_100_wb32.hpp | 4 +- host/lib/usrp/cores/i2c_core_200.hpp | 4 +- host/lib/usrp/cores/radio_ctrl_core_3000.hpp | 4 +- host/lib/usrp/cores/rx_dsp_core_200.hpp | 4 +- host/lib/usrp/cores/rx_dsp_core_3000.hpp | 4 +- host/lib/usrp/cores/rx_frontend_core_200.cpp | 2 + host/lib/usrp/cores/rx_frontend_core_200.hpp | 4 +- host/lib/usrp/cores/rx_vita_core_3000.hpp | 4 +- host/lib/usrp/cores/spi_core_100.hpp | 4 +- host/lib/usrp/cores/spi_core_3000.hpp | 4 +- host/lib/usrp/cores/time64_core_200.hpp | 4 +- host/lib/usrp/cores/time_core_3000.hpp | 4 +- host/lib/usrp/cores/tx_dsp_core_200.hpp | 4 +- host/lib/usrp/cores/tx_dsp_core_3000.hpp | 4 +- host/lib/usrp/cores/tx_frontend_core_200.cpp | 2 + host/lib/usrp/cores/tx_frontend_core_200.hpp | 4 +- host/lib/usrp/cores/tx_vita_core_3000.hpp | 4 +- host/lib/usrp/cores/user_settings_core_200.cpp | 2 + host/lib/usrp/cores/user_settings_core_200.hpp | 4 +- host/lib/usrp/cores/wb_iface.cpp | 51 ------------------ host/lib/usrp/cores/wb_iface.hpp | 75 -------------------------- 24 files changed, 43 insertions(+), 164 deletions(-) delete mode 100644 host/lib/usrp/cores/wb_iface.cpp delete mode 100644 host/lib/usrp/cores/wb_iface.hpp (limited to 'host/lib/usrp/cores') diff --git a/host/lib/usrp/cores/CMakeLists.txt b/host/lib/usrp/cores/CMakeLists.txt index f526319bc..f28ae040f 100644 --- a/host/lib/usrp/cores/CMakeLists.txt +++ b/host/lib/usrp/cores/CMakeLists.txt @@ -22,7 +22,6 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) LIBUHD_APPEND_SOURCES( - ${CMAKE_CURRENT_SOURCE_DIR}/wb_iface.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gpio_core_200.cpp ${CMAKE_CURRENT_SOURCE_DIR}/i2c_core_100.cpp ${CMAKE_CURRENT_SOURCE_DIR}/i2c_core_200.cpp diff --git a/host/lib/usrp/cores/gpio_core_200.hpp b/host/lib/usrp/cores/gpio_core_200.hpp index a3edf5454..15fe5f2dd 100644 --- a/host/lib/usrp/cores/gpio_core_200.hpp +++ b/host/lib/usrp/cores/gpio_core_200.hpp @@ -23,7 +23,7 @@ #include #include #include -#include "wb_iface.hpp" +#include class gpio_core_200 : boost::noncopyable{ public: @@ -33,7 +33,7 @@ public: typedef uhd::usrp::dboard_iface::atr_reg_t atr_reg_t; //! makes a new GPIO core from iface and slave base - static sptr make(wb_iface::sptr iface, const size_t base, const size_t rb_addr); + static sptr make(uhd::wb_iface::sptr iface, const size_t base, const size_t rb_addr); //! 1 = ATR virtual void set_pin_ctrl(const unit_t unit, const boost::uint16_t value) = 0; @@ -56,7 +56,7 @@ public: typedef uhd::usrp::dboard_iface::atr_reg_t atr_reg_t; - static sptr make(wb_iface::sptr iface, const size_t); + static sptr make(uhd::wb_iface::sptr iface, const size_t); virtual void set_atr_reg(const atr_reg_t atr, const boost::uint32_t value) = 0; diff --git a/host/lib/usrp/cores/i2c_core_100.hpp b/host/lib/usrp/cores/i2c_core_100.hpp index f7a5ae4f7..4e7a2874b 100644 --- a/host/lib/usrp/cores/i2c_core_100.hpp +++ b/host/lib/usrp/cores/i2c_core_100.hpp @@ -22,14 +22,14 @@ #include #include #include -#include "wb_iface.hpp" +#include class i2c_core_100 : boost::noncopyable, public uhd::i2c_iface{ public: typedef boost::shared_ptr sptr; //! makes a new i2c core from iface and slave base - static sptr make(wb_iface::sptr iface, const size_t base); + static sptr make(uhd::wb_iface::sptr iface, const size_t base); }; #endif /* INCLUDED_LIBUHD_USRP_I2C_CORE_100_HPP */ diff --git a/host/lib/usrp/cores/i2c_core_100_wb32.hpp b/host/lib/usrp/cores/i2c_core_100_wb32.hpp index f2ac98292..b5912ba9a 100644 --- a/host/lib/usrp/cores/i2c_core_100_wb32.hpp +++ b/host/lib/usrp/cores/i2c_core_100_wb32.hpp @@ -22,14 +22,14 @@ #include #include #include -#include "wb_iface.hpp" +#include class i2c_core_100_wb32 : boost::noncopyable, public uhd::i2c_iface{ public: typedef boost::shared_ptr sptr; //! makes a new i2c core from iface and slave base - static sptr make(wb_iface::sptr iface, const size_t base); + static sptr make(uhd::wb_iface::sptr iface, const size_t base); virtual void set_clock_rate(const double rate) = 0; }; diff --git a/host/lib/usrp/cores/i2c_core_200.hpp b/host/lib/usrp/cores/i2c_core_200.hpp index 508855985..1b20455d3 100644 --- a/host/lib/usrp/cores/i2c_core_200.hpp +++ b/host/lib/usrp/cores/i2c_core_200.hpp @@ -22,14 +22,14 @@ #include #include #include -#include "wb_iface.hpp" +#include class i2c_core_200 : boost::noncopyable, public uhd::i2c_iface{ public: typedef boost::shared_ptr sptr; //! makes a new i2c core from iface and slave base - static sptr make(wb_iface::sptr iface, const size_t base, const size_t readback); + static sptr make(uhd::wb_iface::sptr iface, const size_t base, const size_t readback); }; #endif /* INCLUDED_LIBUHD_USRP_I2C_CORE_200_HPP */ diff --git a/host/lib/usrp/cores/radio_ctrl_core_3000.hpp b/host/lib/usrp/cores/radio_ctrl_core_3000.hpp index 8c0548d89..a49ca2a4b 100644 --- a/host/lib/usrp/cores/radio_ctrl_core_3000.hpp +++ b/host/lib/usrp/cores/radio_ctrl_core_3000.hpp @@ -22,13 +22,13 @@ #include #include #include -#include "wb_iface.hpp" +#include #include /*! * Provide access to peek, poke for the radio ctrl module */ -class radio_ctrl_core_3000 : public wb_iface +class radio_ctrl_core_3000 : public uhd::wb_iface { public: typedef boost::shared_ptr sptr; diff --git a/host/lib/usrp/cores/rx_dsp_core_200.hpp b/host/lib/usrp/cores/rx_dsp_core_200.hpp index b01f751e9..3937df9e8 100644 --- a/host/lib/usrp/cores/rx_dsp_core_200.hpp +++ b/host/lib/usrp/cores/rx_dsp_core_200.hpp @@ -24,7 +24,7 @@ #include #include #include -#include "wb_iface.hpp" +#include #include class rx_dsp_core_200 : boost::noncopyable{ @@ -32,7 +32,7 @@ public: typedef boost::shared_ptr sptr; static sptr make( - wb_iface::sptr iface, + uhd::wb_iface::sptr iface, const size_t dsp_base, const size_t ctrl_base, const boost::uint32_t sid, const bool lingering_packet = false ); diff --git a/host/lib/usrp/cores/rx_dsp_core_3000.hpp b/host/lib/usrp/cores/rx_dsp_core_3000.hpp index 23b12b9b7..02e5587a2 100644 --- a/host/lib/usrp/cores/rx_dsp_core_3000.hpp +++ b/host/lib/usrp/cores/rx_dsp_core_3000.hpp @@ -24,7 +24,7 @@ #include #include #include -#include "wb_iface.hpp" +#include #include class rx_dsp_core_3000 : boost::noncopyable{ @@ -32,7 +32,7 @@ public: typedef boost::shared_ptr sptr; static sptr make( - wb_iface::sptr iface, + uhd::wb_iface::sptr iface, const size_t dsp_base ); diff --git a/host/lib/usrp/cores/rx_frontend_core_200.cpp b/host/lib/usrp/cores/rx_frontend_core_200.cpp index 1813758da..09b36c1a6 100644 --- a/host/lib/usrp/cores/rx_frontend_core_200.cpp +++ b/host/lib/usrp/cores/rx_frontend_core_200.cpp @@ -18,6 +18,8 @@ #include "rx_frontend_core_200.hpp" #include +using namespace uhd; + #define REG_RX_FE_SWAP_IQ _base + 0 //lower bit #define REG_RX_FE_MAG_CORRECTION _base + 4 //18 bits #define REG_RX_FE_PHASE_CORRECTION _base + 8 //18 bits diff --git a/host/lib/usrp/cores/rx_frontend_core_200.hpp b/host/lib/usrp/cores/rx_frontend_core_200.hpp index 5755424c8..8327aef8b 100644 --- a/host/lib/usrp/cores/rx_frontend_core_200.hpp +++ b/host/lib/usrp/cores/rx_frontend_core_200.hpp @@ -21,7 +21,7 @@ #include #include #include -#include "wb_iface.hpp" +#include #include #include @@ -29,7 +29,7 @@ class rx_frontend_core_200 : boost::noncopyable{ public: typedef boost::shared_ptr sptr; - static sptr make(wb_iface::sptr iface, const size_t base); + static sptr make(uhd::wb_iface::sptr iface, const size_t base); virtual void set_mux(const bool swap) = 0; diff --git a/host/lib/usrp/cores/rx_vita_core_3000.hpp b/host/lib/usrp/cores/rx_vita_core_3000.hpp index b011a7388..577510728 100644 --- a/host/lib/usrp/cores/rx_vita_core_3000.hpp +++ b/host/lib/usrp/cores/rx_vita_core_3000.hpp @@ -24,7 +24,7 @@ #include #include #include -#include "wb_iface.hpp" +#include #include class rx_vita_core_3000 : boost::noncopyable @@ -33,7 +33,7 @@ public: typedef boost::shared_ptr sptr; static sptr make( - wb_iface::sptr iface, + uhd::wb_iface::sptr iface, const size_t base ); diff --git a/host/lib/usrp/cores/spi_core_100.hpp b/host/lib/usrp/cores/spi_core_100.hpp index 87d328aaa..ce53c0b86 100644 --- a/host/lib/usrp/cores/spi_core_100.hpp +++ b/host/lib/usrp/cores/spi_core_100.hpp @@ -22,14 +22,14 @@ #include #include #include -#include "wb_iface.hpp" +#include class spi_core_100 : boost::noncopyable, public uhd::spi_iface{ public: typedef boost::shared_ptr sptr; //! makes a new spi core from iface and slave base - static sptr make(wb_iface::sptr iface, const size_t base); + static sptr make(uhd::wb_iface::sptr iface, const size_t base); }; #endif /* INCLUDED_LIBUHD_USRP_SPI_CORE_100_HPP */ diff --git a/host/lib/usrp/cores/spi_core_3000.hpp b/host/lib/usrp/cores/spi_core_3000.hpp index 995ad59db..923efed3d 100644 --- a/host/lib/usrp/cores/spi_core_3000.hpp +++ b/host/lib/usrp/cores/spi_core_3000.hpp @@ -22,7 +22,7 @@ #include #include #include -#include "wb_iface.hpp" +#include class spi_core_3000 : boost::noncopyable, public uhd::spi_iface { @@ -30,7 +30,7 @@ public: typedef boost::shared_ptr sptr; //! makes a new spi core from iface and slave base - static sptr make(wb_iface::sptr iface, const size_t base, const size_t readback); + static sptr make(uhd::wb_iface::sptr iface, const size_t base, const size_t readback); //! Set the spi clock divider to something usable virtual void set_divider(const double div) = 0; diff --git a/host/lib/usrp/cores/time64_core_200.hpp b/host/lib/usrp/cores/time64_core_200.hpp index 315f2ba67..e211ce040 100644 --- a/host/lib/usrp/cores/time64_core_200.hpp +++ b/host/lib/usrp/cores/time64_core_200.hpp @@ -22,7 +22,7 @@ #include #include #include -#include "wb_iface.hpp" +#include #include #include @@ -37,7 +37,7 @@ public: //! makes a new time64 core from iface and slave base static sptr make( - wb_iface::sptr iface, const size_t base, + uhd::wb_iface::sptr iface, const size_t base, const readback_bases_type &readback_bases, const size_t mimo_delay_cycles = 0 // 0 means no-mimo ); diff --git a/host/lib/usrp/cores/time_core_3000.hpp b/host/lib/usrp/cores/time_core_3000.hpp index ffe2f4133..fad408810 100644 --- a/host/lib/usrp/cores/time_core_3000.hpp +++ b/host/lib/usrp/cores/time_core_3000.hpp @@ -22,7 +22,7 @@ #include #include #include -#include "wb_iface.hpp" +#include class time_core_3000 : boost::noncopyable { @@ -37,7 +37,7 @@ public: //! makes a new time core from iface and slave base static sptr make( - wb_iface::sptr iface, const size_t base, + uhd::wb_iface::sptr iface, const size_t base, const readback_bases_type &readback_bases ); diff --git a/host/lib/usrp/cores/tx_dsp_core_200.hpp b/host/lib/usrp/cores/tx_dsp_core_200.hpp index 0e1cfb6bc..ce3d1dbdd 100644 --- a/host/lib/usrp/cores/tx_dsp_core_200.hpp +++ b/host/lib/usrp/cores/tx_dsp_core_200.hpp @@ -23,14 +23,14 @@ #include #include #include -#include "wb_iface.hpp" +#include class tx_dsp_core_200 : boost::noncopyable{ public: typedef boost::shared_ptr sptr; static sptr make( - wb_iface::sptr iface, + uhd::wb_iface::sptr iface, const size_t dsp_base, const size_t ctrl_base, const boost::uint32_t sid ); diff --git a/host/lib/usrp/cores/tx_dsp_core_3000.hpp b/host/lib/usrp/cores/tx_dsp_core_3000.hpp index eb5ffaf0f..6f725b836 100644 --- a/host/lib/usrp/cores/tx_dsp_core_3000.hpp +++ b/host/lib/usrp/cores/tx_dsp_core_3000.hpp @@ -23,14 +23,14 @@ #include #include #include -#include "wb_iface.hpp" +#include class tx_dsp_core_3000 : boost::noncopyable{ public: typedef boost::shared_ptr sptr; static sptr make( - wb_iface::sptr iface, + uhd::wb_iface::sptr iface, const size_t dsp_base ); diff --git a/host/lib/usrp/cores/tx_frontend_core_200.cpp b/host/lib/usrp/cores/tx_frontend_core_200.cpp index e35874173..d701027e5 100644 --- a/host/lib/usrp/cores/tx_frontend_core_200.cpp +++ b/host/lib/usrp/cores/tx_frontend_core_200.cpp @@ -21,6 +21,8 @@ #include #include +using namespace uhd; + #define REG_TX_FE_DC_OFFSET_I _base + 0 //24 bits #define REG_TX_FE_DC_OFFSET_Q _base + 4 //24 bits #define REG_TX_FE_MAG_CORRECTION _base + 8 //18 bits diff --git a/host/lib/usrp/cores/tx_frontend_core_200.hpp b/host/lib/usrp/cores/tx_frontend_core_200.hpp index 8ee0f3e6d..7d09b39d2 100644 --- a/host/lib/usrp/cores/tx_frontend_core_200.hpp +++ b/host/lib/usrp/cores/tx_frontend_core_200.hpp @@ -21,7 +21,7 @@ #include #include #include -#include "wb_iface.hpp" +#include #include #include @@ -29,7 +29,7 @@ class tx_frontend_core_200 : boost::noncopyable{ public: typedef boost::shared_ptr sptr; - static sptr make(wb_iface::sptr iface, const size_t base); + static sptr make(uhd::wb_iface::sptr iface, const size_t base); virtual void set_mux(const std::string &mode) = 0; diff --git a/host/lib/usrp/cores/tx_vita_core_3000.hpp b/host/lib/usrp/cores/tx_vita_core_3000.hpp index 2070936ce..d4677a3e3 100644 --- a/host/lib/usrp/cores/tx_vita_core_3000.hpp +++ b/host/lib/usrp/cores/tx_vita_core_3000.hpp @@ -24,7 +24,7 @@ #include #include #include -#include "wb_iface.hpp" +#include #include class tx_vita_core_3000 : boost::noncopyable @@ -33,7 +33,7 @@ public: typedef boost::shared_ptr sptr; static sptr make( - wb_iface::sptr iface, + uhd::wb_iface::sptr iface, const size_t base ); diff --git a/host/lib/usrp/cores/user_settings_core_200.cpp b/host/lib/usrp/cores/user_settings_core_200.cpp index d262631b1..391725edc 100644 --- a/host/lib/usrp/cores/user_settings_core_200.cpp +++ b/host/lib/usrp/cores/user_settings_core_200.cpp @@ -17,6 +17,8 @@ #include "user_settings_core_200.hpp" +using namespace uhd; + #define REG_USER_ADDR _base + 0 #define REG_USER_DATA _base + 4 diff --git a/host/lib/usrp/cores/user_settings_core_200.hpp b/host/lib/usrp/cores/user_settings_core_200.hpp index 1f5d13de7..f5fca2ce6 100644 --- a/host/lib/usrp/cores/user_settings_core_200.hpp +++ b/host/lib/usrp/cores/user_settings_core_200.hpp @@ -21,14 +21,14 @@ #include #include #include -#include "wb_iface.hpp" +#include class user_settings_core_200 : boost::noncopyable{ public: typedef boost::shared_ptr sptr; typedef std::pair user_reg_t; - static sptr make(wb_iface::sptr iface, const size_t base); + static sptr make(uhd::wb_iface::sptr iface, const size_t base); virtual void set_reg(const user_reg_t ®) = 0; }; diff --git a/host/lib/usrp/cores/wb_iface.cpp b/host/lib/usrp/cores/wb_iface.cpp deleted file mode 100644 index 9aa6d18d4..000000000 --- a/host/lib/usrp/cores/wb_iface.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// -// Copyright 2013 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 . -// - -#include "wb_iface.hpp" -#include - -using namespace uhd; - -void wb_iface::poke64(const wb_iface::wb_addr_type, const boost::uint64_t) -{ - throw uhd::not_implemented_error("poke64 not implemented"); -} - -boost::uint64_t wb_iface::peek64(const wb_iface::wb_addr_type) -{ - throw uhd::not_implemented_error("peek64 not implemented"); -} - -void wb_iface::poke32(const wb_iface::wb_addr_type, const boost::uint32_t) -{ - throw uhd::not_implemented_error("poke32 not implemented"); -} - -boost::uint32_t wb_iface::peek32(const wb_iface::wb_addr_type) -{ - throw uhd::not_implemented_error("peek32 not implemented"); -} - -void wb_iface::poke16(const wb_iface::wb_addr_type, const boost::uint16_t) -{ - throw uhd::not_implemented_error("poke16 not implemented"); -} - -boost::uint16_t wb_iface::peek16(const wb_iface::wb_addr_type) -{ - throw uhd::not_implemented_error("peek16 not implemented"); -} diff --git a/host/lib/usrp/cores/wb_iface.hpp b/host/lib/usrp/cores/wb_iface.hpp deleted file mode 100644 index 197788180..000000000 --- a/host/lib/usrp/cores/wb_iface.hpp +++ /dev/null @@ -1,75 +0,0 @@ -// -// Copyright 2011-2013 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 . -// - -#ifndef INCLUDED_LIBUHD_USRP_WB_IFACE_HPP -#define INCLUDED_LIBUHD_USRP_WB_IFACE_HPP - -#include -#include -#include - -class /*UHD_API*/ wb_iface -{ -public: - typedef boost::shared_ptr sptr; - typedef boost::uint32_t wb_addr_type; - - /*! - * Write a register (64 bits) - * \param addr the address - * \param data the 64bit data - */ - virtual void poke64(const wb_addr_type addr, const boost::uint64_t data); - - /*! - * Read a register (64 bits) - * \param addr the address - * \return the 64bit data - */ - virtual boost::uint64_t peek64(const wb_addr_type addr); - - /*! - * Write a register (32 bits) - * \param addr the address - * \param data the 32bit data - */ - virtual void poke32(const wb_addr_type addr, const boost::uint32_t data); - - /*! - * Read a register (32 bits) - * \param addr the address - * \return the 32bit data - */ - virtual boost::uint32_t peek32(const wb_addr_type addr); - - /*! - * Write a register (16 bits) - * \param addr the address - * \param data the 16bit data - */ - virtual void poke16(const wb_addr_type addr, const boost::uint16_t data); - - /*! - * Read a register (16 bits) - * \param addr the address - * \return the 16bit data - */ - virtual boost::uint16_t peek16(const wb_addr_type addr); - -}; - -#endif /* INCLUDED_LIBUHD_USRP_WB_IFACE_HPP */ -- cgit v1.2.3