| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- # get IDF version for comparison
- set(idf_version "${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}")
- # set conversion sources
- set(srcs
- conversions/yuv.c
- conversions/to_jpg.cpp
- conversions/to_bmp.c
- conversions/jpge.cpp
- conversions/esp_jpg_decode.c
- )
- set(priv_include_dirs
- conversions/private_include
- )
- set(include_dirs
- driver/include
- conversions/include
- )
- set(COMPONENT_REQUIRES driver)
- # set driver sources only for supported platforms
- if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET STREQUAL "esp32s3")
- list(APPEND srcs
- driver/esp_camera.c
- driver/cam_hal.c
- driver/sensor.c
- sensors/ov2640.c
- sensors/ov3660.c
- sensors/ov5640.c
- sensors/ov7725.c
- sensors/ov7670.c
- sensors/nt99141.c
- sensors/gc0308.c
- sensors/gc2145.c
- sensors/gc032a.c
- sensors/bf3005.c
- sensors/bf20a6.c
- sensors/sc101iot.c
- sensors/sc030iot.c
- sensors/sc031gs.c
- sensors/mega_ccm.c
- )
- list(APPEND priv_include_dirs
- driver/private_include
- sensors/private_include
- target/private_include
- )
- if(IDF_TARGET STREQUAL "esp32")
- list(APPEND srcs
- target/xclk.c
- target/esp32/ll_cam.c
- )
- endif()
- if(IDF_TARGET STREQUAL "esp32s2")
- list(APPEND srcs
- target/xclk.c
- target/esp32s2/ll_cam.c
- target/tjpgd.c
- )
- list(APPEND priv_include_dirs
- target/esp32s2/private_include
- )
- endif()
- if(IDF_TARGET STREQUAL "esp32s3")
- list(APPEND srcs
- target/esp32s3/ll_cam.c
- )
- endif()
- set(priv_requires freertos nvs_flash)
- set(min_version_for_esp_timer "4.2")
- if (idf_version VERSION_GREATER_EQUAL min_version_for_esp_timer)
- list(APPEND priv_requires esp_timer)
- endif()
- # include the SCCB I2C driver
- # this uses either the legacy I2C API or the newwer version from IDF v5.4
- # as this features a method to obtain the I2C driver from a port number
- if (idf_version VERSION_GREATER_EQUAL "5.4")
- list(APPEND srcs driver/sccb-ng.c)
- else()
- list(APPEND srcs driver/sccb.c)
- endif()
- endif()
- # CONFIG_ESP_ROM_HAS_JPEG_DECODE is available from IDF v4.4 but
- # previous IDF supported chips already support JPEG decoder, hence okay to use this
- if(idf_version VERSION_GREATER_EQUAL "4.4" AND NOT CONFIG_ESP_ROM_HAS_JPEG_DECODE)
- list(APPEND srcs
- target/tjpgd.c
- )
- list(APPEND priv_include_dirs
- target/jpeg_include/
- )
- endif()
- idf_component_register(
- SRCS ${srcs}
- INCLUDE_DIRS ${include_dirs}
- PRIV_INCLUDE_DIRS ${priv_include_dirs}
- REQUIRES driver # due to include of driver/gpio.h in esp_camera.h
- PRIV_REQUIRES ${priv_requires}
- )
|