Commit graph

331 commits

Author SHA1 Message Date
Ryan Thompson
90bd8bb9cc doc: update sync config buffer size description 2025-04-09 23:17:40 -07:00
Ryan Thompson
2d2904e880 libbladeRF: added bladerf_format_to_string function 2025-04-09 23:17:40 -07:00
Ryan Thompson
79cae1e87f libbladeRF: added sc16q11 packed sample format
libbladeRF ingests SC12 Q11 samples and expands them to SC16 Q11 before
filling the end buffer. The trade-off is CPU cycles for the 12b to 16b
conversion.
2025-04-09 23:17:40 -07:00
Ryan Thompson
bdd4f39a3d fx3_firmware: rev libbladeRF, hdl, and fx3 for 2048 sample gpif buffers
FX3 GPIF buffers set to 2048 samples and number of buffers reduced to
11 per dma channel. This substantially increases the theoretical USB
SuperSpeed throughput from roughly 228MB/s to 356MB/s.

$ make test_libbladeRF
[       OK ] libbladeRF.scheduled_retune (19755 ms)
[----------] 29 tests from libbladeRF (308802 ms total)

[----------] Global test environment tear-down
[==========] 29 tests from 1 test suite ran. (308802 ms total)
[  PASSED  ] 29 tests.
2025-04-09 23:17:40 -07:00
Ryan Thompson
a62c1d4903 libbladeRF: support and clamp byte alignment to larger GPIF buffer size
This change also includes a refactor of the redundant format to sample
size conversions found within the synchronous and asynchronous
interfaces.
2025-04-09 23:17:40 -07:00
Ryan Thompson
a8481c2af7 doc: added packet length warning for BLADERF_FORMAT_PACKET_META
A packet length of (n*256-4) DWORDs will cause the synchronous
buffer it's filled into to indefinitely persist.
2025-04-09 23:17:40 -07:00
Ryan Thompson
f81b82aa8e libbladeRF: bump to version 2.5.1
Introduces bladeRF-power cli tool and gain calibration functionality.
2024-08-08 00:15:01 -05:00
Ryan Thompson
3c25f57893 libbladeRF: gain_calibration: added bladerf_get_gain_target
The gain target is either set or calculated based on the gain mode. If
using manual gain control, the gain target from the gain table is
returned. If the AGC is enabled, the gain target is calculated based
on the current gain.
2024-08-07 15:31:54 -05:00
Ryan Thompson
8031b84e59 libbladeRF: gain_calibration: store gain cal file within table 2024-08-07 15:19:06 -05:00
Ryan Thompson
aab04e0a2b libbladeRF: image: print type with metadata
Ex:
Magic: bladeRF
Type: Raw Data
Version: 0.1.0
Timestamp: 655e530f
Serial: 
Address: 0
Length: 0
2024-08-07 15:19:06 -05:00
Ryan Thompson
eb3d128a8d libbladeRF: image: bladerf_image_print_metadata added
Ex:
Magic: bladeRF
Version: 0.1.0
Timestamp: 655e530f
Serial: 
Address: 0
Length: 0
2024-08-07 15:19:06 -05:00
Ryan Thompson
986c3a3353 libbladeRF: gain_calibration: added gain calibration image type 2024-08-07 15:19:06 -05:00
Ryan Thompson
9fb9b19f42 libbladeRF: gain_calibration: added bladerf_get_gain_calibration 2024-08-07 15:19:06 -05:00
Ryan Thompson
228de95650 libbladeRF: gain_calibration: print function added 2024-08-07 15:19:06 -05:00
Ryan Thompson
50dd427e49 libbladeRF: gain_calibration: enable function added 2024-08-06 18:47:45 -05:00
Ryan Thompson
838c177eba libbladeRF: gain_calibration: load function initialized 2024-08-06 18:47:45 -05:00
Ryan Thompson
3583aaca8e libbladeRF: gain_calibration: init
Adds the gain calibration tables along with the prototype for
bladerf_load_gain_calibration(). Also copies the stored calibration
references to the output directory.
2024-08-06 18:47:45 -05:00
Ryan Thompson
a91b51974d libbladeRF: added bladerf_print_quick_tune()
Outputs the current quick retune parameters of a bladeRF
device to standard output. It is useful for debugging and verifying the
configuration of quick tune settings.
2024-08-06 18:47:44 -05:00
Ryan Thompson
acdb03af43 doc: added bladerf_alloc_image parameter descriptions 2024-08-06 17:31:31 -05:00
Ryan Thompson
ac3e5aeb3f doc: updated default tuning mode to host 2024-04-04 08:21:22 -05:00
Ryan Thompson
d4cdad16ff doc: note that quick_tune must be non-NULL for the bladeRF micro 2.0 2023-10-31 11:00:36 -05:00
Ryan Thompson
0769521902 doc: corrected value pair type to int8_t
fix #939
2023-09-11 11:04:01 -05:00
Ryan Thompson
3a79fef1bd libbladeRF: correct documented SC8_Q7 range
Fixes #921
2023-05-11 16:50:46 -05:00
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