Commit graph

1,912 commits

Author SHA1 Message Date
Rey Tucker
c490baa215 Python bindings v1.1.0
Note: an erroneous python_v1.0.2 tag was created, which is basically
identical to this, but had the wrong version number. I apologize for any
confusion this may cause.
2018-10-30 16:45:24 -04:00
Rey Tucker
01e2dc6e22 MATLAB v1.0.2 2018-10-30 16:41:29 -04:00
Rey Tucker
6b659c2dcc bladeRF-cli v1.7.0 2018-10-30 16:40:20 -04:00
Rey Tucker
97d0cfae2f libbladeRF v2.1.0 2018-10-30 16:34:14 -04:00
Rey Tucker
344e677dea host: backend/cyapi: fix cyapi_get_flash_id compile fail on Windows 2018-10-30 16:08:26 -04:00
Rey Tucker
95aa1837fb host: libbladeRF: add FPGA v0.9.0 compat 2018-10-26 16:37:24 -04:00
Rey Tucker
45bcbfafd4 host: bladeRF-cli: print ranges on sample rate, bandwidth, frequency
When printing bandwidth, frequency, and sample rate, display the
supported ranges in parantheses after the current value.
2018-10-26 15:56:50 -04:00
Robert Ghilduta
e1d8c61c44 libbladeRF: add meta RX hardware flags for underflow, miniexp{1,2} 2018-10-21 01:20:01 -07:00
Robert Ghilduta
0cb4ea8885 libbladeRF: fix OSX and FreeBSD compilation issue
malloc.h is not present on either OSX or FreeBSD. Avoid including it on those
platforms.
2018-10-18 23:02:05 -07:00
Rey Tucker
c9a2230cf4
host: common: include pthread.h in nanosleep.h (#669) (#671)
* host: common: include pthread.h in nanosleep.h (#669)

default header sort on nanosleep.c puts nanosleep.h above
pthread.h, which creates an implicit definition of struct
timespec.

Fixes #669

* host: common/nanosleep: cleanup includes
2018-10-08 18:04:29 -04:00
Rey Tucker
95f620cf5d
host: libbladeRF: fix wrong get_flash_id fptr in dummy.c (#670)
* host: libbladeRF: fix wrong get_flash_id fptr in dummy.c

h/t @gvanem

* also point cypress_fns.get_flash_id to an actual function
2018-10-08 18:04:01 -04:00
Rey Tucker
f38dde896b python: update _cdef with bladerf_get_fpga_source 2018-09-27 14:45:27 -04:00
Rey Tucker
75906e68e5 host: python: improve import_header.py script
fixes:
 - Script will now look in the same dir as the input file
   (e.g. ../../../libbladeRF/include/) for other headers. This
   is specifically to let it find bladeRF1.h and bladeRF2.h
   more expeditiously.
 - Create a stoplist of lines to not include in the output.
   This largely consists of typedefs from pycparser's fake
   system header files.
2018-09-27 14:45:16 -04:00
Rey Tucker
14a9677f11 bladeRF-cli: fix missing return in error case
Fixes #666
2018-09-27 14:44:52 -04:00
Rey Tucker
d73fd39ac7 host: libbladeRF/sync: extend transfer timeout to match stream timeout
In a case where we have a long stream timeout, e.g. when using
triggered receive, the long stream timeout is being rendered
ineffective by the per-transfer timeout, which defaults to
1000 ms.

This adds two functions to async, for setting and getting the
transfer timeout:

int async_set_transfer_timeout(struct bladerf_stream *stream,
                               unsigned int transfer_timeout_ms);

int async_get_transfer_timeout(struct bladerf_stream *stream,
                               unsigned int *transfer_timeout_ms);

This also calls async_set_transfer_timeout in sync_worker_init,
setting it to either the BULK_TIMEOUT_MS from usb.h (1000 ms)
or the timeout_ms for the stream (user-specified), whichever is
longer.
2018-09-26 15:35:21 -04:00
Rey Tucker
04bd38586b bladeRF-cli: version: display FPGA config source, if known
Calls bladerf_get_fpga_source, and if it's a valid answer, appends
a description of the source to the printed FPGA version string.

Example output:

  bladeRF-cli version:        1.6.1-git-9b6f3140-dirty
  libbladeRF version:         2.0.2-git-9b6f3140-dirty

  Firmware version:           2.3.1-git-9b6f3140-dirty
  FPGA version:               0.8.0 (configured from SPI flash)

Also refactor version.c for cleaner flow.
2018-09-26 14:50:23 -04:00
Rey Tucker
fa73127ba0 host: libbladeRF: add bladerf_get_fpga_source()
Adds a new API call, bladerf_get_fpga_source(), which queries
the firmware for the source of the most recent FPGA programming.

This requires firmware v2.3.1 or later. Using an older firmware
will result in BLADERF_ERR_UNSUPPORTED.
2018-09-26 14:50:23 -04:00
Rey Tucker
5ff42cebe7 host: libbladerf/bladerf2: implement bladerf_{set,get}_stream_timeout 2018-09-26 12:44:03 -04:00
Rey Tucker
74a876d274 host: matlab: fix tx_gain property handling in simulink
processTunedPropertiesImpl() was not updated during the migration
from tx_vga1+tx_vga2 to tx_gain.

h/t mando238

Fixes #654
2018-09-26 12:43:42 -04:00
Rey Tucker
57b111fc05 host: python: update _cdef.py 2018-09-26 12:43:16 -04:00
Rey Tucker
2e5ef31196 host: bladeRF-cli: add support for trigger signal aliases 2018-09-26 12:43:16 -04:00
Rey Tucker
fb9e6d02d0 host: libbladeRF/common: allow more accurate trigger labeling
This adds two new values for the bladerf_trigger_signal enum,
BLADERF_TRIGGER_J51_1 and BLADERF_TRIGGER_MINI_EXP_1, as well
as the necessary backend processing to make them work.

It turns out that it doesn't actually matter which one is chosen;
they all behave identically and interchangeably once they're passed
to the Nios interface functions.

The reason for this change is to reduce confusion, as the bladeRF
x40/x115 use J71-4 for mini_exp[1] and the bladeRF xA4/xA9 use
J51-1.
2018-09-26 12:43:16 -04:00
Rey Tucker
628236b07e host: bladerf1: skip init if BLADERF_FORCE_NO_FPGA_PRESENT
On the bladerf2, we have a comparatively long initialization process,
and thus we skip the init if we're "just" loading an FPGA, e.g. with
the -l option to bladeRF-cli.

This adds the same bypass to bladerf1.
2018-09-24 14:54:57 -04:00
Rey Tucker
f0c7256916 host: bladeRF-cli: handle already-open devices on probe
In the event a device is already open (e.g. the user started
bladeRF-cli -i, then did "probe"), distinguish this in the list
of returned devices.

If the device couldn't be opened because of an access denial,
also distinguish this and omit the missing information.
2018-09-24 13:15:50 -04:00
Rey Tucker
c37192bc61 host: libbladeRF/libusb: keep partial info on access-denied probes
In the event libusb_open fails with a LIBUSB_ERROR_ACCESS, pass
back the info we do have instead of simply ignoring the device.
This will be indicated by the serial number being, literally,
"ANY".
2018-09-24 13:15:50 -04:00
Rey Tucker
bed46d01bc host: nios_access: reduce verbose logging spew
There are a few functions which are used very often, resulting in
a lot of unnecessary bloat on the verbose logging.

Unless ENABLE_LIBBLADERF_NIOS_ACCESS_LOG_VERBOSE is defined, the
following functions will no longer print verbose logging output:

nios_si5338_read
nios_si5338_write
nios_lms6_read
nios_lms6_write
nios_ad9361_spi_read
nios_ad9361_spi_write
nios_adi_axi_read
nios_adi_axi_write
nios_rffe_control_read
nios_rffe_control_write
2018-09-24 13:15:04 -04:00
Rey Tucker
35dd8b5f8d python: pep8 compliance 2018-09-24 13:14:36 -04:00
Rey Tucker
586c69338e python: add get_serial_struct, replace get_serial 2018-09-24 13:14:36 -04:00
Rey Tucker
38259d1733 python: update _cdef with latest libbladeRF.h 2018-09-24 13:14:36 -04:00
Rey Tucker
436c78b5c2 host: version.c: fix missing newlines in version_check 2018-09-21 13:19:47 -04:00
Mark Topham
4b7a72b2f0 host: common: Memory deallocation fix (#649)
parse.c is releasing memory for strings, after it assigns the memory location to a struct. This results in the memory potentially being overwritten by subsequent allocations before it's referenced.

Fixes #643
2018-09-21 12:09:59 -04:00
Rey Tucker
6737d7b02b libbladeRF: bump FW_FLASH_ID warning to a debug 2018-09-14 14:23:07 -04:00
Brian Glod
970e6f707c libbladeRF/bladerf1.c: add AGC log_error output
Add log_error() output to help the user figure out why they're receiving
ERR_UNSUPPORTED.
2018-09-14 14:22:57 -04:00
Rey Tucker
b9eeb7e277 bladerf: fix strncpy in bladerf_get_serial_struct
Fixes stringop-truncation warning in newer gcc versions
2018-09-14 13:54:08 -04:00
Rey Tucker
88223fad5f libbladeRF: add get_flash_id to usb_fns struct in usb drivers
MSVC is a stickler about how structs are populated, and
so we need to put something in libusb.c and cyapi.c even
though get_flash_id is actually handled in usb.c
2018-09-14 13:53:51 -04:00
Brian Glod
8036032bfd libbladeRF/python: Add bladerf_get_flash_size()
bladerf-tool will print the flash density with the 'info' command.
2018-09-14 12:33:30 -04:00
Brian Glod
8a6e9dea35 host: bladeRF-cli: Add flash size to 'info' command
Prints the size of the SPI flash in the output of the 'info' command.
2018-09-14 12:33:30 -04:00
Brian Glod
08a3a8cf76 host: libbladeRF: API add bladerf_get_flash_size()
New function allows the SPI flash size to be returned. Result is in
bytes.
2018-09-14 12:33:30 -04:00
Brian Glod
71bb8f1089 host: libbladeRF: Add flash ID decode to bladerf_open()
bladerf_open() will retrieve the SPI flash ID information from
the FX3 and decode it to get the flash density, page size, and other
architectural information required for flash interaction.

If the FX3 firmware does not support flash ID readback, assumptions will
be made based on the FPGA size. If FPGA size is not available, sane
defaults will be used. This should be sufficient to read calibration and
other important data from flash for board operation. Flashing an FPGA,
however, may not work depending on the device specifics.
2018-09-14 12:33:30 -04:00
Brian Glod
cf30fda46e host: libbladeRF/backend: Add SPI Flash ID readout
Add backend functions for read-out of SPI Flash ID information.
2018-09-14 12:33:30 -04:00
Brian Glod
bfe2cbd476 host: libbladeRF: Fix typo 2018-09-14 12:33:30 -04:00
Brian Glod
211c5c80ac host: libbladeRF: Add BLADERF_CAP_FW_FLASH_ID capability
Also update compatibility table.
2018-09-14 12:33:30 -04:00
Rey Tucker
32f84d3d11 libbladeRF: add bladerf_get_serial_struct function
Adds a bladerf_get_serial_struct function, which is similar
in functionality to bladerf_get_serial, but instead of requiring
a user-supplied buffer of at least BLADERF_SERIAL_LENGTH bytes,
it expects a pointer to a struct bladerf_serial which itself has
a buffer of BLADERF_SERIAL_LENGTH bytes as a member.

This turns BLADERF_SERIAL_LENGTH into an API-internal value,
instead of something that API users have to be intently aware of.

Fixes #382
2018-09-14 12:19:33 -04:00
Rey Tucker
5a886c355b matlab: add missing BB_TXVGA1_RXLPF loopback option
Fixes #478
2018-09-13 18:11:13 -04:00
Rey Tucker
ead2de258b libbladeRF/python: fix rx_channel_count and tx_channel_count 2018-09-13 17:57:16 -04:00
Rey Tucker
8a1953ed5e libbladerf/python: update cdef 2018-09-13 17:54:30 -04:00
Rey Tucker
4d28aead34 libbladeRF: fix bladerf2_trigger_arm typo
on the bladerf2, bladerf_trigger_arm was calling fpga_trigger_fire
instead of fpga_trigger_arm, creating a situation where the triggers
were not being armed.

Fixes #632
2018-09-13 15:29:57 -04:00
Rey Tucker
a656abcb07 bladerf2: rename convenience static fns, misc cleanup
Renames a couple static functions to clarify their usage

Changes a couple more uint64_t to bladerf_frequency

Remove __FUNCTION__ from a few warnings/errors where it is just
clutter
2018-09-12 17:55:14 -04:00
Rey Tucker
1bd44b6995 bladeRF-cli: display manufacturer/product during probe and info 2018-09-12 17:51:00 -04:00
Rey Tucker
f4ca0ba212 libbladeRF: add manufacturer/product strings to devinfo
Adds 'manufacturer' and 'product' members to the
bladerf_devinfo struct, and ensures they are properly
initialized and populated during enumeration.

These contain the human-readable manufacturer and
product names from the USB device descriptor.
2018-09-12 17:51:00 -04:00