Commit graph

20 commits

Author SHA1 Message Date
Robert Ghilduta
0aca485ad0 libbladeRF: hdl: allow quicktune to control XB gpio register
This commit uses the reserved field of the pkt_retune NiOS packet to encode
xb_gpio register configuration data.
2019-04-02 01:59:55 -07:00
Rey Tucker
146215e2f3 fpga_common: lms.h: check return val in lms_set_frequency (fixes #691)
If lms_calculate_tuning_params is unsuccessful, then
lms_set_precalculated_frequency is called with an uninitialized
lms_freq struct.
2018-11-12 17:20:33 -05:00
Vanya A. Sergeev
562243c80d libbladeRF: refactor codebase for multi-board support
Includes fixups for clean rebase atop bladeRF commit 8b420eb
2017-12-15 18:15:06 -05:00
Jon Szymaniak
75e7793636 libbladeRF: Added bug catcher for CID 1308077
This addresses an item picked up by Coverity. Defects in bands[] or
frequency checks could potentially cause an out-of-bounds memory access.

A bounds check has been added to avoid an invalid access, should one of
the aforementioned defect ever creep in.
2015-08-12 15:50:00 -04:00
Jon Szymaniak
a219666893 libbladeRF: Decoupling correction calls from USB code
The backend interface now presents functions for IQ gain/phase
access, instead of lumping it all under "FPGA corrections."

There is no need for the USB code to know anything about LMS
corrections, so this has been moved back up the top level,
with bladerf.c calling into the lms.c functions that now
provide this functionality.

The USB backend now hooks up calls to nios_legacy_* routines.
In the future we can maintain a USB backend that uses these, while
another backend structure proivdes the use of new NIOS packet handlers.
2015-06-18 20:20:57 -04:00
Jon Szymaniak
c9fefe0cb5 lms: Added lms_get_quick_tune() implementation 2015-06-18 18:34:29 -04:00
Jon Szymaniak
9f0c6fd2f7 lms: Added flags with "force VCOCAP" option 2015-06-18 18:34:28 -04:00
Jon Szymaniak
80fb8ee526 lms: Struct re-order nitpick 2015-06-18 18:34:28 -04:00
Jon Szymaniak
cbcca71de5 lms: Provided VCOCAP back to caller 2015-06-18 18:34:28 -04:00
Jon Szymaniak
bbbe04816f lms, libbladeRF: Moved LMS charge pump offset current configuration
This only needs to be done once per initialization, not every time
the device is re-tuned. Moved this to init_device() to cut down
on SPI transactions required to complete tuning operation.
2015-06-18 18:34:28 -04:00
Jon Szymaniak
400531fdc8 lms: Added VCOCAP estimation
Estimate our initial VCOCAP value using a linear interpolation of
experimentally observed min/max values over a VCO range.
2015-06-18 18:34:28 -04:00
Jon Szymaniak
14f7ea0e39 lms: Fixed @file and copyright dates 2015-06-18 18:34:28 -04:00
Jon Szymaniak
376d51f2e4 nios, libbladeRF: Moved band selection to allow it to execute in NIOS II
After retuning, the high or low band must be selected. This requires
a few control register ("CONFIG_GPIO") and LMS6 accesses. Moving these
to the retune operation already in the NIOS II removes some extra
USB communication time.
2015-06-18 18:34:28 -04:00
Jon Szymaniak
19b1bd77a8 lms: Removed fields from lms_freq structure
freq_hz is not necessary; it can be quickly computed on the host side.

The VCO division ratio is only needed on the host side currently.
2015-06-18 18:34:28 -04:00
Jon Szymaniak
7a2d044f2e lms: Removed reference field from lms_freq structure
This is a compile-time constant, so a macro definition is used.
2015-06-18 18:34:28 -04:00
Jon Szymaniak
1d3d78d9f9 lms: Determine high/low band as part of pre-calculating tuning params
This alleviates the need for lms_set_precalculated_frequency() to know
the original frequency value; it just needs the precalculated
parameters.
2015-06-18 18:34:28 -04:00
Jon Szymaniak
edac278d8b lms: Expose function to pre-calculate tuning parameters 2015-06-18 18:34:28 -04:00
Jon Szymaniak
d2554d9e1b nios: PC simulation build fixes 2015-06-18 18:34:28 -04:00
Jon Szymaniak
d7f1908629 nios: Added nios retune packet format 2015-06-18 18:34:28 -04:00
Jon Szymaniak
a4c8cb8b52 libbladeRF, nios: Made LMS6002D code available to NIOS II
To allow the LMS6002D code to be build into the NIOS II code,
lms.c has been moved to fpga_common and its license has been
changed from LGPLv2 to MIT.

Currently, only the subset of functions required for
frequency tuning are used during a NIOS II build.
2015-06-18 18:34:28 -04:00
Renamed from host/libraries/libbladeRF/src/lms.h (Browse further)