468 Commits

Author SHA1 Message Date
Jared Boone
e02d2f0325 Remove dependencies on application-specific USB descriptors. 2013-09-17 15:13:12 -07:00
Jared Boone
fe2a700f8f Move files that have no application-specific bits (e.g. USB stack, tuning, and RF path APIs) to ../common/. 2013-09-17 15:10:46 -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
Jared Boone
0a46aae5b9 Convert from unsigned to two's complement inside CPLD. TODO: This requires changes to gr-osmosdr and software that uses hackrf_transfer files directly. 2013-09-16 14:59:14 -07:00
Ben Gamari
4cd7662f7c hackrf_usb_rom_to_ram: Add usb_queue to Makefile 2013-09-15 18:29:33 -04: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
d2b2b11998 xapp058/ports: Clean up comments and dead code
It's still not pretty but it's an improvement
2013-09-14 18:24:25 -04:00
Ben Gamari
8e897be975 usb_standard_request: Multiple config support
GET_DESCRIPTOR would only return one configurations. This fixes that.
2013-09-14 18:24:25 -04:00
Ben Gamari
34fabad121 usb_standard_request: Sent descriptors can be const 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
Ben Gamari
500aa5888c usb_queue: Introduce queue management 2013-09-14 18:24:25 -04:00
Ben Gamari
24d5a5c4f1 usb: Add usb_endpoint_append_td
This implements the procedure for adding a TD to the end of an active
queue described in UM10503 Section 23.10.11.3.
2013-09-14 18:24:25 -04:00
Ben Gamari
1a44890095 usb_descriptor: Add description strings for configurations 2013-09-14 18:24:25 -04:00
Ben Gamari
21ad0778d2 usb_descriptor: Fix whitespace 2013-09-14 18:24:25 -04:00
Jared Boone
7075cc6c1c More constraints clean-up:
Associating timing specification groups on the NET declarations.
Updated setup/hold constraints -- old constraints were incomplete and possibly incorrect, though I'm still not *positive*.
2013-09-11 16:55:14 -07:00
Jared Boone
d628e2d09c Add CODEC_CLK to adc_data constraint group. 2013-09-11 16:22:39 -07:00
Jared Boone
e9236e50c2 Fix CPLD constraint to assume SGPIO frequency of 40MHz, not 20MHz. 2013-09-11 16:21:16 -07:00
Jared Boone
5a7b927db6 Change line endings in CPLD user constraints file license header to match the rest of the file. 2013-09-11 16:20:43 -07:00
Jared Boone
d7e2a8d133 Added note on generating XSVF inside Xilinx tools. 2013-09-11 15:54:17 -07: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
d00123ed24 Update RFFC5071 enable state when switching RF path direction. TODO: There's some stuff here that needs refactoring -- duplicate code is showing up. 2013-09-08 15:20:47 -07:00
Jared Boone
a897c4f016 Add RF_PATH_DIRECTION_OFF enum and code. 2013-09-08 15:19:27 -07:00
Jared Boone
217630d82c Convert rf_path_set_direction from if/else to switch/case. 2013-09-08 15:13:44 -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
1c81fa895c Bump mossmann/libopencm3 commit. 2013-09-07 22:34:36 -07:00
Jared Boone
ddf4c01f66 Forgot to propagate license to rf_path.[ch]. 2013-09-07 22:30:48 -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
518c46a111 Oops, missed a spot where I should've called a MAX2837 mode function. 2013-09-06 23:09:29 -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
a367f84d15 Add MAX2837 mode set/get functions. 2013-09-06 22:29:57 -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
1ac3d59875 Update libopencm3 submodule commit. 2013-09-06 16:02:01 -07:00
Jared Boone
5143456d6d Update libopencm3 submodule commit. 2013-09-06 15:25:34 -07:00