Massive changes to bladeRF_rx_gui to allow it to work with the new gain methods
and also allow it to properly inform the user of problems setting gains when
the gain mode (AGC) is set to automatic.
Some platforms have power and temperature monitoring, provide a way for them to
be exposed in matlab. To read the temperature of a device run the following:
> b = bladeRF()
> b.misc.temperature
misc.dc_power can be used to read the current power consumption
misc.dc_source be used to determine if the power is coming from USB or AC
bladeRF_XCVR has to catch up to the new way of doing things in libbladeRF. Low
level gain settings like directly RXLNA, RXVGA1, RXVGA2, TXVGA1, and TXVGA2 have
all been removed to make way for the unified gain setting based on
bladerf_set_gain(). Setting the gain value to 60 for RX indicates maximum RX
gain, while a value of 60 for TX indicates a output power of 0dBm.
Adding the new A4 and A9 boards. Currently some decisions are being made by
identifying the generation of the device. In the future this should be replaced
with a feature and capability mask.
Most of the changes that make libbladeRF return -8 still allow scripts to run
without serious issues. This commit should be changed back after a few releases
once developers have had a chance to update their scripts.
* libbladeRF: add typedefs for common parameter types
This adds typedefs for, and changes libbladeRF.h to use said typedefs
for, the following:
bladerf_gain -> int
bladerf_sample_rate -> unsigned int
bladerf_bandwidth -> unsigned int
bladerf_frequency -> uint64_t
bladerf_timestamp -> uint64_t
bladerf_correction_value -> int16_t
* 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
* libbladeRF/matlab: change win64 bool type (#543)
This should fix an error in recent Thunk builds. I am not sure what the
side effects of this will be (esp. with older Matlab versions) but this
seems to work now.
* host: libbladeRF_bindings: re-sort libbladeRF_proto.m to match recent MATLAB output
* host: matlab: update for libbladeRF 1.9.0
Add a few missing functions:
bladerf_set_gain_mode
bladerf_get_gain_mode
bladerf_set_smb_mode
bladerf_get_smb_mode
bladerf_trigger_init
bladerf_trigger_arm
bladerf_trigger_fire
bladerf_trigger_state
bladerf_set_vctcxo_tamer_mode
bladerf_get_vctcxo_tamer_mode
bladerf_xb300_set_trx
bladerf_xb300_get_trx
bladerf_xb300_set_amplifier_enable
bladerf_xb300_get_amplifier_enable
bladerf_xb300_get_output_power
bladerf_get_fw_log
bladerf_init_stream
bladerf_stream
bladerf_submit_stream_buffer
bladerf_submit_stream_buffer_nb
bladerf_deinit_stream
bladerf_read_trigger
bladerf_write_trigger
Add a few missing structs and enums, related to above
Also remove the bool_ret/bool_arg vars, as they aren't really needed any
more.
* host: matlab: fixup uint64s, cleanup
Removed the 'pathsep' from the architecture case, since it's seemingly
set by matlab itself
Not pre-allocating ival, to avoid having to count that high
* host: matlab: comment out stream-related protos
Matlab doesn't support FcnPtrs (bladerf_stream_cb) or voidPtrPtrPtr
(void***), so bladerf_init_stream is not usable. If bladerf_init_stream
isn't usable, then anything involving struct bladerf_stream isn't
usable.
* 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
* host: libbladeRF-bindings/python: general updates
This commit adds the following changes:
Overall:
* Adds an _import_header.py tool, which parses libbladeRF.h (or other
headers) into a convenient string ready for ffi.cdef
* Passes pycodestyle and pyflakes checks cleanly
bladerf.py:
* Various new class wrappers for enums, etc
* Subclassed exceptions (e.g. bladerf.UnsupportedError will be raised if
libbladeRF returns BLADERF_ERR_UNSUPPORTED)
* Added functions for bootloader firmware recovery
* More comments all around
* Use properties instead of getters/setters:
>>> b = bladerf.BladeRF()
>>> # OLD:
>>> b.get_devinfo()
>>> b.set_clock_select(ClockSelect.External)
>>> # NEW:
>>> b.devinfo
>>> b.clock_select = ClockSelect.External
* Added more functions, particularly for bladeRF 2
* Added a Channel class, for channel-specific properties:
>>> b = bladerf.BladeRF()
>>> ch = d.Channel(bladerf.CHANNEL_RX(0))
>>> ch.frequency = 2.45e9
bladerf-tool.py:
* General changes to use properties instead of get_/set_ functions
* Also updated to use subclassed exceptions from bladerf.py
* Dump a lot more info with the 'info' command
* Look for bootloader devices with the 'probe' command
* Added 'recover_fw' command, for firmware recovery
* Moved from single-channel paradigm to MIMO paradigm on 'rx', 'tx'
* host: python: implement more methods, various fixes
Implement loopback, rx_mux, ad9361_temperature, and adf4002_* functions
Fix set_clock_select type handling
Use 4-space indent in cffi block, for placating text editors
Add -v option to bladerf-tool.py info, to clean things up a bit
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
Our proto file must provide the absolute path to the thunk library,
whether it is in the current directory or in MATLABPATH (as is the
case with our Windows installer).
Moving forward, MATLAB and Simulink support will be offered via
libbladeRF bindings maintained in this repository. These MATLAB bindings
are implemented as a thin object-oriented interface that utilizes
loadlibrary() and calllib().
Simulink support is achieved through a MATLAB System block
implementation that uses bladeRF.m. Users are welcome to adapt the
provided bladeRF_Simulink.m implementation to their particular needs.