aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/multi_usrp.cpp
Commit message (Collapse)AuthorAgeFilesLines
* host: Add static_assert to prevent meta_range_t(0,0)Lane Kolbly2021-07-141-2/+2
| | | | | | | meta_range_t(0,0) actually calls the iterator-based constructor for meta_range_t, which is almost certainly not the intended constructor for that call syntax. Therefore, we add a static_assert to prevent such usage, and fix all failing instances.
* uhd: Remove includes of list_of.hpp where appropriateMartin Braun2021-06-241-1/+0
| | | | This Boost header is included in some places, despite not being used.
* multi_usrp: Factor out make_overall_tune_range() and fix limitsMartin Braun2021-06-091-19/+1
| | | | | | | | | This function had an issue where it might return negative frequency values. A quick fix was to limit it to positive frequencies. Since this function was duplicated between multi_usrp and multi_usrp_rfnoc, this patch also moves it to a common location to not have to fix it twice.
* multi_usrp, x300: Relax LO set API strictnessAaron Rossetto2021-05-191-8/+16
| | | | | | | | | | | This PR relaxes the set_{rx|tx}_lo_{source|sources|export_enabled}() functions to allow them to be called with 'internal'/ALL_LOS or false/ALL_LOS on devices which do not support changing their LO source or exporting. This makes the get and set functions for those LOs settings more symmetrical in that the values returned from the get function can be successfully passed to the set function. Prior to this change, calling the set functions would throw an error indicating that the device does not support manual configuration of the LO.
* host: Update code base using clang-tidyMartin Braun2021-03-041-152/+167
| | | | | | | | | The checks from the new clang-tidy file are applied to the source tree using: $ find . -name "*.cpp" | sort -u | xargs \ --max-procs 8 --max-args 1 clang-tidy --format-style=file \ --fix -p /path/to/compile_commands.json
* multi_usrp: Add get_mb_controller() API callCristina Fuentes2020-09-241-0/+6
|
* uhd: Add APIs for getting the available power rangeMartin Braun2020-08-171-0/+21
| | | | | | | | | The previously added APIs for getting/setting power reference levels was missing an option to read back the currently available power levels (minimum and maximum power levels). This adds getters for TX and RX power ranges to multi_usrp and radio_control. The power API is thus now more similar to the gain API, which always had getters for gain ranges.
* filter API: Fix multi_usrp tx callsSteven Koo2020-07-171-4/+2
| | | | | Adding the fix to use fs_path instead of tx_rf_fe_root. This was done to the rx methods and should have been done for the tx ones as well.
* multi_usrp: Add get_radio_control() API callMartin Braun2020-07-161-0/+6
| | | | | This is an advanced API call that allows direct underlying access to the radio_control object for RFNoC devices.
* filter API: Fix Python bindings and multi_usrp callsMartin Braun2020-06-101-4/+2
| | | | | | | | | | | This fixes the following issues: - The Python bindings did not declare parents for the various filter object classes properly. This meant that set_?x_filter wouldn't work, because the user would pass a specific type (e.g., analog_filter_lp), but the class would not recognize it as a filter_info_base. - In multi_usrp.cpp, filter names are also property tree paths to make them unique. However, the setters and getters for filters would then prepend the FE path again, thus breaking those calls.
* multi_usrp: Amend get_usrp_{rx,tx}_info() to include cal keysMartin Braun2020-05-201-0/+16
| | | | | | This adds two more keys to the dictionary return from get_usrp_{rx,tx}_info() which can be used to query the calibration key and serial.
* multi_usrp: Remove rfnoc-specific code from multi_usrp.cppMartin Braun2020-04-281-38/+0
| | | | | This implementation of multi_usrp is only for non-RFNoC devices; the section was thus dead code.
* uhd: Add reference power level API to multi_usrp and radio_controlMartin Braun2020-04-171-0/+56
| | | | | | | | | | | | | | | | | | This adds the following API calls: - multi_usrp::has_{rx,tx}_power_reference() - multi_usrp::set_{rx,tx}_power_reference() - multi_usrp::get_{rx,tx}_power_reference() - radio_control::has_{rx,tx}_power_reference() - radio_control::set_{rx,tx}_power_reference() - radio_control::get_{rx,tx}_power_reference() It also adds a manual page explaining the philosophy of the API. Note that this does not actually add this feature to any device implementation. Calling the new API calls will thus result in `uhd::not_implemented_error` exceptions being thrown. This commit is to lock down the API and ABI.
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-031-829/+1084
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* multi_usrp: Add get_tree() API callMartin Braun2020-02-041-0/+5
| | | | | | This allows access to the underlying property tree without having to refer to the device object. Useful for RFNoC objects, where the device object is not accessible.
* multi_usrp: Amend APIs for GPIO source controlMartin Braun2020-01-231-1/+7
| | | | | | | | | | | This adds a new API call to multi_usrp: get_gpio_src_banks(). This returns a list of GPIO banks who's source can be controlled through the motherboard controller. The remaining GPIO source methods' docstrings are improved, to explain the difference between GPIO banks for set_gpio_attr() and set_gpio_src(). The former controls the actual value on a GPIO bank, and the latter who drives it. These can be different banks.
* multi_usrp: unify GPIO access typeBrent Stapleton2019-12-301-1/+1
| | | | | | | | GPIOs in the property tree are registered as uint32_t's, so the get_gpio_attr function should use that type as well. This resolves a property tree runtime_error when running the `gpio` example with a B2xx device.
* multi_usrp: Add set_rx_spp() callMartin Braun2019-11-261-1/+18
| | | | | | | | This API call is a more explicit way of setting the spp than passing in an spp value in the args of the stream args when creating streamers. For pre-RFNoC devices, this is done by injecting the spp arg back into the stream args. For RFNoC devices, the set_property() call on the radio is called.
* uhd: Replace all occurrences of boost::bind with std::bindMartin Braun2019-11-261-15/+15
| | | | | | | | | | | | | | | | | | | | | Note: Replacing everything with a lambda would be even better, but that can't be easily scripted so we'll do this as a first step to reduce the Boost footprint. This also removes occurences of #include <boost/bind.hpp>, and makes sure all usages of std::bind have an #include <functional>. clang-format wasn't always applied to minimize the changeset in this commit, however, it was applied to the blocks of #includes. Due to conflicts with other Boost libraries, the placeholders _1, _2, etc. could not be directly used, but had to be explicitly called out (as std::placeholders::_1, etc.). This makes the use of std::bind even uglier, which serves as another reminder that using std::bind (and even more so, boost::bind) should be avoided. nirio/rpc/rpc_client.cpp still contains a reference to boost::bind. It was not possible to remove it by simply doing a search and replace, so it will be removed in a separate commit.
* uhd: Replace usage of boost smart pointers with C++11 counterpartsMartin Braun2019-11-261-3/+3
| | | | | | | | | | | | | | | | | | | This removes the following Boost constructs: - boost::shared_ptr, boost::weak_ptr - boost::enable_shared_from_this - boost::static_pointer_cast, boost::dynamic_pointer_cast The appropriate includes were also removed. All C++11 versions of these require #include <memory>. Note that the stdlib and Boost versions have the exact same syntax, they only differ in the namespace (boost vs. std). The modifications were all done using sed, with the exception of boost::scoped_ptr, which was replaced by std::unique_ptr. References to boost::smart_ptr were also removed. boost::intrusive_ptr is not removed in this commit, since it does not have a 1:1 mapping to a C++11 construct.
* Remove proto-RFNoC filesMartin Braun2019-11-261-5/+2
| | | | | | | This commit removes all files and parts of files that are used by proto-RFNoC only. uhd: Fix include CMakeLists.txt, add missing files
* rfnoc: Add multi_usrp_rfnoc, modify multi_usrpBrent Stapleton2019-11-261-318/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a separate version of multi_usrp for RFNoC devices. It is compatible with RFNoC devices only, and prefers C++ APIs over property tree usage. The factory of multi_usrp is modified such that it picks the correct version, users of multi_usrp don't care about this change. This also introduces some API changes: - Removing redundant GPIO functions. Now all GPIO control, setting, and readback is done with uint32_t's. - Adding getter/setter for GPIO source. This was done to simplify the other GPIO settings, as the source for each pin is not always a binary. The CTRL mode, for example, can either be ATR or GPIO. However, the source can be controlled by various radios or "PS" or some other source. - Removing the mask from the RFNoC radio controllers' set_gpio_attr(). - Adding state caching to gpio_atr_3000, and a getter for it. Whenever an attribute is set, that value is cached, and can now be retreieved. - Remove low-level register API. Since UHD 3.10, there is no USRP that implements that API. Modifying the filter API in the following ways: - Splitting filter API getter/setter/list into separate RX and TX functions - Adding channel numbers as an argument - The filter name will no longer be a property tree path, but rather a filter name. For RFNoC devices, this will take the form `BLOCK_ID:FILTER_NAME`. For non-RFNoC devices, this will just be the filter name (e.g. `HB_1`) - Removing search mask from listing function. Users can do their own searching Co-Authored-By: Martin Braun <martin.braun@ettus.com>
* utils: soft_register: Remove 16-bit modeMartin Braun2019-11-261-14/+0
| | | | | This mode is never used, and makes it more cumbersome to maintain this code.
* uhd: Remove deprecated objects and methodsMartin Braun2019-11-261-23/+0
| | | | | | | | | This removes the following symbols: - otw_type_t - clock_config_t - Any functions that use those symbols - Non-standard args from examples (e.g., --total-time is deprecated in favour of --duration)
* multi_usrp: Fix typo in get_user_settings_iface()Brent Stapleton2019-08-191-1/+1
|
* X300: Add recovery for duplicate IP addresses in EEPROMMichael West2018-10-251-1/+1
| | | | | - Limit initialization to ZPU communication if recover_mb_eeprom=1 is set in device args.
* multi_usrp: Add sync_source APIMartin Braun2018-10-111-6/+160
| | | | | | | | | | The sync_source API is an atomic setter for all sync-related settings. If supported by the underlying USRP, it can be faster to call set_sync_source() rather than sequentially calling set_clock_source() and set_time_source(). If the underlying device does not support the sync_source API, it will fall back to the set_clock_source() and set_time_source() APIs, making this change backward-compatiple.
* multi_usrp: move definition of constantsAndrew Lynch2018-10-041-0/+2
| | | | ALL_MBOARDS and ALL_CHANS will be exported on GCC and MSVC
* multi_usrp: Add get_user_settings_iface() API callMartin Braun2018-08-161-0/+12
| | | | | | | | | | | For USRPs that support user settings (e.g., B2xx, N230), this will return an object that will allow peeking and poking user-defined settings registers. Mock code example: auto usrp = multi_usrp::make(...); auto user_settings_iface = usrp->get_user_settings_iface(); user_settings_iface->poke32(0, 23);
* fixup! uhd: Warn when tuning with auto DSP frequency and an external LOBrent Stapleton2018-07-181-1/+3
| | | | | | Check for ALL_LOS in the property tree before checking if its set to external. This warning is only applicable to the TwinRX, so its fine to only look for the ALL_LOS property.
* multi_usrp: Fix get_usrp_tx_info() for MPMD devicesMartin Braun2018-07-171-1/+1
|
* uhd: Expose DC Offset range via multi_usrp interfaceDerek Kozel2018-07-111-0/+18
|
* uhd: Warn when tuning with auto DSP frequency and an external LODerek Kozel2018-07-101-0/+19
| | | | | In LO sharing cases this can result in frequency errors between channels.
* multi_usrp: Check for existence of mboard sensor namesMartin Braun2018-05-171-1/+4
| | | | | get_mboard_sensor_names() would crash if a USRP didn't actually have at least one sensors defined.
* UHD: Fix get_usrp_?x_infoMichael West2018-05-151-2/+2
|
* lib: Remove some unnecessary use of boost::posix_timeMartin Braun2018-05-141-5/+7
| | | | Replace by std::chrono.
* multi_usrp: Update get_usrp_?x_info()Trung N Tran2018-05-011-15/+78
| | | | | | | In MPM devices, daughterboard EEPROMs now use eeprom_map_t instead of dboard_eeprom_t. The eeprom also is under rfnoc path. This change will allow ?x_info() to reach that rfnoc path and pull information from the new eeprom_map_t.
* lib: Purge all references to boost::this_thread::sleep()Martin Braun2018-04-301-3/+4
| | | | Replace with std::this_thread::sleep_for().
* multi_usrp: Add API call to query the clock rate rangeMartin Braun2018-04-031-0/+17
|
* multi_usrp: Refactor gpio_attr methodsMartin Braun2018-03-301-117/+164
| | | | | | | | | - Fix indentation issues - Fix inconsistent formatting - Fix typos in user-facing messages - Fix inconsistent exception messages - Apply coding guideline formatting rules - Remove some code duplication
* fixup! usrp: Add set_gpio_attr overload that use stringTrung N Tran2018-03-141-2/+2
| | | | | set_gpio_attr did not return after completion. This leads to wrong error reporting.
* uhd: Move internal headers to uhdlib/Martin Braun2018-03-141-1/+1
| | | | | | | | | | | | | | | | To avoid the proliferation of additional include directories and multiple ways of including project-local headers, we now default to moving all headers that are used across UHD into the uhdlib/ subdirectory. Some #include statements were also reordered as they were modified for closer compliance with the coding guidelines. Internal cpp source files should now include files like this: #include <uhdlib/rfnoc/ctrl_iface.hpp> Reviewed-by: Ashish Chaudhari <ashish.chaudhari@ettus.com>
* uhd: Move some gpio_defs constants definitions out of headersMartin Braun2018-02-271-0/+1
| | | | Reviewed-by: Trung Tran <trung.tran@ettus.com>
* usrp: Add set_gpio_attr overload that use stringTrung N Tran2018-02-211-22/+172
| | | | | | | | | | | | | 1/ multi_usrp.hpp; multi_usrp.cpp: added new functions - set_gpio_attr() that allow user to set certain attribute by string value. - get_gpio_string_attr() return string type value of certain attribute. 2/ gpio_defs.hpp; gpio_atr_3000.cpp : added new definition of SRC attribute. This commit enable user to use multi_usrp api to set_gpio_attr using string value. This is helpful; because the attribute can represent more than two state as of old API. This enable user to set SRC (source) that drive each GPIO bank's pin. Source can be either processing unit(PS) or radio frontend logic from FPGA logic.
* uhd: Update license headersMartin Braun2018-02-191-1/+2
| | | | | | | All copyright is now attributed to "Ettus Research, a National Instruments company". SPDX headers were also updated to latest version 3.0.
* multi_usrp: Fix compiler warningsMartin Braun2018-01-161-22/+41
| | | | Also elevated a UHD_LOG_ERROR() to an exception.
* usrp: add multiusrp api for gain profile.Trung N Tran2018-01-121-0/+72
|
* Move all license headers to SPDX format.Martin Braun2017-12-221-12/+1
|
* multi_usrp: Expose APIs for TX LO controlsMartin Braun2017-12-061-0/+220
| | | | | Reviewed-By: Ashish Chaudhari <ashish@ettus.com> Reviewed-By: Derek Kozel <derek.kozel@ettus.com>
* uhd: Replaced many lexical_cast with appropriate C++11 equivalentsMartin Braun2017-06-291-3/+3
|