diff options
author | Trung N Tran <trung.tran@ettus.com> | 2018-02-05 11:04:07 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-02-08 22:24:21 +0100 |
commit | d76918974ad467a4364d4c32948ce00a3afb59ff (patch) | |
tree | a5bc76081356938318d36774656188d361b122d7 /mpm/lib | |
parent | 832cbe095ae5e851aadddce66e1510d33a4430f3 (diff) | |
download | uhd-d76918974ad467a4364d4c32948ce00a3afb59ff.tar.gz uhd-d76918974ad467a4364d4c32948ce00a3afb59ff.tar.bz2 uhd-d76918974ad467a4364d4c32948ce00a3afb59ff.zip |
mpm: ad937x: implement set_bw_filter
Diffstat (limited to 'mpm/lib')
-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( |