Commit graph

87 commits

Author SHA1 Message Date
Brian Padalino
14657308d6 cli+lib: TX/RX interface changes. 2013-08-04 22:18:06 -04:00
Jon Szymaniak
79a8bccb60 libbladeRF: [WIP] Fixed use after free in libusb backend error handling 2013-08-04 21:56:57 -04:00
Brian Padalino
460fd4d672 cli+lib: [WIP] libusb and cli changes.
Currently the FPGA loads and register reads/writes work.

Need to get samples sending/receiving.
2013-08-04 21:51:59 -04:00
Jon Szymaniak
12e6a024d9 libbladeRF: [WIP] Added driver workaround in FPGA loading 2013-08-04 21:38:13 -04:00
Brian Padalino
cb7766d1bd backend/libusb: Open and close now works. 2013-08-04 19:44:07 -04:00
Jon Szymaniak
f8b555c733 libbladeRF: [WIP] File read output params now updated. 2013-08-04 17:29:41 -04:00
Jon Szymaniak
c6258c4b6e libbladeRF: [WIP] Moved devinfo match routines to bladerf_priv 2013-08-04 16:36:13 -04:00
Jon Szymaniak
7766af1880 libbladeRF: [WIP] Moved a few snippets from linux backend to top level. 2013-08-04 14:10:52 -04:00
Jon Szymaniak
82a47b2a4a libbladeRF: Implemented & stubbed out part of linux backend open() 2013-08-03 03:02:56 -04:00
Jon Szymaniak
6157f564ac libbladeRF: [WIP] Fixed str2devinfo and test.c bugs 2013-08-03 02:26:06 -04:00
Jon Szymaniak
53b7e3d763 libbladeRF: [WIP] Tweak naming of device identifier routine(s) 2013-08-03 01:50:13 -04:00
Jon Szymaniak
c323fb553d libbladeRF: [WIP] First cut at path from top-level to backend opens
Nightly check-in. This currently fails to run - there's likely
a number of assertion failures and segfaults to address.
2013-08-03 01:23:03 -04:00
Jon Szymaniak
1c13addd1d libbladeRF: [WIP] Planned bladerf_open out, misc interface cleanup. 2013-08-02 21:27:25 -04:00
Jon Szymaniak
103c7214d2 libbladeRF: [WIP] Added file_ops.c/h
Common file operations will be tucked in here to allow them to
be easily dummied out for NIOS build without making a mess of
bladerf.c.
2013-08-02 21:25:54 -04:00
Jon Szymaniak
e12fcbf347 libbladeRF: [WIP] header file cleanup 2013-08-02 19:59:47 -04:00
Jon Szymaniak
f4102152ce libbladeRF: [WIP] Moved liblms.h items to private lms.h
The top-level, public interface is now libbladeRF.h. Depedencies
should now only flow downward, with lms.c/h depending on
libbladeRF.
2013-08-02 19:39:57 -04:00
Jon Szymaniak
d494c61f5b libbladeRF: [WIP] Stubbed out calls that need to be implemented 2013-08-02 01:04:52 -04:00
Jon Szymaniak
e277b9b15e libbladeRF: [WIP] Further file renaming 2013-08-01 23:49:00 -04:00
Jon Szymaniak
c3019016c6 libbladeRF: [WIP] Refactored Linux driver backend now compiles.
A number of XXX's and TODO's need to be addresses, as this is
not yet functional.
2013-08-01 22:04:02 -04:00
Brian Padalino
2a73ceb3ec lib: [WIP] Builds but functionality needs checking.
Major overhaul of driver structure has been changed to support
better library versus platform separation.
2013-08-01 02:15:17 -04:00
Brian Padalino
633ea2dfa7 lib: [WIP] Heavy modification to separate out linux specific code. 2013-08-01 02:15:17 -04:00
Jon Szymaniak
b3f442c01c [BROKEN] Fixed typo in bladerf_libusb.h 2013-08-01 01:57:14 -04:00
Jon Szymaniak
e3566e4249 [BROKEN] Added remaining fns to libusb support. (Untested) 2013-08-01 01:41:30 -04:00
Jon Szymaniak
bcbca049ac [BROKEN] Stubbed out remaining routines in libusb support 2013-08-01 00:38:48 -04:00
Jon Szymaniak
01e9812eb7 lib: [Broken] Added fpga programming routines to libusb support 2013-07-31 23:46:30 -04:00
Jon Szymaniak
70a628fc3d lib: Typo fix in LMS register access
Function call was missing a device handle argument
2013-07-26 00:37:09 -04:00
Brian Padalino
183518d4fb lib: Do not want to enable the modules via pins until we're ready to do something with them. 2013-07-25 23:49:16 -04:00
Brian Padalino
51a3905881 kernel: Remove some breaks which were causing issues.
lib: Add some device initialization after the FPGA is loaded.
2013-07-25 23:39:50 -04:00
Jon Szymaniak
807007f193 libbladeRF: Cleand up gpio_* return values and remove a few printf()'s 2013-07-25 21:43:06 -04:00
Jon Szymaniak
9828c91201 CLI: Typo fixes in comments from previous commit 2013-07-25 10:02:25 -04:00
Jon Szymaniak
cf8336c159 CLI: Added missing bladerf_enable_module() implementation
This routine is used to enable/disable the RX/TX on the LMS,
and should be used instead of the gpio_* routines.

