diff options
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;  } - | 
