Skip to content

Instantly share code, notes, and snippets.

@craigjb
craigjb / key_test.py
Created July 16, 2023 20:45
Key matrix test with GreatFET
import time, curses
from curses import wrapper
from greatfet import GreatFET
def main():
gf = GreatFET()
columns = [
gf.gpio.get_pin("J1_P3"),
@craigjb
craigjb / lcd128x128_gc9107.py
Last active July 3, 2023 21:07
Initialization for 128x128 0.85" LCD with GC9107
# Example init and basic routines for 0.85" 128x128 pixel LCD
# Sold under Wisevision N085-1212TBWIG41-H12
#
# Unnecessary init commands have been stripped out versus other
# routines I found online
def write_cmd(cmd):
set_dc_pin_low()
spi_transmit(cmd)
`default_nettype none
module corescore_haps_dx7_clock_gen
(input wire i_clk,
output wire o_clk,
output reg o_rst);
wire clkfb;
wire locked;
reg locked_r;
@craigjb
craigjb / scheduler.cpp
Created May 6, 2012 23:46
Task/Job Scheduler Implementation
/// This is not written to compile. I just copied everything into one file to make viewing easy
/// Here is a sample usage (task definitions and implementations omitted)
int main()
{
TaskScheduler scheduler;
MyTaskA taskA;
MyTaskB taskB;
BOOL running = true
@craigjb
craigjb / fizzbuzz.s
Created May 4, 2012 21:01
x64 System V Assembly FizzBuzz
/*
FizzBuzz written in x64 Assembly
Uses System V ABI (so Mac, Linux, Unix)
To Compile:
gcc -o fizzbuzz fizzbuzz.s
Written by Craig Bishop
5/4/2012
*/