Skip to content

Instantly share code, notes, and snippets.

@rutles
rutles / mc6800clk.c
Created May 9, 2015 16:24
PIC12F1822 application for MC6800 clock generator.
//mc6800 clock generator
//device: PIC12F1822(5V)
//compiler: HI-TECH PICC 9.80a
#include <pic.h>
__CONFIG(FOSC_INTOSC & WDTE_OFF);
void main(){
CCP1SEL = 1;
@rutles
rutles / ws2811.s
Last active August 29, 2015 14:09
DW2811 Handler. LPC810 @ 24MHz only.
@ ws2811.s - ws2811 handler
@ LPC810@24MHz
@ void ws2811Write(const uint8_t *data, uint8_t count)
.cpu cortex-m0plus
.thumb
.syntax unified
.file "ws2811.s"
.text
@rutles
rutles / aqm1248fs.c
Created November 2, 2013 06:31
AQM1248 hadling example for Raspberry Pi via file system version.fill gray all area.
// AQM1248 hadling example for Raspberry Pi
// via file system version
// compile: cc aqm1248fs.c -o aqm1248fs
// execute: sudo ./aqm1248fs
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
@rutles
rutles / aqm1248.c
Last active December 27, 2015 05:39
AQM1248 hadling example for Raspberry Pi via register version.fill gray all area.
// AQM1248 hadling example for Raspberry Pi
// via register version
// compile: cc aqm1248.c -o aqm1248
// execute: sudo ./aqm1248
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
@rutles
rutles / wink.c
Last active December 24, 2015 21:09
Raspberry Pi LED blink test.
// wink.c
// LED blink test
// hardware: LED with resistor shall be connected to GPIOxx
// compile: cc wink.c -o wink
// execute: sudo ./wink xx
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
@rutles
rutles / register.c
Last active December 10, 2019 09:00
Raspberry Pi BCM2835 peripheral registers handling example
/*
file name: register.c
description: Raspberry Pi BCM2835 peripheral registers handling example
compile: cc register.c -o register
execute: sudo ./register
Tetsuya Suzuki, 2013
*/
#include <stdio.h>
#include <unistd.h>
@rutles
rutles / gpio_poll.c
Last active January 4, 2023 09:39
Raspberry Pi GPIO polling by wait for event example. Most simple code. No count errors.
/*
gpio_poll.c
Raspberry Pi GPIO polling example.
Hardware: A switch (hardware pulluped) shall be connected to GPIO25.
Compile: cc gpio_poll.c -o gpio_poll
Execute: sudo ./gpio_poll.c
*/
#include <fcntl.h>
#include <stdio.h>