Commit Graph

2966 Commits

Author SHA1 Message Date
Jared Boone
6499de39bf Shorten AIS packet to expected data + FCS length. 2015-11-06 09:40:00 -08:00
Jared Boone
bd76f0e13b Note to try different -mcpu= for LPC43xx Cortex-M0. 2015-11-06 09:40:00 -08:00
Jared Boone
e9f28f9ef3 Provide configuration of symbol unstuffing. 2015-11-06 09:40:00 -08:00
Jared Boone
a00fcbaa8f Unstuffing pattern length of zero should never match. 2015-11-06 09:40:00 -08:00
Jared Boone
05badaddda Put symbol coding into PacketBuilder.
Removes stuffing symbols before placing them into packet buffer.
2015-11-06 09:40:00 -08:00
Jared Boone
c936e09702 Add bit unstuffing algorithm.
For use in AIS. Probably useful elsewhere, too...
2015-11-06 09:39:59 -08:00
Jared Boone
31ff13f1c0 Un-const Message in message handler interfaces.
I want to modify in place the messages that are received. Naughty, but oh well.
2015-11-06 09:39:59 -08:00
Jared Boone
5469a3a31d Get ui::Console to a working state. 2015-11-06 09:39:59 -08:00
Jared Boone
5c31e803c8 Change interface to AccessCodeCorrelator, inline in header. 2015-11-06 09:39:59 -08:00
Jared Boone
a3cce5632e Complete rewrite of clock recovery, lots of refactoring. 2015-11-06 09:39:59 -08:00
Jared Boone
8b2e75a299 Add LinearResampler implementation for clock recovery. 2015-11-06 09:39:59 -08:00
Jared Boone
f13e2d32c0 Add symbol coding namespace, NRZI decoder. 2015-11-06 09:39:59 -08:00
Jared Boone
934936d3f6 Enhancements to clock recovery
Linearly interpolate input and delayed samples, based on phase of internal symbol clock.
2015-11-06 09:39:59 -08:00
Jared Boone
b41ff962f4 Replace std::sin() with interpolated LUT. 2015-10-14 11:10:24 -07:00
Jared Boone
291de8f869 Change channel_spectrum type to std::complex<float>.
Move FFT bit-reversal to complex<int16_t> -> complex<float> copy.
Change window so that adjacent bins have constant(-ish) gain.
Change window to float.
Change time domain samples to accumulate at even intervals over the FFT interval.
2015-10-14 11:10:24 -07:00
Jared Boone
882fbbef31 Add more fft_swap bit reversal functions. 2015-10-14 11:10:24 -07:00
Jared Boone
8f7e26b5c1 Break out BasebandStatsView, add main, RSSI threads. 2015-10-14 10:59:32 -07:00
Jared Boone
7f46f0d071 Add tick tracking for all baseband threads. 2015-10-14 10:44:20 -07:00
furrtek
ff96464efe Added AFSK BW and repeat parameters 2015-09-16 15:43:43 +02:00
furrtek
00ee78f533 Play dead init 2015-09-15 22:34:36 +02:00
furrtek
457baa65f4 Added binaries 2015-09-14 21:35:32 +02:00
furrtek
9a7657fb38 Play dead actually works, fixed 7bit AFSK, AFSK repeat, started whistle mode 2015-09-10 20:36:39 +02:00
furrtek
f1166205b0 Checkboxes, more AFSK options 2015-09-05 20:17:43 +02:00
furrtek
30531a20f2 Splash screen and Play Dead functionality 2015-09-04 20:37:27 +02:00
furrtek
ec26f587f1 Started adding AFSK modulator options, cleaning up LCR TX 2015-09-03 06:34:00 +02:00
Jared Boone
aa733b1b61 Remove FSK from receiver menu. It doesn't do anything (yet). 2015-09-02 18:55:00 -07:00
Jared Boone
f91f17b9fb Increase touch sensitivity a bit. 2015-09-02 18:48:51 -07:00
Jared Boone
9a3454d695 Touch code cleanup, stop scanning when no touch.
No need to change voltages on touch panel when no touch is detected. This should reduce noise a bit.
2015-09-02 18:48:38 -07:00
Jared Boone
f1ca3fe5bb Switch RFFC5072, MAX2837 back to 40MHz reference.
Turns out the MAX2837 can't tune the necessary range when given a 50MHz reference. Oops.
2015-09-02 17:45:19 -07:00
Jared Boone
293337b647 Init radio in RX mode, not TX mode. 2015-09-02 17:30:16 -07:00
Jared Boone
e2bb77d756 Change wideband FFT bin filter, clean up code a bit. 2015-09-02 11:29:38 -07:00
Jared Boone
c4de9c4423 Mute audio whenever baseband mode is changed. 2015-09-01 21:05:47 -07:00
Jared Boone
c52de7abe6 Clean up baseband/RSSI streaming control.
Address hang-up of baseband and RSSI when switching modulation modes really fast.
2015-09-01 21:05:32 -07:00
Jared Boone
687e627dae Mechanism to clear waterfall when switching modulations. 2015-09-01 21:04:27 -07:00
Jared Boone
d4c85bd786 Move receiver "back" button to separate row. 2015-09-01 20:38:59 -07:00
Jared Boone
24e398ca62 Add HackRF mode explanation text. 2015-09-01 20:23:11 -07:00
Jared Boone
4846557f12 Missed spots when renaming REVISION to GIT_REVISION. 2015-09-01 14:21:40 -07:00
Jared Boone
5d8c636f40 Halt M4 right after sending M0 the shutdown message.
Addresses issue #55.
2015-09-01 13:49:09 -07:00
furrtek
0e0261f813 LCR in TEDI 1200/2400 AFSK transmit 2015-08-28 20:50:42 +02:00
Jared Boone
75d9aa9c73 Remove extra CPLD code internal signals. 2015-08-27 16:54:38 -07:00
Jared Boone
19764ce693 Swap function of P2_8, P2_4 in schematic, firmware, CPLD.
gpio_unused: P2_4 -> P2_8
gpio_lcd_rd: P2_8 -> P2_4
P2_8 is a very long line, shared with DFU button.
Revise schematic to match CPLD signal names.
2015-08-27 16:54:38 -07:00
Jared Boone
3fea68d777 Adjust wideband specan gain to match other modes. 2015-08-27 14:57:05 -07:00
Jared Boone
b13081696d Simplify MessageQueue pop() usage. 2015-08-27 14:35:17 -07:00
Jared Boone
d8b3b4cb6b Check queue empty only once when reading messages.
There was a second is_empty() call hidden in the pop() call, so the while(condition) was redundant.
2015-08-27 14:27:29 -07:00
Jared Boone
5d9079f87f Stop streaming when changing baseband configuration.
Without, the baseband would get confused.
2015-08-27 14:07:15 -07:00
Jared Boone
e751e10e45 Add wideband spectrum processor. 2015-08-27 13:57:31 -07:00
Jared Boone
23ac04ad56 Make channel spectrum members protected, not private. 2015-08-27 13:51:55 -07:00
Jared Boone
c7907e948c Extract FSKProcessor into separate files. 2015-08-27 13:31:39 -07:00
Jared Boone
ffe829cf67 Extract WidebandFMAudio into separate files. 2015-08-27 13:19:34 -07:00
Jared Boone
7c5db55f8f Extract NarrowbandFMAudio into separate files. 2015-08-27 13:14:45 -07:00
Jared Boone
e246ea2c39 Extract NarrowbandAMAudio class into separate files. 2015-08-27 13:07:07 -07:00
Jared Boone
6bf61cbe88 Extract BasebandProcessor into separate files. 2015-08-27 11:11:08 -07:00
Jared Boone
b0e9afe26c Add missing #includes. 2015-08-27 11:10:44 -07:00
Jared Boone
04d05368c7 Push static variables and spectrum calc into BasebandProcessor. 2015-08-27 10:48:29 -07:00
Jared Boone
de0777f476 Extract FMSquelch into separate files. 2015-08-27 09:59:03 -07:00
Jared Boone
b904971ef2 Extract IIR filter configurations into separate file. 2015-08-27 09:58:37 -07:00
Jared Boone
c92bf12fbd Extract ChannelDecimator into separate files. 2015-08-27 09:49:14 -07:00
Jared Boone
035ec84f04 Wrap MessageQueue.push() with mutex.
This addresses issue #61, occasional FIFO/data corruption. With the mutex, any thread on one core can write to the FIFO. But still, only one thread on one core should read from the FIFO.
2015-08-26 14:18:03 -07:00
Jared Boone
7937ea7327 Enable DMB instruction at end of FIFO data copy.
Can't hurt to make sure FIFO and buffer state are flushed before returning to caller...
2015-08-26 14:13:51 -07:00
Jared Boone
4974774f82 Simplify PLL math when correcting for PPM. 2015-08-25 17:56:03 -07:00
Jared Boone
98773cb62a Make GIT_REVISION value available within code.
Addresses issue #59.
No idea what it'll do if the commit is also tagged as a release...
2015-08-25 16:33:52 -07:00
Jared Boone
4fe145b61d Remove application kludge to strip DFU of header.
Strip the header in in the Python SPI image generator, instead.
2015-08-25 15:11:22 -07:00
Jared Boone
f7ced7a823 Support Python 3.x in make_spi_image.py. 2015-08-25 14:56:50 -07:00
Jared Boone
dfe0bd7366 Generate SPI flash image with Python, not dd/cat/head.
Addresses issue #42.
Windows users now stand a chance of being able to build an image, and all these zero-byte HackRF binary issues should go away.
2015-08-25 14:30:38 -07:00
Jared Boone
8f326e2d8e Use PPB correction to adjust clock generator XTAL PLLA frequency.
Addresses issue #40.
2015-08-24 12:11:33 -07:00
Jared Boone
fe7dcdc613 Function to adjust clock generator XTAL PLL frequency.
Needed to switch PLLA to operate in fractional mode.
2015-08-24 12:09:11 -07:00
furrtek
8f815a3b39 Integerized the waveform table 2015-08-24 05:16:55 +02:00
furrtek
8e0210f944 Savestate ! RDS (only PSN) tx 2015-08-23 05:08:38 +02:00
Jared Boone
3a96c04aa7 Implement, use configuration for FM demod deviation. 2015-08-21 09:19:08 -07:00
Jared Boone
fa275156ed Move FSKPacketMessage to stack. 2015-08-21 09:18:21 -07:00
Jared Boone
589cb47cc6 Move M4 shutdown() next to init(). 2015-08-20 20:40:46 -07:00
Jared Boone
672284080b Extract M4 IPC IRQ code into separate file. 2015-08-20 20:39:08 -07:00
Jared Boone
11561659b4 Reset the M0 after the M4 is running HackRF firmware. 2015-08-20 20:26:36 -07:00
Jared Boone
690c3c98db Add Shutdown message, plumbing to send and handle. 2015-08-20 18:03:49 -07:00
Jared Boone
15791e345d Make baseband event loop methods private. 2015-08-20 17:57:59 -07:00
Jared Boone
2efbd337bd Provide a way to exit application event loop. 2015-08-20 17:56:47 -07:00
Jared Boone
9742a058e9 Move event loop into dispatcher, provide a way to exit. 2015-08-20 17:56:19 -07:00
Jared Boone
5978c99c31 Add API to stop HAL SysTick counter. 2015-08-20 17:51:07 -07:00
Jared Boone
bd791a8512 Remove code replaced by memory_map.hpp. 2015-08-20 17:50:20 -07:00
Jared Boone
4b7780f5c6 Move _KiB and _MiB user-defined literals to utility.hpp.
Where I put all the stuff I don't know where to put.
2015-08-20 17:15:51 -07:00
Jared Boone
1c3e45917c Rework to make use of declared memory map regions. 2015-08-20 17:11:08 -07:00
Jared Boone
05690b20ed Created memory_map header.
Knowledge of memory map will be consolidated here.
2015-08-20 17:09:11 -07:00
Jared Boone
e9c47ff91a Remove M0 ldscript NVRAM region.
I misunderstood the documentation. It's not NVRAM (backed up by VBAT), it just survives a deeper core sleep than other RAM does.
2015-08-20 16:03:14 -07:00
Jared Boone
52e8093618 Generalize FIFO to specify FIFO size as 2^K.
Configure baseband queue to be larger (4K) than application queue (2K).
2015-08-20 15:59:25 -07:00
Jared Boone
4126f1ab1f Change IPC to exchange data, not pointers. 2015-08-20 13:13:12 -07:00
Jared Boone
f99016d78f Tweak cast to C++ style. 2015-08-15 15:40:55 -07:00
Clayton Smith
25c2e612c0 Fix a narrowing conversion warning. 2015-08-15 17:56:30 -04:00
Jared Boone
f2cabadf60 Review application initialization order.
Group related things together.
2015-08-14 22:28:28 -07:00
Jared Boone
49b91d9c5d Move event loop into EventDispatcher. 2015-08-14 22:01:20 -07:00
Jared Boone
d5ebb9ef1e Remove more dead code and comments. 2015-08-14 21:58:54 -07:00
Jared Boone
aa801ada60 Move code comments to project Wiki. 2015-08-14 21:54:03 -07:00
Jared Boone
b1a4418f06 Push more widget painting code into ui::Painter
Hide knowledge of damage tracking strategy.
2015-08-14 21:36:51 -07:00
Jared Boone
2ebb41c0e6 Remove dead, commented code. 2015-08-14 21:35:48 -07:00
Jared Boone
872c998ff1 Move widget tree painting to ui::Painter.
Still doesn't seem like the right place, but better than the event dispatcher!
2015-08-14 21:27:46 -07:00
Jared Boone
a9bb7c96e5 Move UI dirty tracking out of application main.cpp. 2015-08-14 21:17:23 -07:00
Jared Boone
fa465c14c4 Extract RTC interrupt handler into separate files. 2015-08-14 20:57:40 -07:00
Jared Boone
32312a6cfb Can't use context() in ui::Widget constructor, move use elsewhere.
TODO: Seems like a design flaw to me... Either eliminate need for context(), or pass into constructors.
2015-08-14 17:52:29 -07:00
Jared Boone
a7226820d0 Hide implementation of MessageHandlerMap. 2015-08-14 17:31:23 -07:00
Jared Boone
2aa8ae0d1f Move FSKPacket message handler to ReceiverView. 2015-08-14 16:46:32 -07:00
Jared Boone
c44357a16a Remove dead, commented-out code. 2015-08-14 16:38:10 -07:00
Jared Boone
02aab9b4e2 Application main() refactoring to group relevant bits. 2015-08-14 15:52:11 -07:00
Jared Boone
1713c82841 Move ChibiOS init comments into Wiki. 2015-08-14 12:23:49 -07:00
Jared Boone
4e0de9c4ad Fix clock configuration for M4.
M0 launches baseband, so M4 clock can be set to PLL1. Provide a way to configure that per project, set to correct values for baseband project.
2015-08-14 12:21:49 -07:00
Jared Boone
66320c39d4 Restore missing halInit() call during M4 __late_init(). 2015-08-14 12:20:45 -07:00
Jared Boone
14ada9e132 Push channel filter data into BasebandProcessor. 2015-08-04 16:48:15 -07:00
Jared Boone
caef87fe90 Refactor IIRBiquadFilter to separate configuration structure. 2015-08-04 15:00:38 -07:00
Jared Boone
76df4f0369 Extract magnitude_squared to utility. 2015-08-04 14:08:15 -07:00
Jared Boone
de0c884b67 Remove test code. 2015-08-04 13:52:04 -07:00
Jared Boone
eea589bd98 Extract stats collectors into separate files. 2015-08-04 12:03:30 -07:00
Jared Boone
efaf13d2d1 Extract complex16_mag_squared_to_dbv_norm to utility. 2015-08-04 12:03:10 -07:00
Jared Boone
d855336985 Persist tuned frequency.
w00t!
2015-08-04 10:31:03 -07:00
Jared Boone
4870f0015b Extract PPB reset value to a constant.
Group with related constants.
2015-08-04 10:29:54 -07:00
Jared Boone
52ba9af1c7 Make persistent memory data_t types explicit.
I want the storage types to be reliable, separate from the interface types.
2015-08-04 10:29:10 -07:00
Jared Boone
11c786c4fb Change set_correction_ppb argument to const. 2015-08-04 10:28:23 -07:00
Jared Boone
45d26abf10 Use correct memory region for persistent storage.
Turns out 0x10088000 - 0x10089fff is not the right place. It's 0x40041000, and is only 256 bytes!
Move PPM to correct place, change representation to PPB for finer control.
Reset PPB value to initial value if read value out of bounds.
Clip PPB value on write to permitted bounds.
Contributes to resolution of issue #11.
2015-08-04 10:03:18 -07:00
Jared Boone
255de16d3e Use head/cat, /dev/zero to pad HackRF firmware
dd approach didn't work for at least one user. Resolves #42.
2015-08-02 11:22:10 -07:00
Jared Boone
985cbb874c Change default receiver frequency.
Remove comments.
2015-08-02 09:38:49 -07:00
Jared Boone
ddcb705a1e Default LNA to off. 2015-08-02 09:37:42 -07:00
Jared Boone
b70f1d9506 Move RSSI/baseband/audio bars to receiver mode.
Addresses issue #38.
Side effects: more room in receiver for fields and data. More room for global status indications in full bar of SystemStatusView.
2015-08-01 18:07:09 -07:00
Jared Boone
30d249df26 Remove dead code. 2015-08-01 15:20:44 -07:00
Jared Boone
e6a3cba14e Move HackRF firmware launch out of portapack::shutdown 2015-08-01 14:43:48 -07:00
Jared Boone
96babc3e84 Shut down LCD during PortaPack shutdown. 2015-08-01 14:40:05 -07:00
Jared Boone
98a1eb5c1c Add LCD shutdown method.
Resets LCD controller, turns off backlight.
2015-08-01 14:36:27 -07:00
Jared Boone
b5802aadda Clean up HackRF firmware mode message. 2015-08-01 14:32:22 -07:00
Jared Boone
65d5f68bfb Move LCD display object to portapack namespace.
Globals are bad... Except in embedded development!
2015-08-01 14:31:51 -07:00
Jared Boone
fecbb7205e Menu item to launch HackRF firmware. 2015-08-01 13:46:15 -07:00
Jared Boone
8797aa9758 Stop audio PLL if shutting down GP_CLKIN clock source. 2015-08-01 13:45:52 -07:00
Jared Boone
bfc73a6675 Move update_peripheral_clocks
Incorrect order of operations would hang execution if switching to IRC.
2015-08-01 13:44:52 -07:00
Jared Boone
c025a2bba2 Code to shut down ClockManager-controlled devices. 2015-08-01 13:43:58 -07:00
Jared Boone
1d16cd8aac Consolidate peripheral declarations. 2015-08-01 13:42:27 -07:00
Jared Boone
8af8941687 Use from-RAM DFU image, proper HackRF firmware padding. 2015-07-30 10:02:05 -07:00
Jared Boone
b32f5e2239 Generalize method for executing SPI flash image in M4 RAM. 2015-07-30 09:41:33 -07:00
Jared Boone
d4c43044e0 Shuffle binaries in SPI flash image to insert HackRF firmware binary.
Bootstrap is now 64k @ 0x00000.
HackRF image is 64k @ 0x10000.
Baseband image is 128k @ 0x20000.
Application image is remainder of SPI flash, @ 0x40000.
2015-07-29 22:30:16 -07:00
Jared Boone
8eda862edc Update hackrf_one_usb_ram.dfu to HackRF release 2015.07.2. 2015-07-29 22:21:35 -07:00
Jared Boone
61eaf9f178 Update "make program" to specify DFU mode PID, too.
Addresses comment in issue #27.
2015-07-29 22:19:27 -07:00
Jared Boone
538d3d1f5e Rename firmware/Makefile variables to better names. 2015-07-29 20:38:40 -07:00
Jared Boone
0acf1bf074 Fix dependency checking for subdirectory Makefiles.
Closes issue #36.
2015-07-29 18:21:47 -07:00
Jared Boone
accf934a45 Remove vregmode debug field in receiver.
Resolves issue #37.
2015-07-29 16:19:18 -07:00
Jared Boone
67976b73ba UI plumbing for PPM adjust in receiver frequency options. 2015-07-29 16:09:00 -07:00
Jared Boone
9db54276c1 Expose reference PPM correction property on receiver model. 2015-07-29 15:59:05 -07:00
Clayton Smith
fd9bb13157 Add frequency correction to receiver screen (WIP). 2015-07-29 14:26:40 -07:00
Clayton Smith
3874c82d57 Store PPM in shared memory for now. 2015-07-29 14:26:40 -07:00
Clayton Smith
9dd41ed48d Add frequency correction (WIP). 2015-07-29 14:26:39 -07:00
Jared Boone
0ed607b6dd Short-term focus navigation fix
Addresses argilo's immediate problem navigating between fields in a row, issue #32.
2015-07-29 14:00:59 -07:00
Jared Boone
10e20ee763 Create firmware/Makefile
New Makefile calls out to component Makefiles, builds SPI flash image, performs device programming, builds release archive. Resolves #28.
2015-07-26 06:30:04 -07:00
Jared Boone
ae62405344 Simplify audio muting.
Zero out the audio buffer instead of muting the codec. The HPF (and other downstream signal processing) can continue running, not produce discontinuities from being effectively halted during mute.
2015-07-21 10:33:40 -07:00
Jared Boone
9a8552eaeb Draw spectrum frequency axis tick marks and labels.
Also removed horizontal separator bar, narrowed filter range band.
2015-07-20 21:55:51 -07:00
Jared Boone
4aa1c8fb65 String functions now default to length = 0, no padding. 2015-07-20 21:53:12 -07:00
Jared Boone
e51db769e6 Refactor to update audio stats when audio output is muted. 2015-07-20 10:21:01 -07:00
Jared Boone
665f54b410 Reorganize BasebandProcessor method/member visibility.
Also hide feed_audio_stats() inside fill_audio_buffer().
2015-07-20 09:41:56 -07:00
Jared Boone
d7cb2c5da4 Simple FM squelch. 2015-07-20 09:34:24 -07:00
Jared Boone
876a591a66 Add IIR execute_in_place() 2015-07-20 09:33:56 -07:00
Jared Boone
71990b380a Bind pass/stop band info to filter taps.
Created fir_taps_real<N> structure, with pass and stop normalized frequencies.
Removed unused filter taps.
2015-07-18 16:50:59 -07:00
Jared Boone
6f2cbd1ac5 Partial refactor of channel filter frequency code.
Move channel filter frequency determination to baseband side, where the filtering is determined and performed.
Add useful accessor methods to BlockDecimator.
2015-07-18 16:49:40 -07:00
Jared Boone
ffc50785b7 specan: cleared up terminology, accounted for decimation.
Channel spectrum decimation now accounted for when computing filter frequencies.
Renamed a bunch of variables relating to channel spectrum bandwidth and filter frequencies.
2015-07-18 16:48:19 -07:00
Jared Boone
98bd9c54e4 Rework how spectrum and filter bandwidth is represented to UI.
Issue #13.
2015-07-18 16:46:59 -07:00
Jared Boone
e571ca7f1c Change reference initializations errors in GCC 4.8
Resolves issue #12.
2015-07-17 12:07:38 -07:00
Jared Boone
92ba4d7fea Fix line endings.
Addresses #21.
2015-07-17 10:55:54 -07:00
Jared Boone
43d13ab47c Mute audio in FSK mode.
Addresses #17.
2015-07-17 10:05:54 -07:00
Jared Boone
154b40d3c9 Extract baseband stats into separate widget
Also removed baseband saturation indication on red (TX) LED. A saturation indicator needs to live somewhere else, and be thought out a bit more...
2015-07-09 11:53:10 -07:00
Jared Boone
7c9fc62f5e Move halt indication code to common place. 2015-07-08 16:28:57 -07:00
Jared Boone
f360c01ff3 Unify duplicated code between touch_adc.cpp and rssi.cpp.
Also remove comments and dead code.
2015-07-08 16:00:18 -07:00
Jared Boone
c142b1bcfc Fix RSSI ADC DMA not working bug.
Resolves sharebrained/portapack-hackrf#3
2015-07-08 15:48:20 -07:00
Jared Boone
f2c6452c4c Change Makefile to use local hackrf DFU binary, now included. 2015-07-08 09:19:55 -07:00
Jared Boone
e1eea8e08a ChibiOS 2.6.8, until I can figure out where to get it from git. 2015-07-08 08:40:23 -07:00
Jared Boone
dc6fee8370 Initial firmware commit. 2015-07-08 08:39:24 -07:00