Commit Graph

25 Commits

Author SHA1 Message Date
Jon Szymaniak fe99478a0c bladeRF: RXVGA2 range is [0, 30]
While the RXVGA2 gain can technically go up to 60 dB, the LMS6002D
datasheet recommends it be clamped to 30dB. libbladeRF clamps to a max
of 30dB, so there's no use in setting max to 60 dB here.
2014-02-16 09:10:08 +01:00
Jon Szymaniak b7360fc879 bladerf: Added 'verbosity' and 'loopback' device parameters
The 'verbosity' parameter may be used to increase or suppress output from
libbladeRF. The available log levels are, in order of decreasing
verbosity are:
    verbose, debug, info, warning, critical, silent

The 'loopback' parameter may be used to put the bladeRF into one of the
supported loopback modes.  The valid modes are listed below. Their
descriptions may be found in the libbladeRF documentation:

      bb_txlpf_rxvga2, bb_txlpf_rxlpf bb_txvga1_rxvga2, bb_txvga1_rxlpf
      rf_lna1, rf_lna2, rf_lna3
2014-02-16 09:10:04 +01:00
Brian Padalino 98a6e7604f bladeRF: Modifying correction calls.
Modifying correction function calls to match libbladeRF API.
2014-01-26 17:36:56 +01:00
Jon Szymaniak 9964a5e6a9 bladerf: Removed sign extension and masking of samples
This is no longer required as of FPGA v0.0.1, and has been removed to
remove some unnecessary computation on samples.
2014-01-26 17:36:53 +01:00
Jon Szymaniak 9a8710757f bladerf: Updates for libbladeRF v0.11.0 API changes 2014-01-26 17:36:50 +01:00
Jon Szymaniak 0ee06038ae bladerf: Use rational sample rate functions
libbladeRF provides accessors for rational sample rates, which the
integer sample rate functions use under the hood. Therefore, there's no
need to check if the requested rate contains a fractional portion and
switch between the two sets of functions.
2014-01-26 17:36:47 +01:00
Jon Szymaniak 1905cdc64c bladerf: Added start()/stop() implementations 2014-01-26 17:36:43 +01:00
Dimitri Stolnikov 9701906aaf bladerf: shorten the serial number that is being shown to the user 2014-01-26 17:36:32 +01:00
Dimitri Stolnikov 27a5e07ba3 bladerf: implement DC offset and IQ imbalance correction
This patch has been provided by Brent J.
2014-01-26 17:36:29 +01:00
Dimitri Stolnikov f78d79398f bladerf: prepare functions to control DC offset / IQ balance (WIP) 2014-01-26 17:36:22 +01:00
Jon Szymaniak dd35921292 bladerf: Don't reload the FPGA unless the force-reload param is set 2013-11-04 21:22:00 +01:00
Jon Szymaniak e735418224 bladerf: Moved initializations to bladerf_common.c, misc. cleanup
Common parameter handling has been moved into bladerf_common::init().

The buflen parameter is now in units of samples, not bytes. This
deviates from the other gr-osmosdr items. However, with the requirement
that buffers be in multiples of 1024 samples, this makes specifying this
parameter a bit easier. The user shouldn't need to know we're operating
on SC16Q12 values under the hood, and have to calculate accordingly.

To avoid confusion when both a bladeRF source and sink are in a flow
graph a [bladeRF source/sink] prefix has been added to output. Error
number have been replaced with bladeRF string representations of these
error values.

Firmware flashing has been removed. The bladeRF-cli or bladeRF-flash
tools are the preferred route for firmware upgrades.
2013-11-04 21:21:54 +01:00
Jon Szymaniak 3ef7394f61 bladerf: Moved no longer "common" items out of bladerf_common
The gr_complex FIFO is no longer used on the TX side, so it doesn't
really make sense to have it in bladerf_common. The associated items
have been moved into bladerf_source, and some renaming has been done in
bladerf_sink to tidy up.

