General documentation cleanup, function name adjustments, merging of
redundant structures, etc.
fpga_common/ad936x_helpers:
Contains wrappers for AD936x RFIC functionality.
fpga_common/bladerf2_common:
Contains bladeRF2-specific helper functions and constants.
fpga_common/ad936x_params:
Reformat (no more tabs, phew)
Move ina219 shunt const to bladerf2_common
host/common/range:
Move functions and macros for handling bladerf_range structs
../libbladeRF/include/bladeRF2.h:
Explicitly index RX/TX FIR enums
Update references to ad936x_params.c
../libbladeRF/src/board/bladerf2/common:
New macros for boilerplate:
- WITH_MUTEX: wrap around locked blocks
- CHECK_STATUS: calls function, checks return code
- CHECK_AD936X: calls function, checks return code, translates
from AD936x to libbladeRF error codes
- CHECK_*_LOCKED: above, but unlocks mutex before erroring
- NULL_CHECK: checks a var for null
Move helper functions into here
../libbladeRF/src/board/bladerf2/bladerf2.c:
Use new macros
Code style fixes
Remove redundant code
Adds new format macros for displaying bladerf_frequency and
bladerf_timestamp values to libbladeRF.h.
Transitions bladerf1.c and bladerf2.c to use these new macros,
and also cleans up a few more places where the typedefs aren't
currently used.
Also fixes a doxygen warning for undocumented #defines in
bladeRF2.h.
Fixes#577Fixes#618Fixes#620
This commit adds libbladeRF support for sample rates down to 0.521 Msps
on the bladeRF 2.0.
* Add bladerf_rfic_rxfir and bladerf_rfic_txfir enums to bladeRF2.h
* Add fns: bladerf_{get,set}_rfic_{rx,tx}_fir for controlling the RFIC's
FIR filters
* Add members to the bladerf2_board_data struct for tracking FIR filter
status, and whether or not it is in low_samplerate_mode
* Shift bladerf2_initialize to use the new setters for rx and tx FIR
* Update bladerf2_set_sample_rate to use the 4x FIR if the sample rate
is in the "low range"
The bladeRF-micro has an option to use either its onboard VCTCXO or an
external 38.4 MHz clock as the clock source for components on the
board. This change addresses some ambiguity in the naming of the onboard
option by renaming it from 'vctcxo' to 'onboard'.
The valid options are now:
1. onboard
2. external
* libbladeRF: brf_get_*_range expect bladerf_range**
Previously, the bladerf_get_*_range family of functions expected a
struct bladerf_range *
The gain-related functions turned out to require a double ptr to work
properly. For consistency, this commit changes libbladeRF to use a
double ptr on all the range functions, instead of just the gain ones.
* bladeRF-cli: update get-range function calls
* 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: 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.
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.