Using 64 bit math is just way easier to read and
just as safe and precise.
Also cleanup random bits in that area
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
When you have something like:
if (bad_thing_happenned)
lms_printf("Panic !");
defining lms_printf to nothing creates a warning.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
There was two issues :
- Swap between the RX/TX GPIOs controlling the switch
- The proper LNA was not being selected inside the LMS
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
The formula used is a very crude quadratic approximation from the
3 data points given in the programming manual ... for something more
precise, we'd need a LUT. But it may vary with temp and device anyway.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Currently the sample rate is not read back from the si5338 and
reconstructed. For the time being, this value is cached in the the
device structure. However, this is a crappy workaround because this
value obviously won't persist, for example, upon
opening/closing/re-opening the CLI.
The VCTCXO DAC operations now have the same functionality as GPIO reads/writes.
The Nios core stores the least significant byte in a temporary variable and only
performs a write to the DAC when the most sigificant byte of the 16bit DAC value
is written to it by the host.
This commit does not address host endianness.
GPIO reads and writes can now 8 bits of the 32bit nios_gpio (GPIO register)
register at a time by subscripting into the register with the uart_cmd.addr
variable. addr 0 operates on the least significant byte, addr 1 operates on the
second least significant byte.
GNU Radio appears to utilize some RT signals, which was causing
bladerf_read_c16 to fail out. These calls now retry so long
as the only error encountered is EINTR.
A last_errno field has been added to struct bladerf to assist
in debugging. We may want to either remove this or make it
(and its accesses/updates) conditionally compiled.
The value of x was being returned as 0 when the FPGA was either not
loaded or when the LMS was still in reset. Catch this condition and
return back an invalid parameter.
Credit where credit is due -- All the code here is basically
copy/paste from Robert's earlier test code, with some added error
checks and debug output.
The firmware loading now checks the write return value and
performs partial writes as needed.
Items that need to be revisited are the sanity checks on file
sizes. In the future I plan to implement a "bladeRF Image" format
that will wrap size and a hash around a firmware/bitstream. These
checks will probably go into that code.
This commit introduces LMS library support for controlling the LimeMicro
LMS6002D transceiver. The LMS library functions were originally developed by
bpadalino.
This is the first commit in a set of upcoming changes that will
move functionality from simple_load and upgrade_firmware into the
libbladeRF library and provide access to these routines through a
bladeRF cli.
Don't merge from jon-dev until I get this straightened out, or
you'll be left with something possibly unusable...
Fixed bladerf_get_device_list return value for condition where no
devices are attached. (Now returns 0, previously returned -1).
Also added a missing catch of a malloc failure and now return appropriate
error value.
Jon's TODO items in the following commits will include:
- Implementing the init/deinit functions
- Implementing the device info and programming functions
- Integrating ../app items into this lib
- Adding libbladerf support to gr-osmosdr