diff options
author | Josh Blum <josh@joshknows.com> | 2012-09-13 10:43:15 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2012-09-20 16:00:13 -0400 |
commit | eb7a99e99dacbe403426849ac4d458aeda21adb6 (patch) | |
tree | b9966826abf8a3a6d549ec0fe708477460e62a00 /host | |
parent | c2e197c09ea5d0c2f4056ad07e92c7a61492f53d (diff) | |
download | uhd-eb7a99e99dacbe403426849ac4d458aeda21adb6.tar.gz uhd-eb7a99e99dacbe403426849ac4d458aeda21adb6.tar.bz2 uhd-eb7a99e99dacbe403426849ac4d458aeda21adb6.zip |
usrp1: added hook to poke user regs
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/usrp/usrp1/usrp1_impl.cpp | 11 | ||||
-rw-r--r-- | host/lib/usrp/usrp1/usrp1_impl.hpp | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp index ffe25b81e..470a71d68 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.cpp +++ b/host/lib/usrp/usrp1/usrp1_impl.cpp @@ -215,6 +215,12 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){ .subscribe(boost::bind(&fx2_ctrl::usrp_load_eeprom, _fx2_ctrl, _1)); //////////////////////////////////////////////////////////////////// + // create user-defined control objects + //////////////////////////////////////////////////////////////////// + _tree->create<std::pair<boost::uint8_t, boost::uint32_t> >(mb_path / "user" / "regs") + .subscribe(boost::bind(&usrp1_impl::set_reg, this, _1)); + + //////////////////////////////////////////////////////////////////// // setup the mboard eeprom //////////////////////////////////////////////////////////////////// const mboard_eeprom_t mb_eeprom(*_fx2_ctrl, USRP1_EEPROM_MAP_KEY); @@ -497,3 +503,8 @@ std::complex<double> usrp1_impl::set_rx_dc_offset(const std::string &db, const s return std::complex<double>(double(i_off) * (1ul << 31), double(q_off) * (1ul << 31)); } + +void usrp1_impl::set_reg(const std::pair<boost::uint8_t, boost::uint32_t> ®) +{ + _iface->poke32(reg.first, reg.second); +} diff --git a/host/lib/usrp/usrp1/usrp1_impl.hpp b/host/lib/usrp/usrp1/usrp1_impl.hpp index bdef50ec1..9461f0081 100644 --- a/host/lib/usrp/usrp1/usrp1_impl.hpp +++ b/host/lib/usrp/usrp1/usrp1_impl.hpp @@ -135,6 +135,8 @@ private: void vandal_conquest_loop(void); + void set_reg(const std::pair<boost::uint8_t, boost::uint32_t> ®); + //handle the enables bool _rx_enabled, _tx_enabled; void enable_rx(bool enb){ |