aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/n230/n230_resource_manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/n230/n230_resource_manager.cpp')
-rw-r--r--host/lib/usrp/n230/n230_resource_manager.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/host/lib/usrp/n230/n230_resource_manager.cpp b/host/lib/usrp/n230/n230_resource_manager.cpp
index 38e689533..4db494302 100644
--- a/host/lib/usrp/n230/n230_resource_manager.cpp
+++ b/host/lib/usrp/n230/n230_resource_manager.cpp
@@ -17,8 +17,6 @@
#include "n230_resource_manager.hpp"
-#include "../../../firmware/usrp3/n230/n230_fw_host_iface.h"
-#include "../../../firmware/usrp3/n230/n230_fw_defs.h"
#include "usrp3_fw_ctrl_iface.hpp"
#include <uhd/transport/if_addrs.hpp>
#include <uhd/transport/udp_zero_copy.hpp>
@@ -32,6 +30,8 @@
#include <boost/functional/hash.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/make_shared.hpp>
+#include "n230_fw_defs.h"
+#include "n230_fw_host_iface.h"
#define IF_DATA_I_MASK 0xFFF00000
#define IF_DATA_Q_MASK 0x0000FFF0
@@ -88,12 +88,19 @@ n230_resource_manager::n230_resource_manager(
n230_eth_conn_t conn_iface;
conn_iface.ip_addr = addr;
- boost::uint32_t iface_id = usrp3::usrp3_fw_ctrl_iface::get_iface_id(
- conn_iface.ip_addr, BOOST_STRINGIZE(N230_FW_COMMS_UDP_PORT), N230_FW_PRODUCT_ID);
+ boost::uint32_t iface_id = 0xFFFFFFFF;
+ try {
+ iface_id = usrp3::usrp3_fw_ctrl_iface::get_iface_id(
+ conn_iface.ip_addr, BOOST_STRINGIZE(N230_FW_COMMS_UDP_PORT), N230_FW_PRODUCT_ID);
+ } catch (uhd::io_error&) {
+ throw uhd::io_error(str(boost::format(
+ "Could not communicate with the device over address %s") %
+ conn_iface.ip_addr));
+ }
switch (iface_id) {
case N230_ETH0_IFACE_ID: conn_iface.type = ETH0; break;
case N230_ETH1_IFACE_ID: conn_iface.type = ETH1; break;
- default: throw uhd::runtime_error("N230 Initialization Error: Could not detect iface.)");
+ default: throw uhd::runtime_error("N230 Initialization Error: Could not detect ethernet port number.)");
}
_eth_conns.push_back(conn_iface);
}
@@ -143,7 +150,7 @@ n230_resource_manager::n230_resource_manager(
throw uhd::runtime_error("N230 Initialization Error: Could not create SPI ctrl.)");
}
- //Create Catalina interface
+ //Create AD9361 interface
UHD_MSG(status) << "Initializing CODEC...\n";
_codec_ctrl = ad9361_ctrl::make_spi(
boost::make_shared<n230_ad9361_client_t>(), _core_spi_ctrl, fpga::AD9361_SPI_SLAVE_NUM);
@@ -151,6 +158,8 @@ n230_resource_manager::n230_resource_manager(
throw uhd::runtime_error("N230 Initialization Error: Could not create Catalina ctrl.)");
}
_codec_ctrl->set_clock_rate(fpga::CODEC_DEFAULT_CLK_RATE);
+ _codec_mgr = ad936x_manager::make(_codec_ctrl, fpga::NUM_RADIOS);
+ _codec_mgr->init_codec();
//Create AD4001 interface
_ref_pll_ctrl = boost::make_shared<n230_ref_pll_ctrl>(_core_spi_ctrl);