171 Commits

Author SHA1 Message Date
Michael Ossmann
d4a5c2290b replaced set_freq_if() with set_freq_explicit() and implemented explicit tuning option in hackrf_transfer 2014-03-13 16:06:51 -06:00
Michael Ossmann
7c3f6340ed HackRF One antenna port power control in firmware, libhackrf, and hackrf_transfer 2014-03-12 17:21:49 -06: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
Michael Ossmann
5b14636c2c initial firmware support for HackRF One 2013-11-19 10:01:26 -07:00
Jared Boone
61a8d0f1d6 Move set_transceiver stuff back hackrf_usb.c, since it seems to fit better there. 2013-09-20 14:24:05 -07:00
Jared Boone
7b50dfa12c Factor out USB API for transceiver control into separate files.
Pull out streaming control functions into common/streaming.[ch].
Remove excess #includes in hackrf_usb.c.
2013-09-20 12:54:56 -07:00
Jared Boone
9120e0b7ba Extracted USB API for board information into separate files. 2013-09-19 22:45:38 -07:00
Jared Boone
aab36292db Moved USB API for manipulating RF chip registers into separate files. 2013-09-19 22:37:36 -07:00
Jared Boone
cde5e1af8a Extracted USB API for SPI flash erase/write/read into separate files. 2013-09-19 22:29:49 -07:00
Jared Boone
f7a42e0747 Move USB API for CPLD management into separate files. 2013-09-19 19:52:14 -07:00
Jared Boone
82ce660932 Broke some application-specific USB code into separate files within hackrf_usb/. Hoping I can use them as necessary in other projects, or push them into a library eventually. 2013-09-19 19:51:32 -07:00
Jared Boone
5b7b98be6c Clean up SGPIO vector assignment code. 2013-09-17 22:37:40 -07:00
Jared Boone
c06facdd25 Push SGPIO configuration into RF path API. 2013-09-17 22:32:10 -07:00
Jared Boone
2e2275ed51 Pull out leaky tri-state transceiver_mode value from sgpio_configure(), replace with SGPIO_DIRECTION_* #defines. 2013-09-17 22:29:41 -07:00
Jared Boone
aebea16b0f Remove USB endpoint fiddling from baseband_streaming_disable().
Create baseband_streaming_enable() to do SGPIO IRQ and stream enable.
2013-09-17 22:23:18 -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
Jared Boone
53415a620d Allow set_transceiver_mode(OFF) to fall through the rest of the function, now that sgpio_configure() is expecting OFF as a value. 2013-09-17 15:33:07 -07:00
Jared Boone
0e8e3c8d53 Push MAX2837 state management into rf_path_set_direction(). 2013-09-17 15:27:16 -07:00
Jared Boone
e02d2f0325 Remove dependencies on application-specific USB descriptors. 2013-09-17 15:13:12 -07:00
Jared Boone
78121f5a3e Merge branch 'refs/heads/bgamari_usb_merge' into jboone_refactor_20130906
Conflicts:
	firmware/hackrf_usb/hackrf_usb.c
2013-09-17 13:10:30 -07:00
Jared Boone
4984a8b681 Fix to SPIFI addressing during hackrf_spiflash read operation. This fixes mismatches between programmed and read-back data. 2013-09-17 12:18:33 -07:00
Jared Boone
d13e80b520 With bgamari's new USB configuration for CPLD, be sure to turn up CPU clock to maximum. 2013-09-16 15:21:28 -07:00
Jared Boone
c0274cd2d3 Merge remote-tracking branch 'bgamari/usb' into bgamari_usb_merge
Conflicts:
	firmware/hackrf_usb/hackrf_usb.c
	firmware/hackrf_usb/usb.c
	firmware/hackrf_usb/usb_queue.c
	firmware/hackrf_usb/usb_queue.h
	firmware/hackrf_usb/usb_standard_request.c
2013-09-16 15:18:14 -07:00
Ben Gamari
67a181ac36 hackrf_usb: Update transceiver_mode on all configuration changes 2013-09-14 18:24:26 -04:00
Ben Gamari
64ef3f71c0 hackrf_usb: Make main loop non-blocking 2013-09-14 18:24:26 -04:00
Ben Gamari
3ba8d33de8 hackrf: Enter cpld_update from main loop
Otherwise we never respond to SET_CONFIGURATION
2013-09-14 18:24:26 -04:00
Ben Gamari
dc9c6c9667 cpld: Stream CPLD data from host
Previously CPLD programming involved a large 64kbyte buffer into which
the the entire bitstream would be completely downloaded, and at which
point the programming process would commence. This is needlessly
wasteful of memory. Moreover, it could lead to USB timeouts as the
firmware needs to wait the entire duration of the programming process
before returning an ACK to the host after the final SETUP data phase
packet.

