aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp_c.cpp
Commit message (Collapse)AuthorAgeFilesLines
* uhd: Replace Boost mutexes and locks with standard optionsMartin Braun2021-10-191-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a very mechanical task that could almost have been done with sed. Boost versions of mutexes and locks were removed, and replaced with std:: versions. The replacement tables are as follows: == Mutexes == - boost::mutex -> std::mutex - boost::recursive_mutex -> std::recursive_mutex Mutexes behave identically between Boost and std:: and have the same API. == Locks == C++11 has only two types of lock that we use/need in UHD: - std::lock_guard: Identical to boost::lock_guard - std::unique_lock: Identical to boost::unique_lock Boost also has boost::mutex::scoped_lock, which is a typedef for boost::unique_lock<>. However, we often have used scoped_lock where we meant to use lock_guard<>. The name is a bit misleading, "scoped lock" sounding a bit like an RAII mechanism. Therefore, some previous boost::mutex::scoped_lock are now std::lock_guard<>. std::unique_lock is required when doing more than RAII locking (i.e., unlocking, relocking, usage with condition variables, etc.). == Condition Variables == Condition variables were out of the scope of this lock/mutex change, but in UHD, we inconsistently use boost::condition vs. boost::condition_variable. The former is a templated version of the latter, and thus works fine with std::mutex'es. Therefore, some boost::condition_variable where changed to boost::condition. All locks and mutexes use `#include <mutex>`. The corresponding Boost includes were removed. In some cases, this exposed issues with implicit Boost includes elsewhere. The missing explicit includes were added.
* utils/C API: Fix property tree accessMartin Braun2020-03-121-4/+4
| | | | | | | | | | The introduction of multi_usrp_rfnoc caused multi_usrp::get_device()->get_tree() to segfault for gen3 devices. In defcb174, we introduced a fix for this (multi_usrp::get_tree()) but we didn't apply it to internal utilities. That means the uhd_cal_* utilties were broken, along with certain sections of the C API, and the latency test suite. This fixes the segfault issue.
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-031-997/+562
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* rfnoc: Add multi_usrp_rfnoc, modify multi_usrpBrent Stapleton2019-11-261-47/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* C API: Add support for Tx LO controlMartin Braun2018-12-141-0/+89
| | | | | The Rx LO control was always there, but the Tx LO control was not exposed into the C API.
* uhd: Remove usage of time_t (except when required)Martin Braun2018-08-201-6/+6
| | | | | | | | | | The C/C++ standards don't define what time_t is, only that it is arithmetic (and real for C11, and integral for C++). It should not be used in portable software and is only used as the return value for some libc calls. A common definition for time_t is int64_t, so we'll switch to that permanently in our own APIs. System APIs will of course stick with time_t.
* C API: Fix incorrectly declared lockMartin Braun2018-07-231-1/+1
|
* 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.
* C API: Properly free streamers to support streamer re-creation.michael-west2018-02-121-24/+14
|
* Move all license headers to SPDX format.Martin Braun2017-12-221-12/+1
|
* C API: Better error handling in uhd_usrp_get_?x_streamMartin Braun2017-09-281-2/+4
| | | | | In uhd_usrp_get_rx_stream and uhd_usrp_get_tx_stream, an error will now be propagated into the streamer handle.
* C API: Make uhd_rx_streamer_last_error use SAFE_CCarl Reinke2017-09-281-1/+1
| | | | | | | uhd_tx_streamer_last_error and uhd_usrp_last_error use UHD_SAFE_C and so uhd_rx_streamer_last_error should as well in order to be consistent. Currently using UHD_SAFE_C_SAVE_ERROR.
* C API: Remove API calls that don't map to C++ callsMartin Braun2017-08-071-20/+0
| | | | | Specifically, remove set_tx_dc_offset() and set_tx_iq_balance() calls that require doubles, and were given bools.
* Merge branch 'maint'Martin Braun2017-03-011-5/+17
|\
| * C API: Implement set_time_source_out and fix typoHendrik Vogt2017-02-271-1/+11
| |
| * C API: Added missing fields to USRP infoMartin Braun2017-02-201-0/+2
| |
| * uhd: Fix C API LO controlsMartin Braun2017-02-201-4/+4
| |
* | uhd: replace BOOST_FOREACH with C++11 range-based for loopAndrej Rode2017-02-101-2/+1
|/ | | | | Note: This is the first commit that uses for-range, and range-based for-loops are now usable for UHD development.
* C API: wrapped multi_usrp functions for interacting with LO'sNicholas Corgan2016-07-191-1/+90
|
* C API: added soft register APINicholas Corgan2015-08-141-0/+48
|
* C API cleanup, feature additionsNicholas Corgan2015-08-121-202/+44
| | | | | | * Cleaned up usage of handles vs. handle pointers * Store global string for last error thrown * Removed uhd::device_addr_t handle, added std::vector<std::string> handle
* C API: feature additions, bugfixesNicholas Corgan2015-08-071-0/+14
| | | | | | * Wrapped uhd::device_addrs_t, added find functions for multi_usrp, multi_usrp_clock * Replaced getopt with public domain implementation * Minor bugfixes
* uhd: C API wrapperNicholas Corgan2015-08-061-0/+1509
* multi_usrp, multi_usrp_clock, and associated classes accessible through C * Added Doxygen documentation explaining structure and API * Simple RX and TX streaming examples * Unit tests for different parts of C interface and C++ error conversion