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 <stdlib.h> | |
#include <stdint.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <math.h> | |
#include <sys/ioctl.h> | |
#include <linux/spi/spidev.h> |
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
/* | |
to pass IQ baseband samples to SX1255 over I2S, run this: | |
./zmq-sub | aplay -t raw -f S32_LE -r 192000 -c 2 --device="hw:0,0" | |
note: you need to enable I2S overlay (acting as a slave) | |
this one works good: https://github.com/AkiyukiOkayasu/RaspberryPi_I2S_Slave | |
note: setting the rate to 192k isn't really effective, the actual rate is 125k (governed by the I2S master - SX1255) | |
*/ | |
#include <stdio.h> |
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
/* | |
to source IQ baseband samples from SX1255 over I2S, run this: | |
arecord -t raw -f S32_LE -r 192000 -c 2 --device="hw:0,1" | ./zmq-pub | |
note: you need to enable I2S overlay (acting as a slave) | |
this one works good: https://github.com/AkiyukiOkayasu/RaspberryPi_I2S_Slave | |
note: setting the rate to 192k isn't really effective, the actual rate is 125k (governed by the I2S master - SX1255) | |
*/ | |
#include <stdio.h> |
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
for(uint8_t y = startRow; y < endRow; y++) | |
{ | |
for(uint8_t x = 0; x < SCREEN_WIDTH; x++) | |
{ | |
if(y<SCREEN_HEIGHT/2) | |
{ | |
size_t pos1 = x + y * SCREEN_WIDTH; | |
size_t pos2 = x + (SCREEN_HEIGHT-1-y) * SCREEN_WIDTH; | |
uint16_t tmp = frameBuffer[pos1]; | |
frameBuffer[pos1] = __builtin_bswap16(frameBuffer[pos2]); |
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
void AT86_Write(const uint16_t addr, const uint8_t val) | |
{ | |
uint8_t tx[3]={(addr>>8)|(1<<7), addr&0xFF, val}; //write enable | |
GPIOA->BSRR=(1<<(4+16)); | |
HAL_SPI_Transmit(&hspi1, tx, 3, 1); | |
GPIOA->BSRR=(1<<4); | |
HAL_Delay(2); | |
} |
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
#!/bin/bash | |
if [ "$#" -lt 1 ]; then | |
echo "Not enough parameters." | |
exit | |
fi | |
mkdir $1 | |
cd $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
delay_ms(250); | |
WM8960_Write(0x0F, 0x1FF); delay_ms(250); //reset | |
WM8960_Write(0x34, 0x018); //PLL prescale=2 | |
WM8960_Write(0x04, 0x3B1); //clocking | |
//WM8960_Write(0x07, (1<<1)); //16-bit, I2S format | |
WM8960_Write(0x07, (1<<0)); //16-bit, left justified MSB first format |
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
--I2S sample source - 1kHz sinewave | |
--8kHz, 16-bit, left-aligned, MSB first | |
--clk - 12MHz input clock | |
--i2s_clk - 400kHz main clock | |
--lr_clk - 8kHz channel clock | |
--outp - data output | |
library IEEE; | |
use IEEE.std_logic_1164.all; | |
use IEEE.std_logic_arith.all; |
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
/* | |
* M17 baseband interpolator | |
* | |
* Wojciech Kaczmarski SP5WWP | |
* M17 Project, Nov 2022 | |
*/ | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <unistd.h> |
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% root-Nyquist (M) filter design % | |
% Source: % | |
% https://my.ece.utah.edu/~farhang/Nyquist_M_r1.pdf % | |
% Edited by Wojciech SP5WWP to work with rcosdesign() % | |
% % | |
% parameters: % | |
% N: filter order (filter length = N+1) % | |
% M: number of samples per symbol period % | |
% alpha: rolloff factor (range 0 to 1) % |
NewerOlder