Skip to content

Instantly share code, notes, and snippets.

View tyan-boot's full-sized avatar
🦀
Creating a new world.

Tyan tyan-boot

🦀
Creating a new world.
  • RingNet
  • CN
  • 15:49 (UTC +08:00)
View GitHub Profile
@tyan-boot
tyan-boot / Adding SPI chip selects on Raspberry Pi.md
Created July 28, 2024 17:06 — forked from mcbridejc/Adding SPI chip selects on Raspberry Pi.md
How to add or change SPI chip select pins on raspberry PI with device tree overlay

The raspberry pi SPI0 by default has 2 CS pins configured. The SPI driver in the kernel uses GPIOS toggled by software, rather than hardware controlled chip selects. This means that any GPIO can be used for a chip select, and any number of them can be supported concurrently. All of these setup for the SPI driver is defined in the device tree, and we can use device tree overlays stored in /boot to dynamically configure the device tree.

The attached example creates a SPI device with 5 CS pins, on GPIO 8, 7, 1, 5, and 6.

To compile it to a binary: dtc -@ -I dts -O dtb -o spi-cs-extend.dtbo spi-cs-extend.dts

Then place spi-cs-extend.dtbo into /boot/overlays and add the following line to your /boot/config.txt: dtoverlay=spi-cs-extend.

@tyan-boot
tyan-boot / README.md
Created January 21, 2023 10:11 — forked from ZipFile/README.md
Pixiv OAuth Flow

Retrieving Auth Token

  1. Run the command:

    python pixiv_auth.py login

    This will open the browser with Pixiv login page.

@tyan-boot
tyan-boot / intellij-tokio-color.icls
Created October 23, 2020 10:31
intellij color theme based tokio.rs
<scheme name="IntelliJ Light copy" version="142" parent_scheme="Default">
<metaInfo>
<property name="created">2020-10-23T18:29:39</property>
<property name="ide">CLion</property>
<property name="ideVersion">2020.2.3.0.0</property>
<property name="modified">2020-10-23T18:29:43</property>
<property name="originalScheme">IntelliJ Light copy</property>
</metaInfo>
<colors>
<option name="CARET_ROW_COLOR" value="fcfaed" />
@tyan-boot
tyan-boot / ObjectPool.hpp
Created February 11, 2018 15:35
C++ Object Pool, Thread-Safe
//
// Created by tyan on 2/6/18.
//
#ifndef OBJECTPOOL_H
#define OBJECTPOOL_H
#include <memory>
#include <vector>
@tyan-boot
tyan-boot / fonts.conf
Created July 25, 2017 08:44
字体配置
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!-- created by WenQuanYi FcDesigner v0.5 -->
<match>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" binding="strong" mode="prepend">
<string>WenQuanYi Micro Hei</string>
@tyan-boot
tyan-boot / db.sql
Last active October 10, 2016 15:04
scan dytt download link
create DATABASE dytt
CREATE TABLE gndy
(
uid INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
name TEXT,
url TEXT
)