Commit graph

24 commits

Author SHA1 Message Date
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
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
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
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
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
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
ae0c803f39 libbladeRF: add bladerf_adf4002_{read,write} accessors 2017-12-21 12:55:06 -05:00
Vanya A. Sergeev
6d1b456d05 libbladeRF: clean up API docs 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