|
【硬件交流】
[rv1126求助]关于驱动SPI ST7789显示屏的问题
发表于 2021-8-30 15:10:24
浏览:7644
|
回复:4
打印
只看该作者
[复制链接]
楼主
您好,自己设计的底板上有两个st7789的1.3寸屏 分别连接到spi0m1和spi1m2上,dts配置如下
&spi0 {
status = "okay";
pinctrl-0 = <&spi0m1_clk &spi0m1_cs0n &spi0m1_cs1n &spi0m1_miso &spi0m1_mosi>;
pinctrl-1 = <>;
//pinctrl-1 = <&spi0m1_clk_hs &spi0m1_cs0n &spi0m1_cs1n &spi0m1_miso_hs &spi0m1_mosi_hs>;
/*spidevtest0: spidev@0 {
compatible = "rockchip,spidev";
reg = <0>;
spi-max-frequency = <48000000>;
status = "okay";
};*/
st7789v@0{
compatible = "sitronix,st7789v";
reg = <0>;
status = "okay";
spi-max-frequency = <48000000>;
buswidth = <8>;
rotate = <0>;
fps = <30>;
rgb;
dc-gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>;
//led-gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_HIGH>
debug = <0x00>;
};
};
&spi1 {
status = "okay";
pinctrl-0 = <&spi1m2_clk &spi1m2_cs0n &spi1m2_cs1n &spi1m2_miso &spi1m2_mosi>;
pinctrl-1 = <>;
/*spidevtest0: spidev@0 {
compatible = "rockchip,spidev";
reg = <0>;
spi-max-frequency = <48000000>;
status = "okay";
};*/
st7789v@0{
compatible = "sitronix,st7789v";
reg = <0>;
status = "okay";
spi-max-frequency = <48000000>;
buswidth = <8>;
rotate = <0>;
fps = <30>;
rgb;
dc-gpios = <&gpio3 RK_PA7 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>;
//led-gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_HIGH>
debug = <0x00>;
};
};
现在spi1下的显示屏能够正常使用,/dev下fb0和fb1均存在且可正常写入。逻辑分析仪看了spi和dc reset口的时序基本是正常的,但spi0下的显示屏未能正常初始化(初始化的时序也基本正常,但存在细微抖动),因此无法显示。dmesg如下。
fbtft_of_value: buswidth = 8
fbtft_of_value: debug = 0
fbtft_of_value: rotate = 0
fbtft_of_value: fps = 30
of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/spi@ff450000/st7789v@0[0]' - status (0)
of_get_named_gpiod_flags: parsed 'dc-gpios' property of node '/spi@ff450000/st7789v@0[0]' - status (0)
mmc_host mmc1: Bus speed (slot 0) = 300000Hz (slot req 300000Hz, actual 300000HZ div = 0)
mmc_host mmc1: Bus speed (slot 0) = 200000Hz (slot req 200000Hz, actual 200000HZ div = 0)
mmc_host mmc1: Bus speed (slot 0) = 100000Hz (slot req 100000Hz, actual 100000HZ div = 0)
Freeing initrd memory: 8948K
graphics fb0: fb_st7789v frame buffer, 135x240, 63 KiB video memory, 4 KiB buffer memory, fps=30, spi0.0 at 48 MHz
fbtft_of_value: buswidth = 8
fbtft_of_value: debug = 0
fbtft_of_value: rotate = 0
fbtft_of_value: fps = 30
of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/spi@ff5b0000/st7789v@0[0]' - status (0)
of_get_named_gpiod_flags: parsed 'dc-gpios' property of node '/spi@ff5b0000/st7789v@0[0]' - status (0)
graphics fb1: fb_st7789v frame buffer, 135x240, 63 KiB video memory, 4 KiB buffer memory, fps=30, spi1.0 at 48 MHz
请问spi0以及GPIO2-C1/C2在rv1126中是有什么特殊的需要注意的吗 还是说其他的原因类似dmesg中mmc_host那一段引发了异常呢,谢谢。
|
|