Banana Pi BPI-R64 SPI touch panel test with OpenWRT

Banana Pi BPI-R64 SPI touch panel test

1 Like

SPI Panel module:
2.4" Touch Screen TFT LCD with SPI Interface, 240x320 (ILI9341 + ADS7843/XPT2046/HR2046)

SPI Panel <–> BPIR64

T_DO, T_DIN, T_CLK <–> SPIC_0: MOSI / MISO / CLK
T_CS <–> SPI-CE0
T_IRQ <–> IO-37
SDO, SCK, SDI <–> SPIC_1: MOSI / MISO / CLK
LED <–> PIN-31
DC <–> PIN-11
RESET <–> PIN-13
CS <–> SPI-CE1
GND <–> GND-9
VCC <–> 3.3V-1

DTS Modification:

/ {
        backlight: backlight {
                compatible = "gpio-backlight";
                gpios = <&pio 82 GPIO_ACTIVE_HIGH>;        //PIN31 IO-31 : GPIO82
                default-on;
        };
};

&pio {
        spic0_pins: spic0-pins {
                mux {
                        function = "spi";
                        groups = "spic0_0";
                };
        };
 
        spic1_pins: spic1-pins {
                mux {
                        function = "spi";
                        groups = "spic1_0";
                };
        };
}

&spi0 {
        pinctrl-names = "default";
        pinctrl-0 = <&spic0_pins>;
        status = "okay";
        touch@0 {
                reg = <0>;                                 //CE0
                compatible = "ti,ads7843";
                interrupt-parent = <&pio>;
                interrupts = <86 0>;                       //PIN37: IO-37 == GPIO86
                pendown-gpio = <&pio 86 0>;
                spi-max-frequency = <1000000>;
                vcc-supply = <&reg_3p3v>;
                wakeup-source;
        };
};

&spi1 {
        pinctrl-names = "default";
        pinctrl-0 = <&spic1_pins>;
        status = "okay";
        display@0{
                compatible = "ilitek,ili9341";
                reg = <0>;                                 //CE0
                spi-max-frequency = <32000000>;
                dc-gpios = <&pio 51 GPIO_ACTIVE_HIGH>;     //PIN11 UART1-TXD : GPIO51
                reset-gpios = <&pio 52 GPIO_ACTIVE_HIGH>;  //PIN13 UART1-RXD : GPIO52
                backlight = <&backlight>;
        };
};

Kernel config:

+CONFIG_FB_TFT_ILI9341
+CONFIG_FB_TFT
+CONFIG_FB
+CONFIG_BACKLIGHT_LCD_SUPPORT
+CONFIG_BACKLIGHT_CLASS_DEVICE
+CONFIG_BACKLIGHT_GPIO
+CONFIG_INPUT
+CONFIG_INPUT_TOUCHSCREEN
+CONFIG_TOUCHSCREEN_ADS7846

Application:

Package Description Source
fbv framebuffer image viewer https://github.com/godspeed1989/fbv
input-event-daemon input-event-daemon with touchTEST event https://github.com/SAM33/input-event-daemon

input-event-daemon config that show image by touch area:
(I don’t know why are the coordinates so strange, but the result of my actual touch and print out that it is like this)

[Global]
listen = /dev/input/event0
listen = /dev/input/event1

[TouchTEST]
340,400,3440,1860 = cat /dev/zero > /dev/fb0; fbv -f /root/bpi_608x429.jpg -s 1
340,2260,3440,1860 = cat /dev/zero > /dev/fb0; fbv -f /root/openwrt_449x449.png -s 1
1 Like