aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/magnesium/magnesium_radio_control.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/dboard/magnesium/magnesium_radio_control.cpp')
-rw-r--r--host/lib/usrp/dboard/magnesium/magnesium_radio_control.cpp48
1 files changed, 4 insertions, 44 deletions
diff --git a/host/lib/usrp/dboard/magnesium/magnesium_radio_control.cpp b/host/lib/usrp/dboard/magnesium/magnesium_radio_control.cpp
index 5eb0f63a5..879885640 100644
--- a/host/lib/usrp/dboard/magnesium/magnesium_radio_control.cpp
+++ b/host/lib/usrp/dboard/magnesium/magnesium_radio_control.cpp
@@ -103,6 +103,10 @@ magnesium_radio_control_impl::magnesium_radio_control_impl(make_args_ptr make_ar
{
RFNOC_LOG_TRACE("Entering magnesium_radio_control_impl ctor...");
UHD_ASSERT_THROW(get_block_id().get_block_count() < 2);
+
+ _tx_gain_profile_api = std::make_shared<rf_control::enumerated_gain_profile>(MAGNESIUM_GP_OPTIONS, "default", MAGNESIUM_NUM_CHANS);
+ _rx_gain_profile_api = std::make_shared<rf_control::enumerated_gain_profile>(MAGNESIUM_GP_OPTIONS, "default", MAGNESIUM_NUM_CHANS);
+
const char radio_slot_name[2] = {'A', 'B'};
_radio_slot = radio_slot_name[get_block_id().get_block_count()];
RFNOC_LOG_TRACE("Radio slot: " << _radio_slot);
@@ -363,28 +367,6 @@ double magnesium_radio_control_impl::set_tx_bandwidth(
return AD9371_TX_MAX_BANDWIDTH;
}
-void magnesium_radio_control_impl::set_tx_gain_profile(
- const std::string& profile, const size_t)
-{
- if (std::find(MAGNESIUM_GP_OPTIONS.begin(), MAGNESIUM_GP_OPTIONS.end(), profile)
- == MAGNESIUM_GP_OPTIONS.end()) {
- RFNOC_LOG_ERROR("Invalid TX gain profile: " << profile);
- throw uhd::key_error("Invalid TX gain profile!");
- }
- _gain_profile[TX_DIRECTION] = profile;
-}
-
-void magnesium_radio_control_impl::set_rx_gain_profile(
- const std::string& profile, const size_t)
-{
- if (std::find(MAGNESIUM_GP_OPTIONS.begin(), MAGNESIUM_GP_OPTIONS.end(), profile)
- == MAGNESIUM_GP_OPTIONS.end()) {
- RFNOC_LOG_ERROR("Invalid RX gain profile: " << profile);
- throw uhd::key_error("Invalid RX gain profile!");
- }
- _gain_profile[RX_DIRECTION] = profile;
-}
-
double magnesium_radio_control_impl::set_tx_gain(const double gain, const size_t chan)
{
std::lock_guard<std::recursive_mutex> l(_set_lock);
@@ -716,28 +698,6 @@ uhd::gain_range_t magnesium_radio_control_impl::get_rx_gain_range(
throw uhd::key_error("Invalid RX gain name!");
}
-std::vector<std::string> magnesium_radio_control_impl::get_tx_gain_profile_names(
- const size_t) const
-{
- return MAGNESIUM_GP_OPTIONS;
-}
-
-std::vector<std::string> magnesium_radio_control_impl::get_rx_gain_profile_names(
- const size_t) const
-{
- return MAGNESIUM_GP_OPTIONS;
-}
-
-std::string magnesium_radio_control_impl::get_tx_gain_profile(const size_t) const
-{
- return _gain_profile.at(TX_DIRECTION);
-}
-
-std::string magnesium_radio_control_impl::get_rx_gain_profile(const size_t) const
-{
- return _gain_profile.at(RX_DIRECTION);
-}
-
meta_range_t magnesium_radio_control_impl::get_tx_bandwidth_range(size_t) const
{
return meta_range_t(AD9371_TX_MIN_BANDWIDTH, AD9371_TX_MAX_BANDWIDTH);