CMakeLists.txt and #include for spi_master.h
Posted: Sun Dec 10, 2023 11:32 am
Dear all,
I have imported a framework 5.1.1 project into framework 5.1.2, and now the linker can't find some header files. I used the File-> Import facility.
I need the header files spi_master.h and spi_common.h, but how do I get them included? I have tried several permutations, but none works.
The path of the header files is: /frameworks/esp-idf-v5.1.2/components/driver/spi/include/driver/spi_master.h and the same for spi_common.h.
My CMakeLists.txt for the component needing the spi is:
idf_component_register{ SRCS "SDC.c" INCLUDE_DIRS "include" REQUIRES "driver" "esp_timer"}
In the source file SDC.c is: #include "esp_timer.h" #include "driver/spi_master.h" #include "driver/spi_common.h"
CMake finds the esp_timer.h but not spi_master.h and not spi_common.h.
How do I get spi_master.h and spi_common.h included?
I have tried to use REQUIRES "driver/spi" within idf_component_register, but that results in several error messages in red ink from the builder.
I use the Espressif IDE as is, and I use the C language.
Regards
Jorgen
I have imported a framework 5.1.1 project into framework 5.1.2, and now the linker can't find some header files. I used the File-> Import facility.
I need the header files spi_master.h and spi_common.h, but how do I get them included? I have tried several permutations, but none works.
The path of the header files is: /frameworks/esp-idf-v5.1.2/components/driver/spi/include/driver/spi_master.h and the same for spi_common.h.
My CMakeLists.txt for the component needing the spi is:
idf_component_register{ SRCS "SDC.c" INCLUDE_DIRS "include" REQUIRES "driver" "esp_timer"}
In the source file SDC.c is: #include "esp_timer.h" #include "driver/spi_master.h" #include "driver/spi_common.h"
CMake finds the esp_timer.h but not spi_master.h and not spi_common.h.
How do I get spi_master.h and spi_common.h included?
I have tried to use REQUIRES "driver/spi" within idf_component_register, but that results in several error messages in red ink from the builder.
I use the Espressif IDE as is, and I use the C language.
Regards
Jorgen