Skip to content

Instantly share code, notes, and snippets.

View whitequark's full-sized avatar
🐈‍⬛

Catherine whitequark

🐈‍⬛
View GitHub Profile
# iCE40HX8K-B-EVN
set_io clk J3
set_io tx B12
lcall _delay_4c
sjmp .
_delay_4c::
; (ljmp delay_4c) ; 0c > 4c
mov acc, dph ; 3c
cjne a, #0, 00000$ ; 4c > 11c [A]
mov acc, dpl ; 3c
subb a, #(24/4+1) ; 2c
inc a ; 1c
@whitequark
whitequark / glasgow-applet-taxonomy.txt
Created March 3, 2019 09:00
See __init__.py files in subdirectories of https://github.com/whitequark/Glasgow/tree/master/software/glasgow/applet for details, including specific examples and counterexamples.
"""
The ``interface`` taxon is the most fundamental and generic applet taxon. It groups applets
implementing interfaces that are used for purposes that do not fit into any single other taxon.
Because the ``interface`` taxon is so important, the applet names in this taxon are not prefixed
with the taxon name.
The ``memory`` taxon groups applets implementing interfaces to memory technology devices (volatile
and non-volatile) that include no functionality beyond manipulating data.
# Macronix 25L6473E
$ glasgow run spi-flash-25c -V 3.3 --pin-ss 0 --pin-miso 1 --pin-mosi 2 --pin-sck 3 --pin-hold 4 identify
I: glasgow.device.hardware: device already has bitstream ID fd8d97b20930df7f44ace0a704c715e6
I: glasgow.cli: running handler for applet 'spi-flash-25c'
I: glasgow.applet.spi_flash_25c: port(s) A, B voltage set to 3.3 V
I: glasgow.applet.spi_flash_25c: JEDEC manufacturer 0xc2 (Macronix) device 0x2017
I: glasgow.applet.spi_flash_25c: device has valid SFDP 1.0 (JESD216) descriptor
I: glasgow.applet.spi_flash_25c: SFDP table #0: JEDEC, Flash Parameter Table 1.0 (JESD216)
I: glasgow.applet.spi_flash_25c: density (Mbits) : 64
I: glasgow.applet.spi_flash_25c: density (Mbytes) : 8
@whitequark
whitequark / gist:c316e23d9b8a7f1fa29d01cf452112a5
Last active May 11, 2018 04:44
GAS DISCHARGE CHARACTER SYNTHESIZING GRAPHICAL INDICATOR ИГГ1-64x64M PASSPORT
GAS DISCHARGE CHARACTER SYNTHESIZING GRAPHICAL INDICATOR
ИГГ1-64x64M
PASSPORT
-2-
ОКП 6349580385
PASSPORT
1. GENERAL INFORMATION
@whitequark
whitequark / glinfo.c
Last active March 25, 2018 13:42
gcc -lGL -lX11 glinfo.c -o glinfo && ./glinfo
#include <GL/gl.h>
#include <GL/glx.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
Display *dpy = XOpenDisplay(NULL);
if(!dpy) {
puts("cannot XOpenDisplay");
return 1;
@whitequark
whitequark / README.txt
Last active October 6, 2022 22:44
Strava archiver
1. install postgres
2. run makedb.rb >tiles.csv
3. run tiles.sql
4. run archive.rb
5. enjoy
@whitequark
whitequark / chrome-export-bookmark-folder.js
Last active June 23, 2017 08:33
A small bookmarklet to export a bookmark folder as HTML, since Chrome does not provide this functionality
// by whitequark. released under CC0.
(function() {
function downloadFile(fileName, content) {
var dataURI = 'data:text/plain;charset=UTF-8,' +
encodeURIComponent(content);
var fakeLink = document.createElement('a');
fakeLink.setAttribute('href', dataURI);
fakeLink.setAttribute('download', fileName);
@whitequark
whitequark / subrenamer.rb
Last active June 14, 2017 11:53
Automated subtitle file renamer
#!/usr/bin/env ruby
# License: BSD-0-clause
VIDEO_EXTS = %w(.mkv .avi .mp4)
SUBTITLE_EXTS = %w(.ssa .ass .srt)
if ARGV.empty?
puts "Automatic subtitle file renamer by whitequark@whitequark.org"
puts "Usage: #{$0} *.ssa *.mkv"
puts " or: DRY_RUN=1 #{$0} *.ssa *.mkv"
@whitequark
whitequark / blink.v
Last active February 24, 2017 19:16
iCE40HX8K-B-EVM Yosys example