Commit graph

1,372 commits

Author SHA1 Message Date
Rey Tucker
e4efdca3a4 host: misc/arch: update for FPGA v0.7.1, fw v2.0.0 2017-12-08 13:29:47 -05:00
Rey Tucker
0f84cc76af
Merge pull request #531 from Nuand/rtucker-host-fix-versioninfoextra
host/cmake: fix regression from #511
2017-12-08 11:35:12 -05:00
Robert Ghilduta
df369b01f4 libbladeRF: bump API version and add changelog for v1.9.0 2017-12-07 21:26:28 -08:00
Robert Ghilduta
339258d56e bladeRF-cli: changelog and bump version to v1.5.1 2017-12-07 21:11:51 -08:00
Robert Ghilduta
327e556e6a libbladeRF: bump libbladeRF version to 1.9.0
Version 1.9.0 now supports bladeRF.conf config options.
2017-12-07 21:07:08 -08:00
Robert Ghilduta
0ba3404c6f Enable config option parsing and parameter setting when the device is opened 2017-12-07 20:34:34 -08:00
Robert Ghilduta
dd604c15bf Add config option handlers for several keys
This commit adds handlers for the following config option keys:
fpga          - fpga file to load
frequency     - set frequency
samplerate    - set integer samplerate
bandwdith     - set bandwidth
agc           - enable or disable AGC
gpio          - set GPIO register value
sampling      - set internal or external sampling
trimdac       - set trimdac value
vctcxo_tamer  - set vctcxo tamer method

These options can be declared in a local or global bladeRF.conf. Square brackets
can used to restrict certain options by FPGA size and serial number.

Example bladeRF.conf file:

fpga /home/user/hostedx40.rbf
trimdac 592
frequency 2.4G

[*:serial=0be673dceaf87623dbefa412ecad6783]
frequency 2.4G
samplerate 20M
2017-12-07 20:34:34 -08:00
Robert Ghilduta
a39a81d700 Add config option file parsing capabilities
This commit adds functions that parse config option files
2017-12-07 20:34:34 -08:00
Robert Ghilduta
68bf8e231a Add string parsing functions
The line to argumenet parser uses a two pass approach. The first pass
finds beginning and end of arguments, and counts the number of quotes.
The second pass copies the characters into the argument buffers.
2017-12-07 20:34:33 -08:00
Robert Ghilduta
82c424cc8c Add string manipulation functions 2017-12-07 20:34:33 -08:00
Robert Ghilduta
38664eaa10 Add bladeRF and libbladeRF specific look-ups and conversion 2017-12-07 17:10:28 -08:00
Robert Ghilduta
579199768c Cleanup files to add options file parser 2017-12-07 17:10:28 -08:00
Robert Ghilduta
dccc4edc2f Filenames are starting to become ambiguous without full pathnames 2017-12-07 17:10:28 -08:00
Robert Ghilduta
3a6742b716 Remove unused CMake macro file 2017-12-07 17:10:28 -08:00
Rey Tucker
a7b2445d87 host/cmake: fix regression from #511
We explicitly set VERSION_INFO_EXTRA to "" for release builds, which
causes (${VERSION_INFO_EXTRA} STREQUAL "") to evaluate to
( STREQUAL ""), a syntax error.

