How to use lcd panel drivers from esp-idf/components/esp_lcd?

kenneth
Posts: 3
Joined: Thu Jan 19, 2023 3:16 am

How to use lcd panel drivers from esp-idf/components/esp_lcd?

Postby kenneth » Thu Jan 19, 2023 3:38 am

I have a dev board with a st7789 panel and I want to use the panel driver located in esp-idf/components/esp_lcd/src/esp_lcd_panel_st7789.c, but I can't find any headers to include. Am I supposed to include the whole .c-file in my own .c-file? It comes with the function definitions on top after all.

ESP_Minatel
Posts: 364
Joined: Mon Jan 04, 2021 2:06 pm

Re: How to use lcd panel drivers from esp-idf/components/esp_lcd?

Postby ESP_Minatel » Thu Jan 19, 2023 9:43 am

Hi,

You can use this example to see how to include the component.

Code: Select all

idf_component_register(
    SRC_DIRS
        "src/boards"
        "src/peripherals"
        "src/storage"
        "src/indev"
        "src/codec"
    INCLUDE_DIRS
        "src/boards"
        "src"
        "include"
    REQUIRES
        esp_hid
        esp_lcd
        fatfs
        bus
        i2c_devices
        spiffs)

kenneth
Posts: 3
Joined: Thu Jan 19, 2023 3:16 am

Re: How to use lcd panel drivers from esp-idf/components/esp_lcd?

Postby kenneth » Thu Jan 19, 2023 9:06 pm

I'm working with the tjpgd example with esp-idf 5.0 and I can't see that it uses esp-lcd as a component in any cmakelist-file, it includes the headers directly. I'm looking at https://docs.espressif.com/projects/esp ... quirements and esp_lcd is not one of the common components so I don't understand why it is possible to use esp_lcd without requiring it as a component? It's the same with /examples/peripherals/adc/continuous_read which got updated for 5.0, I can't see that it requires esp_adc component, it just includes the header "esp_adc/adc_continuous.h". Can the built in esp-idf components in esp-idf/components/ be used directly without requiring them in the cmakelist-file?

To solve the original issue I just used the generic panel functions included in "esp_lcd_panel_ops.h" which I think is what is supposed to be used instead of the panel specific ones. I had to set a gap with

Code: Select all

esp_lcd_panel_set_gap()
to move the picture to the correct place on the display because it doesn't start drawing at 0,0.

Who is online

Users browsing this forum: Baidu [Spider], cdollar, Majestic-12 [Bot] and 123 guests