diff options
-rw-r--r-- | mpm/lib/mykonos/ad937x_ctrl.cpp | 5 | ||||
-rw-r--r-- | mpm/lib/mykonos/ad937x_device.cpp | 24 | ||||
-rw-r--r-- | mpm/lib/mykonos/ad937x_device.hpp | 1 |
3 files changed, 24 insertions, 6 deletions
diff --git a/mpm/lib/mykonos/ad937x_ctrl.cpp b/mpm/lib/mykonos/ad937x_ctrl.cpp index 63eef4314..0e9e2ec00 100644 --- a/mpm/lib/mykonos/ad937x_ctrl.cpp +++ b/mpm/lib/mykonos/ad937x_ctrl.cpp @@ -363,8 +363,9 @@ public: virtual double set_bw_filter(const std::string &which, const double value) { - // TODO implement - return double(); + const auto dir = _get_direction_from_antenna(which); + std::lock_guard<std::mutex> lock(*spi_mutex); + return device.set_bw_filter(dir, value); } virtual double set_gain(const std::string &which, const double value) diff --git a/mpm/lib/mykonos/ad937x_device.cpp b/mpm/lib/mykonos/ad937x_device.cpp index 885d45748..9b48a80bf 100644 --- a/mpm/lib/mykonos/ad937x_device.cpp +++ b/mpm/lib/mykonos/ad937x_device.cpp @@ -572,11 +572,29 @@ double ad937x_device::tune( double ad937x_device::set_bw_filter( const direction_t direction, - const chain_t chain, const double value ) { - // TODO: implement - return double(); + + switch (direction) + { + case TX_DIRECTION: + { + mykonos_config.device->tx->txProfile->rfBandwidth_Hz = value; + mykonos_config.device->tx->txProfile->txBbf3dBCorner_kHz = value/1000; + mykonos_config.device->tx->txProfile->txDac3dBCorner_kHz = value/1000; + break; + } + case RX_DIRECTION: + { + mykonos_config.device->rx->rxProfile->rfBandwidth_Hz = value; + mykonos_config.device->rx->rxProfile->rxBbf3dBCorner_kHz = value/1000; + break; + } + } + const auto state = _move_to_config_state(); + CALL_API(MYKONOS_writeArmProfile(mykonos_config.device)); + _restore_from_config_state(state); + return value; // TODO: what is coercer value? } diff --git a/mpm/lib/mykonos/ad937x_device.hpp b/mpm/lib/mykonos/ad937x_device.hpp index b0f843d39..24a15ba69 100644 --- a/mpm/lib/mykonos/ad937x_device.hpp +++ b/mpm/lib/mykonos/ad937x_device.hpp @@ -79,7 +79,6 @@ public: double set_bw_filter( const uhd::direction_t direction, - const mpm::ad937x::device::chain_t chain, const double value ); void set_agc_mode( |