* 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
The bladerf_{set,get}_gain functions are now reasonably hardware-independent.
On TX channels, setting a gain of 60 dB should result in a CW TX power of roughly 0 dBm.
On RX channels, 60 dB is the maximum gain level.
The ranges returned by bladerf_get_gain_range are adjusted to reflect this.
* devinfo: fix strncpy error
Fix two build errors on Arch:
/root/bladeRF/host/libraries/libbladeRF/src/devinfo.c:308:5:
error: ‘strncpy’ destination unchanged after copying no bytes
[-Werror=stringop-truncation]
/root/bladeRF/host/libraries/libbladeRF/src/devinfo.c:308:5:
error: ‘strncpy’ output truncated before terminating nul copying as many
bytes from a string as its length [-Werror=stringop-truncation]
* bladerf2/params: fix implicit conversion error
/root/bladeRF/host/libraries/libbladeRF/src/board/bladerf2/params.c:437:7:
error: implicit conversion from 'int' to 'int16_t' (aka 'short') changes
value from 32768 to -32768 [-Werror,-Wconstant-conversion]
32768, 0, 0, 0, 0, 0, 0, 0,
^~~~~
* Doxyfile: fix CLANG_ASSISTED_PARSING warning
fixes:
warning: Tag `CLANG_ASSISTED_PARSING' at line 1033 of file
`/root/bladeRF/build/host/libraries/libbladeRF/doc/doxygen/Doxyfile'
belongs to an option that was not enabled at compile time.
To avoid this warning please remove this line from your
configuration file or upgrade it using "doxygen -u", or recompile
doxygen with this feature enabled.
warning: Tag `CLANG_OPTIONS' at line 1041 of file
`/root/bladeRF/build/host/libraries/libbladeRF/doc/doxygen/Doxyfile'
belongs to an option that was not enabled at compile time.
To avoid this warning please remove this line from your
configuration file or upgrade it using "doxygen -u", or recompile
doxygen with this feature enabled.
* libbladeRF: fix doxygen build error
fixes:
/home/rtucker/dev/privatebladeRF/host/libraries/libbladeRF/include/libbladeRF.h:2284:
warning: unable to resolve link to `sync_tx_meta.html' for \link command
* bladeRF-fsk: fix clangscan warning
/root/bladeRF/host/utilities/bladeRF-fsk/c/src/correlator.c:261:59:
warning: The left operand of '/' is a garbage value
corr->ins1->real = corr->ins2->real = samples[i].i/2048.0f;
~~~~~~~~~~~~^
1 warning generated.
* fpga_common/lms.c: fix clangscan warning
/root/bladeRF/fpga_common/src/lms.c:2329:14: warning: 3rd function call
argument is an uninitialized value
status = write_vcocap(dev, base, f->vcocap, vcocap_reg_state);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
* test_repeated_stream: fix clangscan warning
/root/bladeRF/host/libraries/libbladeRF_test/test_repeated_stream/src/main.c:284:9:
warning: 1st function call argument is an uninitialized value
pthread_join(rx_thread, NULL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
* test_interleaver: fix clangscan warning
/root/bladeRF/host/libraries/libbladeRF_test/test_interleaver/src/main.c:119:17:
warning: 4th function call argument is an uninitialized value
snprintf((rowstr + rowidx), rowsize - rowidx, "%02x",
*u8buf++);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
* test_tx_gmsk_bursts: fix clangscan warning
/root/bladeRF/host/libraries/libbladeRF_test/test_timestamps/src/test_tx_gmsk_bursts.c:69:5:
warning: 2nd function call argument is an uninitialized value
printf(" Frequency: %u\n", s->frequency);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
* ad9361_api.c: fix clangscan warning
/root/bladeRF/host/libraries/libbladeRF/src/driver/thirdparty/adi/ad9361_api.c:445:3: warning: Value stored to 'ret' is never read
ret = -ENODEV;
^ ~~~~~~~
1 warning generated.
* correlator: another attempt to fix clangscan warning
* Revert "fpga_common/lms.c: fix clangscan warning"
This reverts commit 8cbb5f03f0d0927befa5053e9564df06d13ede72.
* test_interleaver: fixup clang-scan warning
some sloppy init, some messy iteration, the usual :)
/root/bladeRF/host/libraries/libbladeRF_test/test_interleaver/src/main.c:124:17:
warning: 4th function call argument is an uninitialized value
* Revert "ad9361_api.c: fix clangscan warning"
This reverts commit 14a7f8f53f84aeff721a752259ca9596a13e3a2a.
* bladeRF-fsk: fixup clang-scan warning fix
* host: libbladeRF: clang-format of bladerf.c
* host: libbladeRF: update apply_config_options
Update apply_config_options to use new semantics for channel specifiers
and range min/max determination
Also fix a couple typos
* host: libbladeRF/doc: fixup old channel references
* host: libbladeRF: fix typo of "bandwidth" cfg file key
* host: libbladeRF: add documentation for config files
* host: libbladeRF: config.c: minor typo fix
* host: libbladeRF_test: add test case for config file parsing
Creates a surrogate config file with a few different scope restrictions,
then makes sure the configuration is applied appropriately in the end.
- Hit redundant "Related Pages". This just lists what we have on the
main page.
- Renamed "Modules" to "API Sections"
- Removed "Data Structures". This just provided a redundant information
in an awkward manner.
- Removed "Files". This provided little value over just looking at
libbladeRF.h directly.
Prevent users from loading/flashing the incorrect FPGA image by checking
against the device's reported FPGA size. This was previously only
done (roughly) when writing the FPGA to flash.
Nuand's official bitstreams to not use compression; the FPGA sizes
are known to be specific sizes.
Those making customizations (e.g., enabling compression) may
use the BLADERF_SKIP_FPGA_SIZE_CHECK environment variable.
The main landing page in the Doxygen is now filled out with
some general information.
Existing examples have been simplified and moved to
dedicated pages that are linked to from the main page and
relevant sections of the documentation elsewhere.
Visual Studio 2013 now includes these headers, so they have
been moved as not to conflict (even though they are intended to
be equivalent.)
Our stdbool.h was providing an incorrect typedef; sizeof(bool)
should have been 1, not sizeof(int).
Per http://msdn.microsoft.com/en-us/library/tf4dy80a.aspx:
"In Visual C++4.2, the Standard C++ header files contained a typedef
that equated bool with int. In Visual C++ 5.0 and later, bool is
implemented as a built-in type with a size of 1 byte. That means
that for Visual C++ 4.2, a call of sizeof(bool) yields 4, while in
Visual C++ 5.0 and later, the same call yields 1. This can cause
memory corruption problems if you have defined structure members of
type bool in Visual C++ 4.2 and are mixing object files (OBJ) and/or
DLLs built with the 4.2 and 5.0 or later compilers."
The existing bladerf_sync_rx() snippet in the libbladeRF API docs has
been replaced by a more complete snippet in libbladeRF/doc/examples.
From now on, major snippets and examples to be included in
Doxygen-generated documentation shall now be placed in the
libbladeRF/doc/examples directory, and must be buildable and testable.
The Doxygen "snippet" command to shall be used to include the relevant
code from the example program.
libbladeRF: [WIP] Use a simple delay to wait for TX samples in example
The sync interface has been re-implemented atop the existing
asynchronous interface. This is currently opt-in and only enable when
pthreads support is enabled and available.
Some clarifications have been made in the API documentation,
specifically in the explanations of the various stream parameters.
The bladerf_set_transfer_timeout and bladerf_get_transfer_timeout have
been named more appropriately, as these control stream transfer
timeouts, as opposed to all transfers.
The function to create cal data now is a wrapper around
bladerf_alloc_image() which initializes the returned image with
calibration data.
The associated CLI command now allows this to be either written to a
file or to the device directly.
API header cleanup: Pushed the lower level functions to to the end of
the header, so the functions people will use more frequently will be at
the top of the generated documentation.
Also added a missing API_EXPORT and made the Doxygen color scheme a little
more blue. (Tired of grayscale ;) )
Windows cleanup: Added get_timestamp() implementation, cleaned up
warnings, address some portability issues.