diff options
author | Mark Meserve <mark.meserve@ni.com> | 2017-09-01 15:18:39 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:04:01 -0800 |
commit | 04b0f414b9235d36e7572b8c6644630d77de4aab (patch) | |
tree | b3ae594a9fc272b558e2dfc4464e318bbdf4b1e6 /mpm/lib/mykonos/ad937x_device.hpp | |
parent | 01ddd50e55fae3382c1300616747fc9aebb39523 (diff) | |
download | uhd-04b0f414b9235d36e7572b8c6644630d77de4aab.tar.gz uhd-04b0f414b9235d36e7572b8c6644630d77de4aab.tar.bz2 uhd-04b0f414b9235d36e7572b8c6644630d77de4aab.zip |
mpm: ad937x: Updated controls
Diffstat (limited to 'mpm/lib/mykonos/ad937x_device.hpp')
-rw-r--r-- | mpm/lib/mykonos/ad937x_device.hpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/mpm/lib/mykonos/ad937x_device.hpp b/mpm/lib/mykonos/ad937x_device.hpp index b20feb3f7..4797ed5ef 100644 --- a/mpm/lib/mykonos/ad937x_device.hpp +++ b/mpm/lib/mykonos/ad937x_device.hpp @@ -38,7 +38,14 @@ class ad937x_device : public boost::noncopyable { public: enum class gain_mode_t { MANUAL, AUTOMATIC, HYBRID }; - enum class pll_t { CLK_SYNTH, RX_SYNTH, TX_SYNTH, SNIFF_SYNTH, CALPLL_SDM }; + enum pll_t : uint8_t + { + CLK_SYNTH = 0x01, + RX_SYNTH = 0x02, + TX_SYNTH = 0x04, + SNIFF_SYNTH = 0x08, + CALPLL_SDM = 0x10, + }; ad937x_device( mpm::types::regs_iface* iface, @@ -49,6 +56,8 @@ public: void finish_initialization(); void start_jesd_rx(); void start_jesd_tx(); + void start_radio(); + void stop_radio(); uint8_t get_multichip_sync_status(); uint8_t get_framer_status(); @@ -62,14 +71,17 @@ public: mpm::ad937x::device::arm_version_t get_arm_version(); double set_bw_filter(uhd::direction_t direction, mpm::ad937x::device::chain_t chain, double value); - double set_gain(uhd::direction_t direction, mpm::ad937x::device::chain_t chain, double value); void set_agc_mode(uhd::direction_t direction, gain_mode_t mode); double set_clock_rate(double value); void enable_channel(uhd::direction_t direction, mpm::ad937x::device::chain_t chain, bool enable); + + double set_gain(uhd::direction_t direction, mpm::ad937x::device::chain_t chain, double value); + double get_gain(uhd::direction_t direction, mpm::ad937x::device::chain_t chain); + double tune(uhd::direction_t direction, double value, bool wait_for_lock); double get_freq(uhd::direction_t direction); - bool get_pll_lock_status(pll_t pll); + bool get_pll_lock_status(uint8_t pll, bool wait_for_lock = false); void set_fir(uhd::direction_t direction, mpm::ad937x::device::chain_t chain, int8_t gain, const std::vector<int16_t> & fir); std::vector<int16_t> get_fir(uhd::direction_t direction, mpm::ad937x::device::chain_t chain, int8_t &gain); @@ -90,6 +102,7 @@ public: private: enum class multichip_sync_t { PARTIAL, FULL }; + enum class radio_state_t { OFF, ON }; ad9371_spiSettings_t full_spi_settings; ad937x_config_t mykonos_config; @@ -107,6 +120,11 @@ private: void _verify_product_id(); void _verify_multichip_sync_status(multichip_sync_t mcs); - static uint8_t _convert_rx_gain(double gain); - static uint16_t _convert_tx_gain(double gain); + radio_state_t _move_to_config_state(); + void _restore_from_config_state(radio_state_t state); + + static uint8_t _convert_rx_gain_to_mykonos(double gain); + static double _convert_rx_gain_from_mykonos(uint8_t gain); + static uint16_t _convert_tx_gain_to_mykonos(double gain); + static double _convert_tx_gain_from_mykonos(uint16_t gain); }; |