Commit graph

308 commits

Author SHA1 Message Date
Robert Ghilduta
ad9fdff1ca libbladeRF: bump to version v2.5.0
Introduces 8bit SC8_Q11 mode, and overclocking mode changes for bladeRF 2.0 micro.
This commits also fixes several bugs, including a locking bug in libbladeRF.
Help menus and abbreviation support expanded in bladeRF-cli.
2023-02-13 03:28:19 -08:00
Robert Ghilduta
df5b47e651 libbladeRF: rename bladerf_set_feature to bladerf_enable_feature 2023-02-13 03:28:19 -08:00
Ryan Thompson
a37f40045e libbladeRF: BLADERF_FEATURE prefix prepended to feature names 2023-02-13 03:28:19 -08:00
Ryan Thompson
1fa238d2d6 libbladeRF: features added to libbladeRF header 2023-02-13 03:28:19 -08:00
Robert Ghilduta
78affc3823 libbladeRF: add 8bit sample mode support 2023-02-13 03:28:19 -08:00
Robert Ghilduta
8f8847f936 libbladeRF: bump to version v2.4.1
Fix packet mode bugs, and add support for bladeRF 2.0 micro xA5, and Wishbone
master NiOS peripheral.
2022-04-03 19:39:10 -07:00
Robert Ghilduta
54c519079e libbladeRF: add Wishbone master control functions 2022-04-03 19:39:10 -07:00
Robert Ghilduta
7740242c7b add bladeRF 2.0 micro xA5 support to libbladeRF and FPGA 2022-04-03 19:39:10 -07:00
Robert Ghilduta
82afb15adb libbladeRF: bump to version v2.4.0 2020-12-23 20:45:44 -08:00
Robert Ghilduta
6adfb3b594 libbladeRF: add note for normal meta mode 2020-11-23 00:59:27 -08:00
Robert Ghilduta
d294ba267b libbladeRF: add BLADERF_FORMAT_PACKET_META format 2020-11-23 00:59:27 -08:00
Robert Ghilduta
f03d84333b libbladeRF: clear up documentation 2019-10-01 16:46:12 -07:00
Robert Ghilduta
8e358c1941 libbladeRF: query backend for handle and lock 2019-09-01 22:51:27 -07:00
Robert Ghilduta
e3d7750e53 libbladeRF v2.2.1 2019-07-31 18:28:03 -05:00
Robert Ghilduta
0aca485ad0 libbladeRF: hdl: allow quicktune to control XB gpio register
This commit uses the reserved field of the pkt_retune NiOS packet to encode
xb_gpio register configuration data.
2019-04-02 01:59:55 -07:00
Robert Ghilduta
3bb8ad613e libbladeRF: add functionality to lock OTP 2018-12-27 18:33:33 -08:00
Robert Ghilduta
300d536ac1 libbladeRF: add OTP read/write support 2018-12-27 18:25:51 -08:00
Robert Ghilduta
1416d4918a libbladeRF: update FPGA flash type definitions 2018-12-26 00:21:14 -08:00
Rey Tucker
57b6abdc35 libbladeRF v2.2.0 2018-12-21 16:12:50 -05:00
Rey Tucker
d09761f2e4 host: libbladeRF: include inttypes.h in libbladeRF.h
This is where PRI{i,u,x}{32,64} are defined, which we use
in #defines further down. So, including inttypes.h is sort
of necessary.
2018-12-21 15:12:16 -05:00
Rey Tucker
9a0310d556 host: libbladeRF: minor doxygen fixes 2018-12-21 12:49:56 -05:00
Rey Tucker
825d986b4e host: libbladeRF: add bladerf_get_fpga_bytes() call
This adds a bladerf_get_fpga_bytes() function, which returns the
expected length of the FPGA image.

This is a dynamic replacement for BLADERF_FLASH_BYTE_LEN_FPGA,
which has been removed.

In particular, this is used in spi_flash_write_fpga_bitstream() and
spi_flash_erase_fpga() to determine the number of blocks to erase
during FPGA flashing operations.

