Skip to content

Instantly share code, notes, and snippets.

View jboone's full-sized avatar

Jared Boone jboone

View GitHub Profile
@jboone
jboone / gist:7713722
Created November 30, 2013 00:22
Quick code to locate discontinuities in a test capture file.
#!/usr/bin/env python
import sys
import numpy
f = open(sys.argv[1], 'rb')
d = f.read(2)
test_data = numpy.arange(-128, 126, dtype=numpy.int8)
@jboone
jboone / gist:7713957
Created November 30, 2013 00:46
LPC43xx configuration for controlling CPLD RX decimation.
void sgpio_configure_pin_functions() {
...
scu_pinmux(SCU_PINMUX_SGPIO13, SCU_GPIO_FAST | SCU_CONF_FUNCTION4); /* GPIO5[12] */
scu_pinmux(SCU_PINMUX_SGPIO14, SCU_GPIO_FAST | SCU_CONF_FUNCTION4); /* GPIO5[13] */
scu_pinmux(SCU_PINMUX_SGPIO15, SCU_GPIO_FAST | SCU_CONF_FUNCTION4); /* GPIO5[14] */
sgpio_cpld_stream_rx_set_decimation(0);
GPIO_DIR(GPIO5) |= GPIOPIN14 | GPIOPIN13 | GPIOPIN12;
@jboone
jboone / gist:8079391
Created December 22, 2013 07:16
Fast third-order CIC for s8:s8 (complex) data.
ldrd t1, t2, [buf], #8 /* 3: t1 = Q3:I3:Q2:I2 */
/* t2 = Q5:I5:Q4:I4 */
/* What if I did this using ROL/ROR and SEL? */
/* Q3:I3:Q2:I2,Q5:I5:Q4:I4 -> */
smuad t3, i, taps /* 1: t3 = I1 * 3 + I0 * 1 */
smuad t4, q, taps /* 1: t4 = Q1 * 3 + Q0 * 1 */
sxtb16 i, t1, ror #0 /* 1: i = I3:I2 */
@jboone
jboone / SDR Hellschreiber
Created March 3, 2014 16:59
Quick and dirty Hellschreiber code for ToorCon San Diego 15's software defined radio workshop
#!/usr/bin/env python
import math
import numpy
import scipy.fftpack
import scipy.signal
letters = {
@jboone
jboone / gist:340abf06d38ee220b86f
Created May 10, 2014 18:47
Gnarly Python code to pick through the wreckage of an MPEG-2 transport stream.
#!/usr/bin/env python
#
# Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
@jboone
jboone / portapack_cpld.c
Created June 20, 2014 05:59
Code to program PortaPack CPLD (Altera MAX V) based on process in .SVF file.
static void portapack_cpld_jtag_tck(const uint_fast8_t value) {
if(value) {
gpio_set(PORTAPACK_CPLD_JTAG_TCK_GPIO_PORT, PORTAPACK_CPLD_JTAG_TCK_GPIO_BIT);
} else {
gpio_clear(PORTAPACK_CPLD_JTAG_TCK_GPIO_PORT, PORTAPACK_CPLD_JTAG_TCK_GPIO_BIT);
}
}
static void portapack_cpld_jtag_tdi(const uint_fast8_t value) {
if(value) {
@jboone
jboone / gist:d5222834e5b461248f3e
Created January 3, 2015 06:52
Linux U0 pre-enum phase.
<- Link Good 7
FE* FE* FE* F7* 07 68 07 68
-> Link Good 7
FE* FE* FE* F7* 07 68 07 68
---------------------------------------
-> Link Credit A
FE* FE* FE* F7* 80 A0 80 A0
@jboone
jboone / gist:57f1e354ea7949c61832
Last active August 29, 2015 14:14
Setting up original-recipe PortaPack code
wget http://sharebrained.com/downloads/portapack_cpld_downgrade.dfu
# Plug in with DFU held.
dfu-util --download portapack_cpld_downgrade.dfu
# Screen should go white.
# Wait for green LED to blink.
# Screen should be black.
# Unplug.
@jboone
jboone / gist:dfe4d81e80b41530dc51
Created March 16, 2015 21:52
KiCad Workshop Plan v0.0alpha
KiCad Workshop (subject to change, and bound by time constraints)
Features and functionality
Large-scale examples, including HackRF and Daisho projects
Background
Cross platform
Open source -- contribute! Bugs, documentation, code.
CERN involvement -- donate!
Goals for today:
Know what KiCad can and can't do
Have some idea how to do basic things
@jboone
jboone / morse_synth.py
Last active June 7, 2022 16:32
Morse code baseband file synthesizer for HackRF.
#!/usr/bin/env python
# Copyright (C) 2015 Jared Boone, ShareBrained Technology
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,