From d1596dc40b1f0983512ab48372bdf25dd918710e Mon Sep 17 00:00:00 2001 From: Derek Kozel Date: Fri, 7 Apr 2017 19:38:44 -0700 Subject: rfnoc: Add set_command_time hook to radio block --- host/include/uhd/rfnoc/block_ctrl_base.hpp | 3 +++ host/lib/rfnoc/block_ctrl_base.cpp | 5 +++++ host/lib/usrp/x300/x300_radio_ctrl_impl.cpp | 4 ++++ host/lib/usrp/x300/x300_radio_ctrl_impl.hpp | 1 + 4 files changed, 13 insertions(+) diff --git a/host/include/uhd/rfnoc/block_ctrl_base.hpp b/host/include/uhd/rfnoc/block_ctrl_base.hpp index f770cf129..e9dd9c233 100644 --- a/host/include/uhd/rfnoc/block_ctrl_base.hpp +++ b/host/include/uhd/rfnoc/block_ctrl_base.hpp @@ -381,6 +381,9 @@ protected: // than reset register SR_CLEAR_TX_FC. virtual void _clear(const size_t port = 0); + //! Override this function if your block needs to specially handle + // setting the command time + virtual void _set_command_time(const time_spec_t &time_spec, const size_t port = ANY_PORT); /*********************************************************************** * Protected members **********************************************************************/ diff --git a/host/lib/rfnoc/block_ctrl_base.cpp b/host/lib/rfnoc/block_ctrl_base.cpp index 24dad6b47..a6eecc20b 100644 --- a/host/lib/rfnoc/block_ctrl_base.cpp +++ b/host/lib/rfnoc/block_ctrl_base.cpp @@ -356,6 +356,7 @@ void block_ctrl_base::set_command_time( } iface_sptr->set_time(time_spec); + _set_command_time(time_spec, port); } time_spec_t block_ctrl_base::get_command_time( @@ -583,4 +584,8 @@ void block_ctrl_base::_clear(const size_t port) sr_write(SR_CLEAR_RX_FC, 0x00C1EA12, port); // 'CLEAR', but we can write anything, really } +void block_ctrl_base::_set_command_time(const time_spec_t & /*time_spec*/, const size_t /*port*/) +{ + UHD_RFNOC_BLOCK_TRACE() << "block_ctrl_base::_set_command_time() "; +} // vim: sw=4 et: diff --git a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp index 0e11cb42c..80865eaf0 100644 --- a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp +++ b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp @@ -907,6 +907,10 @@ void x300_radio_ctrl_impl::_set_db_eeprom(i2c_iface::sptr i2c, const size_t addr _db_eeproms[addr] = db_eeprom; } +void x300_radio_ctrl_impl::_set_command_time(const time_spec_t &spec, const size_t port) +{ + set_fe_cmd_time(spec, port); +} /**************************************************************************** * Helpers ***************************************************************************/ diff --git a/host/lib/usrp/x300/x300_radio_ctrl_impl.hpp b/host/lib/usrp/x300/x300_radio_ctrl_impl.hpp index 6e17778bd..417c88f9e 100644 --- a/host/lib/usrp/x300/x300_radio_ctrl_impl.hpp +++ b/host/lib/usrp/x300/x300_radio_ctrl_impl.hpp @@ -161,6 +161,7 @@ private: void set_rx_fe_corrections(const uhd::fs_path &db_path, const uhd::fs_path &rx_fe_corr_path, const double lo_freq); void set_tx_fe_corrections(const uhd::fs_path &db_path, const uhd::fs_path &tx_fe_corr_path, const double lo_freq); + void _set_command_time(const uhd::time_spec_t &spec, const size_t port); void set_fe_cmd_time(const time_spec_t &time, const size_t chan); private: // members -- cgit v1.2.3