diff options
author | Ashish Chaudhari <ashish@ettus.com> | 2014-08-12 18:28:36 -0700 |
---|---|---|
committer | Ashish Chaudhari <ashish@ettus.com> | 2014-08-12 18:28:36 -0700 |
commit | 675350a1d69bafaf76e3723707b23ec1d2830e53 (patch) | |
tree | b16bb60d6a7eaccdde64c04fc86491be81f1438f /host/lib/usrp/b200 | |
parent | 145f1d7cf7aa94f67c7ba349e29daff9a7d85d54 (diff) | |
download | uhd-675350a1d69bafaf76e3723707b23ec1d2830e53.tar.gz uhd-675350a1d69bafaf76e3723707b23ec1d2830e53.tar.bz2 uhd-675350a1d69bafaf76e3723707b23ec1d2830e53.zip |
b200, ad9361: Cleanup up AD9361 driver
- Removed transaction interface
- Made the driver a C++ class
Diffstat (limited to 'host/lib/usrp/b200')
-rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 31 | ||||
-rw-r--r-- | host/lib/usrp/b200/b200_impl.hpp | 2 |
2 files changed, 30 insertions, 3 deletions
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 393da2d04..0d0cec784 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -46,6 +46,33 @@ static const boost::posix_time::milliseconds REENUMERATION_TIMEOUT_MS(3000); static const size_t FE1 = 1; static const size_t FE2 = 0; +class b200_ad9361_client_t : public ad9361_params { +public: + ~b200_ad9361_client_t() {} + double get_band_edge(frequency_band_t band) { + switch (band) { + case AD9361_RX_BAND0: return 2.2e9; + case AD9361_RX_BAND1: return 4.0e9; + case AD9361_TX_BAND0: return 2.5e9; + default: return 0; + } + } + clocking_mode_t get_clocking_mode() { + return AD9361_XTAL_N_CLK_PATH; + } + digital_interface_mode_t get_digital_interface_mode() { + return AD9361_DDR_FDD_LVCMOS; + } + digital_interface_delays_t get_digital_interface_timing() { + digital_interface_delays_t delays; + delays.rx_clk_delay = 0; + delays.rx_data_delay = 0xF; + delays.tx_clk_delay = 0; + delays.tx_data_delay = 0xF; + return delays; + } +}; + /*********************************************************************** * Discovery **********************************************************************/ @@ -349,8 +376,8 @@ b200_impl::b200_impl(const device_addr_t &device_addr) // Init codec - turns on clocks //////////////////////////////////////////////////////////////////// UHD_MSG(status) << "Initialize CODEC control..." << std::endl; - _codec_ctrl = ad9361_ctrl::make( - ad9361_ctrl_transport::make_software_spi(AD9361_B200, _spi_iface, AD9361_SLAVENO)); + ad9361_params::sptr client_settings = boost::make_shared<b200_ad9361_client_t>(); + _codec_ctrl = ad9361_ctrl::make_spi(client_settings, _spi_iface, AD9361_SLAVENO); this->reset_codec_dcm(); //////////////////////////////////////////////////////////////////// diff --git a/host/lib/usrp/b200/b200_impl.hpp b/host/lib/usrp/b200/b200_impl.hpp index c9462c6d6..155ff699c 100644 --- a/host/lib/usrp/b200/b200_impl.hpp +++ b/host/lib/usrp/b200/b200_impl.hpp @@ -100,7 +100,7 @@ private: //controllers b200_iface::sptr _iface; radio_ctrl_core_3000::sptr _local_ctrl; - ad9361_ctrl::sptr _codec_ctrl; + uhd::usrp::ad9361_ctrl::sptr _codec_ctrl; b200_local_spi_core::sptr _spi_iface; boost::shared_ptr<uhd::usrp::adf4001_ctrl> _adf4001_iface; uhd::gps_ctrl::sptr _gps; |