Commit graph

306 commits

Author SHA1 Message Date
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
Brian Glod
5e808b843c bladeRF1: Fix nios_gpio assignment for AGC_EN
Fixes #607

The nios_gpio bit assignment for AGC_EN was already being used for
led(1). This commit also fixes a bug in the agc_band_sel signal
assignment introduced in 3b670ca.
2018-09-06 12:01:22 -04:00
Rey Tucker
eaf9475a44 libbladeRF/bladerf2: add support for lower sample rates
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"
2018-09-04 12:33:37 -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
Brian Glod
84ea9784ec host: libbladeRF: Rename clock select option
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
2018-08-23 23:29:56 -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
2d62faa36f
host: libbladeRF: clang-format the *.h files (#55) 2018-05-30 15:26:28 -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
Rey Tucker
1dc6317b93
host: make low-level API calls generic by removing part numbers (#49)
Instead of using specific part numbers for low-level API calls on the bladeRF micro, use generic functionality-based names.
2018-05-25 10:55:04 -04:00
Rey Tucker
c74c6282ad
host: improve platform-independence of bladerf_{set,get}_gain (#48)
The bladerf_{set,get}_gain functions are now reasonably hardware-independent.

On TX channels, setting a gain of 60 dB should result in a CW TX power of roughly 0 dBm.

On RX channels, 60 dB is the maximum gain level.

The ranges returned by bladerf_get_gain_range are adjusted to reflect this.
2018-05-25 10:53:58 -04:00
Rey Tucker
5023f0cb03
host: fix build errors and clang-scan warnings (#47)
* devinfo: fix strncpy error

Fix two build errors on Arch:

/root/bladeRF/host/libraries/libbladeRF/src/devinfo.c:308:5:
error: ‘strncpy’ destination unchanged after copying no bytes
[-Werror=stringop-truncation]
/root/bladeRF/host/libraries/libbladeRF/src/devinfo.c:308:5:
error: ‘strncpy’ output truncated before terminating nul copying as many
bytes from a string as its length [-Werror=stringop-truncation]

* bladerf2/params: fix implicit conversion error

/root/bladeRF/host/libraries/libbladeRF/src/board/bladerf2/params.c:437:7:
error: implicit conversion from 'int' to 'int16_t' (aka 'short') changes
value from 32768 to -32768 [-Werror,-Wconstant-conversion]
      32768,      0,      0,      0,      0,      0,      0,      0,
      ^~~~~

* Doxyfile: fix CLANG_ASSISTED_PARSING warning

fixes:

warning: Tag `CLANG_ASSISTED_PARSING' at line 1033 of file
`/root/bladeRF/build/host/libraries/libbladeRF/doc/doxygen/Doxyfile'
belongs to an option that was not enabled at compile time.
         To avoid this warning please remove this line from your
configuration file or upgrade it using "doxygen -u", or recompile
doxygen with this feature enabled.
warning: Tag `CLANG_OPTIONS' at line 1041 of file
`/root/bladeRF/build/host/libraries/libbladeRF/doc/doxygen/Doxyfile'
belongs to an option that was not enabled at compile time.
         To avoid this warning please remove this line from your
configuration file or upgrade it using "doxygen -u", or recompile
doxygen with this feature enabled.

* libbladeRF: fix doxygen build error

fixes:
/home/rtucker/dev/privatebladeRF/host/libraries/libbladeRF/include/libbladeRF.h:2284:
warning: unable to resolve link to `sync_tx_meta.html' for \link command

* bladeRF-fsk: fix clangscan warning

/root/bladeRF/host/utilities/bladeRF-fsk/c/src/correlator.c:261:59:
warning: The left operand of '/' is a garbage value
        corr->ins1->real = corr->ins2->real = samples[i].i/2048.0f;
                                              ~~~~~~~~~~~~^
1 warning generated.

* fpga_common/lms.c: fix clangscan warning

/root/bladeRF/fpga_common/src/lms.c:2329:14: warning: 3rd function call
argument is an uninitialized value
    status = write_vcocap(dev, base, f->vcocap, vcocap_reg_state);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

* test_repeated_stream: fix clangscan warning

/root/bladeRF/host/libraries/libbladeRF_test/test_repeated_stream/src/main.c:284:9:
warning: 1st function call argument is an uninitialized value
        pthread_join(rx_thread, NULL);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

* test_interleaver: fix clangscan warning

/root/bladeRF/host/libraries/libbladeRF_test/test_interleaver/src/main.c:119:17:
warning: 4th function call argument is an uninitialized value
                snprintf((rowstr + rowidx), rowsize - rowidx, "%02x",
*u8buf++);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

* test_tx_gmsk_bursts: fix clangscan warning

/root/bladeRF/host/libraries/libbladeRF_test/test_timestamps/src/test_tx_gmsk_bursts.c:69:5:
warning: 2nd function call argument is an uninitialized value
    printf("  Frequency: %u\n", s->frequency);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

* ad9361_api.c: fix clangscan warning

/root/bladeRF/host/libraries/libbladeRF/src/driver/thirdparty/adi/ad9361_api.c:445:3: warning: Value stored to 'ret' is never read
                ret = -ENODEV;
                ^     ~~~~~~~
1 warning generated.

* correlator: another attempt to fix clangscan warning

* Revert "fpga_common/lms.c: fix clangscan warning"

This reverts commit 8cbb5f03f0d0927befa5053e9564df06d13ede72.

* test_interleaver: fixup clang-scan warning

some sloppy init, some messy iteration, the usual :)

/root/bladeRF/host/libraries/libbladeRF_test/test_interleaver/src/main.c:124:17:
warning: 4th function call argument is an uninitialized value

* Revert "ad9361_api.c: fix clangscan warning"

This reverts commit 14a7f8f53f84aeff721a752259ca9596a13e3a2a.

* bladeRF-fsk: fixup clang-scan warning fix
2018-05-23 12:14:26 -04:00
Rey Tucker
8919cac557 host: add support for AD9361's CTRL_OUT pins (#28)
* 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
2018-05-22 12:58:06 -04:00
Rey Tucker
790a197aca
host: libbladeRF: deprecate some low-level bladeRF1 function calls (#26)
* host: libbladeRF: deprecate bladeRF1 gain controls

We now have bladerf_{get,set}_gain and bladerf_{get,set}_gain_stage,
which are both general-purpose functions replacing the bladeRF1-specific
VGA/LNA library calls.

* host: libbladeRF: deprecate bladeRF1 trimdac controls

Instead of bladerf_dac_write and bladerf_dac_read, folks should use
bladerf_trim_dac_write and bladerf_trim_dac_read.
2018-04-06 15:28:34 -04:00
Rey Tucker
ee55f859b9
host: clean up build warnings across multiple platforms (#21)
With this commit, we build without warnings on Arch Linux; CentOS 7; Debian 8 and 9; latest Fedora; Ubuntu 14.04, 16.04, 17.10, and 18.04; Visual Studio 2017; and macOS 10.13.3 w/ Homebrew.

* host: libbladeRF: compile AD9361 srcs with -std=gnu11

Fixes compile errors involving ‘for’ loop initial declarations only
allowed in C99 or C11 mode, on older GCCs.

* host: libbladeRF/adi: remove stdbool workaround

This is not necessary now that we're building to -std=gnu11, and in
fact, it seems to create a conflict.

* host: libbladeRF: pre-declare loop variables

Some compilers are not happy with declaring the loop variable in the for
statement.  Begrudgingly placate them.

* host: libbladeRF_test: pre-declare loop variables

Some compilers are not happy with declaring the loop variable in the for
statement.  Begrudgingly placate them.

* host: bladeRF-cli: pre-declare loop variables

Some compilers are not happy with declaring the loop variable in the for
statement.  Begrudgingly placate them.

* host: libbladeRF: remove refs to strings.h

Windows doesn't have strings.h, but string.h seems to do just fine.

* host: libbladeRF: fix windows compile errors (WIP)

* host: libbladeRF/ad9361: fix windows compile error

"IGNORE" is #define'd in the Windows environment, creating a conflict.
Renaming this to solve the conflict.

* host: common: add setenv implementation for Windows

* host: libbladeRF: build setenv.c stub on Windows

* host: bladeRF-cli: use setenv stub on Windows

* host: common: fixup spacing consistency in setenv

* host: libbladeRF: cast channel macros to bladerf_channel

Visual Studio is picky about this, and throws warnings.

* host: libbladeRF: bladerf2.c: undo workaround for bladerf_channel

* host: libbladeRF: bladerf_get_gain_stages count type is now size_t

This fixes a Windows compile error, and is also generally more sensible.

* host: bladeRF-cli: fix windows compile errors

* host: ad9361: fix variadic macro syntax

Fixes Windows build errors

* host: ad9361: rename _DEBUG to AD9361_DEBUG

Visual Studio automagically sets _DEBUG if the /MDd option is set. Turns
out that a lot of the debugging sections don't build in Visual Studio,
so this accounts for a large number of the build errors...

* host: libbladeRF: fixes for Visual Studio builds

* host: common: fixes for Visual Studio builds

* host: libbladeRF/ad9361: fixes for Visual Studio builds

* host: libbladeRF_test: fixes for Visual Studio builds

* host: bladeRF-cli: fixes for Visual Studio builds

* host: bladeRF-cli: fix static analysis warnings

Fixes potential memory leak in main

Fixes unused values in set_adf_refclk, set_samplerate

* host: common: fix static analysis warnings

fixes:
unread variable in perform_rx_cal
memory leaks in add_arg, add_opt

* host: libbladeRF: fix static analysis warnings

fixes unused variables in bladerf2_set_gain and xb100_enable
2018-04-03 18:20:51 -04:00
Rey Tucker
fabe4f50a1 host: libbladeRF: version 1.9.1
This version is part of development series of changes, not an official
release.

This version of libbladeRF is intended for use with:

FX3 Firmware v2.1.0 (or v1.9.1)
FPGA         v0.7.2

Changes:
 * Refactor to support for multiple product lines
 * Add support for the bladeRF Micro product
 * API: replace bladerf_module with bladerf_channel, a
   reverse-compatible change to handle products with multiple
   independent RF paths in the same direction
 * API: BREAKING CHANGE - on bladerf_set_frequency, et al, the frequency
   parameter is now uint64_t instead of unsigned int
 * Significant code cleanup
 * Various other changes that will be listed in more detail during an
   official release
2018-03-26 15:53:33 -04:00
Rey Tucker
27e7273b42
host: formatting fixes for clang-format, libbladeRF.h comment wording/structure tweaks (#16)
* 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.
2018-03-23 11:17:57 -04:00
Rey Tucker
10d0f549b2
host: add bladerf_adf4002_{get,set}_refclk and related functionality (#15)
* 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
2018-03-23 11:10:14 -04:00
Rey Tucker
8898192015 host: libbladeRF/bladeRF2: add AD9361 RSSI access
Adds bladerf_ad9361_get_rssi() API call, to query the RSSIs from the
AD9361 RFIC.
2018-03-15 18:24:58 -04:00
Rey Tucker
06fb60f719 host: libbladeRF/bladeRF2: fix doxygen grouping for Si53304 2018-03-15 18:24:07 -04:00
Brian Glod
22e90c763c host: libbladeRF: Clock output enable for bladeRF2
Add functinos to enable/disable the external clock output (UFL CLKOUT).
2018-03-09 13:04:38 -05:00
Brian Glod
2f4ec99c3d host: libbladeRF: Clock input select for bladeRF2
Si53304 clock input selection getter and setter functions.
2018-03-09 12:50:51 -05:00
Brian Glod
75bf9d0043 host: libbladeRF: Add power source accessor
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.
2018-03-01 15:20:19 -05:00
Rey Tucker
f7f150fb49 host: libbladeRF: allow null range on bladerf_get_gain_stage_range()
In the event a library user needs to test for the existence of a gain
stage, the bladerf_get_gain_stage_range function may now be called with
a null range, and the return value can be checked to determine whether
it exists.
2018-02-05 16:49:57 -05:00
Rey Tucker
ac55b6edeb
host: libbladeRF: add per-device query of supported loopback modes
* host: libbladeRF: add bladerf_get_loopback_modes

Returns a pointer to an array of supported loopback modes.

* host: libbladeRF: add bladerf_is_loopback_mode_supported()

Tests if a given loopback mode is supported on a device
2018-02-05 16:34:14 -05:00
Rey Tucker
dab88815b1 host: libbladeRF: add BLADERF_CHANNEL_IS_TX() macro
Convenience macro that evals to true if the argument is a TX channel,
false otherwise.
2018-02-05 15:35:28 -05:00
Rey Tucker
db79697bf1 host: libbladeRF: fix compile error on empty struct
clang on OS X complains thus:

error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat]
2018-01-15 19:09:47 -05:00
Rey Tucker
bc0d8169d8 host: libbladeRF: doc, consistency fixes
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.
2017-12-22 16:02:22 -05:00
Rey Tucker
1479696aa2 host: bladerf2: add bladerf_adf4002_get_locked fn
Determines the lock status of the ADF4002 chip
2017-12-21 12:55:09 -05:00
Rey Tucker
151c000ae8 host: bladerf2: ADF4002 configuration
Add bladerf_adf4002_configure and bladerf_adf4002_calculate_ratio
functions to set up the ADF4002.
2017-12-21 12:55:09 -05:00
Rey Tucker
e51afc828e host: libbladeRF: trivial typo fix in a comment 2017-12-21 12:55:09 -05:00