Commit graph

263 commits

Author SHA1 Message Date
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
Rey Tucker
55c8866d28 host: bladeRF2: fix ADF4002 poke functionality 2017-12-21 12:55:08 -05:00
Rey Tucker
9af8e2458d host: bladeRF2: change ad9361 temperature to a float
also divide it by 1000 since that seems to be the thing to do
2017-12-21 12:55:08 -05:00
Rey Tucker
70f533e462 host: bladeRF2: add bladerf_ad9361_temperature function 2017-12-21 12:55:08 -05:00
Rey Tucker
9c6d6d9a7b first cut of bladerf_get_rf_switch_config 2017-12-21 12:55:08 -05:00
Rey Tucker
7cec443e48 host: bladeRF2: minor formatting tweaks 2017-12-21 12:55:08 -05:00
Rey Tucker
c6ba55b347 host: libbladeRF: add ADF4002 enable setter/getter 2017-12-21 12:55:08 -05:00
Rey Tucker
2c96247cd6 host: add support for bias tee
e.g.

print biastee
set biastee rx 1
set biastee tx 1
set biastee rx 0
set biastee tx 0
2017-12-21 12:55:08 -05:00
Rey Tucker
e433628ddf host: add ina219 readback to bladeRF-cli
Example output from "print ina219":

  Bus voltage:  4.896 V
  Load current: 0.56 A
  Load power:   2.76 W
2017-12-21 12:55:08 -05:00
Rey Tucker
9bab63979b host: libbladeRF: add bladeRF2 capabilities, bladerf_get_channel_count
Squashed commit of the following:

commit d12066467c99bdbb7048285c0616db70ff383e2f
Merge: 3493a3b3c 2770a187a
Author: Rey Tucker <rey.tucker@nuand.com>
Date:   Tue Sep 19 13:56:34 2017 -0400

    Merge branch 'master' into rtucker-host-capabilities

commit 3493a3b3c1ab17ea4a616bbf8b543108e5defeca
Author: Rey Tucker <rey.tucker@nuand.com>
Date:   Thu Sep 14 13:40:33 2017 -0400

    host: libbladeRF: add bladerf_get_channel_count call

    This will return the number of channels available on a given hardware.

commit 609bfc7d4bc4bb1fea09164de184b94fe9f691da
Author: Rey Tucker <rey.tucker@nuand.com>
Date:   Thu Sep 14 13:37:04 2017 -0400

    host: libbladeRF/board: add FW capabilities for bladeRF 2

    Not entirely certain we need a capability flag for bladeRF 2 support in
    the firmware, but now there is one.

commit 12f6d61c0c04df1a52d7552ff3ee45f6faaaf6b1
Author: Rey Tucker <rey.tucker@nuand.com>
Date:   Thu Sep 14 13:35:11 2017 -0400

    host: libbladeRF/board: move capabilities to board.h

    Keeping them common between boards seems prudent for now.
2017-12-21 12:55:07 -05:00
Rey Tucker
6662cf40f2 host: libbladeRF: backwards compat for gain mode
older libbladeRF had BLADERF_GAIN_AUTOMATIC, so aliasing it to
BLADERF_GAIN_DEFAULT to avoid mysterious code breakage
2017-12-21 12:55:07 -05:00
Rey Tucker
c677516ab3 host: libbladeRF: add bladerf_get_gain_modes
Squashed commit of the following:

commit b06ffe841dc5e8cc91cfa743213979be49843b83
Author: Rey Tucker <rey.tucker@nuand.com>
Date:   Fri Sep 15 13:46:59 2017 -0400

    host: libbladeRF: forgot bladerf_get_gain_modes implementation

commit ef115599d0baea3ae27136059aedadaaf67f5f43
Author: Rey Tucker <rey.tucker@nuand.com>
Date:   Fri Sep 15 12:15:07 2017 -0400

    libbladeRF: add bladerf_get_gain_modes

    bladerf_get_gain_modes provides a pointer to an array of gain modes
    supported by the device, including human-readable names.
2017-12-21 12:55:07 -05:00
Rey Tucker
11806609ec libbladeRF/bladerf2: add A9 FPGA support 2017-12-21 12:55:07 -05:00
Rey Tucker
62857242b4 libbladeRF: bladerf_enable_module MIMO support
Change bladerf_enable_module to expect a bladerf_channel instead of a
bladerf_direction.  This should have no impact on existing applications:
BLADERF_RX and BLADERF_TX map to BLADERF_CHANNEL_RX(0) and
BLADERF_CHANNEL_TX(0) respectively.

Modify bladerf2_enable_module to set the expected RFFE control reg bits.
2017-12-21 12:55:07 -05:00
Rey Tucker
81fc77760d libbladeRF: add prototypes for MIMO (de)interleave 2017-12-21 12:55:06 -05:00
Rey Tucker
4dee30d2b2 libbladeRF: constify samples param on sync_tx
Since we aren't going to touch any of the data in the sample buffer on
TX, consting it is a good thing to do.
2017-12-21 12:55:06 -05:00
Rey Tucker
ae0c803f39 libbladeRF: add bladerf_adf4002_{read,write} accessors 2017-12-21 12:55:06 -05:00
Ryan Tucker
a378f6a037 bladerf2: handle invalid gain changes gracefully
Squashed commit of the following:

