hdl: nios: devices_rfic: add a standby initialization state
this will be used to indicate that the board is not actively
being driven, but is still initialized and ready to go
improve debugging output
enforce a hard reset at the start of initialization
hdl: nios: devices_rfic: perform init/tuneup on FPGA
Move some of the initialization tasks, previously done on the host and
forwarded up, to the Nios.
Also wee bit of refactoring/cleanup.
hdl: nios: devices_rfic: implement frequency invalidation
when doing a retune via direct SPI writes, libad936x's idea of state is
totally destroyed until the next time a "normal" retune is performed.
hdl: nios: pkt_retune2: inval freq on profile_activate
After doing direct SPI fastlock activities, _rfic_cmd_rd_freq can no
longer provide a valid answer until the next _rfic_cmd_wr_freq. Signal
to the RFIC driver that this has happened, so it can govern itself
accordingly.
p->spdt was not being shifted into the right place, so the SPDTs
were not being properly set on a retune
also reference the magic numbers back to bladerf2_common.h
hdl: nios: implement a queuing strategy for RFIC commands
hdl: devices_rfic: all writes now go to queue
hdl: devices_rfic: move queue stuff into its own file
hdl: devices_rfic: cleanup includes, etc
hdl: devices_rfic: debugging improvements...
hdl: devices_rfic: code cleanup/formatting/streamlining
hdl: devices_rfic: track return value of queued jobs
stores a .rv member in the queue entry struct, then copies that to the
queue's .last_rv member at job completion.
standardizes _rfic_command_write_init args for future
function-pointerization.
hdl: devices_rfic: use function pointers
hdl: devices_rfic: remove inline hint, log_error->DBG
hdl: devices_rfic: swap read/write in rfic_command_fns for consistency
hdl: nios/devices_rfic: move stuff into a state struct
hdl: nios/Makefiles: dont build devices_rfic* on bladerf1
devices_rfic.c: remove stubs
devices_rfic.c: formatting
devices_rfic.h: only include if required
pkt_16x64: guard around bladerf2
pkt_16x64: more guards
pkt_16x64 brf2 guard tweak
pkt_16x64.h: guard the PKT_16x64 define
hdl: nios: devices_rfic: implement INIT command
hdl: devices_rfic: de-assert txnrx/enable
hdl: devices_rfic: move init read to its own fn
hdl: nios: devices_rfic: implement FREQUENCY command
hdl: nios: use shortened _rffe_*_enabled fn names
hdl: nios: devices_rfic: implement STATUS command
hdl: devices_rfic: implement RFIC status register
hdl: nios: implement _rfic_command_read_status
hdl: nios: devices_rfic: implement SAMPLERATE command
hdl: nios: devices_rfic: implement BANDWIDTH command
hdl: nios: devices_rfic: implement GAINMODE command
hdl: nios: devices_rfic: implement GAIN command
hdl: nios: devices_rfic: implement ENABLE command
hdl: nios: devices_rfic: implement RSSI command
hdl: nios: devices_rfic: use new common #defines
hdl: nios: devices_rfic: implement FILTER command
hdl: nios: devices_rfic: implement TXMUTE command
fpga_common: nios: stub out NIOS_PKT_16x64_TARGET_RFIC
fpga_common: add a status register for RFIC control
fpga_common: add 16x64 RFIC status register bit
fpga_common: add NIOS_PKT_16x64_RFIC_TXMUTE target addr
fpga_common: add RSSI readback shifts/masks
fpga_common: clean up old RFIC cmd defines from pkt_16x64
fpga_common: only build bladerf2_common if required
this is distinct enough from platform_bladerf2 that it's worth splitting
it off
thirdparty: adi/brf2_hl: use multiply for msec->usec conversion
This is slightly more accurate than shifting by 10, and matches other
msleep() implementations.
thirdparty: adi: make config.h platform-specific (bladerf2_headless)
thirdparty/adi: disable split gain tables, verbose logging on nios
thirdparty: adi/brf2_hl: run clang-format on these files
they're new on this branch, so i can do this :)
thirdparty: adi: brf2_hl: reduce ad9361 logging
thirdparty: adi: rm vestigial params.c (bladerf2_headless)
During the recent refactor, the RFIC FIR filter functions got
wrapped in a MUTEX_LOCK. This is incompatible with their use
by bladerf2_set_sample_rate, which is called within a MUTEX_LOCK.
🤦♀️
- Add tutorial for command-line GDB debugging for those who want to avoid eclipse.
- Add debugging tips (increasing timeouts, disabling compiler optimization)
General documentation cleanup, function name adjustments, merging of
redundant structures, etc.
fpga_common/ad936x_helpers:
Contains wrappers for AD936x RFIC functionality.
fpga_common/bladerf2_common:
Contains bladeRF2-specific helper functions and constants.
fpga_common/ad936x_params:
Reformat (no more tabs, phew)
Move ina219 shunt const to bladerf2_common
host/common/range:
Move functions and macros for handling bladerf_range structs
../libbladeRF/include/bladeRF2.h:
Explicitly index RX/TX FIR enums
Update references to ad936x_params.c
../libbladeRF/src/board/bladerf2/common:
New macros for boilerplate:
- WITH_MUTEX: wrap around locked blocks
- CHECK_STATUS: calls function, checks return code
- CHECK_AD936X: calls function, checks return code, translates
from AD936x to libbladeRF error codes
- CHECK_*_LOCKED: above, but unlocks mutex before erroring
- NULL_CHECK: checks a var for null
Move helper functions into here
../libbladeRF/src/board/bladerf2/bladerf2.c:
Use new macros
Code style fixes
Remove redundant code
Try to load bladeRF2 fast lock profiles into the RFFE as the scheduled
retune requests are enqueued. This has the potential to speed up retune
times because the profile will be ready before the request goes 'live'.
The '-fshort-enums' optimization will tell GCC to pack enums into the
smallest data type it can instead of defaulting to 32 bits. This means
most enums will be packed into 8-bit data types, saving some
memory. On newer processors, 8-bit data access can be slower than
32-bit or 64-bit accesses, but that should not be a problem on something
like the Nios.
Clear out any scheduled retunes that may exist in the Nios during
bladerf2_open() and bladerf2_close(). This helps prevent unexpected
behavior if the device is (re)opened later.
Wrap bladeRF1-only gain functions around a conditional so they are not
executed on bladeRF2 boards.
This commit is intended to be a stopgap to get the quick tune tests to
build and function on bladeRF2 devices. A follow-up commit using the
more generic 'system gain' functions would be optimal.
Add support for any number of retune frequencies and spacing of these
frequencies.
Limitation: this test program does not support command arguments (never
has), so the number of frequencies, frequency spacing, and center
frequency must be set in the code before building.
Let libbladeRF handle the quick tune profile numbering for bladeRF2
devices. This makes it so that existing bladeRF1 applications using the
quick tune feature should "just work" with bladeRF2.