413 Commits

Author SHA1 Message Date
Michael Ossmann
a2b2728234 Implement bias tee with radio registers 2026-02-20 11:31:06 -05:00
Michael Ossmann
b1bfc246bf Do not apply radio configuration inside ISRs 2026-02-20 11:30:50 -05:00
Michael Ossmann
b4041dd550 Add radio register access from host 2026-02-20 11:29:18 -05:00
Michael Ossmann
547a851fba Store radio configuration in register banks 2026-02-20 11:28:56 -05:00
Michael Ossmann
d60ebc2781 Add clock generator power supply start-up comments 2026-02-20 11:28:15 -05:00
Michael Ossmann
72a96a77f8 Call a sample rate a sample rate
Previously we used "sample rate" to mean a rate that is twice the sample
rate in several places in firmware.
2026-02-20 11:28:15 -05:00
Michael Ossmann
f6be9d54f1 Merge pull request #1669 from martinling/delay
Firmware: Move delay functions, add M0 version of `delay_us_at_mhz`.
2026-02-09 12:44:34 -05:00
Martin Ling
afb6d1372f Move delay functions out of hackrf_core. 2026-02-06 18:29:54 +00:00
Martin Ling
ead77b91cf Always use void argument type for functions taking no arguments. 2026-02-06 17:30:56 +00:00
stafur
1ee45eaaa2 Toolchain 9.2.1 support fix (#1666)
Added -B arm flag to firmware/hackrf_usb/CMakeLists.txt to support builds with v9.2.1 toolchains.
2026-02-05 11:36:56 -05:00
Michael Ossmann
3233cd56cf Set USB API version to 1.10 2026-01-29 22:19:42 -05:00
Martin Ling
f4e120e50d Test RFFC5072 PLL lock during startup. 2026-01-26 19:00:53 +00:00
Martin Ling
46a9a6e881 Fix clock generator initialisation on rad1o.
On the CCC 2015 rad1o badge, the Si5351C clock generator is powered
by the RF section supply (named VDD on the schematic).

So clock_gen_init() must be called after enable_rf_power().

Since the Si5351C is off when the RF power is off, there should be
no need for the shutdown/init calls at startup.
2026-01-06 16:35:12 +00:00
Michael Ossmann
0ab032c4fc Rename hw_sync to trigger
Replace hw_sync_mode_t with bool.
2025-12-30 20:10:10 -05:00
Michael Ossmann
980c87417e Clean up compiler warnings 2025-12-30 18:07:18 -05:00
Antoine van Gelder
3faf82ede6 firmware: move fpga selftest to a separate file to resolve blinky linker issues 2025-12-19 16:10:15 +02:00
Antoine van Gelder
4e90ee5c51 firmware: add register definitions for standard fpga bitstream 2025-12-19 16:10:15 +02:00
Michael Ossmann
2aaa2213c9 Ensure clock generator off before turning on
Do not try to activate clock generator if power supply is disabled on
Praline.
2025-12-17 09:54:24 -05:00
Michael Ossmann
d36805da4e Activate Praline FPGA and RF supplies selectively
Do not turn them on if running from RAM
2025-12-16 21:55:37 -05:00
Michael Ossmann
6f862a1349 Add pin_shutdown()
Portions of pin_setup() that establish a safe, low-power state are moved
into the new pin_shutdown(). Use pin_shutdown() to prepare for sleep or
reset or prior to calling pin_setup().
2025-12-16 21:52:53 -05:00
Michael Ossmann
1925e5908a Merge pull request #1615 from mndza/xcvr-loopback-extended
Extend self-tests
2025-12-13 11:05:12 -05:00
mndza
d8fa93dcda Add FPGA SPI test 2025-12-11 18:22:17 +01:00
mndza
c7cf262486 Add skipped and timeout states as possible results for self-tests 2025-12-11 12:48:43 +01:00
mndza
86850fa14f Extend transceiver loopback self-tests 2025-12-05 09:44:42 +01:00
Antoine van Gelder
db73ecbf5b firmware: fix zlp bug when IN transfer length falls on a packet boundary 2025-12-03 15:50:02 +02:00
Michael Ossmann
90e15ec85f Merge pull request #1612 from martinling/new-rtc-test
New method to test RTC oscillator
2025-11-30 23:12:42 -05:00
Martin Ling
23d69bf90c New method to test RTC oscillator. 2025-11-27 04:41:09 +00:00
mndza
24b05d6426 Do not halt when FPGA configuration fails: update report instead. 2025-11-26 20:53:49 +01:00
Michael Ossmann
cde5d754d3 Remove 32 kHz oscillator self-test
Reliable oscillator start-up requires several hundred milliseconds which
is longer than we are willing to wait at every boot. We could add an
on-demand test in the future instead of an automatic self-test.
2025-11-25 20:31:44 -05:00
Michael Ossmann
4832619823 Use MAX2831 RSSI mux and ADC for selftest
Co-authored-by: Martin Ling <martin-git@earth.li>
2025-11-25 20:12:27 -05:00
Michael Ossmann
29be31bf71 Add hackrf_debug option to read ADC
Co-authored-by: Martin Ling <martin-git@earth.li>
2025-11-25 20:08:20 -05:00
Michael Ossmann
785c068f91 Change Praline USB product string to "HackRF Pro" 2025-11-24 21:33:21 -05:00
Michael Ossmann
409acbc3c9 Add support for HackRF Pro (code name: Praline)
Co-authored-by: mndza <diego.hdmp@gmail.com>
Co-authored-by: Martin Ling <martin-git@earth.li>
Co-authored-by: Antoine van Gelder <antoine@greatscottgadgets.com>
2025-11-24 20:53:41 -05:00
Martin Ling
2d2b6231fb Bump CMake minimum version to 3.10. 2025-09-19 01:12:24 +01:00
Martin Ling
5c39452040 Bump CMake minimum version to 3.5.0.
This is the minimum now accepted by latest CMake releases.
2025-09-16 19:00:49 +01:00
Michael Ossmann
db884152dc Merge pull request #1513 from martinling/sgpio-doc-fix
Update SGPIO code documentation
2024-12-05 11:31:16 -05:00
Martin Ling
8b5a10c26c Update SGPIO code documentation. 2024-12-04 16:10:07 +00:00
Martin Ling
03551cb1fd Detect whether the M0 missed its deadline.
Counter-intuitively, this actually saves us two cycles because we unroll
the first iteration of the loop that spins on the interrupt flag, saving
a branch in the case that the flag is clear the first time.
2024-11-26 19:34:29 +00:00
Martin Ling
d21f01f7b4 In conditional branch table, list one destination per line, in order. 2024-11-26 19:04:42 +00:00
Martin Ling
72a0a01190 Revert "Reduce firmware USB transfer size from 16KB to 8KB."
This reverts commit fefa4f0e45.
2024-02-08 01:07:11 +00:00
Jonathan Suite
dab548bf29 Firmware updates to allow fine-grained control of biast from command line (#1314)
* Initial commit of hackrf_biast

* Cleaned up hackrf_biast

* Cleaned up usage info

* Include getopt.h for non-GNU systems

* Add support for overriding HackRF's default antenna power behavior in firmware.  Add support for specifying antenna power behavior in libhackrf.

* Moved bias tee config routines into user_config.c, cleaned up operation of hackrf_biast

* hackrf_biast now calls usage() and exits when invoked with no arguments

* Fixed minor documentation error in usage()

* minor syntax cleanup

* Add some documentation to the host API call

* Add proper declaration magic in hackrf.h to hackrf_set_user_bias_t_opts() to appease Visual Studio

* Documentation changes suggested by @martinling

* Moved bias t setting above switch statement, removed line that explicit turned bias t off when entering OFF mode

* Change hackrf_set_user_bias_t_opts() to use a friendly struct() instead of a bitmask.  User friendliness fixes to hackrf_biast options.  More clang-format appeasement.

* Removed support for integer mode args from hackrf_biast

* clang-format error fixes

* Tweaked position of comment for clang-format v14

* Reformat files with clang-format v14 instead of 16

* Remove internal numeric modes for bias T settings

Co-authored-by: Martin Ling <martin-github@earth.li>

* Fix documentation error in hackrf_biast.c

---------

Co-authored-by: Martin Ling <martin-github@earth.li>
2023-09-13 11:15:30 -04:00
Jacob Graves
189b5bf693 wrap clkin init in r9 board check (#1307) 2023-04-19 13:32:32 -04:00
Michael Ossmann
c19f85ef24 h1r9: use single SSP configuration for MAX283x
During r9 hardware development it was thought that the MAX2839 would use
a different GPIO pin for chip select, but it ended up being the same pin
as is used for MAX2837 on other hardware revisions.

This takes the MAX283x abstraction a bit further and fixes a bug with
hackrf_debug -m.
2023-01-08 08:21:27 -05:00
Mike Walters
bfe882a2fa h1r9: add MAX283x abstraction layer 2023-01-06 14:33:53 +00:00
Michael Ossmann
7a0aec00ef h1r9: fix usb_vendor_request_reset()
The bootloader is configured by pin straps on certain pins. We use some
of those for other purposes in r9 which causes the bootloader to
misbehave if the device is reset from software. By switching these pins
from outputs to inputs just before reset this problem is avoided.
2023-01-06 14:33:53 +00:00
Michael Ossmann
edd0a80812 h1r9: stop writing MAX2837 registers to MAX2839 2023-01-06 14:33:53 +00:00
Michael Ossmann
8aa79e9fe5 h1r9: use timer to detect external clock frequency 2023-01-06 12:45:46 +00:00
Mike Walters
060d9cbd8a Add firmware_info structure 2023-01-05 15:13:06 +00:00
Michael Ossmann
173612ac77 add --led option to hackrf_debug
and corresponding changes to libhackrf and firmware
2022-12-18 07:22:17 -05:00
Michael Ossmann
b106495042 Merge pull request #1235 from stevefalco/correct_register_definition
Make definition of "prev" consistent
2022-12-01 13:08:35 -05:00