commit da6b51bbe208e5beaeb5de7302177acd10eb096e
Author: Ryan Tucker <ryan.tucker@nuand.com>
Date:   Thu Jul 20 14:16:23 2017 -0400

    libbladeRF: improve wording for clarity

commit 0b14959d6192f687f7c584e0c3d66d83b814530a
Author: Ryan Tucker <ryan.tucker@nuand.com>
Date:   Thu Jul 20 14:16:02 2017 -0400

    bladerf2: general error message improvements

commit 36d6ba728bfc17cf6461fe131ae3af5c2e4c4f1b
Author: Ryan Tucker <ryan.tucker@nuand.com>
Date:   Thu Jul 20 14:05:56 2017 -0400

    bladerf2: warn on invalid gain stage but don't fail

    Some software blindly sets gain stages without checking first, e.g. gqrx
    when switching between bladeRF 1 and bladeRF 2. This will avoid crashes
    in those cases.
2017-12-21 12:55:05 -05:00
Ryan Tucker
2effd65b01 libbladeRF: fix handling of tx gain on bladerf2 2017-12-21 12:55:04 -05:00
Rey Tucker
0c386f45c1 libbladeRF/bladerf2: add initial FPGA size data
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
2017-12-21 12:55:04 -05:00
Ryan Tucker
8e98542d95 libbladeRF: doc/formatting fixes
Constrained everything to within 80 characters width, did some
doxygen-oriented cleanup, corrected some misleading information
2017-12-21 12:55:04 -05:00
Ryan Tucker
a3be0b955d host: libbladeRF: add get_gain_mode, set_gain_mode
On boards with hardware AGC, permit client applications to query and
change the gain mode (e.g. manual, automatic fast attack, etc).
2017-12-21 12:55:04 -05:00
Ryan Tucker
65f19e30bf libbladeRF: add ad9361 bist loopback mode 2017-12-21 12:55:04 -05:00
Vanya A. Sergeev
53e3bf6c2c libbladeRF: update docstring for enable module method 2017-12-21 12:55:03 -05:00
Vanya A. Sergeev
6d1b456d05 libbladeRF: clean up API docs 2017-12-21 12:55:03 -05:00
Vanya A. Sergeev
768ddd9364 libbladeRF: strip lms mentions from docs for generic API 2017-12-21 12:55:03 -05:00
Vanya A. Sergeev
36b3233c3b libbladeRF: add union + anon struct to quick tune structure for bladeRF2
for future implementation.
2017-12-21 12:55:03 -05:00
Vanya A. Sergeev
4527d92e89 libbladeRF: split bladerf 1 & 2 specific APIs into their own header files 2017-12-21 12:55:03 -05:00
Vanya A. Sergeev
9260495ca9 libbladeRF: move dc/phase/gain correction from bladerf1-specific to generic 2017-12-21 12:55:03 -05:00
Vanya A. Sergeev
8a42e206f7 libbladeRF: move vctcxo tamer mode from bladerf1-specific to generic 2017-12-21 12:55:03 -05:00
Vanya A. Sergeev
5d488173d0 libbladeRF: move config gpio accessors from bladerf1-specific to generic 2017-12-21 12:55:03 -05:00
Vanya A. Sergeev
51607bb327 libbladeRF: move trigger control accessors from bladerf1-specific to generic 2017-12-21 12:55:03 -05:00
Vanya A. Sergeev
fec3595463 libbladeRF: add doc group for low-level vctcxo trim dac methods 2017-12-21 12:55:03 -05:00
Vanya A. Sergeev
660fb291d2 libbladeRF: move spi flash accessors from bladerf1-specific to generic 2017-12-21 12:55:03 -05:00
Vanya A. Sergeev
e54b76cbb3 libbladeRF: add get tuning mode method 2017-12-21 12:55:02 -05:00
Vanya A. Sergeev
78f8140655 libbladeRF: move set tuning mode from bladerf1-specific to generic 2017-12-21 12:55:02 -05:00
Vanya A. Sergeev
1d41ea5505 libbladeRF: update param directions and returns in api docs 2017-12-21 12:55:02 -05:00
Vanya A. Sergeev
8fa0710227 libbladeRF: move trim dac read/write from bladerf1-specific to generic 2017-12-21 12:55:01 -05:00
Vanya A. Sergeev
7ac2caf419 libbladeRF: move get vctcxo trim from bladerf1-specific to generic 2017-12-21 12:55:01 -05:00
Robert Ghilduta
d8de9f4303 Add bladerf_ad9361_read() and bladerf_ad9361_write() functions 2017-12-21 12:55:00 -05:00
Vanya A. Sergeev
e63af470b9 libbladeRF/bladerf: make rx mux enumerated values generic 2017-12-21 12:54:59 -05:00
Vanya A. Sergeev
2a4c8998a7 libbladeRF: move set/get loopback from bladerf1-specific to generic 2017-12-21 12:54:59 -05:00
Vanya A. Sergeev
9e371cc375 libbladeRF: move set tuning mode from generic to bladerf1-specific 2017-12-21 12:54:59 -05:00
Vanya A. Sergeev
97728b06f3 libbladeRF: move get/set sampling from generic to bladerf1-specific 2017-12-21 12:54:59 -05:00