diff options
author | michael-west <michael.west@ettus.com> | 2015-04-02 10:51:27 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-04-03 13:43:23 -0700 |
commit | ccf1d5c5e5f5c20ff77f45da3295b9dd5bdb6272 (patch) | |
tree | 6bc08220d844d540f2359262e29da659fc57a577 /host/lib/usrp/x300 | |
parent | da5311407bdabcb7206f8ffb0b77de32d294f083 (diff) | |
download | uhd-ccf1d5c5e5f5c20ff77f45da3295b9dd5bdb6272.tar.gz uhd-ccf1d5c5e5f5c20ff77f45da3295b9dd5bdb6272.tar.bz2 uhd-ccf1d5c5e5f5c20ff77f45da3295b9dd5bdb6272.zip |
uhd: Add ability to get and set command time through dboard_iface.
This creates a wb_iface child class called timed_wb_iface, which
adds support for timed commands.
Diffstat (limited to 'host/lib/usrp/x300')
-rw-r--r-- | host/lib/usrp/x300/x300_dboard_iface.cpp | 15 | ||||
-rw-r--r-- | host/lib/usrp/x300/x300_impl.cpp | 3 | ||||
-rw-r--r-- | host/lib/usrp/x300/x300_impl.hpp | 1 |
3 files changed, 17 insertions, 2 deletions
diff --git a/host/lib/usrp/x300/x300_dboard_iface.cpp b/host/lib/usrp/x300/x300_dboard_iface.cpp index eff5183e0..c286e805a 100644 --- a/host/lib/usrp/x300/x300_dboard_iface.cpp +++ b/host/lib/usrp/x300/x300_dboard_iface.cpp @@ -1,5 +1,5 @@ // -// Copyright 2013 Ettus Research LLC +// Copyright 2013,2015 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -50,6 +50,9 @@ public: void _set_gpio_ddr(unit_t, boost::uint16_t); void _set_gpio_out(unit_t, boost::uint16_t); + void set_command_time(const uhd::time_spec_t& t); + uhd::time_spec_t get_command_time(void); + void set_gpio_debug(unit_t, int); boost::uint16_t read_gpio(unit_t); @@ -331,3 +334,13 @@ double x300_dboard_iface::read_aux_adc(unit_t unit, aux_adc_t which) //convert to voltage and return return 3.3*ad7922_regs.result/4095; } + +uhd::time_spec_t x300_dboard_iface::get_command_time() +{ + return _config.cmd_time_ctrl->get_time(); +} + +void x300_dboard_iface::set_command_time(const uhd::time_spec_t& t) +{ + _config.cmd_time_ctrl->set_time(t); +} diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index 2de44a99d..809a56765 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -1014,6 +1014,7 @@ void x300_impl::setup_radio(const size_t mb_i, const std::string &slot_name) db_config.which_rx_clk = (slot_name == "A")? X300_CLOCK_WHICH_DB0_RX : X300_CLOCK_WHICH_DB1_RX; db_config.which_tx_clk = (slot_name == "A")? X300_CLOCK_WHICH_DB0_TX : X300_CLOCK_WHICH_DB1_TX; db_config.dboard_slot = (slot_name == "A")? 0 : 1; + db_config.cmd_time_ctrl = perif.ctrl; _dboard_ifaces[db_path] = x300_make_dboard_iface(db_config); //create a new dboard manager @@ -1353,7 +1354,7 @@ void x300_impl::set_time_source_out(mboard_members_t &mb, const bool enb) void x300_impl::update_clock_source(mboard_members_t &mb, const std::string &source) { //Optimize for the case when the current source is internal and we are trying - //to set it to internal. This is the only case where we are guaranteed that + //to set it to internal. This is the only case where we are guaranteed that //the clock has not gone away so we can skip setting the MUX and reseting the LMK. if (not (mb.current_refclk_src == "internal" and source == "internal")) { //Update the clock MUX on the motherboard to select the requested source diff --git a/host/lib/usrp/x300/x300_impl.hpp b/host/lib/usrp/x300/x300_impl.hpp index 70c5dccb4..342664ece 100644 --- a/host/lib/usrp/x300/x300_impl.hpp +++ b/host/lib/usrp/x300/x300_impl.hpp @@ -131,6 +131,7 @@ struct x300_dboard_iface_config_t x300_clock_which_t which_rx_clk; x300_clock_which_t which_tx_clk; boost::uint8_t dboard_slot; + uhd::timed_wb_iface::sptr cmd_time_ctrl; }; uhd::usrp::dboard_iface::sptr x300_make_dboard_iface(const x300_dboard_iface_config_t &); |