This fixes an issue where xA9 boards were not being adequately
erased before writing.
2018-12-21 01:28:17 -08:00
Brian Glod
048678df98 host: libbladeRF: API changes, BLADERF_FLASH_EB_SIZE usage
API change:
  - bladerf_image_write(): new parameter: bladeRF device handle
      Change is inspired by the pending removal of BLADERF_FLASH_EB_SIZE
      macro. This macro really shouldn't be exposed to the world, nor
      should it be constant as it may change depending on the flash
      used on the board.

API new function:
  - bladerf_erase_flash_bytes(): new function
      Similar to the existing bladerf_erase_flash() function, but
      handles the conversion from bytes to flash erase block pages
      internally. This function is recommended for new designs because
      the erase block size may change depending on the board. This
      function also checks for proper alignment along erase block
      boundaries.

General changes:
  Although the macro still exists (for now), all uses of
  BLADERF_FLASH_EB_SIZE have been replaced with equivalent
  dev->flash_arch->ebsize_bytes because the value may change depending
  on the flash used on the board.
2018-12-21 01:28:17 -08:00
Brian Glod
b0c1f750ea host: libbladeRF: API new bladerf_{read,write}_flash_bytes()
New API functions:
  - bladerf_read_flash_bytes()
      This function is nearly identical to the existing
      bladerf_read_flash() function, but takes the address and length in
      units of bytes instead of flash pages. The function performs the
      necessary conversions from bytes to pages internally based on the
      specific flash architecture in use.
  - bladerf_write_flash_bytes()
      Same as above, for writes.

New code is advised to use these byte-unit functions instead of the
older page-unit functions because the page size may not be guaranteed to
be 256 bytes in future bladeRF platforms.
2018-12-21 01:28:17 -08:00
Brian Glod
03edb51ee4 host: libbladeRF API changes, BLADERF_FLASH_TOTAL_SIZE usage
API changes:
  - bladerf_alloc_image(): new parameter - bladeRF device handle
  - bladerf_alloc_cal_image(): new parameter - bladeRF device handle

General changes:
  Although the macro still exists (for now), all uses of the
  BLADERF_FLASH_TOTAL_SIZE macro have been replaced with equivalent
  dev->flash_arch->tsize_bytes because the value may change depending on
  teh flash used on the board.

  During this process, some function prototypes were modified so the
  device handle could be passed in, thus allowing flash architecture
  data to be extracted.

    - calibration.c: dc_cal_tbl_image_load()
    - image.c: is_valid_addr_len()
2018-12-21 01:28:17 -08:00
Brian Glod
37bd65d9c7 host: libbladeRF/bladeRF2: improve bladerf2_get_quick_tune()
A few changes to the bladerf_quick_tune structure:
  - rename 'profile' to 'rffe_profile' for clarity
  - delete 'data[16]' not needed anymore and preserves ABI compatibility
  - add    'nios_profile' for indexing the profile stored in the BBP
  - add    'port' for storing the RFFE port settings
  - add    'spdt' for storing the external RF switch settings

Improvements to bladerf2_get_quick_tune():
  - Send rffe_fastlock_save packet to instruct Nios to save a copy of
    the RFFE fast lock profile to itself. This means the fast lock
    profile data (16 bytes) no longer needs to be transmitted to/from
    the Nios and the host machine (retune speedup).
  - Save the RFFE port setting to the quick tune structure so it may be
    sent down to the Nios when scheduling a retune.

Saving the 16-bytes of fast lock profile data to the host is no longer
necessary because it is stored on the Nios itself. This has two
additional benefits: quicker retunes (the profile data does not need to
be shuffled across USB), and it preserves ABI compatibility because the
size of the bladerf_quick_tune struct does not increase compared to
previous versions of libbladeRF.
2018-11-26 16:03:46 -05:00
Brian Glod
a8e3e67568 host: libbladeRF/bladeRF2: implement bladerf2_get_quick_tune()
Update bladerf_quick_tune structure for bladeRF2 data. It now contains:
- profile (profile number, integer)
- data    (profile data, 16 bytes)

