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.
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!
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).
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 copy previously was dereferencing symlinks, resulting in
copies of the library being installed. Asides from being terribly
undesirable, this also resulted in ldconfig warnings.
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.