Commit Graph

185 Commits

Author SHA1 Message Date
michael-west
4a77791cf5 b200: Fix invalid RF switch positions
In some situations, the RF switches on the frontend would be placed in
undefined states.  This does not cause physical harm, but could distort
signals or introduce noise.  This fix ensures the RF switches are always
in a defined state.

Signed-off-by: michael-west <michael.west@ettus.com>
2023-05-10 21:39:39 -05:00
michael-west
91a4f62882 B200: Re-sync times
The times on the device can glitch if either the tick rate changes or
the number of active chains changes.  This throws off the time if the
user gets streamers, changes the sample rate, or changes the tick rate
after synchronizing the time.  This change re-synchronizes the times
automatically in those cases.

Signed-off-by: michael-west <michael.west@ettus.com>
2021-11-10 13:43:48 -08:00
Lane Kolbly
62d467f3fc host: gpio: Create gpio_atr_offsets to store GPIO registers
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!)
2021-10-27 07:56:33 -07:00
Martin Braun
de68707dd4 b200: Move the B200 radio control core into usrp/b200/
This serves two purposes:
- This file no longer goes into the compiled DLL if B200 is disabled
- Discourage use of this file for new devices, making it clear that this
  architecture is no longer used

The file itself is left untouched, only the class is renamed from
radio_ctrl_core_3000 to b200_radio_ctrl_core.

Note: In UHD 3, this file was also used by N230.
2021-07-20 07:21:41 -05:00
Martin Braun
47623aabb4 lib: Use const-ref in for loops instead of const-copy
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.
2021-03-04 08:24:09 -06:00
Martin Braun
ecefbdd9ab lib: Fix warnings related to unnecessary lambda captures 2021-03-04 08:20:04 -06:00
Martin Braun
107a49c0c2 host: Update code base using clang-tidy
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
2021-03-04 08:07:26 -06:00
michael-west
13f1dc28f1 mpmd: Skip find if "resource" key is specified
MPM devices were being discovered when trying to locate PCIe connected
devices.  Adding filter to exclude them if the "resource" key is
specified in the device address arguments.

Replaces "lib: disable non pcie types in find with resource" to reduce
impact to older devices and remove API change.

Signed-off-by: michael-west <michael.west@ettus.com>
2021-02-11 07:16:48 -06:00
Steven Koo
8fea36aa81 lib: disable non pcie types in find with resource
mpmd find doesn't respect the "resource" arg hint and can be detected
when "resource" is set. This results in incorrect device selection when
using PCIe. This change adds detection for "resource" as a prefix
in the device hints for mpmd and the other devices.
2020-10-05 12:02:05 -05:00
Steven Koo
75fe86a92b uhd: clang format device impl 2020-10-05 12:02:05 -05:00
Martin Braun
ae426043df b200: Enable power calibration API
This lets the B200 transmit and/or receive at given reference power
levels. Requirement is that the devices have been separately calibrated
with an external calibration device.
2020-06-03 15:14:01 -05:00
Martin Braun
e33619bcb6 b200: Add a prop tree node usb_version
At /mboards/0/usb_version, we can now read back an int. It's either 2 or
3, depending on what we're using.
2020-04-14 10:28:47 -05:00
Martin Braun
876d4150aa uhd: Apply clang-format against all .cpp and .hpp files in host/
Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of
files that clang-format gets applied against.
2020-03-03 08:51:32 -06:00
Martin Braun
d3a16b7022 uhd: Replace all occurrences of boost::bind with std::bind
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.
2019-11-26 12:21:32 -08:00
Martin Braun
1fe98e8701 uhd: Replace usage of boost smart pointers with C++11 counterparts
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.
2019-11-26 12:21:32 -08:00
Martin Braun
5bba40ed74 b200: Fix compiler warnings related to type conversions
These compiler warnings mostly pop up on MSVC. Most of them are due to
inconsistent usage of size_t, uint{8,16,32}_t, and even int.
This commit changes types mostly such that variables have the correct
type to begin with, although it also contains a few explicit type-casts.
2019-01-07 13:57:55 -08:00
michael-west
20f061689c B200: Restore asynchronous reset of AD936x. 2018-10-17 15:59:08 -07:00
Martin Braun
029e29e24b b200: Enable access to user regs via the 'enable_user_regs' arg 2018-08-16 11:40:48 -07:00
Martin Braun
c14944c357 b200: Remove superfluous fake lambda
No functional changes. Cleanup only. A little less Boost.
2018-08-16 11:40:48 -07:00
Vidush
ee15dbebf7 B200: Fix SC8 RX Streaming
Coerces recv_frame_size to size of words (8 bytes) to prevent
USB_TRANSFER_OVERFLOW error.
2018-07-16 22:02:52 -07:00
michael-west
72e5fda932 fixup! B200: Check if recv_frame_size is larger than minimum value 2018-07-13 20:58:01 -07:00
Vidush
dcd76b9e20 B200: Check if recv_frame_size is larger than minimum value 2018-07-12 15:48:22 -07:00
Vidush
d6f1ff717d B200: Change Recv Frame Size to 8176
The default frame size is set to 8176.
If a frame size entered is a multiple of 512, the actual frame size
is set to the next lowest multiple of 24.

