Skip to content

Instantly share code, notes, and snippets.

@pklazy
pklazy / m5stickc_lcd.py
Last active March 13, 2023 05:04
Micropython M5StickC LCD Driver
import framebuf
import time
from machine import Pin, SPI, I2C
'''
import m5stickc_lcd
lcd = m5stickc_lcd.ST7735()
lcd.text('hello', 10, 10, 0xffff)
lcd.show()
'''
@pklazy
pklazy / sh1107.py
Last active December 20, 2022 10:16
micropython sh1107 driver (m5stick)
import framebuf
'''
from machine import Pin, SPI
vspi = SPI(2, baudrate=1000000, polarity=0, phase=0, bits=8, firstbit=SPI.MSB, sck=Pin(18), mosi=Pin(23))
import sh1107
oled = sh1107.SH1107(64, 128, vspi, Pin(27), Pin(33), Pin(14))
oled.text('hello', 0, 0, 1)
oled.show()
'''
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
fragment@0 {
target = <&spi0>;
__overlay__ {
status = "okay";
// SPDX-License-Identifier: GPL-2.0+
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <video/mipi_display.h>
#include "fbtft.h"
#define DRVNAME "fb_st7789vw"
rz > /dev/ttyUSB0 < /dev/ttyUSB0
sz filename > /dev/ttyUSB0 < /dev/ttyUSB0

라즈베리 파이에서 can-isotp 설치 기록

git clone https://github.com/hartkopp/can-isotp.git
cd can-isotp
sudo apt install raspberrypi-kernel-headers
make
sudo make modules_install
sudo depmod -a

라즈베리 파이 python3.7 빌드 기록

sudo apt build-dep python3
sudo apt install libffi-dev libssl-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libexpat1-dev
git clone https://github.com/python/cpython
cd cpython
git checkout v3.7.0
./configure --enable-optimizations --with-lto --prefix=$HOME/python37
make -j4
/dts-v1/;
/plugin/;
#include <dt-bindings/input/input.h>
/{
compatible = "brcm,bcm2708";
fragment@0 {
target = <&i2c1>;
CROSS_COMPILE = arm-none-eabi-
TOOLCHAIN_LIBS = gcc
LIBGCC_DIR = $(shell dirname `$(CROSS_COMPILE)gcc ${KBUILD_CFLAGS} -print-libgcc-file-name`)
LIB_INCLUDE_DIR += -L ${LIBGCC_DIR}
TOOLCHAIN_CFLAGS = -I/usr/lib/arm-none-eabi/include
DTC ?= /usr/bin/dtc
@pklazy
pklazy / PKGBUILD
Created February 27, 2015 12:35
raspberrypi archlinuxarm 3.18.7-9 rt patch
# Maintainer: Dave Higham <[email protected]>
# Maintainer: Kevin Mihelich <[email protected]>
# Maintainer: Oleg Rakhmanov <[email protected]>
# NOTE: Packages replace linux-raspberrypi-latest, remove if that package comes back
buildarch=20
pkgbase=linux-raspberrypi
_commit=11f2a1f8db91523fbcf10f8428f407cf3b37f936