これは自分のためのメモです。
この備忘録を見られて真似されても結構ですが、動作の保証は出来かねます。
また、真似られたことで不測の不具合が発生しましても、私は一切の責任を負いません。
nonbrand 2.4/2.8inchi Rpi Display
waveshareと勘違いして買ったと言うのは内緒!
SKU MPI2801
LCD Type TFT
LCD Interface SPI
Driver IC ILI9341
Touch Screen Type Resistive
Touch Screen Controller XPT2046
Colors 65536
Backlight LED
Resolution 320240 (Pixel) Aspect Ratio 8:5 Active Area 43.2×57.6(mm) Dimensions 51.53×76.68(mm) Power Dissipation 0.12A5V
Rough Weight(Package containing) 44(g)
PIN NO. SYMBOL DESCRIPTION
1, 17 3.3V Power positive (3.3V power input)
2, 4 5V Power positive (5V power input)
3, 5, 7, 8, 10, 22 NC NC
6, 9, 14, 20, 25 GND Ground
11 TP_IRQ Touch Panel interrupt, low level while the Touch Panel detects touching
12 KEY1 Key
13 RST Reset ※GPIO27
15 LCD_RS LCD instruction control, Instruction/Data Register selection ※GPIO22
16 KEY2 KEY
18 KEY3 KEY
19 LCD_SI / TP_SI SPI data input of LCD/Touch Panel
21 TP_SO SPI data output of Touch Panel
23 LCD_SCK / TP_SCK SPI clock of LCD/Touch Panel
24 LCD_CS LCD chip selection, low active
26 TP_CS Touch Panel chip selection, low active
pi@raspberrypi:~$ uname -a Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux /boot/config.txt enable_uart=1 dtparam=spi=on dtoverlay=fbtft,spi0-0,ili9341,bgr,dc_pin=22,reset_pin=27,width=240,height=320,r otate=270 pi@raspberrypi:~$ dmesg|grep spi [ 6.741665] SPI driver fb_ili9341 has no spi_device_id for ilitek,ili9341 [ 6.741839] fb_ili9341 spi0.0: fbtft_property_value: width = 240 [ 6.741863] fb_ili9341 spi0.0: fbtft_property_value: height = 320 [ 6.741885] fb_ili9341 spi0.0: fbtft_property_value: buswidth = 8 [ 6.741912] fb_ili9341 spi0.0: fbtft_property_value: rotate = 270 [ 6.741932] fb_ili9341 spi0.0: fbtft_property_value: fps = 30 [ 7.131162] graphics fb0: fb_ili9341 frame buffer, 320x240, 150 KiB video memory, 16 KiB buffer memory, fps=31, spi0.0 at 32 MHz pi@raspberrypi:~$ dmesg|grep tft [ 6.689747] fbtft: module is from the staging directory, the quality is unknown, you have been warned. [ 6.741839] fb_ili9341 spi0.0: fbtft_property_value: width = 240 [ 6.741863] fb_ili9341 spi0.0: fbtft_property_value: height = 320 [ 6.741885] fb_ili9341 spi0.0: fbtft_property_value: buswidth = 8 [ 6.741912] fb_ili9341 spi0.0: fbtft_property_value: rotate = 270 [ 6.741932] fb_ili9341 spi0.0: fbtft_property_value: fps = 30 ls -la /dev/fb* pi@raspberrypi:~$ fbset -i -fb /dev/fb0 mode "320x240" geometry 320 240 320 240 16 timings 0 0 0 0 0 0 0 nonstd 1 rgba 5/11,6/5,5/0,0/0 endmode Frame buffer device information: Name : fb_ili9341 Address : 0 Size : 153600 Type : PACKED PIXELS Visual : TRUECOLOR XPanStep : 0 YPanStep : 0 YWrapStep : 0 LineLength : 640 Accelerator : No fbset -i -fb /dev/fb1 sudo cat /dev/zero > /dev/fb0 sudo cat /dev/urandom > /dev/fb0
参考文献
arakan60.mydns.jp/04kousaku/31-0132lcdinst.html
4oc.blogspot.com/2016/04/raspberry-pi24inch-lcd.html
bitset.jp/blog/raspi_framebuffer_1
corgi-lab.com/raspberrypi/raspberrypi-control-display/