From deee58982a45718570dce4910112d6a4b56b2480 Mon Sep 17 00:00:00 2001 From: Andrej Rode Date: Fri, 17 Feb 2017 18:48:33 -0800 Subject: cores: unhide virtual overloaded functions in gpio_atr_3000 --- host/lib/usrp/cores/gpio_atr_3000.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/cores/gpio_atr_3000.cpp b/host/lib/usrp/cores/gpio_atr_3000.cpp index 6df592e1b..4b141e2ab 100644 --- a/host/lib/usrp/cores/gpio_atr_3000.cpp +++ b/host/lib/usrp/cores/gpio_atr_3000.cpp @@ -271,6 +271,7 @@ public: return (~_atr_disable_reg.get()) >> compute_shift(unit); } + using gpio_atr_3000_impl::set_gpio_ddr; inline void set_gpio_ddr(const db_unit_t unit, const uint32_t value, const uint32_t mask) { gpio_atr_3000_impl::set_gpio_ddr(DDR_OUTPUT, compute_mask(unit, value&mask)); @@ -282,6 +283,7 @@ public: return _ddr_reg.get() >> compute_shift(unit); } + using gpio_atr_3000_impl::set_atr_reg; inline void set_atr_reg(const db_unit_t unit, const gpio_atr_reg_t atr, const uint32_t value, const uint32_t mask) { gpio_atr_3000_impl::set_atr_reg(atr, value << compute_shift(unit), compute_mask(unit, mask)); @@ -300,6 +302,7 @@ public: return (reg->get() & compute_mask(unit, MASK_SET_ALL)) >> compute_shift(unit); } + using gpio_atr_3000_impl::set_gpio_out; inline void set_gpio_out(const db_unit_t unit, const uint32_t value, const uint32_t mask) { gpio_atr_3000_impl::set_gpio_out( @@ -312,6 +315,7 @@ public: return (_atr_idle_reg.get_gpio_out() & compute_mask(unit, MASK_SET_ALL)) >> compute_shift(unit); } + using gpio_atr_3000_impl::read_gpio; inline uint32_t read_gpio(const db_unit_t unit) { return (gpio_atr_3000_impl::read_gpio() & compute_mask(unit, MASK_SET_ALL)) >> compute_shift(unit); -- cgit v1.2.3 From fd772737061200d0971ba0dba66bfdddfca02b2d Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 20 Feb 2017 10:52:15 -0800 Subject: uhd: Fix C API LO controls --- host/lib/usrp/usrp_c.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/usrp_c.cpp b/host/lib/usrp/usrp_c.cpp index 943f96db0..99c671ec5 100644 --- a/host/lib/usrp/usrp_c.cpp +++ b/host/lib/usrp/usrp_c.cpp @@ -840,10 +840,10 @@ uhd_error uhd_usrp_get_fe_rx_freq_range( UHD_API uhd_error uhd_usrp_get_rx_lo_names( uhd_usrp_handle h, size_t chan, - uhd_string_vector_handle rx_lo_names_out + uhd_string_vector_handle *rx_lo_names_out ){ UHD_SAFE_C_SAVE_ERROR(h, - rx_lo_names_out->string_vector_cpp = USRP(h)->get_rx_lo_names(chan); + (*rx_lo_names_out)->string_vector_cpp = USRP(h)->get_rx_lo_names(chan); ) } @@ -874,10 +874,10 @@ UHD_API uhd_error uhd_usrp_get_rx_lo_sources( uhd_usrp_handle h, const char* name, size_t chan, - uhd_string_vector_handle rx_lo_sources_out + uhd_string_vector_handle *rx_lo_sources_out ){ UHD_SAFE_C_SAVE_ERROR(h, - rx_lo_sources_out->string_vector_cpp = USRP(h)->get_rx_lo_sources(name, chan); + (*rx_lo_sources_out)->string_vector_cpp = USRP(h)->get_rx_lo_sources(name, chan); ) } -- cgit v1.2.3 From f3f9d95476e870c85ca1b0dfa9cee7a951800f87 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 16 Feb 2017 08:36:58 -0800 Subject: C API: Added missing fields to USRP info --- host/lib/usrp/usrp_c.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/usrp_c.cpp b/host/lib/usrp/usrp_c.cpp index 99c671ec5..623a79d59 100644 --- a/host/lib/usrp/usrp_c.cpp +++ b/host/lib/usrp/usrp_c.cpp @@ -378,6 +378,7 @@ uhd_error uhd_usrp_get_rx_info( uhd::dict rx_info = USRP(h)->get_usrp_rx_info(chan); COPY_INFO_FIELD(info_out, rx_info, mboard_id); + COPY_INFO_FIELD(info_out, rx_info, mboard_name); COPY_INFO_FIELD(info_out, rx_info, mboard_serial); COPY_INFO_FIELD(info_out, rx_info, rx_id); COPY_INFO_FIELD(info_out, rx_info, rx_subdev_name); @@ -396,6 +397,7 @@ uhd_error uhd_usrp_get_tx_info( uhd::dict tx_info = USRP(h)->get_usrp_tx_info(chan); COPY_INFO_FIELD(info_out, tx_info, mboard_id); + COPY_INFO_FIELD(info_out, tx_info, mboard_name); COPY_INFO_FIELD(info_out, tx_info, mboard_serial); COPY_INFO_FIELD(info_out, tx_info, tx_id); COPY_INFO_FIELD(info_out, tx_info, tx_subdev_name); -- cgit v1.2.3 From 454307a8845a3bc697531df5fd2e245233ed5218 Mon Sep 17 00:00:00 2001 From: Mark Meserve Date: Fri, 3 Feb 2017 16:25:34 -0600 Subject: Revise calculation of ADF5355 FRAC2 register Corrected residue formula Fixed cast to uint16_t that was behaving differently in msvc14 32-bit vs 64-bit --- host/lib/usrp/common/adf5355.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/common/adf5355.cpp b/host/lib/usrp/common/adf5355.cpp index e3fd66bc2..80c300d47 100644 --- a/host/lib/usrp/common/adf5355.cpp +++ b/host/lib/usrp/common/adf5355.cpp @@ -48,6 +48,7 @@ static const double ADF5355_PHASE_RESYNC_TIME = 400e-6; static const uint32_t ADF5355_MOD1 = 16777216; static const uint32_t ADF5355_MAX_MOD2 = 16384; +static const uint32_t ADF5355_MAX_FRAC2 = 16384; //static const uint16_t ADF5355_MIN_INT_PRESCALER_89 = 75; class adf5355_impl : public adf5355_iface @@ -261,15 +262,11 @@ public: double N = prescaler_input_freq / _pfd_freq; uint16_t INT = static_cast(floor(N)); uint32_t FRAC1 = static_cast(floor((N - INT) * ADF5355_MOD1)); - double residue = ADF5355_MOD1 * (N - (INT + FRAC1 / ADF5355_MOD1)); + double residue = (N - INT) * ADF5355_MOD1 - FRAC1; double gcd = boost::math::gcd(static_cast(_pfd_freq), static_cast(freq_resolution)); - uint16_t MOD2 = static_cast(floor(_pfd_freq / gcd)); - - if (MOD2 > ADF5355_MAX_MOD2) { - MOD2 = ADF5355_MAX_MOD2; - } - uint16_t FRAC2 = ceil(residue * MOD2); + uint16_t MOD2 = static_cast(std::min(floor(_pfd_freq / gcd), static_cast(ADF5355_MAX_MOD2))); + uint16_t FRAC2 = static_cast(std::min(ceil(residue * MOD2), static_cast(ADF5355_MAX_FRAC2))); double coerced_vco_freq = _pfd_freq * ( todbl(INT) + ( -- cgit v1.2.3 From 16ccfe215b60dfaeb9210fc44f6264338fc4ee11 Mon Sep 17 00:00:00 2001 From: Mark Meserve Date: Fri, 3 Feb 2017 17:37:20 -0600 Subject: Fix max values for MOD2 and FRAC2 --- host/lib/usrp/common/adf5355.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/common/adf5355.cpp b/host/lib/usrp/common/adf5355.cpp index 80c300d47..36d41a5c3 100644 --- a/host/lib/usrp/common/adf5355.cpp +++ b/host/lib/usrp/common/adf5355.cpp @@ -47,8 +47,8 @@ static const double ADF5355_MIN_OUT_FREQ = (3.4e9 / 64); static const double ADF5355_PHASE_RESYNC_TIME = 400e-6; static const uint32_t ADF5355_MOD1 = 16777216; -static const uint32_t ADF5355_MAX_MOD2 = 16384; -static const uint32_t ADF5355_MAX_FRAC2 = 16384; +static const uint32_t ADF5355_MAX_MOD2 = 16383; +static const uint32_t ADF5355_MAX_FRAC2 = 16383; //static const uint16_t ADF5355_MIN_INT_PRESCALER_89 = 75; class adf5355_impl : public adf5355_iface -- cgit v1.2.3 From f85352491975d1b98680512617a074db09f6da5e Mon Sep 17 00:00:00 2001 From: Hendrik Vogt Date: Fri, 21 Oct 2016 19:24:39 +0200 Subject: C API: Implement set_time_source_out and fix typo --- host/lib/usrp/usrp_c.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/usrp_c.cpp b/host/lib/usrp/usrp_c.cpp index 623a79d59..e97be2abe 100644 --- a/host/lib/usrp/usrp_c.cpp +++ b/host/lib/usrp/usrp_c.cpp @@ -615,6 +615,16 @@ uhd_error uhd_usrp_set_clock_source_out( ) } +uhd_error uhd_usrp_set_time_source_out( + uhd_usrp_handle h, + bool enb, + size_t mboard +){ + UHD_SAFE_C_SAVE_ERROR(h, + USRP(h)->set_time_source_out(enb, mboard); + ) +} + uhd_error uhd_usrp_get_num_mboards( uhd_usrp_handle h, size_t *num_mboards_out @@ -1491,7 +1501,7 @@ uhd_error uhd_usrp_write_register( ) } -uhd_error uhd_usrp_write_register( +uhd_error uhd_usrp_read_register( uhd_usrp_handle h, const char* path, uint32_t field, -- cgit v1.2.3