This file contains hidden or 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 <Arduino.h> | |
#include <SPI.h> | |
// for the pinPeripheral() function | |
#include <wiring_private.h> | |
#ifndef _ICECLASS_DOPPLER_ | |
#define _ICECLASS_DOPPLER_ | |
#define SPI_FPGA_SPEED 34000000 |
This file contains hidden or 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 "file.h" | |
bool file_load(const char *path, file_t *out) { | |
if (out->data) { | |
file_unload(out); |
This file contains hidden or 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 <cassert> | |
#include <cstdint> | |
#include <cmath> | |
#include <algorithm> | |
#include <array> | |
#define _SDL_main_h | |
#include <SDL/SDL.h> | |
struct app_t { |
This file contains hidden or 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 span( float x0, float y0 ) | |
{ | |
// blah | |
} | |
void raster( vec2 point[3] ) | |
{ | |
std::array<mut::vec2, 3> p = { | |
point[0], point[1], point[2] | |
}; |
This file contains hidden or 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 the line from [x0,y0] -> [x1,y1] | |
// given y solve for sx (point on line) | |
// given x solve for sy (point on line) | |
const float dx = x1 - x0; | |
const float dy = y1 - y0; | |
const float sx = x0 + (y*dx - y0*dx) / dy; | |
const float sy = y0 + (x*dy - x0*dy) / dx; |
This file contains hidden or 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
std::string base_path(std::string in) { | |
const size_t last1 = in.rfind('/'); | |
const size_t last2 = in.rfind('\\'); | |
const size_t last = std::max(last1 == std::string::npos ? 0 : last1, | |
last2 == std::string::npos ? 0 : last2); | |
in.resize(last); | |
return in; | |
} |
This file contains hidden or 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
`default_nettype none | |
`timescale 1ns / 1ps | |
// 640x480 vga generator | |
// clk = 25Mhz | |
module vga_t(input i_clk, | |
output reg o_hsync, | |
output reg o_vsync, | |
output reg [9:0] o_x, |
This file contains hidden or 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
# ############################################################################## | |
# iCEcube PCF | |
# Version: 2014.12.27052 | |
# File Generated: Apr 27 2015 09:46:33 | |
# Family & Device: iCE40HX1K | |
# Package: VQ100 | |
# ############################################################################## | |
### Main FPGA Clock | |
set_io i_Clk 15 |
This file contains hidden or 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
`default_nettype none | |
`timescale 1ns / 1ps | |
module seven_seg(input [3:0] val, output reg [6:0] seg); | |
// seg | |
// | |
// +--0--+ | |
// 5 1 | |
// +--6--+ |
This file contains hidden or 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
`default_nettype none | |
`timescale 1ns / 1ps | |
module rom16x256( | |
input in_clk, | |
input in_rst, | |
input [7:0] in_addr, | |
output [15:0] out_data); | |
assign out_data = rom[ in_addr ]; |