Instead, we now receive 512 byte chunks of the bitstream and stream them
to the CPLD one at a time. We wait for each packet to be streamed out to
the CPLD before ACKing the packet to prevent active data being
overwritten.
2013-09-14 18:24:25 -04:00
Ben Gamari
4773ee5a53 hackrf_usb: Port to use usb_queue 2013-09-14 18:24:25 -04:00
Jared Boone
042229ea19 Set transceiver mode to OFF whenever USB configuration changes. 2013-09-08 15:52:36 -07:00
Jared Boone
0411ffe3f0 Set RF path direction to "off" when transceiver_mode is OFF. 2013-09-08 15:44:37 -07:00
Jared Boone
98e33fbb5b Remove commented RFFC5071 code in set_transceiver_mode. 2013-09-08 15:36:25 -07:00
Jared Boone
9b2b7b0817 Move SGPIO ISRs to separate .c/.h files.
Move usb_bulk_buffer* to separate .c/.h files.
2013-09-08 15:10:19 -07:00
Jared Boone
14eba3d947 Extract tuning code into separate .c/.h file. 2013-09-07 22:30:13 -07:00
Jared Boone
b5dc264d22 Extract rf_path code into a separate .c/.h.
Add an rf_path_init() function to do initial, idle configuration during start-up.
2013-09-07 22:22:03 -07:00
Jared Boone
7cf4058372 Move various switchctrl manipulation into clearly-defined rf_path_*() implementations. 2013-09-07 22:06:01 -07:00
Jared Boone
bf297e0e08 I might've been a bit hasty removing volatile from transceiver_mode. 2013-09-07 22:01:46 -07:00
Jared Boone
4ad3680428 Break SGPIO interrupt handlers in two -- RX and TX.
Assign an SGPIO interrupt handler function at runtime, based on RX or TX mode. NOTE: This is incompatible with placing the vector table in ROM, which is fine on a device with no internal flash).
Remove SGPIO interrupt-time dependency on volatile transceiver_mode variable. Side effect is that a few cycles are probably saved inside the SGPIO interrupt.
2013-09-07 21:04:36 -07:00
Jared Boone
e7c6408473 Add comment describing SWITCHCTRL pins vs. RF path configurations. 2013-09-07 20:21:43 -07:00
Jared Boone
d65314db37 Clean up switchctrl code a bit -- redundant #ifdefs and complex if conditions. 2013-09-07 20:20:48 -07:00
Jared Boone
bafe97e302 Extract knowledge of RF path configurations from the RFFC5071 driver.
Change initial RF path mode to SWITCHCTRL_SAFE. (Previously started at SWITCHCTRL_SAFE and then immediately switched to SWITCHCTRL_AMP_BYPASS.)
2013-09-07 12:59:57 -07:00
Jared Boone
6dee455ef2 Contain calls to rffc5071_(rx|tr) to a single location. 2013-09-07 12:40:09 -07:00
Jared Boone
b89f43e97e Replace transceiver_mode dependent MAX2837 mode management with max2837_mode() -> max2837_set_mode() calls. 2013-09-06 22:50:04 -07:00
Jared Boone
a5c0b5deeb Add MAX2837 functions to control operating mode.
Replace direct manipulation of GPIOs controlling MAX2837 with operating mode functions.
2013-09-06 21:29:31 -07:00
Jared Boone
7c5db57f02 Hide the MAX2837 intermediate frequency behind a function. It also prevents leakage of the freq_*_cache variables. 2013-09-06 16:46:03 -07:00
Jared Boone
b893b0a694 Merge remote-tracking branch 'bgamari/usb' into bgamari_usb_merge
Conflicts:
	firmware/hackrf_usb/hackrf_usb.c
	firmware/libopencm3
2013-09-06 15:20:58 -07:00
Jared Boone
6c0d803647 Cleaned up management of SGPIO and transceiver mode state vs. USB configuration state. This should help with power management. It may also be necessary when operating at low speed (48MHz), to keep the SGPIO interrupts from chewing up ALL available CPU cycles. 2013-09-04 16:27:43 -07:00
Jared Boone
1f5b979fd9 Added usb_set_configuration_changed_cb() call that bgamari fixed in his as-yet-unmerged USB branch. 2013-09-04 16:24:19 -07:00
Jared Boone
189d245868 Merge remote-tracking branch 'TitanMKD/master' into titanmkd_overclock_fix
Conflicts:
	firmware/hackrf_usb/hackrf_usb.c
2013-09-04 12:41:03 -07:00
TitanMKD
24ed48d93a Fix for "issues/62 fix PLL1 overclock bug" see hackrf_core.c -> cpu_clock_init()
Fix for "issues/78 startup current too high" see hackrf_core.c -> New functions cpu_clock_pll1_low_speed()/cpu_clock_pll1_max_speed() & hackrf_usb.c to switch low_speed/max_speed.
2013-08-28 22:01:57 +02:00
Ben Gamari
14526cd1c2 hackrf_usb: Be more careful in transceiver_mode check 2013-07-07 17:50:53 -04:00