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
  • 19:03 (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.