53 Commits

Author SHA1 Message Date
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
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
51bae663fc h1r9: update pin assignments for board spin B 2023-01-06 14:33:53 +00:00
Michael Ossmann
4db7e8d38a h1r9: more bring-up fixes 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
3738270e4f h1r9: use MAX2839 2023-01-06 14:33:53 +00:00
Michael Ossmann
b61c30a50d h1r9: bring-up wip 2023-01-06 14:33:53 +00:00
Michael Ossmann
6d48671084 h1r9: initial GPIO definitions 2023-01-06 12:45:51 +00:00
Michael Ossmann
06b9d7bee0 Clean up source code copyright notices. 2022-09-23 14:46:52 -04:00
Martin Ling
3dd2e51d71 Initialise rf_path->switchctrl to SWITCHCTRL_SAFE.
This was previously never being initialised.
2022-09-21 12:22:58 +01:00
Martin Ling
cf34beebb0 Remove extra call to switchctrl_set and global switchctrl variable.
This call is not required since the GPIOs are already configured in
rf_path_pin_setup(). The global switchctrl is not used anywhere else.
2022-09-21 12:17:18 +01:00
Martin Ling
eec6963759 Initialise RF path GPIOs to safe settings.
Previously these calls were leaving the amplifiers on, since the
control settings passed were missing SWITCHCTRL_NO_TX_AMP_PWR and
SWITCHCTRL_NO_RX_AMP_PWR. Use the predefined SWITCHCTRL_SAFE here.

