From 7df29f6ee62d44eaeed878700ddbaeeb1d7fda46 Mon Sep 17 00:00:00 2001 From: Trung N Tran Date: Thu, 9 Nov 2017 17:32:32 -0800 Subject: 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 --- .../dboard/magnesium/magnesium_radio_ctrl_init.cpp | 109 +++++++++++++++++++++ 1 file changed, 109 insertions(+) (limited to 'host/lib/usrp/dboard/magnesium/magnesium_radio_ctrl_init.cpp') 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(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>(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(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(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(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>(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(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(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(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>(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(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(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(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>(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(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(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() -- cgit v1.2.3