This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 -u | |
import serial | |
import struct | |
import sys | |
# set up the serial device | |
if len(sys.argv) > 1: | |
deviceFile = sys.argv[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/dts-v1/; | |
/plugin/; | |
/{ | |
compatible = "rockchip,rockpi","rockchip,rk3399"; | |
fragment@0 { | |
target = <&i2c4>; | |
__overlay__ { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <libopencm3/stm32/rcc.h> | |
#include <libopencm3/stm32/gpio.h> | |
#include <libopencm3/stm32/usart.h> | |
#include <libopencm3/stm32/i2c.h> | |
static void clock_setup(void) { | |
rcc_clock_setup_hsi(&rcc_clock_config[2]); // 16mhz hsi raw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ASoC driver for MikroElectronika 506 (wm8731 proto board) | |
* connected to a RockPi 4 | |
* | |
* Author: Chris Chronopoulos, <chronopoulos.chris@gmail.com> | |
* Copyright 2020 | |
* Based on rpi-proto.c by Florian Meier | |
* | |
* This program is free software; you can redistribute it and/or modify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// simple-wm8731-overlay.dts | |
/dts-v1/; | |
/plugin/; | |
/ { | |
compatible = "rockchip,rockpi","rockchip,rk3399"; | |
fragment@0 { | |
target = <&i2s1>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ASoC driver for MikroElectronika 506 (wm8731 proto board) | |
* connected to a RockPi 4 | |
* | |
* Author: Chris Chronopoulos, <chronopoulos.chris@gmail.com> | |
* Copyright 2020 | |
* Based on rpi-proto.c by Florian Meier | |
* | |
* This program is free software; you can redistribute it and/or modify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// rockpi-mikroe-506-overlay.dts | |
/dts-v1/; | |
/plugin/; | |
/ { | |
compatible = "rockchip,rockpi","rockchip,rk3399"; | |
fragment@0 { | |
target = <&i2s1>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ns = 30000 # number of samples | |
f = h5py.File('/home/chrono/sng/data/take5.h5') | |
dset = f['wired-dataset'] # this has length 30000, where each element is a non-rectangular tuple | |
data = np.zeros((1024,ns), dtype='int16') # 1024 channels at 30 kHz | |
aux = np.zeros((32,45,ns/15), dtype='int16') # 32 chips, 45 aux values, samples at 2 kHz | |
for i in range(ns): | |
data[:,i] = dset[i][3][:1024] |