Also move these calls before setting the GPIO pins to output mode,
to avoid driving them to the wrong states briefly first.
2022-09-21 12:05:17 +01:00
Martin Ling
44511c6c3b Move RFFC5072 setup before enabling RF power. 2022-09-19 13:02:29 +01:00
Martin Ling
c0d13de598 Add braces to all control statements without them. 2022-08-03 23:46:46 +01:00
Martin Ling
c3fdf402d7 Reformat all code to new clang-format standard. 2022-08-03 23:46:44 +01:00
Martin Ling
dbcc46d221 Mark code sections to be left alone by clang-format. 2022-08-03 23:03:15 +01:00
Martin Ling
1acc71bebf rf_path: Realign scu_pinmux calls. 2022-08-03 23:03:15 +01:00
Mike Walters
05b1650a6a Rename hackrf-ui.[ch]
Every other source file uses underscores! :(
2020-01-22 14:20:23 +00:00
Jared Boone
c32d57158a PortaPack: Remove weak UI functions, detect and return UI function table.
TODO: Side effect was that now blinky has a lot of unreasonable dependencies.
TODO: rad1o breakage is likely...
2019-03-02 14:23:06 -08:00
Jared Boone
ccc86aad14 Add support for PortaPack user interface add-on board. 2018-08-01 21:05:10 -07:00
schneider
c0c0fab368 chore(rad1o): White space fixes and cleanup 2017-02-03 19:27:19 +01:00
schneider
642feac51e Merge remote-tracking branch 'mossmann/master' into opera-merge
Conflicts:
	firmware/common/hackrf_core.c
	firmware/common/rf_path.c
	firmware/hackrf-common.cmake
	firmware/hackrf_usb/hackrf_usb.c
	firmware/hackrf_usb/usb_api_transceiver.c
	host/hackrf-tools/src/hackrf_transfer.c
2017-01-28 23:46:43 +01:00
schneider
fb2057cd09 fix(rf_path): Port rad1o pin config 2017-01-27 20:45:49 +01:00
Dominic Spill
cb06ce9656 ifdef out HackRF One rf path pins for jawbreaker build 2017-01-27 12:24:19 -07:00
schneider
70c41463b1 refact(mixer): Basic mixer abstraction 2017-01-26 00:31:43 +01:00
schneider
35ca538c18 Merge remote-tracking branch 'mossmann/master' into rad1o
Just a very rough merge to get off the ground. Major parts are not yet
implemented. The mixer intergration is in a messed up state. Part which
need work have been marked with XXX

Conflicts:
	firmware/common/hackrf_core.c
	firmware/common/hackrf_core.h
	firmware/common/max2837.c
	firmware/common/max2837.h
	firmware/common/rf_path.c
	firmware/common/rffc5071.c
	firmware/common/rffc5071.h
	firmware/common/sgpio.c
	firmware/common/si5351c.c
	firmware/common/tuning.c
	firmware/common/w25q80bv.c
	firmware/common/w25q80bv.h
	firmware/common/xapp058/ports.c
	firmware/hackrf-common.cmake
	firmware/hackrf_usb/hackrf_usb.c
	firmware/hackrf_usb/usb_api_register.c
	firmware/hackrf_usb/usb_api_transceiver.c
	host/hackrf-tools/src/hackrf_transfer.c
2017-01-26 00:21:58 +01:00
Dominic Spill
87f59de104 Merge "abstract buses" changes with "fix SPI flash read" 2015-12-20 15:28:29 +00:00
Dominic Spill
b985d9c899 Merge branch 'abstract_buses' of https://github.com/jboone/hackrf into jboone-abstract_buses 2015-12-18 12:24:43 +00:00
Tobias Schneider
d7c162902c fix(hackrf-ui): Make the calls weak 2015-12-09 22:26:16 +01:00
Tobias Schneider
c6e7490397 Merge remote-tracking branch 'mossmann/master' into rad1o
Conflicts:
	host/misc/udev/53-hackrf.rules.in
	host/python/max2837_dump.py
	host/python/set_transceiver_mode.py
2015-12-07 21:05:39 +01:00
Tobias Schneider
86b424d9d3 feat(hackrf): Callbacks for a possible UI 2015-12-07 00:29:33 +01:00
Tobias Schneider
cbf2185edc fix(rf-path): Remove misplaced RX/TX switching
The LNA bypass sections were configuring the RX/TX path again. That was
redundant and prevented RX without the LNA.
2015-07-27 09:16:38 +02:00
Michael Ossmann
af13e756d9 turn off RF amplifier at end of transmission, fixes bug #178 2015-07-08 16:37:49 -06:00
Tobias Schneider
c79c53c52f chore(name): We are now rad1o 2015-06-07 23:33:24 +02:00
Tobias Schneider
b4b768c76f feat(max2871.c): Set the default values after reset 2015-06-07 13:58:46 +02:00
Tobias Schneider
9e6ae19e10 fix(rf_path): First version of rad10 path 2015-06-07 03:35:59 +02:00
Tobias Schneider
d3cb14650d fix(rf_path): TX/RX switch 2015-06-06 19:22:35 +02:00
Tobias Schneider
c05929fe25 fix(common, hackf_usb): Make it compile for rad10 2015-06-06 18:49:09 +02:00
Jared Boone
5363ec3672 Use new GPIO API to abstract GPIO in various drivers.
Had to do it all at once due to name conflicts with API exposed in libopencm3.
Quite invasive patch! Also precipitated an LED API...
2014-11-15 16:26:59 -08:00
Jared Boone
e6c02bea62 MAX5864: Abstract SPI, extract target code 2014-11-10 16:55:02 -08:00
Jared Boone
d55bd529e2 RFFC507x: De-singleton the driver code. 2014-11-10 16:42:08 -08:00
Jared Boone
453f622b74 MAX2837: De-singleton the driver.
Conflicts:
	firmware/common/hackrf_core.c
	firmware/common/hackrf_core.h
2014-11-10 16:37:34 -08:00
Michael Ossmann
7c3f6340ed HackRF One antenna port power control in firmware, libhackrf, and hackrf_transfer 2014-03-12 17:21:49 -06:00
Michael Ossmann
7f34c6cc92 disable antenna port power 2014-02-21 16:55:44 -07:00
Jared Boone
2fab6c40cd Extract SGPIO multi_slice configuration argument into an init-time function, so it doesn't need to be passed each time the SGPIO interface direction is changed. 2013-12-08 12:21:41 -08:00
Jared Boone
b285b91e4c Merge remote-tracking branch 'mossmann/master' into jboone_refactor_20130906
Conflicts:
	firmware/common/hackrf_core.h
	firmware/common/rffc5071.c
2013-11-20 18:43:40 -08:00
Jared Boone
314b3cdc7b Don't put MAX2837 into shutdown mode -- powering up takes a bit too long (500us for PLL to stabilize). Will need to revisit, because the MAX2837 chews up significant current (35 to 45mA) when not in shutdown.
Remove excess calls to max2837_start() and max2837_stop().
2013-09-22 11:52:45 -07:00
Jared Boone
c06facdd25 Push SGPIO configuration into RF path API. 2013-09-17 22:32:10 -07:00
Jared Boone
1ec9f560b4 Move more RF path stuff (initialization and MAX5864 state management) into rf_path.c.
Changed initial RF path mode to lowest power (OFF).
Remove initial MAX2837 IF setting -- it's a waste of effort when the first (and necessary) tuning operation will reset it anyway (perhaps to a different value).
2013-09-17 17:25:00 -07:00