summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/usrp/dboard_base.hpp10
-rw-r--r--host/include/uhd/usrp/dboard_iface.hpp (renamed from host/include/uhd/usrp/dboard_interface.hpp)18
-rw-r--r--host/include/uhd/usrp/dboard_manager.hpp6
-rw-r--r--host/lib/usrp/dboard/db_rfx.cpp28
-rw-r--r--host/lib/usrp/dboard_base.cpp6
-rw-r--r--host/lib/usrp/dboard_manager.cpp34
-rw-r--r--host/lib/usrp/usrp2/dboard_iface.cpp26
-rw-r--r--host/lib/usrp/usrp2/dboard_impl.cpp4
-rw-r--r--host/lib/usrp/usrp2/usrp2_iface.hpp2
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.hpp2
10 files changed, 68 insertions, 68 deletions
diff --git a/host/include/uhd/usrp/dboard_base.hpp b/host/include/uhd/usrp/dboard_base.hpp
index 907a7814a..2025760ee 100644
--- a/host/include/uhd/usrp/dboard_base.hpp
+++ b/host/include/uhd/usrp/dboard_base.hpp
@@ -24,7 +24,7 @@
#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_iface.hpp>
namespace uhd{ namespace usrp{
@@ -35,10 +35,10 @@ namespace uhd{ namespace usrp{
class UHD_API dboard_base : boost::noncopyable{
public:
typedef boost::shared_ptr<dboard_base> sptr;
- //the constructor args consist of a subdev name and an interface
+ //the constructor args consist of a subdev name, interface, and ids
//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, dboard_interface::sptr, dboard_id_t, dboard_id_t> ctor_args_t;
+ typedef boost::tuple<std::string, dboard_iface::sptr, dboard_id_t, dboard_id_t> ctor_args_t;
//structors
dboard_base(ctor_args_t const&);
@@ -52,13 +52,13 @@ public:
protected:
std::string get_subdev_name(void);
- dboard_interface::sptr get_interface(void);
+ dboard_iface::sptr get_iface(void);
dboard_id_t get_rx_id(void);
dboard_id_t get_tx_id(void);
private:
std::string _subdev_name;
- dboard_interface::sptr _dboard_interface;
+ dboard_iface::sptr _dboard_iface;
dboard_id_t _rx_id, _tx_id;
};
diff --git a/host/include/uhd/usrp/dboard_interface.hpp b/host/include/uhd/usrp/dboard_iface.hpp
index c4e822751..ca40bf778 100644
--- a/host/include/uhd/usrp/dboard_interface.hpp
+++ b/host/include/uhd/usrp/dboard_iface.hpp
@@ -15,8 +15,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
-#ifndef INCLUDED_UHD_USRP_DBOARD_INTERFACE_HPP
-#define INCLUDED_UHD_USRP_DBOARD_INTERFACE_HPP
+#ifndef INCLUDED_UHD_USRP_DBOARD_IFACE_HPP
+#define INCLUDED_UHD_USRP_DBOARD_IFACE_HPP
#include <uhd/config.hpp>
#include <boost/shared_ptr.hpp>
@@ -53,14 +53,14 @@ struct UHD_API spi_config_t{
};
/*!
- * 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 interface for its dboard.
+ * The daughter board dboard 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 iface for its dboard.
*/
-class UHD_API dboard_interface{
+class UHD_API dboard_iface{
public:
- typedef boost::shared_ptr<dboard_interface> sptr;
+ typedef boost::shared_ptr<dboard_iface> sptr;
typedef std::vector<boost::uint8_t> byte_vector_t;
//tells the host which unit to use
@@ -187,4 +187,4 @@ public:
}} //namespace
-#endif /* INCLUDED_UHD_USRP_DBOARD_INTERFACE_HPP */
+#endif /* INCLUDED_UHD_USRP_DBOARD_IFACE_HPP */
diff --git a/host/include/uhd/usrp/dboard_manager.hpp b/host/include/uhd/usrp/dboard_manager.hpp
index ed8ee73ef..6de64b02d 100644
--- a/host/include/uhd/usrp/dboard_manager.hpp
+++ b/host/include/uhd/usrp/dboard_manager.hpp
@@ -59,16 +59,16 @@ public:
* Make a new dboard manager.
* \param rx_dboard_id the id of the rx dboard
* \param tx_dboard_id the id of the tx dboard
- * \param interface the custom dboard interface
+ * \param iface the custom dboard interface
* \return an sptr to the new dboard manager
*/
static sptr make(
dboard_id_t rx_dboard_id,
dboard_id_t tx_dboard_id,
- dboard_interface::sptr interface
+ dboard_iface::sptr iface
);
- //dboard_interface
+ //dboard manager interface
virtual prop_names_t get_rx_subdev_names(void) = 0;
virtual prop_names_t get_tx_subdev_names(void) = 0;
virtual wax::obj get_rx_subdev(const std::string &subdev_name) = 0;
diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp
index 1cb39f83c..e5dc16808 100644
--- a/host/lib/usrp/dboard/db_rfx.cpp
+++ b/host/lib/usrp/dboard/db_rfx.cpp
@@ -112,19 +112,19 @@ rfx_xcvr::rfx_xcvr(
_freq_range = freq_range;
//enable the clocks that we need
- this->get_interface()->set_clock_enabled(dboard_interface::UNIT_TX, true);
- this->get_interface()->set_clock_enabled(dboard_interface::UNIT_RX, true);
+ this->get_iface()->set_clock_enabled(dboard_iface::UNIT_TX, true);
+ this->get_iface()->set_clock_enabled(dboard_iface::UNIT_RX, true);
//set the gpio directions
boost::uint16_t output_enables = POWER_UP | ANT_SW | MIX_EN;
- this->get_interface()->set_gpio_ddr(dboard_interface::UNIT_TX, output_enables);
- this->get_interface()->set_gpio_ddr(dboard_interface::UNIT_RX, output_enables);
+ this->get_iface()->set_gpio_ddr(dboard_iface::UNIT_TX, output_enables);
+ this->get_iface()->set_gpio_ddr(dboard_iface::UNIT_RX, output_enables);
//setup the tx atr (this does not change with antenna)
- this->get_interface()->set_atr_reg(dboard_interface::UNIT_TX, dboard_interface::ATR_REG_IDLE, POWER_UP | ANT_SW);
- this->get_interface()->set_atr_reg(dboard_interface::UNIT_TX, dboard_interface::ATR_REG_RX_ONLY, POWER_UP | ANT_SW);
- this->get_interface()->set_atr_reg(dboard_interface::UNIT_TX, dboard_interface::ATR_REG_TX_ONLY, POWER_UP | MIX_EN);
- this->get_interface()->set_atr_reg(dboard_interface::UNIT_TX, dboard_interface::ATR_REG_FULL_DUPLEX, POWER_UP | MIX_EN);
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_IDLE, POWER_UP | ANT_SW);
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_RX_ONLY, POWER_UP | ANT_SW);
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_TX_ONLY, POWER_UP | MIX_EN);
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_TX, dboard_iface::ATR_REG_FULL_DUPLEX, POWER_UP | MIX_EN);
//set some default values
set_lo_freq((_freq_range.min + _freq_range.max)/2.0);
@@ -148,10 +148,10 @@ void rfx_xcvr::set_rx_ant(const std::string &ant){
boost::uint16_t ant_val = (ant == "tx/rx")? 0 : ANT_SW;
//set the rx atr regs
- this->get_interface()->set_atr_reg(dboard_interface::UNIT_RX, dboard_interface::ATR_REG_IDLE, POWER_UP | ant_val);
- this->get_interface()->set_atr_reg(dboard_interface::UNIT_RX, dboard_interface::ATR_REG_RX_ONLY, POWER_UP | ant_val | MIX_EN);
- this->get_interface()->set_atr_reg(dboard_interface::UNIT_RX, dboard_interface::ATR_REG_TX_ONLY, POWER_UP | ant_val);
- this->get_interface()->set_atr_reg(dboard_interface::UNIT_RX, dboard_interface::ATR_REG_FULL_DUPLEX, POWER_UP | ant_val | MIX_EN);
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_IDLE, POWER_UP | ant_val);
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_RX_ONLY, POWER_UP | ant_val | MIX_EN);
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_TX_ONLY, POWER_UP | ant_val);
+ this->get_iface()->set_atr_reg(dboard_iface::UNIT_RX, dboard_iface::ATR_REG_FULL_DUPLEX, POWER_UP | ant_val | MIX_EN);
}
void rfx_xcvr::set_rx_pga0_gain(float gain){
@@ -165,8 +165,8 @@ void rfx_xcvr::reload_adf4360_regs(void){
(adf4360_regs_t::ADDR_RCOUNTER)
;
BOOST_FOREACH(adf4360_regs_t::addr_t addr, addrs){
- this->get_interface()->write_spi(
- dboard_interface::UNIT_TX,
+ this->get_iface()->write_spi(
+ dboard_iface::UNIT_TX,
spi_config_t::EDGE_RISE,
_adf4360_regs.get_reg(addr), 24
);
diff --git a/host/lib/usrp/dboard_base.cpp b/host/lib/usrp/dboard_base.cpp
index 09d3bbfd4..68e4743d1 100644
--- a/host/lib/usrp/dboard_base.cpp
+++ b/host/lib/usrp/dboard_base.cpp
@@ -25,7 +25,7 @@ using namespace uhd::usrp;
* dboard_base dboard dboard_base class
**********************************************************************/
dboard_base::dboard_base(ctor_args_t const& args){
- boost::tie(_subdev_name, _dboard_interface, _rx_id, _tx_id) = args;
+ boost::tie(_subdev_name, _dboard_iface, _rx_id, _tx_id) = args;
}
dboard_base::~dboard_base(void){
@@ -36,8 +36,8 @@ std::string dboard_base::get_subdev_name(void){
return _subdev_name;
}
-dboard_interface::sptr dboard_base::get_interface(void){
- return _dboard_interface;
+dboard_iface::sptr dboard_base::get_iface(void){
+ return _dboard_iface;
}
dboard_id_t dboard_base::get_rx_id(void){
diff --git a/host/lib/usrp/dboard_manager.cpp b/host/lib/usrp/dboard_manager.cpp
index 5e62b5564..06f8c55b6 100644
--- a/host/lib/usrp/dboard_manager.cpp
+++ b/host/lib/usrp/dboard_manager.cpp
@@ -125,11 +125,11 @@ public:
dboard_manager_impl(
dboard_id_t rx_dboard_id,
dboard_id_t tx_dboard_id,
- dboard_interface::sptr interface
+ dboard_iface::sptr iface
);
~dboard_manager_impl(void);
- //dboard_interface
+ //dboard_iface
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);
@@ -141,7 +141,7 @@ private:
//the subdevice proxy is internal to the cpp file
uhd::dict<std::string, subdev_proxy::sptr> _rx_dboards;
uhd::dict<std::string, subdev_proxy::sptr> _tx_dboards;
- dboard_interface::sptr _interface;
+ dboard_iface::sptr _iface;
void set_nice_dboard_if(void);
};
@@ -151,10 +151,10 @@ private:
dboard_manager::sptr dboard_manager::make(
dboard_id_t rx_dboard_id,
dboard_id_t tx_dboard_id,
- dboard_interface::sptr interface
+ dboard_iface::sptr iface
){
return dboard_manager::sptr(
- new dboard_manager_impl(rx_dboard_id, tx_dboard_id, interface)
+ new dboard_manager_impl(rx_dboard_id, tx_dboard_id, iface)
);
}
@@ -190,9 +190,9 @@ static args_t get_dboard_args(
dboard_manager_impl::dboard_manager_impl(
dboard_id_t rx_dboard_id,
dboard_id_t tx_dboard_id,
- dboard_interface::sptr interface
+ dboard_iface::sptr iface
){
- _interface = interface;
+ _iface = iface;
dboard_ctor_t rx_dboard_ctor; std::string rx_name; prop_names_t rx_subdevs;
boost::tie(rx_dboard_ctor, rx_name, rx_subdevs) = get_dboard_args(rx_dboard_id, "rx");
@@ -208,7 +208,7 @@ dboard_manager_impl::dboard_manager_impl(
ASSERT_THROW(rx_subdevs == tx_subdevs);
BOOST_FOREACH(const std::string &subdev, rx_subdevs){
dboard_base::sptr xcvr_dboard = rx_dboard_ctor(
- dboard_base::ctor_args_t(subdev, interface, rx_dboard_id, tx_dboard_id)
+ dboard_base::ctor_args_t(subdev, iface, rx_dboard_id, tx_dboard_id)
);
//create a rx proxy for this xcvr board
_rx_dboards[subdev] = subdev_proxy::sptr(
@@ -226,7 +226,7 @@ dboard_manager_impl::dboard_manager_impl(
//make the rx subdevs
BOOST_FOREACH(const std::string &subdev, rx_subdevs){
dboard_base::sptr rx_dboard = rx_dboard_ctor(
- dboard_base::ctor_args_t(subdev, interface, rx_dboard_id, dboard_id::NONE)
+ dboard_base::ctor_args_t(subdev, iface, rx_dboard_id, dboard_id::NONE)
);
//create a rx proxy for this rx board
_rx_dboards[subdev] = subdev_proxy::sptr(
@@ -236,7 +236,7 @@ dboard_manager_impl::dboard_manager_impl(
//make the tx subdevs
BOOST_FOREACH(const std::string &subdev, tx_subdevs){
dboard_base::sptr tx_dboard = tx_dboard_ctor(
- dboard_base::ctor_args_t(subdev, interface, dboard_id::NONE, tx_dboard_id)
+ dboard_base::ctor_args_t(subdev, iface, dboard_id::NONE, tx_dboard_id)
);
//create a tx proxy for this tx board
_tx_dboards[subdev] = subdev_proxy::sptr(
@@ -276,15 +276,15 @@ wax::obj dboard_manager_impl::get_tx_subdev(const std::string &subdev_name){
void dboard_manager_impl::set_nice_dboard_if(void){
//make a list of possible unit types
- std::vector<dboard_interface::unit_t> units = boost::assign::list_of
- (dboard_interface::UNIT_RX)
- (dboard_interface::UNIT_TX)
+ std::vector<dboard_iface::unit_t> units = boost::assign::list_of
+ (dboard_iface::UNIT_RX)
+ (dboard_iface::UNIT_TX)
;
//set nice settings on each unit
- BOOST_FOREACH(dboard_interface::unit_t unit, units){
- _interface->set_gpio_ddr(unit, 0x0000); //all inputs
- _interface->set_atr_reg(unit, dboard_interface::ATR_REG_IDLE, 0x0000); //all low
- _interface->set_clock_enabled(unit, false); //clock off
+ BOOST_FOREACH(dboard_iface::unit_t unit, units){
+ _iface->set_gpio_ddr(unit, 0x0000); //all inputs
+ _iface->set_atr_reg(unit, dboard_iface::ATR_REG_IDLE, 0x0000); //all low
+ _iface->set_clock_enabled(unit, false); //clock off
}
}
diff --git a/host/lib/usrp/usrp2/dboard_iface.cpp b/host/lib/usrp/usrp2/dboard_iface.cpp
index d0c4bf6c1..f77dfc495 100644
--- a/host/lib/usrp/usrp2/dboard_iface.cpp
+++ b/host/lib/usrp/usrp2/dboard_iface.cpp
@@ -26,7 +26,7 @@
using namespace uhd::usrp;
-class usrp2_dboard_iface : public dboard_interface{
+class usrp2_dboard_iface : public dboard_iface{
public:
usrp2_dboard_iface(usrp2_iface::sptr iface, clock_control::sptr clk_ctrl);
~usrp2_dboard_iface(void);
@@ -68,11 +68,11 @@ private:
/***********************************************************************
* Make Function
**********************************************************************/
-dboard_interface::sptr make_usrp2_dboard_iface(
+dboard_iface::sptr make_usrp2_dboard_iface(
usrp2_iface::sptr iface,
clock_control::sptr clk_ctrl
){
- return dboard_interface::sptr(new usrp2_dboard_iface(iface, clk_ctrl));
+ return dboard_iface::sptr(new usrp2_dboard_iface(iface, clk_ctrl));
}
/***********************************************************************
@@ -117,10 +117,10 @@ void usrp2_dboard_iface::set_clock_enabled(unit_t unit, bool enb){
/***********************************************************************
* GPIO
**********************************************************************/
-static int unit_to_shift(dboard_interface::unit_t unit){
+static int unit_to_shift(dboard_iface::unit_t unit){
switch(unit){
- case dboard_interface::UNIT_RX: return 0;
- case dboard_interface::UNIT_TX: return 16;
+ case dboard_iface::UNIT_RX: return 0;
+ case dboard_iface::UNIT_TX: return 16;
}
throw std::runtime_error("unknown unit type");
}
@@ -166,10 +166,10 @@ void usrp2_dboard_iface::set_atr_reg(unit_t unit, atr_reg_t atr, boost::uint16_t
* \param unit the dboard interface unit type enum
* \return an over the wire representation
*/
-static boost::uint8_t unit_to_otw_spi_dev(dboard_interface::unit_t unit){
+static boost::uint8_t unit_to_otw_spi_dev(dboard_iface::unit_t unit){
switch(unit){
- case dboard_interface::UNIT_TX: return SPI_SS_TX_DB;
- case dboard_interface::UNIT_RX: return SPI_SS_RX_DB;
+ case dboard_iface::UNIT_TX: return SPI_SS_TX_DB;
+ case dboard_iface::UNIT_RX: return SPI_SS_RX_DB;
}
throw std::invalid_argument("unknown unit type");
}
@@ -213,7 +213,7 @@ void usrp2_dboard_iface::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);
}
-dboard_interface::byte_vector_t usrp2_dboard_iface::read_i2c(int i2c_addr, size_t num_bytes){
+dboard_iface::byte_vector_t usrp2_dboard_iface::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);
@@ -243,10 +243,10 @@ dboard_interface::byte_vector_t usrp2_dboard_iface::read_i2c(int i2c_addr, size_
* \param unit the dboard interface unit type enum
* \return an over the wire representation
*/
-static boost::uint8_t unit_to_otw(dboard_interface::unit_t unit){
+static boost::uint8_t unit_to_otw(dboard_iface::unit_t unit){
switch(unit){
- case dboard_interface::UNIT_TX: return USRP2_DIR_TX;
- case dboard_interface::UNIT_RX: return USRP2_DIR_RX;
+ case dboard_iface::UNIT_TX: return USRP2_DIR_TX;
+ case dboard_iface::UNIT_RX: return USRP2_DIR_RX;
}
throw std::invalid_argument("unknown unit type");
}
diff --git a/host/lib/usrp/usrp2/dboard_impl.cpp b/host/lib/usrp/usrp2/dboard_impl.cpp
index 4b300de68..fe74219d6 100644
--- a/host/lib/usrp/usrp2/dboard_impl.cpp
+++ b/host/lib/usrp/usrp2/dboard_impl.cpp
@@ -44,11 +44,11 @@ void usrp2_impl::dboard_init(void){
dboard_id_t tx_dboard_id = ntohs(in_data.data.dboard_ids.tx_id);
//create a new dboard interface and manager
- dboard_interface::sptr _dboard_interface(
+ dboard_iface::sptr _dboard_iface(
make_usrp2_dboard_iface(_iface, _clk_ctrl)
);
_dboard_manager = dboard_manager::make(
- rx_dboard_id, tx_dboard_id, _dboard_interface
+ rx_dboard_id, tx_dboard_id, _dboard_iface
);
//load dboards
diff --git a/host/lib/usrp/usrp2/usrp2_iface.hpp b/host/lib/usrp/usrp2/usrp2_iface.hpp
index 7b4321c0b..1298d87f1 100644
--- a/host/lib/usrp/usrp2/usrp2_iface.hpp
+++ b/host/lib/usrp/usrp2/usrp2_iface.hpp
@@ -19,7 +19,7 @@
#define INCLUDED_USRP2_IFACE_HPP
#include <uhd/transport/udp_simple.hpp>
-#include <uhd/usrp/dboard_interface.hpp> //spi config
+#include <uhd/usrp/dboard_iface.hpp> //spi config
#include <boost/shared_ptr.hpp>
#include <boost/utility.hpp>
#include <boost/cstdint.hpp>
diff --git a/host/lib/usrp/usrp2/usrp2_impl.hpp b/host/lib/usrp/usrp2/usrp2_impl.hpp
index 7eea1e250..dbcee367b 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.hpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.hpp
@@ -37,7 +37,7 @@
* \param clk_ctrl the clock control object
* \return a sptr to a new dboard interface
*/
-uhd::usrp::dboard_interface::sptr make_usrp2_dboard_iface(
+uhd::usrp::dboard_iface::sptr make_usrp2_dboard_iface(
usrp2_iface::sptr iface,
clock_control::sptr clk_ctrl
);