2021-01-14 04:11:22 +00:00
|
|
|
# NOTE: This kind of mocking currently works on Linux targets only.
|
|
|
|
# On Espressif chips, too many dependencies are missing at the moment.
|
|
|
|
# Furthermore, this component can only mock the interfaces of
|
|
|
|
# spi_master.h and gpio.h.
|
2021-10-22 02:35:46 +00:00
|
|
|
message(STATUS "building DRIVER MOCKS (only SPI, I2C and GPIO driver)")
|
2021-01-14 04:11:22 +00:00
|
|
|
|
|
|
|
idf_component_get_property(original_driver_dir driver COMPONENT_OVERRIDEN_DIR)
|
|
|
|
|
|
|
|
set(include_dirs
|
|
|
|
"${original_driver_dir}/include"
|
|
|
|
"${original_driver_dir}/include/driver"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../hal/include"
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/../esp_hw_support/include")
|
|
|
|
|
|
|
|
idf_component_mock(INCLUDE_DIRS ${include_dirs}
|
2021-07-21 04:07:53 +00:00
|
|
|
REQUIRES freertos
|
2021-01-14 04:11:22 +00:00
|
|
|
MOCK_HEADER_FILES
|
|
|
|
${original_driver_dir}/include/driver/spi_master.h
|
|
|
|
${original_driver_dir}/include/driver/spi_common.h
|
2021-10-22 02:35:46 +00:00
|
|
|
${original_driver_dir}/include/driver/i2c.h
|
2021-01-14 04:11:22 +00:00
|
|
|
${original_driver_dir}/include/driver/gpio.h)
|
2022-12-02 06:54:27 +00:00
|
|
|
|
|
|
|
target_compile_definitions(${COMPONENT_LIB} PUBLIC SOC_I2C_NUM=2)
|