ST7789 CS無し LCDにコンソールを
ST7789 LCD 240x240 1.3インチのちっちゃいところにRaspberry Piのコンソールを表示したい。
同じことを考えている人はいる様ですが、CS(ChipSelect)がない!カーネルバージョンがBusterから5.xに上がってしまった!との声が。
でもやりたいね。
いろいろ読み進めると、以下の2点がキーであることがわかりました。
・Pimoroni Pirate Audio Headphone Amp for Raspberry Pi
・ST7789のCS無しはSPI MODE3で動かす
経緯から
Webで見つけたあっきぃさんのページ
でも、僕のLCDモジュールにはCSがないのです。
あっきぃさんの通りにやってもダメでした。
Pimoroniの"DeviceTreeを使う"これは基本的に正解(でした)。
ここからCS無しを対応しましょう。
1. Install “buster-lite” and run “sudo apt update” but DO NOT run “sudo apt upgrade”
2. run “sudo raspi-config” and enable “SSH”, “SPI”, and “I2C” within “Interfacing Options” then reboot.
3. login as the pi user.
4. run “wget
https://gist.githubusercontent.com/hgroll/2731ae6d05350df663b123615f765bf5/raw/f8fe3829136296c20ba670dcd572e8a5c60da995/pidi-overlay.dts”
5. run “dtc -@ -I dts -O dtb -o pidi.dtbo pidi-overlay.dts”
6. run “sudo cp pidi.dtbo /boot/overlays/”
7. edit “/boot/config.txt” and add the line “dtoverlay=pidi”
8. edit “/boot/cmdline.txt” and append " fbcon=map:10 fbcon=font:VGA8x16" (with the beginning space) to the 1st line after the word “rootwait”
9. run “sudo dpkg-reconfigure console-setup” then select “UTF8”, “Guess optimal…”, “Let the system select…”, “8x16”, “Ok”
10. run “sudo reboot”
違うのは4.でgetしたdtsファイルの編集です。
このregとpinctrl-namesの間に「MODE3で動いてね」を挿入し、
Backlight LEDの値も1から0へ変更します。
この2行だけ付け加えて5.から先を進めましょう。
raspi-configでSPIを有効にするのを忘れずに。
以上