From eb7a99e99dacbe403426849ac4d458aeda21adb6 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 13 Sep 2012 10:43:15 -0700 Subject: usrp1: added hook to poke user regs --- host/lib/usrp/usrp1/usrp1_impl.cpp | 11 +++++++++++ host/lib/usrp/usrp1/usrp1_impl.hpp | 2 ++ 2 files changed, 13 insertions(+) (limited to 'host/lib/usrp') 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 @@ -214,6 +214,12 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){ _tree->create(mb_path / "load_eeprom") .subscribe(boost::bind(&fx2_ctrl::usrp_load_eeprom, _fx2_ctrl, _1)); + //////////////////////////////////////////////////////////////////// + // create user-defined control objects + //////////////////////////////////////////////////////////////////// + _tree->create >(mb_path / "user" / "regs") + .subscribe(boost::bind(&usrp1_impl::set_reg, this, _1)); + //////////////////////////////////////////////////////////////////// // setup the mboard eeprom //////////////////////////////////////////////////////////////////// @@ -497,3 +503,8 @@ std::complex usrp1_impl::set_rx_dc_offset(const std::string &db, const s return std::complex(double(i_off) * (1ul << 31), double(q_off) * (1ul << 31)); } + +void usrp1_impl::set_reg(const std::pair ®) +{ + _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 ®); + //handle the enables bool _rx_enabled, _tx_enabled; void enable_rx(bool enb){ -- cgit v1.2.3