1 开发板和显示屏准备
本人采用幸狐RV1106 Luckfox Pico Max开发板,在某宝买了一块2.4寸st7789v显示屏,也就二十几块钱。
2 修改设备树
首先修改设备树的头文件 rv1106-luckfox-pico-pro-max-ipc.dtsi。将spidev@0 和fbtft@0注释掉。
&spi0 {
pinctrl-0 = <&spi0m0_clk &spi0m0_miso &spi0m0_mosi &spi0m0_cs0>;
#address-cells = <1>;
#size-cells = <0>;
//spidev@0 {
//compatible = "rockchip,spidev";
// spi-max-frequency = <50000000>;
// reg = <0>;
//};
//fbtft@0{
// compatible = "sitronix,st7789v";
// reg = <0>;
// spi-max-frequency = <20000000>;
// fps = <30>;
// buswidth = <8>;
// debug = <0x7>;
// led-gpios = <&gpio2 RK_PB0 GPIO_ACTIVE_LOW>;//BL
// dc = <&gpio2 RK_PB1 GPIO_ACTIVE_HIGH>; //DC
// reset = <&gpio1 RK_PC3 GPIO_ACTIVE_LOW>; //RES
//};
};
修改rv1106g-luckfox-pico-pro-max.dts文件。将原来的&spi0注释掉,添加新的&spi0和&pinctrl
//&spi0 {
//