radxa-pkg / radxa-overlays

Additional device tree overlays to support different hardwares on Radxa products
GNU General Public License v2.0
43 stars 31 forks source link

Radxa zero 使用 spi屏幕 #379

Closed YeiliQ closed 1 week ago

YeiliQ commented 1 week ago

测试屏幕使用的是 waveshare3.5 ili9486+ads7846

MHS35B-Touch.dts

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/gpio/meson-g12a-gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
/ {
    metadata {
        title = "MHS35B-Touch";
        compatible = "radxa,zero";
        category = "misc";
        exclusive = "spicc1", "GPIOH_4", "GPIOH_5", "GPIOH_6", "GPIOH_7", "GPIOAO_3", "GPIOX_8", "GPIOX_9", "GPIOAO_2";
        //添加所用的引脚
        description = "MHS35B-Touch";
    };
};

&spicc1 {
    pinctrl-0 = <&spicc1_pins>;
    pinctrl-names = "default";
    cs-gpios = <&gpio GPIOH_6 GPIO_ACTIVE_LOW  &gpio GPIOX_9 GPIO_ACTIVE_LOW>;
    //前一个是屏幕的cs引脚  后面是触摸屏cs引脚
    #address-cells = <1>;
    #size-cells = <0>;
    status = "okay";
    ili9486: ili9486@0 {
        compatible = "ilitek,ili9486";
        reg = <0>;
        spi-max-frequency = <120000000>;
        //spi速率
        txbuflen = <32768>;
        rotate = <90>;
        bgr = <0>;
        fps = <50>;
        buswidth = <8>;
        regwidth = <16>;
        reset-gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
        //reset所用引脚
        dc-gpios = <&gpio GPIOX_8 GPIO_ACTIVE_HIGH>;
        //dc所用引脚
        debug = <0>; 
    };

    ads7846: ads7846@1 {
        compatible = "ti,ads7846";
        status = "okay";
        reg = <1>;
        id = <1>;
        spi-max-frequency = <2000000>;
        ti,x-plate-ohms = /bits/ 16 <60>;
        ti,pressure-max = /bits/ 16 <255>;
        ti,swap-xy = <0>;
        ti,invert-y = <1>;
        interrupts = <GPIOAO_2 IRQ_TYPE_EDGE_FALLING>;
        //触摸屏IRQ引脚 与pendown-gpio保持一致
        interrupt-parent = <&gpio_intc>;
        pendown-gpio = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
        vcc-supply = <&ao_5v>;
    };

};

//树莓派mhs3.5屏幕
//B-spi
//     ###屏幕引脚###                         #####开发板引脚######
//显示屏 :ili9486
//LCD_RS (PIN18:DC)                         DC引脚       (PIN18:GPIOX_8)
//RST    (PIN22:RESET)                    RESET引脚    (PIN7:GPIOAO_3)
//LCD_SI (PIN19:MOS                        MOSI引脚     (PIN19:GPIOH_4)
//LCD_SCK(PIN23:SCLK)                      SCLK引脚     (PIN23:GPIOH_7)
//LCD_CS (PING24:SS)                     SS引脚        (PIN24:GPIOH_6)

//触屏:ads7846:xpt2046
//TP_IRQ  (PIN11:GPIOAO_2)                  PIN11
//TP_SI   (PIN19:GPIOH_4)                   PIN19
//TP_SO   (PIN21:GPIOH_5)               PIN21
//TP_SCK  (PIN23:GPIOH_7)               PIN23
//TP_CS   (PIN26:GPIOX_9)               PIN12
Logan147 commented 1 week ago

大佬

nascs commented 1 week ago

大佬

RadxaYuntian commented 1 week ago

麻烦直接提交PR吧。另外我记得微信群里面是有改驱动的,现在这个overlay是不是不需要修改驱动?