Pending further performance tests of the bladerf_source, the _fifo
member (boost::circular_buffer) may need to be replaced.
2013-11-04 21:21:48 +01:00
Daniel Gröber 0d75ab353d bladerf: Added device caching, this enables full-duplex operation. 2013-11-04 21:21:44 +01:00
Dimitri Stolnikov f7640dc11c bladerf: remove unused variable 2013-10-25 23:45:48 +02:00
Dimitri Stolnikov d81936d907 bladerf: use newstyle version getters 2013-10-04 18:31:39 +02:00
Dimitri Stolnikov 7b199a8b95 bladerf: make source less picky wrt rf gain 2013-10-03 14:37:02 +02:00
Dimitri Stolnikov d8534d8721 bladerf: implement automatic bandwidth selection 2013-09-28 13:33:30 +02:00
Jon Szymaniak cbf791469c bladeRF: Refactored buffering scheme in sink
Removed the use of an intermediate sample FIFO in the sink
implementation. Note the the FIFO has not been moved out of
bladerf_common --> bladerf_source_c in this commit.

work() now handles converting samples from complex to SC16_Q12, and filling
"transmit-ready" buffers. The callbacks are now only responsible for
marking the provided buffer free, and returning the next buffer.

It appears that a small deadlock issues remains in this changest, which
can be induced by:
 1: Using a small sample rate (160Khz)
 2: Switching back and forth between sinusoid <-> GSM burst

 In this case, it appears that work() is blocked waiting for a buffer to
 become free. More investigation here is required...
2013-09-28 00:05:32 +02:00
Dimitri Stolnikov 0690c077d2 bladerf: migration to async api (WIP)
receive works, transmit locks up in work() after few seconds
2013-09-28 00:05:25 +02:00
Frederik M.J. Vestre cdeb105495 Support setting external sampling to bladerf 2013-08-29 23:37:20 +02:00
Dimitri Stolnikov 6fe392546a bladerf: follow recent API changes
tested against aea04c5f119288370166ece05166a8a4157da6fa
2013-08-27 22:40:52 +02:00
Dimitri Stolnikov 9dfe3a6354 bladerf: update common sample rate values 2013-07-28 16:35:48 +02:00
Dimitri Stolnikov 93ad959d8d bladerf: migrate to new api to enable/disable TX/RX modules
TX support has been verified with osmocom_siggen and fpga image from git
f6c6a3abcb22d2794946e5adbc556805a73788a3
2013-07-26 21:46:47 +02:00
Dimitri Stolnikov e5f7b28093 bladerf: add support for nuand LLC bladeRF (WIP)
This is based on the original work (https://github.com/Nuand/gr-osmosdr)
done by folks at nuand LLC for the gr3.6 branch of gr-osmosdr.

The following modifications have been done in this commit:

* port to gr-osmosdr master codebase (gr3.7)
* moved shared properties to bladerf_common
* added & verified IF filter bandwidth setters
* set LMS6002D registers with values taken from FAQ 5.27
* print device information (serial/versions) on startup
* added fpga= and fw= device arguments to program MCU/FPGA
* added bladerf=# dev. arg. to select a specific bladeRF
* grc gain field controls RF path VGA for RX/TX
* grc BB gain field controls BB path VGA for RX/TX

Usage example:

osmocom_fft -a "bladerf,fpga=/tmp/hostedx115.rbf"

The following RX named gain stages are available:

LNA: 0 to 6 dB, in 3dB steps
VGA1: 5 to 30 dB, in 1dB steps; nonlinear mapping done inside the lib
VGA2: 0 to 60 dB, in 3dB steps; not recommended to be used above 30dB

The following TX named gain stages are available:

VGA1: -35 to -4 dB, in 1dB steps, BB side
VGA2: 0 to 25 dB, in 1dB steps, RF side

Thanks a lot to the team of nuand LLC for this major contribution.
2013-07-21 11:59:22 +02:00