aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard
Commit message (Collapse)AuthorAgeFilesLines
* zbx: Remove stray includeMartin Braun2022-06-101-1/+0
|
* n320: Fix reading DB serial in applying correctionsMartin Braun2022-06-101-2/+2
| | | | | | The frontend corrections for N320 (IQ imbalance, DC offset) require the DB serial. However, there was an error in reading the DB serial in the code that applies the corrections.
* n320: Improve comments regarding low bandMartin Braun2022-06-102-4/+6
| | | | | The N320 code include some constants that were either unused or incorrect. This clarifies the lowband frequency.
* uhd: change default into option flag in register definitionLars Amsel2022-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for read only registers in generated interfaces. For this the default is extended to an option string. The old format is still supported for backward compability, so if options string is just a number it will be handled as a writable number. The option string is a comma separated list with key=value pairs. The value is optional and treated as None if missing. common.py now allows to pass in **kwargs to the generate method which is used by gen_zbx_cpld_regs.py to pass a filter function for registers used by mpm only. get_all_addr now has an additional (optional, defaults to false) flag to indicate whether read only addresses are to be returned or not. It also supports type generic for the result to align with get_changed_addr function. The ZBX CPLD CTRL map is adapted accordingly to reflect read only registers. The power registers are flagged as MPM scope only (and not used in ZBX CPLD control of UHD). Co-authored-by: Martin Braun <martin.braun@ettus.com>
* n310: Improve LO source control options for ALL and LO2 casesmattprost2022-06-101-19/+40
| | | | | | | | If ALL option is specified, set lo source for both lo's. Do not report an error if user sets LO2 to internal. Enforce single lo target for queries about lo state. Signed-off-by: mattprost <matt.prost@ni.com>
* n310: Add Filter API to n310mattprost2022-04-075-1/+179
| | | | | | | | | | Add the Filter API to n3xx specifically for the AD937x device. The TX filter is limited to 32 taps, and the RX filter is limited to 48 taps. This feature requires MPM version 4.2 or later on the device. Co-authored-by: bpadalino <bpadalino@gmail.com> Signed-off-by: mattprost <matt.prost@ni.com>
* n310: Add frontend bandwidth controlmattprost2022-04-073-25/+107
| | | | | | | | | | | | Allow users to control the Mykonos frontend bandwidth settings for Rx and Tx. Note that this operation requires the daughterboard to re-initialize, so it may take some time. Values for frontend filter settings were derived using ADI's AD9371 Filter Wizard. This feature requires MPM version 4.1 or later on the device. Co-authored-by: bpadalino <bpadalino@gmail.com> Signed-off-by: mattprost <matt.prost@ni.com>
* n310: cpld: Get and set TX ATR bitsmattprost2022-04-072-0/+66
| | | | | | | | | This allows the user to get the current state of the tx atr bits and set them back to a given state. This is useful for the n310 when resetting the front end, in order to avoid any tx power out of the frontend when the init_cals are run. Signed-off-by: mattprost <matt.prost@ni.com>
* N310: Deactivate frontend components on radio shutdownmattprost2022-03-033-0/+35
| | | | | | | | Make sure no active components are connected to the TX frontend during next boot. This avoids configurations that could generate unwanted tones during operations such as the Mykonos init cals. Signed-off-by: mattprost <matt.prost@ni.com>
* uhd: fix negligible copy/paste typos in rhodium radio controlDavid Raeman2022-02-282-4/+4
|
* Remove FSRU-related filesMartin Braun2022-02-221-3/+0
| | | | | | | The FSRU (aka EISCAT) was never supported in UHD 4.0. The FPGA repository never had the relevant files, and the block controller also never existed. This removes all the corresponding files from MPM, as well as some references from makefiles.
* uhd: Harmonize fuzzy frequency comparisonsMartin Braun2022-02-046-41/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Throughout UHD, we often do floating-point comparisons for frequency ranges that require resilience to floating point rounding errors. Most of the time the checks look like this: ```cpp if (fp_compare_epsilon<double>(freq) > boundary) { // ... } ``` The exception is the N320 daughterboard control, which uses a custom epsilon: ```cpp if (fp_compare_epsilon<double>(freq, RHODIUM_FREQ_COMPARE_EPSILON) > boundary) { // ... } ``` This was, for the most part, not by design, but because authors simply didn't think about which epsilon value was appropriate for the frequency comparison. This was complicated by the fact that fp_compare_epsilon previously had some issues. This patch introduces FREQ_COMPARE_EPSILON, which is a sensible default value for fp_compare_epsilon when doing frequency comparisons (note that fp_compare_delta already had such a value). Also, it introduces freq_compare_epsilon(x), which is a shorthand for fp_compare_epsilon<double>(x, FREQ_COMPARE_EPSILON). We then replace all occurrences of fp_compare_epsilon<double> which are specific to frequency checks with freq_compare_epsilon.
* host: zbx: Expose tuning table on property treeLane Kolbly2022-02-032-5/+18
| | | | | This allows viewing or, conceivably, customizing the tuning table that ZBX uses, depending on the particular needs of the end user.
* host: Implement nameless_gain_mixinLane Kolbly2022-01-202-67/+25
|
* e3xx: Fix frequency queryingMartin Braun2022-01-101-2/+11
| | | | | | | The E3xx devices have one LO per TX/RX, respectively. That means when changing the frequency on channel 0, the frequency on channel 1 also gets changed. The code didn't track this change properly: When setting channel 1, channel 0's frequency didn't match.
* host: rf_control: Add internal antenna API abstraction.Lane Kolbly2022-01-051-35/+11
|
* e3xx: Remove unused constantMartin Braun2021-12-091-2/+0
|
* host: gpio: Create gpio_atr_offsets to store GPIO registersLane Kolbly2021-10-273-21/+28
| | | | | | | Refactors register addresses into a gpio_atr_offsets structure which contains the various register addresses. This allows creating other devices with different GPIO register layouts with greater ease, and eliminates the use of macros (yay!)
* uhd: Fix spelling errorsA. Maitland Bottoms2021-10-221-1/+1
| | | | Thanks to Mait for pointing these out!
* uhd: Replace Boost mutexes and locks with standard optionsMartin Braun2021-10-193-44/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* uhd: zbx: Prevent TX antenna config from disrupting RXLane Kolbly2021-09-161-2/+8
| | | | | | | | | | | | | | So, both the set_tx_antenna_switches and set_rx_antenna_switches functions configure the TX0_ANT_11 register (which controls the final switch before the TX/RX port, switching it between the three TX paths and the RX path). The RX antenna configuration code will, if the RX antenna is set to TX/RX, configure that switch to the TX/RX->RX path when the ATR is set to RX. However, the TX antenna config code will always configure that switch to the "bypass" path, for both the 0X and RX ATR modes, regardless of whether the RX side actually needs that path. Ergo, this change makes set_tx_antenna_switches only configure that switch when it is configuring the XX or TX modes.
* rh: Fix auto DC-offset correction and auto-IQ balance APIsMartin Braun2021-09-082-7/+1
| | | | | | | | N320 doesn't have an automatic RX IQ balance correction, so that API is removed. The auto-DC offset correction was calling into the manual DC offset correction code, which means auto-DC offset correction was never enabled for N320.
* n3x0/e3x0: Remove reference to "master FP-GPIO radio"Martin Braun2021-07-302-2/+0
| | | | | | | | | In days of yore, before we had evolved RFNoC to the UHD 4.0 state, only one radio on N310 was able to drive the front-panel GPIOs. With the introduction of the UHD 4.0 GPIO API, we have fine-grained control for every pin who may drive it. This makes this constant obsolete, and we remove it to avoid confusion. Besides, these two `constexpr` values where being used nowhere.
* dbsrx: Fix issue with loop variableMartin Braun2021-07-201-3/+4
| | | | | | In 26cc208, we accidentally added an `auto` into a loop, making the loop variable's scope local. However, this variable lives outside this for loop.
* 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.
* uhd: Remove all occurences of boost::math::*round()Martin Braun2021-06-249-29/+35
| | | | | | | Its behaviour is almost identical to std::lround, which we use instead. The only downside of std::lround is that it always returns a long, which we don't always need. We thus add some casts for those cases to make the compiler happy.
* fixup! zbx: Fix clang compiler warningsMartin Braun2021-06-231-4/+0
| | | | | The TRACE message is repeated in the zbx_lo_ctrl object and is thus not worth carrying the _chan and _trx attributes.
* zbx: Fix clang compiler warningsMartin Braun2021-06-222-10/+5
| | | | | | | | - Missing override - Superfluous 'this' lambda capture - Register state in zbx_cpld_ctrl was being initialized too late (this is actually a bug depending on compiler version) - Remove lots of unused fields from experts
* zbx: Fix compilation on clang-10Martin Braun2021-06-221-4/+1
| | | | | | The ostream<< overloads where in the wrong namespace to be found by the expert framework. Other compilers are more forgiving; not so clang 10. This enables compilation on that compiler.
* uhd: Add support for the USRP X410Lars Amsel2021-06-107-0/+3232
| | | | | | | | | | | | | | | | Co-authored-by: Lars Amsel <lars.amsel@ni.com> Co-authored-by: Michael Auchter <michael.auchter@ni.com> Co-authored-by: Martin Braun <martin.braun@ettus.com> Co-authored-by: Paul Butler <paul.butler@ni.com> Co-authored-by: Cristina Fuentes <cristina.fuentes-curiel@ni.com> Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com> Co-authored-by: Virendra Kakade <virendra.kakade@ni.com> Co-authored-by: Lane Kolbly <lane.kolbly@ni.com> Co-authored-by: Max Köhler <max.koehler@ni.com> Co-authored-by: Andrew Lynch <andrew.lynch@ni.com> Co-authored-by: Grant Meyerhoff <grant.meyerhoff@ni.com> Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com> Co-authored-by: Thomas Vogel <thomas.vogel@ni.com>
* n320: Add correction APIs to radio_control objectMartin Braun2021-05-062-0/+63
| | | | | | | | | | The N320, like the X310, has some frontend corrections (IQ balance, DC offset) which can be controlled from software. The property tree entries exist for these, but the radio_control APIs do not (which also disables the multi_usrp APIs). This makes it harder to disable DC offset or IQ balance corrections from software, and disables our calibration utilities.
* lib: Fix misssing include in e3xx_radio_control_implMartin Braun2021-05-041-0/+3
| | | | Adds a missing <thread>, <algorithm>, and <chrono>.
* dboard: magnesium: Update Rx IF Frequency Valuemattprost2021-04-301-1/+1
| | | | | | | Add extra precision to if frequency in the low band rx path in order to avoid hitting the edges of a filter. Signed-off-by: mattprost <matt.prost@ni.com>
* Revert "N310: Low band IF adjustments"mattprost2021-04-301-17/+21
| | | | | | | | This reverts commit 969e426f2ef57f8d6fd3099870955ba2083abf9c. Revert "fixup! N310: Low band IF adjustments" This reverts commit 71137999430afaca18bfff179e6a3c4b0276d54c.
* N320: Fix IQ mapping and frontend correctionsmichael-west2021-04-221-2/+4
| | | | | | | | Changed register offset from 4 bytes to 8 bytes. The registers in the frontend were not being properly addressed, so calibration, IQ mapping, and frontend corrections were not working properly. Signed-off-by: michael-west <michael.west@ettus.com>
* N320: Fix available antennasmichael-west2021-04-221-2/+2
| | | | | | Available antennas for TX and RX were swapped. Signed-off-by: michael-west <michael.west@ettus.com>
* N310: Fix calculation of LO freq w/ext LO for RXmichael-west2021-04-121-1/+1
| | | | | | | A typo was causing an issue with order of precedence in the calculation of the LO frequency when using an external LO for RX on the N310. Signed-off-by: michael-west <michael.west@ettus.com>
* n320: Fix address for RX frontend controlMartin Braun2021-04-121-1/+1
| | | | The RX FE core was using the address for the TX FE core.
* uhd: Fix radio_control-related method constnessMartin Braun2021-03-173-9/+10
| | | | | | | | | | | | | | | | | The const-ness of some radio_control differed between base class and implementation. This fixes the consistency, but also makes sure these methods follow the rules for when to make methods 'const'. The following rules apply: - Methods that query static capabilities are const. Here, we made get_tx_lo_sources() const (the RX version was already const). - Getters that may have to interact with the device (e.g., peek a register) are not const, because the act of peeking is usually also non-const. Here, we changed get_rx_lo_export_enabled() to non-const. - All base classes are fixed such that the derived classes and the base classes have the same const-ness. Clang was warning about differences. This can cause very tricky bugs, where the radio_control_impl version can get called instead of the intended child class.
* host: Update code base using clang-tidyMartin Braun2021-03-1710-50/+57
| | | | | | | | | | | | 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 Note: This is the same procedure as 107a49c0, but applied to all the new code since then.
* mg: Fix slot_idx referenceWade Fife2021-03-081-1/+1
|
* lib: Use const-ref in for loops instead of const-copyMartin Braun2021-03-042-3/+3
| | | | | | This is potentially a performance issue, even though it doesn't have a big impact in this context. Clang will warn about it, and this fixes the compiler warning.
* twinrx: Fix missing default copy ctorMartin Braun2021-03-041-0/+3
| | | | | | | twinrx_gain_config_t defined an assignment operator, but not a default copy ctor. This is not allowed in modern C++, although compilers let it slide and provide their own defaults. Clang, however, throws a warning so let's fix it.
* lib: Fix warnings related to unnecessary lambda capturesMartin Braun2021-03-041-2/+2
|
* mg: Remove unused private attribute from ad9371_ifaceMartin Braun2021-03-042-4/+0
| | | | This fixes a clang warning.
* rh: Remove unused constantMartin Braun2021-03-041-1/+0
| | | | This fixes a clang warning.
* rh: cpld control: Comment out gain table addressMartin Braun2021-03-041-1/+1
| | | | This fixes a clang warning.
* rh: Remove use of magic number of identify durationMartin Braun2021-03-042-3/+3
| | | | This fixes a clang compiler warning.
* host: Update code base using clang-tidyMartin Braun2021-03-0412-221/+240
| | | | | | | | | 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
* ADF535x: Change freq_resolution to mod2michael-west2021-02-041-4/+4
| | | | | | | | | The freq_resolution parameter to the set_frequency() method was confusing. Changing it to the mod2 value clarifies the intention and makes the math to reduce the FRAC2 and MOD2 values much easier to read and maintain. Signed-off-by: michael-west <michael.west@ettus.com>