Commit graph

24 commits

Author SHA1 Message Date
Rey Tucker
35dd8b5f8d python: pep8 compliance 2018-09-24 13:14:36 -04:00
Rey Tucker
586c69338e python: add get_serial_struct, replace get_serial 2018-09-24 13:14:36 -04:00
Rey Tucker
38259d1733 python: update _cdef with latest libbladeRF.h 2018-09-24 13:14:36 -04:00
Brian Glod
8036032bfd libbladeRF/python: Add bladerf_get_flash_size()
bladerf-tool will print the flash density with the 'info' command.
2018-09-14 12:33:30 -04:00
Rey Tucker
ead2de258b libbladeRF/python: fix rx_channel_count and tx_channel_count 2018-09-13 17:57:16 -04:00
Rey Tucker
8a1953ed5e libbladerf/python: update cdef 2018-09-13 17:54:30 -04:00
Rey Tucker
0d8546aa57 host: python v1.0.1
v1.0.1 (2018-08-24)
--------------------------------

This version is intended for use with libbladeRF v2.0.1.

Changes:
 * host: libbladeRF: Rename clock select option
2018-08-24 16:07:23 -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
Robert Ghilduta
bc576497fc host: python: add trim DAC read/write accessors
These functions get and set trim DAC values
2018-06-20 00:50:31 -04:00
Rey Tucker
152b7be95c
host: python: fix calls to get_*_range (#59)
The Python bindings didn't get updated for the `const struct bladerf_range **` changes in #48 and #53 , but now they are
2018-06-01 15:51:47 -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
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
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
ba8e485d2f host: python: set version = 0.9.1 (so we can bump to 1.0.0 at release) 2018-03-26 12:44:50 -04:00
Rey Tucker
5240d995b0
host: python: Python packaging (#18)
* host: python: reorganize files for packaging

* host: python: move bladerf-tool CLI into main()

* host: python: move cdef string into its own file

Since packaging lets us have multiple files easily, this cleans up
bladerf.py a lot.

* host: python: add __init__.py skeleton

* host: python: fixup py3flakes and pycodestyle

* host: python: fix unused local variable

* host: python: more reorganization to appease Python

* host: python: update .gitignore for setup detritus

* host: python: initial setup.py

* host: python: update accompanying documentation

* host: python: cleanup setup.py

* host: python: move license stuff into files

* host: python: version 1.0.0
2018-03-26 12:26:46 -04:00
Rey Tucker
f857b28b34
host: python: fix up error handling on rssi property (#17) 2018-03-23 16:28:24 -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
4cf79bc8c0 host: python: add RSSI readback for AD9361 2018-03-15 18:24:58 -04:00
Rey Tucker
b2786e9ce2
host: libbladeRF-bindings/python: general updates (#11)
* host: libbladeRF-bindings/python: general updates

This commit adds the following changes:

Overall:
* Adds an _import_header.py tool, which parses libbladeRF.h (or other
  headers) into a convenient string ready for ffi.cdef
* Passes pycodestyle and pyflakes checks cleanly

bladerf.py:
* Various new class wrappers for enums, etc
* Subclassed exceptions (e.g. bladerf.UnsupportedError will be raised if
  libbladeRF returns BLADERF_ERR_UNSUPPORTED)
* Added functions for bootloader firmware recovery
* More comments all around
* Use properties instead of getters/setters:
   >>> b = bladerf.BladeRF()
   >>> # OLD:
   >>> b.get_devinfo()
   >>> b.set_clock_select(ClockSelect.External)
   >>> # NEW:
   >>> b.devinfo
   >>> b.clock_select = ClockSelect.External
* Added more functions, particularly for bladeRF 2
* Added a Channel class, for channel-specific properties:
   >>> b = bladerf.BladeRF()
   >>> ch = d.Channel(bladerf.CHANNEL_RX(0))
   >>> ch.frequency = 2.45e9

bladerf-tool.py:
* General changes to use properties instead of get_/set_ functions
* Also updated to use subclassed exceptions from bladerf.py
* Dump a lot more info with the 'info' command
* Look for bootloader devices with the 'probe' command
* Added 'recover_fw' command, for firmware recovery
* Moved from single-channel paradigm to MIMO paradigm on 'rx', 'tx'

* host: python: implement more methods, various fixes

Implement loopback, rx_mux, ad9361_temperature, and adf4002_* functions

Fix set_clock_select type handling

Use 4-space indent in cffi block, for placating text editors

Add -v option to bladerf-tool.py info, to clean things up a bit
2018-03-15 11:45:11 -04: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
Rey Tucker
37d457365c bladerf.py: fix device_reset call 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
Vanya A. Sergeev
6be5e8ecf2 libbladeRF_bindings: add python3 binding and example tool 2017-12-21 12:55:04 -05:00