Both changes are made to ensure no packet gets stuck in the fx3.
2018-07-12 15:47:51 -07:00
Martin Braun
9df9bea6c1 lib: Purge some use of boost::system_time
These are all timeout loops, which now use
std::chrono::steady_clock::now() to check for timeout events.
2018-07-12 11:42:59 -07:00
Vidush
9c56eb9261 B200: Enforce min_tick_rate 2018-06-21 17:28:07 -07:00
Martin Braun
38a7fa64f4 lib: Remove some unnecessary use of boost::posix_time
Replace by std::chrono.
2018-05-14 17:24:19 -07:00
Martin Braun
5d9a7c92d3 lib: Purge use of boost::assign, except for uhd::dict
Replaced with initialization lists.
Note: uhd::dict does not work with initializer lists without making
changes to said data structure. This commit has no functional changes,
so keeping the boost::assigns for uhd::dict.
2018-05-02 17:01:21 -07:00
Martin Braun
fb1b7b7868 ad936x: De-boostify ad936x_manager, minor cleanup
- Remove all use of boost::bind and boost::function
- Demote some log messages to DEBUG
- Change some formatting to match coding guidelines
- B2xx/E310: Match changes in loopback function
2018-04-26 13:14:47 -07:00
Martin Braun
d110e64f82 b200: Add clock rate range 2018-04-03 17:03:14 -07:00
Andrej Rode
3645139e7d uhd: Fix some log statements
Some log statements were incorrectly using multi-line log statements.
2018-03-07 16:16:42 -08:00
Martin Braun
076dd81984 fixup! x300,n230,e300: changes to adapt to new usrp API
Fixes some compiler warnings.
2018-02-23 14:29:52 -08:00
Trung N Tran
1e5388e70d fixup! x300,n230,e300,b200: changes to adapt to new usrp API 2018-02-22 14:11:20 -08:00
Martin Braun
ae5211d71d uhd: Update license headers
All copyright is now attributed to "Ettus Research, a National
Instruments company".

SPDX headers were also updated to latest version 3.0.
2018-02-19 16:54:52 -08:00
Martin Braun
4f948e2c8b Move all license headers to SPDX format. 2017-12-22 10:45:51 -08:00
Martin Braun
83dde40090 uhd: Changed mboard_eeprom_t interface, refactored MB EEPROM code
- uhd::usrp::mboard_eeprom_t is now simply a map. Its commit() method
  has no utility being a public API call, because the user never gets
  access to the appropriate I2C object (Minor API breakage)
- The central mboard_eeprom.cpp file was broken up and put into many
  smaller compilation units in every device's implementation folder.
- Renamed some of the constants (e.g. B000_* -> USRP1_*, N100_* ->
  N200_*)
- Removed the N000_* EEPROM code, because, well, you know, there's no
  such device
2017-09-29 10:50:56 -07:00
Andrej Rode
21aad77c9c utils: introduce new logging API and remove msg API 2017-02-20 17:13:15 -08:00
Martin Braun
2333a30341 uhd: Replace clocking_mode_t unscoped enum with scoped version
This is not a functional change, but it marks the usage of scoped enums
in UHD. Commits past this one may also use this C++11 feature.
2017-02-17 12:47:00 -08:00
Andrej Rode
26cc20847c uhd: replace BOOST_FOREACH with C++11 range-based for loop
Note: This is the first commit that uses for-range, and range-based
for-loops are now usable for UHD development.
2017-02-10 16:44:33 -08:00
Martin Braun
99c2730bc9 Remove all boost:: namespace prefix for uint32_t, int32_t etc. (fixed-width types)
- Also removes all references to boost/cstdint.hpp and replaces it with
  stdint.h (The 'correct' replacement would be <cstdint>, but not all of our
  compilers support that).
2016-11-08 08:02:22 -08:00
Martin Braun
ad5b10677c b200: Make sure no GPS settings are applied when no gpsdo present.
This changes the exception message thrown when gpsdo is selected as a
clock source, but does not change the exception. Note that before,
during its first run, the B2x0 would happily accept gpsdo as a clock
source even when none was present.
2016-10-18 17:15:16 -07:00
Martin Braun
83912104a9 Merge branch 'UHD-3.9.LTS' into maint
This provides the GPS fixes.

Conflicts:
	host/CMakeLists.txt
	tools/debs/upload_debs.sh
2016-09-02 11:27:37 -07:00
michael-west
b229a1972c B200: GPSDO fixes
- Fix initialization order
- Initialize to proper baud rate divisor
- Remove unused function to change baud rate divisor
- Simplify UART code so it does not strip or add characters
2016-09-02 11:10:46 -07:00
Martin Braun
b9a80a76aa Revert "B200: Adding separate B200 radio control code"
This reverts commit 5d360ab43e.
2016-08-23 16:53:07 -07:00
Martin Braun
041264b4c4 ad936x: Loopback check now takes peeker/poker functors instead of assuming any kind of interface 2016-08-09 10:21:53 -07:00
michael-west
5d360ab43e B200: Adding separate B200 radio control code 2016-07-22 11:31:41 -07:00
Martin Braun
ef57ffcbbf Merge branch 'maint'
Conflicts:
	host/lib/usrp/b200/b200_impl.cpp
2016-06-23 09:58:20 -07:00
Martin Braun
8d2262f6b3 b200: Update DSPs after changing tick rate
Reviewed-By: Andrew Lynch <andrew.lynch@ni.com>
Reviewed-By: Michael West <michael.west@ettus.com>
2016-06-22 18:00:26 -07:00
Martin Braun
30c3a9f0d5 Merge branch 'maint'
Conflicts:
	host/CMakeLists.txt
	host/lib/usrp/b200/b200_impl.cpp
2016-05-06 11:02:54 -07:00
Andrew Lynch
60ed2ef421 b200: Changed implicit conversion to explicit conversion for wptr 2016-05-05 09:30:44 -05:00
Andrew Lynch
9e8bb7e7d6 b200: Changed tree sptr in lambda to wptr 2016-05-04 16:55:47 -07:00