Quoting ${VERSION_INFO_EXTRA} should not cause the ambigious condition
foretold in CMP0054, so doing that.
2017-10-24 16:15:22 -04:00
Rey Tucker
6116d09049 libbladeRF: add compilation hint to boilerplate.c
h/t owen on IRC
2017-08-09 10:58:08 -04:00
Rey Tucker
1d41ada308 Merge pull request #525 from Nuand/rtucker-issue-511
host/CMakeLists: dequote variables in ifs (CMP0054) #511
2017-08-07 18:18:17 -04:00
Rey Tucker
b8f3cb8315 Merge pull request #524 from Nuand/rtucker-issue-447
host/README.md: add pthreads-win32 build instructions (#447)
2017-08-07 18:17:32 -04:00
Rey Tucker
155cd5266d Merge pull request #522 from Nuand/rtucker-issue-475-clean
CyAPI: Define Windows 10 support, fail gracefully if missing (#475)
2017-08-07 18:17:00 -04:00
Rey Tucker
33da458132 host/cmake/CyAPI: define Windows 10 support
This requires that the user get special additional drivers in addition
to the ones provided by the usual SDK; a URL will point in the right
direction.

Note that this does not remove the requirement for driver signing.  Some
work will be needed to document how to do this.
2017-08-07 18:09:30 -04:00
Jon Szymaniak
70d5fb14b2 libbladeRF: Treat incompatible OS version as "not found" in FindCyAPI.cmake 2017-08-07 18:08:34 -04:00
Rey Tucker
a075d0149b host/CMakeLists: dequote variables in ifs (CMP0054) #511
Per CMake Policy CMP0054, the meaning of constructs like

if("${FOOBAR}" STREQUAL "quux")

is ambigious, and the old meaning is deprecated.

https://cmake.org/cmake/help/git-stage/policy/CMP0054.html
2017-08-07 12:27:21 -04:00
Rey Tucker
8cec8d03dd host/libbladeRF/cyapi: ReleaseMutex before CloseHandle
When working on mutexes for the libusb backend, I noticed that I needed
to ReleaseMutex() when closing the device, or else that device would not
be usable again until all of the mutexes were released.

I have not tested this with CyAPI as yet, but I believe the same problem
will occur, and I also believe this may fix it.
2017-08-07 11:35:16 -04:00
Rey Tucker
880f195e90 host/libusb.c: properly release/close handles 2017-08-04 18:00:34 -04:00
Rey Tucker
72322089c6 host/libusb.c: fix create_device_mutex errors (#484)
This builds and correctly enforces exclusive access under Windows 10.
2017-08-04 17:17:29 -04:00
Rey Tucker
daab20341f host/backend/libusb: enforce exclusive access (#484)
Windows seems to allow multiple instances of libbladeRF to open the same
device, which is problematic in many ways.  This borrows the mutex
approach from cyapi.c to enforce exclusivity.
2017-08-04 16:44:30 -04:00
Rey Tucker
bafb0b5ca0 host/cmake: search for pthreadVC2.dll more vigorously (#517)
With the pre-built binary pack, pthreadVC2.dll lives in a
dll/${ARCHITECTURE}/ directory.  However, when compiling from scratch,
it just lives in the source code's root directory.  Look in both places
and set a LIBPTHREADSWIN32_DLL variable accordingly.
2017-08-04 16:07:49 -04:00
Rey Tucker
f680b9ba8c host: dc_calibration.c: fix int conversion in rx_cal_dc_off (#515)
MSVC warns of loss of precision on implicit conversion from float to
int16_t.  Instead of relying on truncation, do a proper round with
bounds-checking.
2017-08-04 15:21:22 -04:00
Rey Tucker
5ba6482ed1 Merge pull request #514 from Nuand/rtucker-issue-512
host/usb.c: add missing set_agc_dc_correction handler (#512)
2017-08-04 14:10:03 -04:00
Rey Tucker
db18fd308c host/usb.c: add missing set_agc_dc_correction handler
backend_fns_usb_legacy was missing a .set_agc_dc_correction member,
which causes issues with some compilers.  Stubbed in
set_agc_dc_correction_unsupported.
2017-08-04 14:07:16 -04:00
Rey Tucker
70cc0a0020 Merge pull request #513 from Nuand/rtucker-issue-508
macOS: detect clock_gettime presence directly, instead of inferring from version (#508)
2017-08-04 13:50:30 -04:00
Rey Tucker
2665f90649 host/README.md: add pthreads-win32 build instructions (#447)
On recent versions of Windows / Visual Studio, struct timespec is
already defined, and the definition is subtly different than what
pthreads-win32 is built with.

It may be possible to handle this in a more automatic fashion via CMake,
but this is TBD.
2017-08-04 13:40:37 -04:00
Rey Tucker
236753aaea clock_gettime.c: remove HAVE_CLOCK_GETTIME check
This is not necessary due to the fact that cmake only includes this file
if clock_gettime is missing in the first place.
2017-08-03 10:56:17 -04:00
Rey Tucker
5ba5f16221 clock_gettime.h: include host_config.h 2017-08-02 19:25:49 -04:00
Rey Tucker
786c3cc001 Merge pull request #507 from Nuand/rtucker-debian-fiximgperms
Fix permissions on downloaded FPGA/firmware images in debian package
2017-08-02 17:52:18 -04:00
Rey Tucker
63c5be3105 host: add note about Fedora and /usr/local (#490) 2017-08-02 17:34:52 -04:00
Rey Tucker
0779109841 host: explicitly test for clock_gettime (#508)
Instead of using version-based guessing on macOS (which appears to fail
with newer versions of Xcode on older versions of macOS), use an
explicit test for clock_gettime in CMake.
2017-08-02 15:02:38 -04:00
Rey Tucker
037e2886f2 udev: fix CMakeLists syntax error (#509) 2017-08-01 15:29:56 -04:00
Rey Tucker
7544c671b2 libbladeRF: more descriptive error on file_read_buffer failures
In the event that file_read_buffer fails, print a more useful error
message to make it easier to track down the problem
2017-07-25 15:40:45 -04:00
Robert Ghilduta
2ce14de630 libbladeRF: fix GCC 7 error
GCC 7 rightfully believes that this buffer can be 11 bytes long. Counting the
additional NULL byte, this buffer should be at least 12 bytes in size.
2017-07-06 08:27:47 -07:00
Robert Ghilduta
dcc7647fef bladeRF-cli: changelog and version bump ( v1.5.0 ) 2017-07-06 08:27:47 -07:00
Robert Ghilduta
fe718e8f70 bladeRF-cli: add AGC print and set commands
The AGC can be enabled by running set agc on, and it can be disabled by running
set agc off.
2017-07-06 08:27:47 -07:00
Robert Ghilduta
1434ae89b8 libbladeRF: Updated to v1.8.0
libbladeRF v1.8.0 introduces support for the Automatic Gain Control.
2017-07-06 08:27:47 -07:00
Robert Ghilduta
ebecc847da libbladeRF: only enable AGC when it is supported
The AGC depends on a newer DC cal table and FPGA version 0.7.0 being loaded. A
DC cal table version of 2 or greater is also required for the AGC to work.
2017-07-06 08:27:47 -07:00
Robert Ghilduta
f1ef088f2b libbladeRF: add gain_mode settings to control AGC
bladerf_set_gain_mode() and bladerf_get_gain_mode() were added to allow for
control of the bladeRF's AGC.
2017-07-05 08:59:09 -07:00
Robert Ghilduta
905c65c2a5 libbladeRF: add AGC GPIO bit
Bit 12 controls the AGC
2017-07-05 08:59:08 -07:00
Robert Ghilduta
e7fb00c683 bladeRF-cli: add cal table agc rx functionality 2017-07-05 08:59:08 -07:00
Robert Ghilduta
b31d4e6d5c bladeRF-cli: print verbose output for DC LUT calculation 2017-07-05 08:59:08 -07:00
Robert Ghilduta
53a698fde2 libbladeRF: introduce support for BLADERF_CAP_AGC_DC_LUT (FPGA v0.7.0) 2017-07-05 08:59:08 -07:00
Robert Ghilduta
7aff155a97 libbladeRF: add gain specific mean errors to DC calibration table
The DC calibration table will now include mean residual errors for 3 different
gains (that will be used by the AGC amont other things) including:
    Max : LNA=6dB, RXVGA1=30dB, RXVGA2=15dB
    Mid : LNA=6dB, RXVGA1=30dB, RXVGA2= 0dB
    Low : LNA=3dB, RXVGA1=12dB, RXVGA2= 0dB

The DC cal table version has been bumped to 2. This commit will allow backward
compatibility with existing DC cal tables.
2017-07-05 08:59:08 -07:00