2020-12-17 06:02:55 +00:00
|
|
|
if(ESP_PLATFORM)
|
|
|
|
|
|
|
|
file(GLOB SOURCES *.c)
|
2021-02-23 15:00:21 +00:00
|
|
|
set(LVGL_INCLUDE_DIRS . lvgl_tft)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/disp_driver.c")
|
|
|
|
|
|
|
|
#@todo add SimleInclude macro here
|
|
|
|
|
|
|
|
# Include only the source file of the selected
|
|
|
|
# display controller.
|
|
|
|
if(CONFIG_LV_TFT_DISPLAY_CONTROLLER_ILI9341)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/ili9341.c")
|
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_ILI9481)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/ili9481.c")
|
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_ILI9486)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/ili9486.c")
|
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_ILI9488)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/ili9488.c")
|
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_ST7789)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/st7789.c")
|
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_ST7735S)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/st7735s.c")
|
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_ST7796S)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/st7796s.c")
|
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_HX8357)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/hx8357.c")
|
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_SH1107)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/sh1107.c")
|
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_SSD1306)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/ssd1306.c")
|
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_FT81X)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/EVE_commands.c")
|
|
|
|
list(APPEND SOURCES "lvgl_tft/FT81x.c")
|
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_IL3820)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/il3820.c")
|
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_JD79653A)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/jd79653a.c")
|
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_UC8151D)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/uc8151d.c")
|
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_RA8875)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/ra8875.c")
|
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_GC9A01)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/GC9A01.c")
|
2021-04-29 07:55:22 +00:00
|
|
|
elseif(CONFIG_LV_TFT_DISPLAY_CONTROLLER_ILI9163C)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/ili9163c.c")
|
2021-02-23 15:00:21 +00:00
|
|
|
else()
|
|
|
|
message(WARNING "LVGL ESP32 drivers: Display controller not defined.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_LV_TFT_DISPLAY_PROTOCOL_SPI)
|
|
|
|
list(APPEND SOURCES "lvgl_tft/disp_spi.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Add touch driver to compilation only if it is selected in menuconfig
|
|
|
|
if(CONFIG_LV_TOUCH_CONTROLLER)
|
|
|
|
list(APPEND SOURCES "lvgl_touch/touch_driver.c")
|
|
|
|
list(APPEND LVGL_INCLUDE_DIRS lvgl_touch)
|
|
|
|
|
|
|
|
# Include only the source file of the selected
|
|
|
|
# touch controller.
|
|
|
|
if(CONFIG_LV_TOUCH_CONTROLLER_XPT2046)
|
|
|
|
list(APPEND SOURCES "lvgl_touch/xpt2046.c")
|
|
|
|
elseif(CONFIG_LV_TOUCH_CONTROLLER_FT6X06)
|
|
|
|
list(APPEND SOURCES "lvgl_touch/ft6x36.c")
|
|
|
|
elseif(CONFIG_LV_TOUCH_CONTROLLER_STMPE610)
|
|
|
|
list(APPEND SOURCES "lvgl_touch/stmpe610.c")
|
|
|
|
elseif(CONFIG_LV_TOUCH_CONTROLLER_ADCRAW)
|
|
|
|
list(APPEND SOURCES "lvgl_touch/adcraw.c")
|
|
|
|
elseif(CONFIG_LV_TOUCH_CONTROLLER_FT81X)
|
|
|
|
list(APPEND SOURCES "lvgl_touch/FT81x.c")
|
|
|
|
elseif(CONFIG_LV_TOUCH_CONTROLLER_RA8875)
|
|
|
|
list(APPEND SOURCES "lvgl_touch/ra8875_touch.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_LV_TOUCH_DRIVER_PROTOCOL_SPI)
|
|
|
|
list(APPEND SOURCES "lvgl_touch/tp_spi.c")
|
|
|
|
elseif(CONFIG_LV_TOUCH_DRIVER_PROTOCOL_I2C)
|
|
|
|
list(APPEND SOURCES "lvgl_touch/tp_i2c.c")
|
|
|
|
endif()
|
|
|
|
endif()
|
2020-12-17 06:02:55 +00:00
|
|
|
|
|
|
|
idf_component_register(SRCS ${SOURCES}
|
2021-02-23 15:00:21 +00:00
|
|
|
INCLUDE_DIRS ${LVGL_INCLUDE_DIRS}
|
2020-12-17 06:02:55 +00:00
|
|
|
REQUIRES lvgl)
|
2021-02-23 19:28:27 +00:00
|
|
|
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_LVGL_H_INCLUDE_SIMPLE")
|
2020-12-17 06:02:55 +00:00
|
|
|
|
2021-02-23 15:00:21 +00:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "LVGL ESP32 drivers: ESP_PLATFORM is not defined. Try reinstalling ESP-IDF.")
|
2020-12-17 06:02:55 +00:00
|
|
|
endif()
|