All calls that are not prefixed with bladerf_* will be removed
and replaced with more appropriate interfaces in the near future.
2013-07-25 10:01:00 -04:00
Jon
e40e0898fb libbladeRF: Fixed typos introduced in previous commit
The patch applied as f6018c14d9 wasn't
intended to be merged. This cleans up said patch and touches
up surrounding documentation a bit.

This compiles but is untested as I don't currently have access to
hardware. (Just wanted to ensure the build isn't left broken all day!)

My apologies if this inconvenience anyone!
2013-07-24 10:14:59 -04:00
Jon
f6018c14d9 libbladeRF: change to using BLADERF_GPIO_FEATURE_HW macro
Minor clean up.
2013-07-24 02:53:15 -07:00
Robert Ghilduta
8d9ed972ca fix HS buffering
This commit defines nios_gpio(7) as the GPIF buffer size control signal. The FX3
firmware makes the DMA engine operate on GPIF buffers that are twice the size of
the maximum sized URB. Since this is speed dependent, bladeRFs operating in HS
will have their GPIF DMA controllers only read 1024 bytes of data (512*2)
instead of 2048 (1024) as is expected when the device is in SS mode. To fix
this, the driver tells the library when a device is HS, the library then s the
nios_gpio bit that causes the FPGA to limit itself to only reading/writing to
the 32bit GPIF for 256 cycle at a time (instead of 512 cycles at SS).
2013-07-22 03:45:40 -07:00
Sylvain Munaut
718210ba9a lib/lms: Add a function to convert a lms_freq struct to frequency in Hz
... and use it.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-07-21 22:10:34 +02:00
Sylvain Munaut
f27f71c7f9 lib/lms: New VCOCAP search algorithm
Seems more resilient to errors than the previous one.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-07-21 13:38:20 +02:00
Sylvain Munaut
c658692e25 lib/lms: Clean up of the PLL parameters setting
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>
2013-07-21 13:37:03 +02:00
Sylvain Munaut
ce22ce2611 lib: Avoid warning in lib when using lms_printf in 'if'
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>
2013-07-21 13:30:48 +02:00
Sylvain Munaut
65a9715666 lib: Fix band selection
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>
2013-07-21 12:52:51 +02:00
Sylvain Munaut
1efc77b1f5 lib: Fix TXVGA2/RXVGA2, avoid casting (int*) to (uint8_t *)
Not everyone is little endian !

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-07-20 19:29:05 +02:00
Sylvain Munaut
3ca91833f9 lib: Fix RXVGA1 set/get to convert from dB to raw value
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>
2013-07-20 19:28:18 +02:00
Jon Szymaniak
4806ccdf52 lib: Added temporary workaround for not being able to read sample rate
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.
2013-07-18 09:10:48 -04:00
Brian Padalino
3cddc493cc linux: Fixed some typos an added some URLs. 2013-07-17 00:33:13 -04:00
Brian Padalino
a1477e6bae linux: README files updated. 2013-07-17 00:26:01 -04:00
Jon Szymaniak
a1bd7a2b22 libbladeRF: Fixed 'make install' target to copy symlinks correctly.
The copy previously was dereferencing symlinks, resulting in
copies of the library being installed. Asides from being terribly
undesirable, this also resulted in ldconfig warnings.
2013-07-16 23:06:24 -04:00
Brian Padalino
2aed383bc7 cli: Set frequency bounds checking.
lib: Add band selection when setting frequency.
2013-07-15 00:30:30 -04:00
Rob
24455aa55f hdl: driver: add subscripted VCTCXO read/write support
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.
2013-07-07 18:35:04 -07:00
Rob
e892db1aaf hdl: driver: change GPIO register size to 32 bits
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.
2013-07-07 18:20:45 -07:00
Jon Szymaniak
21e44fc710 libbladeRF: Fixed send/read_c16 size defect.
This defect was introduced in cf3ef1d0fa0bd67f487e5e1535067966ef91046
and results in truncated reads and writes.
2013-07-06 21:24:33 -04:00
Jon Szymaniak
6ff54e7399 libbladeRF: Updated doxygen comments to reflect send/read_c16 changes 2013-07-06 14:14:24 -07:00