0

我正在尝试配置连接在Orange Pi zero plus的 SPI1 上的 ST7789v LCD 面板。

我在 armbian 配置中添加了模块ST7789v ,并使用不带桌面的 buster 版本编译了Armbian 。我将使用 X 服务器来显示屏幕。该模块在内核目录中可用。

我创建了一个*.dts文件如下并使用armbian-add-overlay命令编译它。

/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";
    fragment@0 {
        target = <&spi1>;
        __overlay__ {
            #address-cells = <1>;
            #size-cells = <0>;
            status = "okay";

            spidev@0 {
                compatible = "sitronix,st7789v";
                reg = <0>;
                reset-gpios = <&pio 0 2 0 >;
                power-supply = <&pio 0 7 0 >;
                buswidth = <8>;
                dc-gpios = <&pio 0 7 0>;
                spi-max-frequency = <32000000>;
                spi-cpol;
                spi-cpha;
                rotate = <0x5a>; /* seems to work 10e */
            };
        };
    };
    fragment@1 {
        target-path = "/";
        __overlay__ {
            leds {
                compatible = "gpio-leds";

                screen {
                    gpios = <&pio 0 6 0>; /* PA10 */
                    default-state = "on";
                };
            };
        };
    };
};

屏幕正在工作。但是,它不使用面板驱动程序,而是使用暂存目录中的fbtft驱动程序。请查看 lsmod 的输出:

root@orangepizeroplus:~# lsmod
Module                  Size  Used by
8189fs               1445888  0
zstd                   16384  4
cfg80211              356352  1 8189fs
fb_st7789v             16384  1
fbtft                  40960  1 fb_st7789v
rfkill                 28672  3 cfg80211
sun8i_codec_analog     32768  0
snd_soc_simple_card    24576  0
sun8i_adda_pr_regmap    16384  1 sun8i_codec_analog
sun4i_i2s              24576  0
snd_soc_simple_card_utils    20480  1 snd_soc_simple_card
sun4i_gpadc_iio        24576  0
snd_soc_core          176128  4 sun4i_i2s,sun8i_codec_analog,snd_soc_simple_card_utils,snd_soc_simple_card
ac97_bus               16384  1 snd_soc_core
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_pcm               106496  3 sun4i_i2s,snd_soc_core,snd_pcm_dmaengine
sun4i_tcon             32768  0
snd_timer              40960  1 snd_pcm
sun8i_mixer            40960  0
sun8i_tcon_top         16384  1 sun4i_tcon
snd                    81920  3 snd_timer,snd_soc_core,snd_pcm
soundcore              16384  1 snd
cpufreq_dt             20480  0
zram                   32768  2
sch_fq_codel           20480  6
usb_f_acm              20480  1
u_serial               32768  3 usb_f_acm
g_serial               16384  0
libcomposite           61440  2 g_serial,usb_f_acm
ip_tables              32768  0
x_tables               36864  1 ip_tables
autofs4                49152  2
realtek                24576  1
dwmac_sun8i            28672  0
mdio_mux               16384  1 dwmac_sun8i
gpio_regulator         16384  1
fixed                  20480  3

我也尝试将fbtft模块列入黑名单,但屏幕无法启动。请查看 lsmod 的输出:

root@orangepizeroplus:~# lsmod
Module                  Size  Used by
zstd                   16384  4
8189fs               1445888  0
cfg80211              356352  1 8189fs
snd_soc_simple_card    24576  0
sun8i_codec_analog     32768  0
rfkill                 28672  3 cfg80211
snd_soc_simple_card_utils    20480  1 snd_soc_simple_card
sun8i_adda_pr_regmap    16384  1 sun8i_codec_analog
sun4i_i2s              24576  0
sun4i_gpadc_iio        24576  0
snd_soc_core          176128  4 sun4i_i2s,sun8i_codec_analog,snd_soc_simple_card_utils,snd_soc_simple_card
ac97_bus               16384  1 snd_soc_core
snd_pcm_dmaengine      16384  1 snd_soc_core
snd_pcm               106496  3 sun4i_i2s,snd_soc_core,snd_pcm_dmaengine
snd_timer              40960  1 snd_pcm
snd                    81920  3 snd_timer,snd_soc_core,snd_pcm
sun4i_tcon             32768  0
sun8i_tcon_top         16384  1 sun4i_tcon
soundcore              16384  1 snd
sun8i_mixer            40960  0
cpufreq_dt             20480  0
zram                   32768  2
sch_fq_codel           20480  6
usb_f_acm              20480  1
u_serial               32768  3 usb_f_acm
g_serial               16384  0
libcomposite           61440  2 g_serial,usb_f_acm
ip_tables              32768  0
x_tables               36864  1 ip_tables
autofs4                49152  2
realtek                24576  1
dwmac_sun8i            28672  0
mdio_mux               16384  1 dwmac_sun8i
gpio_regulator         16384  1
fixed                  20480  3

请参阅两个模块的 modinfo

root@orangepizeroplus:~# modinfo panel-sitronix-st7789v
filename:       /lib/modules/5.4.47-sunxi64/kernel/drivers/gpu/drm/panel/panel-sitronix-st7789v.ko
license:        GPL v2
description:    Sitronix st7789v LCD Driver
author:         Maxime Ripard <maxime.ripard@free-electrons.com>
alias:          of:N*T*Csitronix,st7789vC*
alias:          of:N*T*Csitronix,st7789v
depends:        
intree:         Y
name:           panel_sitronix_st7789v
vermagic:       5.4.47-sunxi64 SMP mod_unload aarch64
signat:         PKCS#7
signer:         
sig_key:        
sig_hashalgo:   md4
root@orangepizeroplus:~# modinfo fb_st7789v
filename:       /lib/modules/5.4.47-sunxi64/kernel/drivers/staging/fbtft/fb_st7789v.ko
license:        GPL
author:         Dennis Menschel
description:    FB driver for the ST7789V LCD Controller
alias:          platform:st7789v
alias:          spi:st7789v
alias:          platform:fb_st7789v
alias:          spi:fb_st7789v
alias:          of:N*T*Csitronix,st7789vC*
alias:          of:N*T*Csitronix,st7789v
depends:        fbtft
staging:        Y
intree:         Y
name:           fb_st7789v
vermagic:       5.4.47-sunxi64 SMP mod_unload aarch64
signat:         PKCS#7
signer:         
sig_key:        
sig_hashalgo:   md4
root@orangepizeroplus:~# 

为什么要使用舞台上的那个?有什么我想念的吗?也许面板驱动程序无法使用,因为我没有配置任何 DRM?

4

1 回答 1

0

ST7789v 的 Arduino 库:您可以从此链接查看 https://github.com/deirvlon/ST7789v-Arduino

于 2020-10-27T12:31:22.073 回答