Using LVGL library ST7789 DISPLAY+FT6336 with nRF52840 using Zephyr

i am working on custom board nRF52840  with display ST7789 + touch Ft6336

1) i want to use LVGL library with Display how do i get started with LVGL .Any tutorials or sample code in zephyr  to get started with LVGL 

2) how can we use FT6336 touch with LVGL any sample code or links will be helpful 

Parents
  • Hello,

    1) i want to use LVGL library with Display how do i get started with LVGL .Any tutorials or sample code in zephyr  to get started with LVGL 

    You can start with the zephyr LVGL sample (zephyr\samples\subsys\display\lvgl). 

    The official Zephyr migration guide for version 3.7 specifically addresses the ST7789V display and shows how the overlay should be structured using the new MIPI DBI driver class. Here is the relevant example from the documentation:

    /* Legacy ST7789V display definition */
    &spi0 {
        st7789: st7789@0 {
            compatible = "sitronix,st7789v";
            reg = <0>;
            spi-max-frequency = <32000000>;
            reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
            cmd-data-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
            ...
        };
    };
    
    /* New display definition with MIPI DBI device */
    
    #include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>
    
    mipi_dbi {
        compatible = "zephyr,mipi-dbi-spi";
        reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
        dc-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
        spi-dev = <&spi0>;
        #address-cells = <1>;
        #size-cells = <0>;
    
        st7789: st7789@0 {
            compatible = "sitronix,st7789v";
            reg = <0>;
            mipi-max-frequency = <32000000>;
            mipi-mode = <MIPI_DBI_MODE_SPI_4WIRE>;
            reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
            cmd-data-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
            width = <240>;
            height = <240>;
            x-offset = <0>;
            y-offset = <0>;
            vcom = <0x19>;
            gctrl = <0x35>;
            vrhs = <0x12>;
            vdvs = <0x20>;
            mdac = <0x00>;
            lcm = <0x2c>;
            colmod = <0x05>;
            gamma = <0x01>;
            porch-param = [0c 0c 00 33 33];
            cmd2en-param = [5a 69 02 01];
            pwctrl1-param = [a4 a1];
            pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23];
            nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23];
            ram-param = [00 F0];
            rgb-param = [CD 08 14];
            ...
        };
    };

    You also need to add some config in thr prj.conf file which you can see in the LVGL sample. For example:

    CONFIG_DISPLAY=y
    CONFIG_LVGL=y
    CONFIG_LV_MEM_CUSTOM=y
    # ... other LVGL and display configs ...

    source:  https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/peripherals/posts/lvgl-on-a-tft-lcd-display-with-the-nrf9160-dk 

     one previous case: (+) 'cst816s: failed reading chip id' with Waveshare 1.69" Touch LCD - Nordic Q&A - Nordic DevZone - Nordic DevZone

    2) how can we use FT6336 touch with LVGL any sample code or links will be helpful 

    There is not direct sample for touch FT6336, but you can look at this case where customer successfully implemented one touch LCD  (+) 'cst816s: failed reading chip id' with Waveshare 1.69" Touch LCD - Nordic Q&A - Nordic DevZone - Nordic DevZone

    If you have access to a device tree binding for FT6336 or know that a compatible driver exists, you could attempt to add it as an I2C device in your overlay, similar to how other I2C touch controllers are added. However, I have not seen any concrete example or confirm support for FT6336 in zephyr.

    Thanks.

    BR

    Kazi

Reply
  • Hello,

    1) i want to use LVGL library with Display how do i get started with LVGL .Any tutorials or sample code in zephyr  to get started with LVGL 

    You can start with the zephyr LVGL sample (zephyr\samples\subsys\display\lvgl). 

    The official Zephyr migration guide for version 3.7 specifically addresses the ST7789V display and shows how the overlay should be structured using the new MIPI DBI driver class. Here is the relevant example from the documentation:

    /* Legacy ST7789V display definition */
    &spi0 {
        st7789: st7789@0 {
            compatible = "sitronix,st7789v";
            reg = <0>;
            spi-max-frequency = <32000000>;
            reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
            cmd-data-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
            ...
        };
    };
    
    /* New display definition with MIPI DBI device */
    
    #include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>
    
    mipi_dbi {
        compatible = "zephyr,mipi-dbi-spi";
        reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
        dc-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
        spi-dev = <&spi0>;
        #address-cells = <1>;
        #size-cells = <0>;
    
        st7789: st7789@0 {
            compatible = "sitronix,st7789v";
            reg = <0>;
            mipi-max-frequency = <32000000>;
            mipi-mode = <MIPI_DBI_MODE_SPI_4WIRE>;
            reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
            cmd-data-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
            width = <240>;
            height = <240>;
            x-offset = <0>;
            y-offset = <0>;
            vcom = <0x19>;
            gctrl = <0x35>;
            vrhs = <0x12>;
            vdvs = <0x20>;
            mdac = <0x00>;
            lcm = <0x2c>;
            colmod = <0x05>;
            gamma = <0x01>;
            porch-param = [0c 0c 00 33 33];
            cmd2en-param = [5a 69 02 01];
            pwctrl1-param = [a4 a1];
            pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23];
            nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23];
            ram-param = [00 F0];
            rgb-param = [CD 08 14];
            ...
        };
    };

    You also need to add some config in thr prj.conf file which you can see in the LVGL sample. For example:

    CONFIG_DISPLAY=y
    CONFIG_LVGL=y
    CONFIG_LV_MEM_CUSTOM=y
    # ... other LVGL and display configs ...

    source:  https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/peripherals/posts/lvgl-on-a-tft-lcd-display-with-the-nrf9160-dk 

     one previous case: (+) 'cst816s: failed reading chip id' with Waveshare 1.69" Touch LCD - Nordic Q&A - Nordic DevZone - Nordic DevZone

    2) how can we use FT6336 touch with LVGL any sample code or links will be helpful 

    There is not direct sample for touch FT6336, but you can look at this case where customer successfully implemented one touch LCD  (+) 'cst816s: failed reading chip id' with Waveshare 1.69" Touch LCD - Nordic Q&A - Nordic DevZone - Nordic DevZone

    If you have access to a device tree binding for FT6336 or know that a compatible driver exists, you could attempt to add it as an I2C device in your overlay, similar to how other I2C touch controllers are added. However, I have not seen any concrete example or confirm support for FT6336 in zephyr.

    Thanks.

    BR

    Kazi

Children
No Data
Related