Commit graph

20 commits

Author SHA1 Message Date
Frank Jenner
3655b3d516 Added variable-level logging mechanism
Added a mechanism to log messages with different priority levels, and to
filter which messages are output by setting a threshold level. The
function to set the current log level/verbosity is exposed through
libbladeRF.h, while the logging function/macros themselves are private
to this project, and are present in log.c/log.h. Callers should use the
convenience macros bladerf_log_[level]() to issue their log messages.
These macros piece together a format string that contains the message
priority and, for warning and higher priorities, the function and line
number on which the message was logged. Also, warning level and higher
level messages are output to stderr, rather than stdout.
2013-09-02 15:39:41 -04:00
Brian Padalino
826b5888fe libbladeRF: First stab at DC offset calibration.
Some users have shown large DC offsets.  I've seen these offsets
initially but they become much more reasonable after the first
few sample buffers come out of the FPGA.

Currently DC offset appears to be +/-30 or so after running
the calibration.

In the cli, run 'cal' to run through all modules of calibration.
2013-09-01 15:57:15 -04:00
Brian Padalino
4d8312b59b libbladeRF: Add API to change the ADC sampling location.
The ADC can be configured to sample from the internal inputs
or from the external pins.  Adding the API to change the sampling
between internal and external.  Also using the appropriate API
function for the CLI.
2013-08-28 23:48:53 -04:00
Jon Szymaniak
b82952687e libbladeRF: Cleaned up a few items and issues in OTP/cal readback.
This addresses some invalid accesses reported by valgrind. However, a few issues remain:
  - Accessing calibration data on a 2.0 port causes an invalid access
  - The libusb backend's implemation of open() will need to be
  refactored in order to support matching on serial numbers.
2013-08-27 00:07:13 -04:00
Jon Szymaniak
e5b8f42279 Fixed misc. (nonfunctional) typos 2013-08-26 20:06:46 -04:00
Robert Ghilduta
10ffba1b39 Add device reset functionality
This commit adds the much needed device reset functionality that allows the
device to reset after an upgrade and start running the new firmware.
2013-08-25 18:21:07 -07:00
Robert Ghilduta
33957f17c1 libbladeRF: cache calibration and OTP data reads
This commit caches the caclibration and OTP data reads, and performs them when
the USB device is "open()"ed.
2013-08-25 18:21:01 -07:00
Jon Szymaniak
439e099b01 libbladeRF: Renamed configuration GPIO read/write functions
Renamed to avoid confusion with expansion board GPIO routines that
will be added in the future.
2013-08-25 12:27:25 -04:00
Jon Szymaniak
792894c228 libbladeRF: [WIP] Changed API interfaces to use int instead of ssize_t.
This is intended to simplify some portability issues, since an int
type is sufficient in the few spots where we had ssize_t.

We'll need to still add a ssize_t wrapper around the Windows
[SSIZE_T](msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx#SSIZE_T)
for use inside the library.
2013-08-23 01:44:13 -04:00
Jon Szymaniak
c1de666afb libbladeRF: Touched up note about LOW_LEVEL routines. 2013-08-22 22:37:04 -04:00
Jon Szymaniak
6a76a4817e libbladeRF: Updated header file and documentation for async changes
Added check that # transfers <= # buffers in bladerf_stream(),
as this is noted in the interface documentation.
2013-08-22 22:28:06 -04:00
Jon Szymaniak
8cc9f2a4b5 libbladeRF: Cleaned up API enumerations and macro definitions.
The _t suffix on enums has been removed, as "_t" is reserved for
POSIX types.

To avoid naming collisions, macro definitions and enumeration values are
now prefixed with at least "BLADERF_".

Also in the mix is a stubbed out "unsupported" implementation of the
stream routines for the Linux driver backend.
2013-08-22 01:01:23 -04:00
Jon Szymaniak
32ec6d97ef libbladeRF: [WIP] Touched up error handling in libusb backend.
Added some memory allocation checks and attempts to tear down the
stream at the first sign of errors, avoiding submitting transfers
if intialization errors occurred. Also did some misc. error
code house keeping.

STREAM_ERROR has been removed. Use STREAM_SHUTTING_DOWN and the
bladerf_stream->error_code field to differentiate between a clean an
error-driven shutdown.

It appears that attempting to use the libusb backend before the FPGA is
loaded yields erroneous behavior when attempting to load the FPGA after
encountering a BLADERF_ERR_IO. (This situation requires a power on reset
of the board.) As such, an FPGA check has been added to the async test
program.
2013-08-20 00:11:22 -04:00
Brian Padalino
f349d209eb libbladeRF: [WIP] Fixed streams for both TX and RX.
Using libusb for streams of both TX and RX.  The example
tx_async test is now for both and wil save off samples
in CSV to a file.  The code still needs to be audited
before it can be brought down to the mainline.
2013-08-18 23:58:42 -04:00
Brian Padalino
5fc3284e2c libbladeRF: [WIP] Zero copy TX async interface. 2013-08-18 20:15:54 -04:00
Jon Szymaniak
456efcbd90 libbladeRF: [WIP] Updated a few fields.
Does not compile.
2013-08-18 16:30:05 -04:00
Brian Padalino
b926523b17 libbladeRF: [WIP] Updating test program. 2013-08-18 14:03:25 -04:00
Jon Szymaniak
29cabea762 libbladeRF: [WIP] Starting to re-work today's design. 2013-08-17 23:27:56 -04:00
Jon Szymaniak
bd4408a6e3 libbladeRF: [WIP] In the process of adding and testing tx stream.
Additionally authored by bpadalino.
This functionality is currently not working.
2013-08-16 23:56:28 -04:00
Jon Szymaniak
df05b174ec libbladeRF & bladeRF-CLI: Fixed build issues. Moved backend config info.
From henceforth, all backend selection should live in the
backend_config.h.in file, so backend.c or backend.h doesn't get muddied
with #ifdef's.
2013-08-13 23:44:42 -04:00