diff options
| -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){ | 
