feat(lcd): enable Linux host compilation for esp_lcd

Register LCD and I2S HAL on the POSIX simulator and compile the
software panel ops path without hardware-only drivers.
This commit is contained in:
morris
2026-09-18 10:53:38 +08:00
parent bd0820d403
commit 0383dcb39e
4 changed files with 15 additions and 20 deletions
+15 -13
View File
@@ -1,17 +1,19 @@
idf_build_get_property(target IDF_TARGET)
if(${target} STREQUAL "linux")
return() # This component is not supported by the POSIX/Linux simulator
endif()
set(srcs "src/esp_lcd_common.c"
"src/esp_lcd_panel_io.c"
"src/esp_lcd_panel_ssd1306.c"
"src/esp_lcd_panel_st7789.c"
"src/esp_lcd_panel_ops.c")
set(srcs "src/esp_lcd_panel_ops.c")
set(includes "include" "interface")
set(priv_requires "esp_mm" "esp_psram" "esp_pm" "esp_driver_i2s" "esp_driver_dma")
set(public_requires "esp_driver_gpio" "esp_driver_i2c" "esp_driver_spi" "esp_driver_parlio" "esp_hal_lcd")
set(priv_includes "priv_include")
set(public_requires "esp_hal_lcd" "esp_hal_gpio")
set(priv_requires)
if(NOT ${target} STREQUAL "linux")
list(APPEND srcs "src/esp_lcd_common.c"
"src/esp_lcd_panel_io.c"
"src/esp_lcd_panel_ssd1306.c"
"src/esp_lcd_panel_st7789.c")
list(APPEND priv_requires "esp_mm" "esp_psram" "esp_pm" "esp_driver_i2s" "esp_driver_dma")
list(APPEND public_requires "esp_driver_gpio" "esp_driver_i2c" "esp_driver_spi" "esp_driver_parlio")
endif()
if(CONFIG_SOC_I2C_SUPPORTED)
list(APPEND srcs "i2c/esp_lcd_panel_io_i2c.c")
@@ -48,9 +50,9 @@ endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS ${includes}
PRIV_INCLUDE_DIRS "priv_include" "i80"
PRIV_REQUIRES ${priv_requires}
PRIV_INCLUDE_DIRS ${priv_includes}
REQUIRES ${public_requires}
PRIV_REQUIRES ${priv_requires}
LDFRAGMENTS linker.lf)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")