From 728d9abfe7fd9adf87ba4f87627829e09ddcc8cf Mon Sep 17 00:00:00 2001 From: Mark Meserve Date: Tue, 2 Oct 2018 14:26:49 -0500 Subject: rh: add lo distribution support - This is a combination of 5 commits. - rh: add lo distribution board gpio expander - rh: add lo distribution mpm functions - rh: add code to conditionally initialize lo distribution - rh: change empty i2c device from exception to assertion - rh: add lo distribution board control --- .../dboard/rhodium/rhodium_radio_ctrl_init.cpp | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'host/lib/usrp/dboard/rhodium/rhodium_radio_ctrl_init.cpp') diff --git a/host/lib/usrp/dboard/rhodium/rhodium_radio_ctrl_init.cpp b/host/lib/usrp/dboard/rhodium/rhodium_radio_ctrl_init.cpp index 8c2e6f231..6f7e37c26 100644 --- a/host/lib/usrp/dboard/rhodium/rhodium_radio_ctrl_init.cpp +++ b/host/lib/usrp/dboard/rhodium/rhodium_radio_ctrl_init.cpp @@ -213,6 +213,10 @@ void rhodium_radio_ctrl_impl::_init_peripherals() _tx_fe_core->set_dc_offset(tx_frontend_core_200::DEFAULT_DC_OFFSET_VALUE); _tx_fe_core->set_iq_balance(tx_frontend_core_200::DEFAULT_IQ_BALANCE_VALUE); _tx_fe_core->populate_subtree(_tree->subtree(_root_path / "tx_fe_corrections" / 0)); + + UHD_LOG_TRACE(unique_id(), "Checking for existence of LO Distribution board"); + _lo_dist_present = _rpcc->request_with_token(_rpc_prefix + "is_lo_dist_present"); + UHD_LOG_DEBUG(unique_id(), str(boost::format("LO distribution board is%s present") % (_lo_dist_present ? "" : " NOT"))); } void rhodium_radio_ctrl_impl::_init_frontend_subtree( @@ -661,6 +665,28 @@ void rhodium_radio_ctrl_impl::_init_frontend_subtree( this->set_tx_lo_export_enabled(enabled, RHODIUM_LO2, chan_idx); }) ; + + //LO Distribution Output Ports + if (_lo_dist_present) { + for (const auto& port : LO_OUTPUT_PORT_NAMES) { + subtree->create(tx_fe_path / "los" / RHODIUM_LO1 / "lo_distribution" / port / "export") + .add_coerced_subscriber([this, chan_idx, port](bool enabled) { + this->set_tx_lo_output_enabled(enabled, port, chan_idx); + }) + .set_publisher([this, chan_idx, port]() { + return this->get_tx_lo_output_enabled(port, chan_idx); + }) + ; + subtree->create(rx_fe_path / "los" / RHODIUM_LO1 / "lo_distribution" / port / "export") + .add_coerced_subscriber([this, chan_idx, port](bool enabled) { + this->set_tx_lo_output_enabled(enabled, port, chan_idx); + }) + .set_publisher([this, chan_idx, port]() { + return this->get_tx_lo_output_enabled(port, chan_idx); + }) + ; + } + } } void rhodium_radio_ctrl_impl::_init_prop_tree() -- cgit v1.2.3