Skip to content

Commit

Permalink
LVGL: Add support of LVGL9 into LVGL port
Browse files Browse the repository at this point in the history
  • Loading branch information
espzav committed Jan 16, 2024
1 parent c62e19f commit 3867e25
Show file tree
Hide file tree
Showing 21 changed files with 2,885 additions and 1,302 deletions.
1 change: 1 addition & 0 deletions bsp/esp32_c3_lcdkit/include/bsp/esp32_c3_lcdkit.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "driver/i2s_pdm.h"
#include "iot_button.h"
#include "lvgl.h"
#include "esp_lvgl_port.h"
#include "esp_codec_dev.h"

/**************************************************************************************************
Expand Down
40 changes: 30 additions & 10 deletions components/esp_lvgl_port/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,49 @@
file(GLOB_RECURSE IMAGE_SOURCES images/*.c)
#Select folder by LVGL version
set(PORT_FOLDER "lvgl8")
set(PORT_PATH "src/${PORT_FOLDER}")

idf_component_register(SRCS "esp_lvgl_port.c" ${IMAGE_SOURCES} INCLUDE_DIRS "include" REQUIRES "esp_lcd" PRIV_REQUIRES "esp_timer")
idf_component_register(SRCS "${PORT_PATH}/esp_lvgl_port.c" "${PORT_PATH}/esp_lvgl_port_disp.c" INCLUDE_DIRS "include" REQUIRES "esp_lcd" PRIV_REQUIRES "esp_timer")

set(ADD_SRCS "")
set(ADD_LIBS "")

idf_build_get_property(build_components BUILD_COMPONENTS)
if("espressif__button" IN_LIST build_components)
target_link_libraries(${COMPONENT_LIB} PRIVATE idf::espressif__button)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_button.c")
list(APPEND ADD_LIBS idf::espressif__button)
endif()
if("button" IN_LIST build_components)
target_link_libraries(${COMPONENT_LIB} PRIVATE idf::button)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_button.c")
list(APPEND ADD_LIBS idf::button)
endif()
if("espressif__esp_lcd_touch" IN_LIST build_components)
target_link_libraries(${COMPONENT_LIB} PRIVATE idf::espressif__esp_lcd_touch)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_touch.c")
list(APPEND ADD_LIBS idf::espressif__esp_lcd_touch)
endif()
if("esp_lcd_touch" IN_LIST build_components)
target_link_libraries(${COMPONENT_LIB} PRIVATE idf::esp_lcd_touch)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_touch.c")
list(APPEND ADD_LIBS idf::esp_lcd_touch)
endif()
if("espressif__knob" IN_LIST build_components)
target_link_libraries(${COMPONENT_LIB} PRIVATE idf::espressif__knob)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_knob.c")
list(APPEND ADD_LIBS idf::espressif__knob)
endif()
if("knob" IN_LIST build_components)
target_link_libraries(${COMPONENT_LIB} PRIVATE idf::knob)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_knob.c")
list(APPEND ADD_LIBS idf::knob)
endif()
if("espressif__usb_host_hid" IN_LIST build_components)
target_link_libraries(${COMPONENT_LIB} PRIVATE idf::espressif__usb_host_hid)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_usbhid.c" "images/${PORT_FOLDER}/img_cursor.c")
list(APPEND ADD_LIBS idf::espressif__usb_host_hid)
endif()
if("usb_host_hid" IN_LIST build_components)
target_link_libraries(${COMPONENT_LIB} PRIVATE idf::usb_host_hid)
list(APPEND ADD_SRCS "${PORT_PATH}/esp_lvgl_port_usbhid.c" "images/${PORT_FOLDER}/img_cursor.c")
list(APPEND ADD_LIBS idf::usb_host_hid)
endif()

if(ADD_SRCS)
target_sources(${COMPONENT_LIB} PRIVATE ${ADD_SRCS})
endif()
if(ADD_LIBS)
target_link_libraries(${COMPONENT_LIB} PRIVATE ${ADD_LIBS})
endif()
Loading

0 comments on commit 3867e25

Please sign in to comment.