Skip to content

Instantly share code, notes, and snippets.

View suarezvictor's full-sized avatar

Victor Suarez Rovere suarezvictor

View GitHub Profile
@captain-amygdala
captain-amygdala / mooncell_c120.lpf
Last active April 11, 2023 20:57
Lattice LPF Pinout for the Mooncell C120 LED receiver module
#### Claude Schwarz 26.03.2023
#### Mooncell C120
####
#### SDRAM DQM lines and CE are hardwired to ground, CKE is hardwired to VCC
#### PHY Clock is 125MHz, on the PHY0 and PHY1 RXCLK inputs
#### 25MHz Clock on CLK25
#### MDIO and RESET is shared between both PHYs
#### FLASH Clock, if needed in user logic, needs to be enabled trough USRMCLK
#### The INPUT_KEY_RC Pin is filtered with a RC combination
#### The GPIO Connectors are named after their pins on the connector.
/////////////////////////////////////////////////////////////////////////
// This is a minimal example that shows the 4 main building-blocks needed to
// write concurrent/async coroutine code.
//
// 1. A coroutine type that lets users write their coroutine logic
// and call and co_await other coroutines that they write.
// This allows composition of async coroutine code.
//
// This example defines a basic `task<T>` type that fulfills this purpose.
//
@newhouseb
newhouseb / delay_line.py
Created February 21, 2021 22:46
ECP5 Delay Line with ~50ps precision
# This is an nmigen delay line for ECP5 FPGAs using the open source toolchain. It strings together a series of
# manually placed carry chains into a "thermometer." It returns a signal that's (length) long that represents
# the chain "snapshotted" at the primary clock domain (using the flip flops colocated in the slice).
#
# This can be used in a Time to Digital Converter (i.e. to measure the time between to events) or in
# an ADC by comparing (with LVDS) a signal to a reference signal.
#
# Note that the bit precision (read: delay per carry element) varies as a function of temperature. On
# a LFE5U-25F-8MG285C, I've measure delay times of approximately 43ps on average. Due to assorted reasons,
# the delay time will vary between bits and due to variations in routing (even when manually places), you might
// the donut code with fixed-point arithmetic; no sines, cosines, square roots, or anything.
// a1k0n 2020
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define R(mul,shift,x,y) \
_=x; \
x -= mul*y>>shift; \
@shirriff
shirriff / edid.py
Created March 25, 2018 15:58
Parse VGA configuration data (EDID) accessed from I2C device 0x50
# Program to parse VGA data (EDID) accessed from I2C device 0x50
#
# This is a quick demo not a supported program, so don't expect
# correctness from it.
#
# Edid format from:
# https://en.wikipedia.org/wiki/Extended_Display_Identification_Data#EDID_1.4_data_format
#
# Ken Shirriff http://righto.com
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],