Fill in the bladerf2_get_quick_tune() function. The bladeRF2's RFIC uses
the concept of fast lock profiles, of which there are 8 for TX and 8 for
RX. These profiles store the VCO information needed to quickly change
frequencies. To use more than 8 profiles, the profiles may be stored
off-chip, which is what we're doing here.

1. It is assumed the RFIC has been tuned to a particular frequency.
2. The profile is created using ad9361_fastlock_store().
3. The profile is read back and stored in host memory using
   ad9361_fastlock_save().
2018-11-26 16:03:46 -05:00
Rey Tucker
97d0cfae2f libbladeRF v2.1.0 2018-10-30 16:34:14 -04:00
Robert Ghilduta
e1d8c61c44 libbladeRF: add meta RX hardware flags for underflow, miniexp{1,2} 2018-10-21 01:20:01 -07: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
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
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
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
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
Rey Tucker
045708a0f3 libbladeRF: add format macros for frequency, timestamp
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 #577
Fixes #618
Fixes #620
2018-09-12 17:50:40 -04:00
Rey Tucker
c556947565
Revert "host: add a product description string to devinfo" (#622)
* Revert "Revert "host: add format macros for bladerf_frequency, bladerf_timestamp" (#621)"

This reverts commit 5e481b1db2.

* Revert "bladeRF-cli: ensure device is initialized after deferred open"

This reverts commit 5ed03a3b01.

* Revert "bladeRF-cli: print product string where relevant"

This reverts commit 2ccd6e3d5e.

* Revert "libbladeRF: add 'product' string to devinfo"

This reverts commit 11a71d835a.
2018-09-10 21:39:03 -04:00
Rey Tucker
5e481b1db2
Revert "host: add format macros for bladerf_frequency, bladerf_timestamp" (#621)
* Revert "bladeRF-cli: ensure device is initialized after deferred open"

This reverts commit 5ed03a3b01.

* Revert "bladeRF-cli: print product string where relevant"

This reverts commit 2ccd6e3d5e.

* Revert "libbladeRF: add 'product' string to devinfo"

This reverts commit 11a71d835a.

* Revert "bladeRF-cli: update print/sets to use typedefs"

This reverts commit a4b176c516.

* Revert "libbladeRF: add format macros for frequency, timestamp"

This reverts commit 1cf6a7871c.
2018-09-10 21:32:11 -04:00
Rey Tucker
11a71d835a libbladeRF: add 'product' string to devinfo
Adds a 'product' member to the bladerf_devinfo struct, and
populates it during device enumeration.

This will contain a human-readable description of the found
device, built from the USB Manufacturer and Product strings.
2018-09-07 18:16:09 -04:00
Rey Tucker
1cf6a7871c libbladeRF: add format macros for frequency, timestamp
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.
2018-09-07 18:15:34 -04:00
Rey Tucker
13afbb8d8e libbladeRF: move rf_ports into low-level functions
These settings generally don't need to be manually adjusted,
because higher-level functions (e.g. bladerf_set_frequency)
handle the setup in coordination with the rest of the RF
hardware (e.g. via bladerf_get_rf_switch_config).
2018-09-07 18:15:06 -04:00
Rey Tucker
7f94ecda97 libbladeRF v2.0.2
This version of libbladeRF is intended for use with:

FX3 Firmware v2.2.0
FPGA         v0.7.3

There are no functional changes since v2.0.1, although there are changes to
the API documentation and the cmake build scripts.

Changes:
 * Improve bladerf_gain_mode documentation (#595)
 * Don't warn about libusb version on FreeBSD (#594)
2018-08-30 18:06:37 -04:00
Rey Tucker
0e69ee5dec
libbladeRF: improve bladerf_gain_mode documentation (#592) (#595)
Discuss what the gain modes mean in better detail, and also
indicate that the BLADERF_GAIN_*_AGC options are advanced and
require additional implementation work to use effectively.
2018-08-29 17:20:20 -04:00
Rey Tucker
bca25d7968 host: libbladeRF 2.0.1
v2.0.1 (2018-08-24)
--------------------------------

This version of libbladeRF is intended for use with:

FX3 Firmware v2.2.0
FPGA         v0.7.3

This release contains minor fixes since v2.0.0.

Note to bladeRF2 users: If you are using bladerf_{get,set}_clock_select(),
please note that the enum for bladerf_clock_select has changed.
CLOCK_SELECT_VCTCXO has been replaced with CLOCK_SELECT_ONBOARD.

Changes:
 * FreeBSD build fixes (#561)
 * 32-bit architecture fixes (#573)
 * Detect and handle a bladeRF Micro that is running old firmware to allow
   re-flashing without recovery mode (#578)
 * bladeRF1: bladerf_set_gain_mode returning BLADERF_ERR_UNSUPPORTED is no
   longer fatal (#542)
 * bladeRF1: only check AGC DC LUT setting when enabling AGC
 * bladeRF1: typo fix in set_tx_gain (#580)
 * xb200: check for null xb_data before dereferencing it (#575)
 * bladeRF2: cache factory trimdac value at initialization; preserve trimdac
   disable state on bladerf2_trim_dac_write (#582)
 * bladeRF2: bladerf_clock_select: replace CLOCK_SELECT_VCTCXO with
   CLOCK_SELECT_ONBOARD for clarity (#585)
 * Improvements to the release notes (#583)
 * bladeRF-cli: Add 200 ms delay before probing PLL lock status (#587)
 * Windows: add a nanosleep() shim (#589)
2018-08-24 15:54:45 -04:00
Rey Tucker
d73d4648df
libbladeRF: polished release notes for v2.0 (#583)
Updates the release notes for v2.0 to include more useful information, less useless information, and fewer typos. More consistent and readable, hopefully.

Also fixes one error in the documentation in libbladeRF.h.

* host: libbladeRF/doxygen: improve 2.0.0 relnotes

Some wording/formatting cleanup here and there.

Add \remarks for most sections to suggest some "do not" and "do" items.

Add some quick documentation on the bias tees, PLL, power status, etc.

* host: libbladeRF: fix doc for bladerf_get_timestamp

* host: libbladeRF/doxygen: more relnotes work

Adding a "What is a channel?" section to describe channels

* libbladeRF: 2.0.0 relnotes: soften wording, misc cleanup

* libbladeRF: relnotes: new section on gain ranges, fixup sectioning for Further Info

* libbladeRF: relnotes: more fixes, cleanup

* libbladeRF: relnotes: more tweaks, getting close

* libbladeRF: relnotes: final changes, honest

* libbladeRF: docs: relnotes 2.0.0 -> relnotes 2.0

This is actually more sensible given the versioning.

* libbladeRF: relnotes: fix typos/spelling

* libbladeRF: relnotes: hand-merge ac6b182c

Update wording
2018-08-24 12:04:39 -04:00
Rey Tucker
c58600e420 host: libbladeRF v2.0.0
Update changelog and version tags for v2.0.0
2018-08-13 20:08:09 -04:00
Rey Tucker
7dc32cc56f
host: bladerf_get_channel_count now takes a bladerf_direction (#58)
This is more intuitive than 'bool tx'.
2018-06-01 15:49:04 -04:00
Rey Tucker
ae129c5ccd
host: libbladeRF: improve consistency of 'const' modifier location (#54)
I have a tendency to put 'const' in the middle of the type, e.g. struct bladerf_range const **range

I can argue that it is superior to do it that way, but I don't want to, as it makes no difference and just looks weird :)

* libbladeRF.h: put const at start of type

* board.h: move const to the start of types
2018-05-29 13:11:05 -04:00
Rey Tucker
5ef5199d88
host: bladerf_get_*_range now expect struct bladerf_range** (#53)
* 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
2018-05-29 13:10:49 -04:00
Rey Tucker
a0d498e723
host: typedef common parameter types (#51)
* 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
2018-05-25 11:45:38 -04:00