* host: libbladeRF: add bladerf_ad9361_get_ctrl_out
Adds functionality to read the CTRL_OUT pins from the AD9361 RFIC.
* host: bladeRF-cli: add print for AD9361 CTRL_OUT
* host: python: add support for ad9361_ctrl_out
* host: libbladeRF: deprecate bladeRF1 gain controls
We now have bladerf_{get,set}_gain and bladerf_{get,set}_gain_stage,
which are both general-purpose functions replacing the bladeRF1-specific
VGA/LNA library calls.
* host: libbladeRF: deprecate bladeRF1 trimdac controls
Instead of bladerf_dac_write and bladerf_dac_read, folks should use
bladerf_trim_dac_write and bladerf_trim_dac_read.
With this commit, we build without warnings on Arch Linux; CentOS 7; Debian 8 and 9; latest Fedora; Ubuntu 14.04, 16.04, 17.10, and 18.04; Visual Studio 2017; and macOS 10.13.3 w/ Homebrew.
* host: libbladeRF: compile AD9361 srcs with -std=gnu11
Fixes compile errors involving ‘for’ loop initial declarations only
allowed in C99 or C11 mode, on older GCCs.
* host: libbladeRF/adi: remove stdbool workaround
This is not necessary now that we're building to -std=gnu11, and in
fact, it seems to create a conflict.
* host: libbladeRF: pre-declare loop variables
Some compilers are not happy with declaring the loop variable in the for
statement. Begrudgingly placate them.
* host: libbladeRF_test: pre-declare loop variables
Some compilers are not happy with declaring the loop variable in the for
statement. Begrudgingly placate them.
* host: bladeRF-cli: pre-declare loop variables
Some compilers are not happy with declaring the loop variable in the for
statement. Begrudgingly placate them.
* host: libbladeRF: remove refs to strings.h
Windows doesn't have strings.h, but string.h seems to do just fine.
* host: libbladeRF: fix windows compile errors (WIP)
* host: libbladeRF/ad9361: fix windows compile error
"IGNORE" is #define'd in the Windows environment, creating a conflict.
Renaming this to solve the conflict.
* host: common: add setenv implementation for Windows
* host: libbladeRF: build setenv.c stub on Windows
* host: bladeRF-cli: use setenv stub on Windows
* host: common: fixup spacing consistency in setenv
* host: libbladeRF: cast channel macros to bladerf_channel
Visual Studio is picky about this, and throws warnings.
* host: libbladeRF: bladerf2.c: undo workaround for bladerf_channel
* host: libbladeRF: bladerf_get_gain_stages count type is now size_t
This fixes a Windows compile error, and is also generally more sensible.
* host: bladeRF-cli: fix windows compile errors
* host: ad9361: fix variadic macro syntax
Fixes Windows build errors
* host: ad9361: rename _DEBUG to AD9361_DEBUG
Visual Studio automagically sets _DEBUG if the /MDd option is set. Turns
out that a lot of the debugging sections don't build in Visual Studio,
so this accounts for a large number of the build errors...
* host: libbladeRF: fixes for Visual Studio builds
* host: common: fixes for Visual Studio builds
* host: libbladeRF/ad9361: fixes for Visual Studio builds
* host: libbladeRF_test: fixes for Visual Studio builds
* host: bladeRF-cli: fixes for Visual Studio builds
* host: bladeRF-cli: fix static analysis warnings
Fixes potential memory leak in main
Fixes unused values in set_adf_refclk, set_samplerate
* host: common: fix static analysis warnings
fixes:
unread variable in perform_rx_cal
memory leaks in add_arg, add_opt
* host: libbladeRF: fix static analysis warnings
fixes unused variables in bladerf2_set_gain and xb100_enable
This version is part of development series of changes, not an official
release.
This version of libbladeRF is intended for use with:
FX3 Firmware v2.1.0 (or v1.9.1)
FPGA v0.7.2
Changes:
* Refactor to support for multiple product lines
* Add support for the bladeRF Micro product
* API: replace bladerf_module with bladerf_channel, a
reverse-compatible change to handle products with multiple
independent RF paths in the same direction
* API: BREAKING CHANGE - on bladerf_set_frequency, et al, the frequency
parameter is now uint64_t instead of unsigned int
* Significant code cleanup
* Various other changes that will be listed in more detail during an
official release
* host: libbladeRF: clang-format fixes
* host: bladeRF-cli: clang-format fixes
* host: libbladeRF: spacing/wording/clang-format
Improve wording of various parts, add missing params, clean up various
wrap anomalies, and make it run clean through clang-format.
* host: libbladeRF: add functions to get/set ADF4002 refclk frequency
* host: bladeRF-cli: add print/set adf_refclk
* host: python: add adf4002_refclk functions
This permits getting and setting the ADF4002 reference clock
frequency.
>>> import bladerf
>>> b = bladerf.BladeRF()
ad9361_init : AD936x Rev 2 successfully initialized
>>> b.adf4002_refclk
10000000
>>> b.adf4002_refclk = 9000000
>>> b.adf4002_refclk
9000000
>>> b.adf4002_refclk = 900000000
[ERROR @
"/home/rtucker/dev/privatebladeRF/host/libraries/libbladeRF/src/board/bladerf2/bladerf2.c":4360]
bladerf_adf4002_set_refclk: bladerf_adf4002_calculate_ratio failed:
Provided parameter was out of the allowable range
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/home/rtucker/dev/privatebladeRF/host/libraries/libbladeRF_bindings/python/bladerf.py",
line 1581, in set_adf4002_refclk
_check_error(ret)
File
"/home/rtucker/dev/privatebladeRF/host/libraries/libbladeRF_bindings/python/bladerf.py",
line 998, in _check_error
raise globals()[errorval.name](err)
bladerf.RangeError: Provided parameter was out of the allowable range
>>> b.adf4002_refclk
9000000
>>> b.adf4002_refclk = 10000000
>>> b.adf4002_refclk
10000000
* host: libbladeRF: make ADF convenience functions static
bladerf_adf4002_set_refclk is much nicer (and safer) than calculating
the R/N ratio and then doing a bladerf_adf4002_configure.
* host: python: update cffi header block
Intended for use by bladeRF-micro, which has a TPS2115A auto power
mux. The function will read the power status bit from the Nios GPIO and
set the human-readable enum corresponding to the active power source.
In the event a library user needs to test for the existence of a gain
stage, the bladerf_get_gain_stage_range function may now be called with
a null range, and the return value can be checked to determine whether
it exists.
* host: libbladeRF: add bladerf_get_loopback_modes
Returns a pointer to an array of supported loopback modes.
* host: libbladeRF: add bladerf_is_loopback_mode_supported()
Tests if a given loopback mode is supported on a device
Update bladerf_rf_switch_config struct to use "rfic" instead of "ad9361"
for genericness and consistency.
Also clean up missing/incorrect documentation in various places.
Fix bladeRF-cli to use proper struct member names for
bladerf_rf_switch_config.
Squashed commit of the following:
commit d12066467c99bdbb7048285c0616db70ff383e2f
Merge: 3493a3b3c 2770a187a
Author: Rey Tucker <rey.tucker@nuand.com>
Date: Tue Sep 19 13:56:34 2017 -0400
Merge branch 'master' into rtucker-host-capabilities
commit 3493a3b3c1ab17ea4a616bbf8b543108e5defeca
Author: Rey Tucker <rey.tucker@nuand.com>
Date: Thu Sep 14 13:40:33 2017 -0400
host: libbladeRF: add bladerf_get_channel_count call
This will return the number of channels available on a given hardware.
commit 609bfc7d4bc4bb1fea09164de184b94fe9f691da
Author: Rey Tucker <rey.tucker@nuand.com>
Date: Thu Sep 14 13:37:04 2017 -0400
host: libbladeRF/board: add FW capabilities for bladeRF 2
Not entirely certain we need a capability flag for bladeRF 2 support in
the firmware, but now there is one.
commit 12f6d61c0c04df1a52d7552ff3ee45f6faaaf6b1
Author: Rey Tucker <rey.tucker@nuand.com>
Date: Thu Sep 14 13:35:11 2017 -0400
host: libbladeRF/board: move capabilities to board.h
Keeping them common between boards seems prudent for now.
Squashed commit of the following:
commit b06ffe841dc5e8cc91cfa743213979be49843b83
Author: Rey Tucker <rey.tucker@nuand.com>
Date: Fri Sep 15 13:46:59 2017 -0400
host: libbladeRF: forgot bladerf_get_gain_modes implementation
commit ef115599d0baea3ae27136059aedadaaf67f5f43
Author: Rey Tucker <rey.tucker@nuand.com>
Date: Fri Sep 15 12:15:07 2017 -0400
libbladeRF: add bladerf_get_gain_modes
bladerf_get_gain_modes provides a pointer to an array of gain modes
supported by the device, including human-readable names.
Change bladerf_enable_module to expect a bladerf_channel instead of a
bladerf_direction. This should have no impact on existing applications:
BLADERF_RX and BLADERF_TX map to BLADERF_CHANNEL_RX(0) and
BLADERF_CHANNEL_TX(0) respectively.
Modify bladerf2_enable_module to set the expected RFFE control reg bits.
Squashed commit of the following:
commit da6b51bbe208e5beaeb5de7302177acd10eb096e
Author: Ryan Tucker <ryan.tucker@nuand.com>
Date: Thu Jul 20 14:16:23 2017 -0400
libbladeRF: improve wording for clarity
commit 0b14959d6192f687f7c584e0c3d66d83b814530a
Author: Ryan Tucker <ryan.tucker@nuand.com>
Date: Thu Jul 20 14:16:02 2017 -0400
bladerf2: general error message improvements
commit 36d6ba728bfc17cf6461fe131ae3af5c2e4c4f1b
Author: Ryan Tucker <ryan.tucker@nuand.com>
Date: Thu Jul 20 14:05:56 2017 -0400
bladerf2: warn on invalid gain stage but don't fail
Some software blindly sets gain stages without checking first, e.g. gqrx
when switching between bladeRF 1 and bladeRF 2. This will avoid crashes
in those cases.
Assume an A4 for now.
This lets one stash hostedxA4.rbf into <install_prefix>/share/Nuand/bladeRF
and have it Do The Right Thing for autoloading.
Full implementation will depend on SPI flash, etc