retropie-buster-4.8-rpi1_zero.img
retropie-buster-4.8-rpi2_3_zero2w.img
retropie-buster-4.8-rpi4_400.img
Raspberry Ri Zero、Zero 2W、3B、4B、CM4
spotpear-GamePi13
因为fbcp是拷贝HDMI的firwame buffer的信号所以设置HDMI的显示效果就是fbcp拷贝到SPI显示器的效果
sudo nano /boot/config.txt
添加配置代码
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=1
hdmi_mode=87
hdmi_cvt 480 480 60 6 0 0 0
#display_rotate=0
avoid_warnings=1
git clone https://github.com/juj/fbcp-ili9341.git
cd fbcp-ili9341
sudo mkdir build
cd build
sudo nano ../st7735r.cpp
屏蔽和添加代码
#define MADCTL_BGR_PIXEL_ORDER (1<<3)
#define MADCTL_ROW_COLUMN_EXCHANGE (1<<5)
#define MADCTL_COLUMN_ADDRESS_ORDER_SWAP (1<<6)
#define MADCTL_ROW_ADDRESS_ORDER_SWAP (1<<7)
#define MADCTL_ROTATE_0_DEGREES 0x00
#define MADCTL_ROTATE_90_DEGREES (MADCTL_COLUMN_ADDRESS_ORDER_SWAP | MADCTL_ROW_COLUMN_EXCHANGE)
#define MADCTL_ROTATE_180_DEGREES (MADCTL_COLUMN_ADDRESS_ORDER_SWAP | MADCTL_ROW_ADDRESS_ORDER_SWAP)
#define MADCTL_ROTATE_270_DEGREES (MADCTL_ROW_ADDRESS_ORDER_SWAP | MADCTL_ROW_COLUMN_EXCHANGE)
#define MADCTL_ROTATE_3D_TV_DEGREES (MADCTL_COLUMN_ADDRESS_ORDER_SWAP | MADCTL_ROW_ADDRESS_ORDER_SWAP)
//#ifdef DISPLAY_ROTATE_180_DEGREES
// madctl ^= MADCTL_ROTATE_180_DEGREES;
//#endif
#if defined(DISPLAY_ROTATE_0_DEGREES)
madctl = MADCTL_ROTATE_0_DEGREES;
#elif defined(DISPLAY_ROTATE_90_DEGREES)
madctl = MADCTL_ROTATE_90_DEGREES;
#elif defined(DISPLAY_ROTATE_180_DEGREES)
madctl |= MADCTL_ROTATE_180_DEGREES;
#elif defined(DISPLAY_ROTATE_270_DEGREES)
madctl = MADCTL_ROTATE_270_DEGREES;
#elif defined(DISPLAY_ROTATE_3D_TV_DEGREES)
madctl ^= MADCTL_ROTATE_3D_TV_DEGREES;
#endif
sudo nano ../config.h
添加以上代码
#define DISPLAY_ROTATE_0_DEGREES
//#define DISPLAY_ROTATE_90_DEGREES
//#define DISPLAY_ROTATE_180_DEGREES
//#define DISPLAY_ROTATE_270_DEGREES
//#define DISPLAY_ROTATE_3D_TV_DEGREES
需要选择旋转时解除宏定义前的注释即可
在build文件夹下
sudo cmake -DWAVESHARE_ST7789VW_HAT=ON -DGPIO_TFT_DATA_CONTROL=25 -DGPIO_TFT_RESET_PIN=27 -DSPI_BUS_CLOCK_DIVISOR=6 -DSTATISTICS=number ..
sudo make -j4
我司提供配置好的离线fbcp-ili9341包】
spotpear-fbcp-ili9341_rotateOK-241207.zip
解压后无需上述步骤配置直接使用
sudo unzip ./spotpear-fbcp-ili9341_rotateOK-241207.zip
编译完成后执行sudo ./fbcp-ili9341可以看到显示效果
sudo nano /etc/rc.local
添加
sudo /home/pi/fbcp-ili9341/build/fbcp-ili9341 &
sudo reboot