summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnathan Corgan2012-03-16 14:43:18 -0700
committerJohnathan Corgan2012-03-16 14:43:18 -0700
commit710f3dccddcd1096e3b14899d589b96da39c1dd8 (patch)
tree7e7f951d0d6200f628b36613e29629fef81533c7
parentfcdac045ad64099949dbbefff25832a6dcef3187 (diff)
parent7e2d501a7b8cee26412605bc37cb3cc6f771bbc7 (diff)
downloadgnuradio-710f3dccddcd1096e3b14899d589b96da39c1dd8.tar.gz
gnuradio-710f3dccddcd1096e3b14899d589b96da39c1dd8.tar.bz2
gnuradio-710f3dccddcd1096e3b14899d589b96da39c1dd8.zip
Merge branch 'master' into next
-rw-r--r--gr-uhd/include/gr_uhd_usrp_sink.h9
-rw-r--r--gr-uhd/include/gr_uhd_usrp_source.h9
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_sink.cc9
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_source.cc8
4 files changed, 35 insertions, 0 deletions
diff --git a/gr-uhd/include/gr_uhd_usrp_sink.h b/gr-uhd/include/gr_uhd_usrp_sink.h
index ce76ec03b..d6cbe2fdc 100644
--- a/gr-uhd/include/gr_uhd_usrp_sink.h
+++ b/gr-uhd/include/gr_uhd_usrp_sink.h
@@ -448,6 +448,15 @@ public:
* \return the multi usrp device object
*/
virtual uhd::usrp::multi_usrp::sptr get_device(void) = 0;
+
+ /*!
+ * Perform write on the user configuration register bus. These only exist if
+ * the user has implemented custom setting registers in the device FPGA.
+ * \param addr 8-bit register address
+ * \param data 32-bit register value
+ * \param mboard which motherboard to set the user register
+ */
+ virtual void set_user_register(const uint8_t addr, const uint32_t data, size_t mboard = 0) = 0;
};
#endif /* INCLUDED_GR_UHD_USRP_SINK_H */
diff --git a/gr-uhd/include/gr_uhd_usrp_source.h b/gr-uhd/include/gr_uhd_usrp_source.h
index 8a799b397..cf2186bc0 100644
--- a/gr-uhd/include/gr_uhd_usrp_source.h
+++ b/gr-uhd/include/gr_uhd_usrp_source.h
@@ -457,6 +457,15 @@ public:
virtual uhd::usrp::multi_usrp::sptr get_device(void) = 0;
/*!
+ * Perform write on the user configuration register bus. These only exist if
+ * the user has implemented custom setting registers in the device FPGA.
+ * \param addr 8-bit register address
+ * \param data 32-bit register value
+ * \param mboard which motherboard to set the user register
+ */
+ virtual void set_user_register(const uint8_t addr, const uint32_t data, size_t mboard = 0) = 0;
+
+ /*!
* Convenience function for finite data acquisition.
* This is not to be used with the scheduler; rather,
* one can request samples from the USRP in python.
diff --git a/gr-uhd/lib/gr_uhd_usrp_sink.cc b/gr-uhd/lib/gr_uhd_usrp_sink.cc
index 05237100c..7d173d972 100644
--- a/gr-uhd/lib/gr_uhd_usrp_sink.cc
+++ b/gr-uhd/lib/gr_uhd_usrp_sink.cc
@@ -278,6 +278,15 @@ public:
return _dev;
}
+ void set_user_register(const uint8_t addr, const uint32_t data, size_t mboard){
+ #ifdef UHD_USRP_MULTI_USRP_USER_REGS_API
+ _dev->set_user_register(addr, data, mboard);
+ #else
+ throw std::runtime_error("not implemented in this version");
+ #endif
+ }
+
+
/***********************************************************************
* Work
**********************************************************************/
diff --git a/gr-uhd/lib/gr_uhd_usrp_source.cc b/gr-uhd/lib/gr_uhd_usrp_source.cc
index 2244238bd..5d3a3321e 100644
--- a/gr-uhd/lib/gr_uhd_usrp_source.cc
+++ b/gr-uhd/lib/gr_uhd_usrp_source.cc
@@ -290,6 +290,14 @@ public:
return _dev;
}
+ void set_user_register(const uint8_t addr, const uint32_t data, size_t mboard){
+ #ifdef UHD_USRP_MULTI_USRP_USER_REGS_API
+ _dev->set_user_register(addr, data, mboard);
+ #else
+ throw std::runtime_error("not implemented in this version");
+ #endif
+ }
+
/***********************************************************************
* Work
**********************************************************************/