diff options
author | Trung N Tran <trung.tran@ettus.com> | 2017-11-09 17:32:32 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:05:57 -0800 |
commit | 7df29f6ee62d44eaeed878700ddbaeeb1d7fda46 (patch) | |
tree | bc1ac0a1e4e09bd9ad3e6fbb23d7b459b9bf0449 /host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp | |
parent | b9a0cf1467e89000658f69089bb773722e41ea89 (diff) | |
download | uhd-7df29f6ee62d44eaeed878700ddbaeeb1d7fda46.tar.gz uhd-7df29f6ee62d44eaeed878700ddbaeeb1d7fda46.tar.bz2 uhd-7df29f6ee62d44eaeed878700ddbaeeb1d7fda46.zip |
mg: Add LO specific properties and methods
This change adds extra hooks to the property tree to make LOs accessible
thru the property tree.
These can be used by multi_usrp api.
Reviewed-By: Martin Braun <martin.braun@ettus.com>
Diffstat (limited to 'host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp')
-rw-r--r-- | host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp index 191218133..1b9e7f90e 100644 --- a/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp +++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp @@ -366,6 +366,115 @@ void magnesium_radio_ctrl_impl::_init_frontend_subtree( ); }) ; + //LO Specific + //RX LO + subtree->create<meta_range_t>(rx_fe_path / "los"/MAGNESIUM_LO1/"freq/range") + .set_publisher([this,chan_idx](){ + return this->get_rx_lo_freq_range(MAGNESIUM_LO1, chan_idx); + }) + ; + subtree->create<std::vector<std::string>>(rx_fe_path / "los"/MAGNESIUM_LO1/"source/options") + .set_publisher([this,chan_idx](){ + return this->get_rx_lo_sources(MAGNESIUM_LO1, chan_idx); + }) + ; + subtree->create<std::string>(rx_fe_path / "los"/MAGNESIUM_LO1/"source/value") + .add_coerced_subscriber([this,chan_idx](std::string src){ + this->set_rx_lo_source(src, MAGNESIUM_LO1,chan_idx); + }) + .set_publisher([this,chan_idx](){ + return this->get_rx_lo_source(MAGNESIUM_LO1, chan_idx); + }) + ; + subtree->create<double>(rx_fe_path / "los"/MAGNESIUM_LO1/"freq/value") + .set_publisher([this,chan_idx](){ + return this->get_rx_lo_freq(MAGNESIUM_LO1, chan_idx); + }) + .set_coercer([this,chan_idx](const double freq){ + return this->set_rx_lo_freq(freq, MAGNESIUM_LO1, chan_idx); + }) + ; + + subtree->create<meta_range_t>(rx_fe_path / "los"/MAGNESIUM_LO2/"freq/range") + .set_publisher([this,chan_idx](){ + return this->get_rx_lo_freq_range(MAGNESIUM_LO2, chan_idx); + }) + ; + subtree->create<std::vector<std::string>>(rx_fe_path / "los"/MAGNESIUM_LO2/"source/options") + .set_publisher([this,chan_idx](){ + return this->get_rx_lo_sources(MAGNESIUM_LO2, chan_idx); + }) + ; + + subtree->create<std::string>(rx_fe_path / "los"/MAGNESIUM_LO2/"source/value") + .add_coerced_subscriber([this,chan_idx](std::string src){ + this->set_rx_lo_source(src, MAGNESIUM_LO2, chan_idx); + }) + .set_publisher([this,chan_idx](){ + return this->get_rx_lo_source(MAGNESIUM_LO2, chan_idx); + }) + ; + subtree->create<double>(rx_fe_path / "los"/MAGNESIUM_LO2/"freq/value") + .set_publisher([this,chan_idx](){ + return this->get_rx_lo_freq(MAGNESIUM_LO2, chan_idx); + }) + .set_coercer([this,chan_idx](double freq){ + return this->set_rx_lo_freq(freq, MAGNESIUM_LO2, chan_idx); + }); + //TX LO + subtree->create<meta_range_t>(tx_fe_path / "los"/MAGNESIUM_LO1/"freq/range") + .set_publisher([this,chan_idx](){ + return this->get_rx_lo_freq_range(MAGNESIUM_LO1, chan_idx); + }) + ; + subtree->create<std::vector<std::string>>(tx_fe_path / "los"/MAGNESIUM_LO1/"source/options") + .set_publisher([this,chan_idx](){ + return this->get_tx_lo_sources(MAGNESIUM_LO1, chan_idx); + }) + ; + subtree->create<std::string>(tx_fe_path / "los"/MAGNESIUM_LO1/"source/value") + .add_coerced_subscriber([this,chan_idx](std::string src){ + this->set_tx_lo_source(src, MAGNESIUM_LO1, chan_idx); + }) + .set_publisher([this,chan_idx](){ + return this->get_tx_lo_source(MAGNESIUM_LO1, chan_idx); + }) + ; + subtree->create<double>(tx_fe_path / "los"/MAGNESIUM_LO1/"freq/value ") + .set_publisher([this,chan_idx](){ + return this->get_tx_lo_freq(MAGNESIUM_LO1, chan_idx); + }) + .set_coercer([this,chan_idx](double freq){ + return this->set_tx_lo_freq(freq, MAGNESIUM_LO1, chan_idx); + }) + ; + + subtree->create<meta_range_t>(tx_fe_path / "los"/MAGNESIUM_LO2/"freq/range") + .set_publisher([this,chan_idx](){ + return this->get_tx_lo_freq_range(MAGNESIUM_LO2,chan_idx); + }) + ; + subtree->create<std::vector<std::string>>(tx_fe_path / "los"/MAGNESIUM_LO2/"source/options") + .set_publisher([this,chan_idx](){ + return this->get_tx_lo_sources(MAGNESIUM_LO2, chan_idx); + }) + ; + + subtree->create<std::string>(tx_fe_path / "los"/MAGNESIUM_LO2/"source/value") + .add_coerced_subscriber([this,chan_idx](std::string src){ + this->set_tx_lo_source(src, MAGNESIUM_LO2, chan_idx); + }) + .set_publisher([this,chan_idx](){ + return this->get_tx_lo_source(MAGNESIUM_LO2, chan_idx); + }) + ; + subtree->create<double>(tx_fe_path / "los"/MAGNESIUM_LO2/"freq/value") + .set_publisher([this,chan_idx](){ + return this->get_tx_lo_freq(MAGNESIUM_LO2, chan_idx); + }) + .set_coercer([this,chan_idx](double freq){ + return this->set_tx_lo_freq(freq, MAGNESIUM_LO2, chan_idx); + }); } void magnesium_radio_ctrl_impl::_init_prop_tree() |