aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/usrp2_iface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/usrp2/usrp2_iface.cpp')
-rw-r--r--host/lib/usrp/usrp2/usrp2_iface.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp
index 4124221ef..44aef2a34 100644
--- a/host/lib/usrp/usrp2/usrp2_iface.cpp
+++ b/host/lib/usrp/usrp2/usrp2_iface.cpp
@@ -51,7 +51,7 @@ public:
_ctrl_transport = ctrl_transport;
//check the fpga compatibility number
- const boost::uint32_t fpga_compat_num = this->peek32(U2_REG_COMPAT_NUM_RB);
+ const boost::uint32_t fpga_compat_num = this->peek32(this->regs.compat_num_rb);
if (fpga_compat_num != USRP2_FPGA_COMPAT_NUM){
throw std::runtime_error(str(boost::format(
"Expected fpga compatibility number %d, but got %d:\n"
@@ -115,7 +115,7 @@ public:
//setup the out data
usrp2_ctrl_data_t out_data;
out_data.id = htonl(USRP2_CTRL_ID_TRANSACT_ME_SOME_SPI_BRO);
- out_data.data.spi_args.dev = which_slave;
+ out_data.data.spi_args.dev = htonl(which_slave);
out_data.data.spi_args.miso_edge = spi_edge_to_otw[config.miso_edge];
out_data.data.spi_args.mosi_edge = spi_edge_to_otw[config.mosi_edge];
out_data.data.spi_args.readback = (readback)? 1 : 0;
@@ -203,6 +203,19 @@ public:
throw std::runtime_error("usrp2 no control response");
}
+ /***********************************************************************
+ * Get/set hardware revision
+ **********************************************************************/
+ void set_hw_rev(int rev) {
+ hw_rev = rev;
+ regs = usrp2_get_regs(rev); //might be a better place to do this
+ }
+
+ int get_hw_rev(void) {
+ return hw_rev;
+ }
+
+
private:
//this lovely lady makes it all possible
udp_simple::sptr _ctrl_transport;