diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-03-23 15:17:16 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:03:44 -0800 |
commit | d96ff2270cbaed482b4ef52230979d5de792783a (patch) | |
tree | b8471ae01f85f591020bf82a3b974642078313ed /mpm/lib | |
parent | bc4d1bf0ca341a72a7d7f6b2168aa3d2e936aabf (diff) | |
download | uhd-d96ff2270cbaed482b4ef52230979d5de792783a.tar.gz uhd-d96ff2270cbaed482b4ef52230979d5de792783a.tar.bz2 uhd-d96ff2270cbaed482b4ef52230979d5de792783a.zip |
mpm: Minor modifications to ad937x controls
- Made rates a vector instead of set for better compat w/ RPC and UHD
- Minor whitespace fixes
Diffstat (limited to 'mpm/lib')
-rw-r--r-- | mpm/lib/mykonos/ad937x_ctrl.cpp | 2 | ||||
-rw-r--r-- | mpm/lib/mykonos/ad937x_ctrl.hpp | 6 | ||||
-rw-r--r-- | mpm/lib/mykonos/ad937x_device.cpp | 49 |
3 files changed, 28 insertions, 29 deletions
diff --git a/mpm/lib/mykonos/ad937x_ctrl.cpp b/mpm/lib/mykonos/ad937x_ctrl.cpp index a5cd842f5..1aff4ed42 100644 --- a/mpm/lib/mykonos/ad937x_ctrl.cpp +++ b/mpm/lib/mykonos/ad937x_ctrl.cpp @@ -34,7 +34,7 @@ uhd::meta_range_t ad937x_ctrl::get_bw_filter_range(void) return uhd::meta_range_t(0, 1); } -std::set<double> ad937x_ctrl::get_clock_rates(void) +std::vector<double> ad937x_ctrl::get_clock_rates(void) { // TODO: fix return { 125e6 }; diff --git a/mpm/lib/mykonos/ad937x_ctrl.hpp b/mpm/lib/mykonos/ad937x_ctrl.hpp index 213a146b4..defb57fa2 100644 --- a/mpm/lib/mykonos/ad937x_ctrl.hpp +++ b/mpm/lib/mykonos/ad937x_ctrl.hpp @@ -36,11 +36,11 @@ class ad937x_ctrl : public boost::noncopyable public: typedef std::shared_ptr<ad937x_ctrl> sptr; static sptr make(spi_lock::sptr spi_l, uhd::spi_iface::sptr iface); - virtual ~ad937x_ctrl(void) {}; + virtual ~ad937x_ctrl(void) {} static uhd::meta_range_t get_rf_freq_range(void); static uhd::meta_range_t get_bw_filter_range(void); - static std::set<double> get_clock_rates(void); + static std::vector<double> get_clock_rates(void); static uhd::meta_range_t get_gain_range(const std::string &which); virtual uint8_t get_product_id() = 0; @@ -69,4 +69,4 @@ protected: static ad937x_device::chain_t _get_chain_from_antenna(const std::string& antenna); static std::set<size_t> _get_valid_fir_lengths(const std::string& which); -};
\ No newline at end of file +}; diff --git a/mpm/lib/mykonos/ad937x_device.cpp b/mpm/lib/mykonos/ad937x_device.cpp index 62725f219..85eb9553a 100644 --- a/mpm/lib/mykonos/ad937x_device.cpp +++ b/mpm/lib/mykonos/ad937x_device.cpp @@ -43,20 +43,20 @@ static const size_t ARM_BINARY_SIZE = 98304; static const uint32_t INIT_CAL_TIMEOUT_MS = 10000; static const uint32_t INIT_CALS = - TX_BB_FILTER | - ADC_TUNER | - TIA_3DB_CORNER | + TX_BB_FILTER | + ADC_TUNER | + TIA_3DB_CORNER | DC_OFFSET | - TX_ATTENUATION_DELAY | - RX_GAIN_DELAY | + TX_ATTENUATION_DELAY | + RX_GAIN_DELAY | FLASH_CAL | - PATH_DELAY | - TX_LO_LEAKAGE_INTERNAL | + PATH_DELAY | + TX_LO_LEAKAGE_INTERNAL | // TX_LO_LEAKAGE_EXTERNAL | TX_QEC_INIT | - LOOPBACK_RX_LO_DELAY | + LOOPBACK_RX_LO_DELAY | LOOPBACK_RX_RX_QEC_INIT | - RX_LO_DELAY | + RX_LO_DELAY | RX_QEC_INIT | // DPD_INIT | // CLGC_INIT | @@ -110,7 +110,7 @@ void ad937x_device::_call_gpio_api_function(std::function<mykonosGpioErr_t()> fu void ad937x_device::_initialize() { _call_api_function(std::bind(MYKONOS_resetDevice, mykonos_config.device)); - + if (get_product_id() != AD9371_PRODUCT_ID) { throw uhd::runtime_error("AD9371 product ID does not match expected ID!"); @@ -140,7 +140,7 @@ void ad937x_device::_initialize() } // TODO: ADD GPIO CTRL setup here - + set_gain(uhd::RX_DIRECTION, chain_t::ONE, 0); set_gain(uhd::RX_DIRECTION, chain_t::TWO, 0); set_gain(uhd::TX_DIRECTION, chain_t::ONE, 0); @@ -153,7 +153,7 @@ void ad937x_device::_initialize() _start_jesd(); _enable_tracking_calibrations(); - + // radio is ON! _call_api_function(std::bind(MYKONOS_radioOn, mykonos_config.device)); @@ -182,10 +182,10 @@ void ad937x_device::_run_initialization_calibrations() uint8_t errorFlag = 0; uint8_t errorCode = 0; _call_api_function( - std::bind(MYKONOS_waitInitCals, - mykonos_config.device, - INIT_CAL_TIMEOUT_MS, - &errorFlag, + std::bind(MYKONOS_waitInitCals, + mykonos_config.device, + INIT_CAL_TIMEOUT_MS, + &errorFlag, &errorCode)); if ((errorFlag != 0) || (errorCode != 0)) @@ -210,14 +210,14 @@ void ad937x_device::_run_initialization_calibrations() void ad937x_device::_start_jesd() { // Stop and/or disable SYSREF - // ensure BBIC JESD is reset and ready to recieve CGS characters + // ensure BBIC JESD is reset and ready to receive CGS characters // prepare to transmit CGS when sysref starts _call_api_function(std::bind(MYKONOS_enableSysrefToRxFramer, mykonos_config.device, 1)); - + // prepare to transmit CGS when sysref starts //_call_api_function(std::bind(MYKONOS_enableSysrefToObsRxFramer, mykonos_config.device, 1)); - + // prepare to transmit CGS when sysref starts _call_api_function(std::bind(MYKONOS_enableSysrefToDeframer, mykonos_config.device, 0)); @@ -471,9 +471,9 @@ void ad937x_device::set_agc_mode(uhd::direction_t direction, gain_mode_t mode) } void ad937x_device::set_fir( - const uhd::direction_t direction, - const chain_t chain, - int8_t gain, + const uhd::direction_t direction, + const chain_t chain, + int8_t gain, const std::vector<int16_t> & fir) { switch (direction) @@ -490,8 +490,8 @@ void ad937x_device::set_fir( } std::vector<int16_t> ad937x_device::get_fir( - const uhd::direction_t direction, - const chain_t chain, + const uhd::direction_t direction, + const chain_t chain, int8_t &gain) { switch (direction) @@ -513,4 +513,3 @@ int16_t ad937x_device::get_temperature() return status.tempCode; } - |