How to add component to a project?

espOAK
Posts: 9
Joined: Wed Mar 18, 2020 8:34 am

How to add component to a project?

Postby espOAK » Mon Mar 23, 2020 6:53 am

Hi,

I have a project and want to use some esp-idf components, eg

-- MyProject
| |
| -- src
|
-- esp
|
-- esp-idf
|
-- components
|
-- driver

There is some c-files needed in the driver folder.

To be able to use these components including all include files, how to include them in MyProject? What needs to be done? I must copy files? How to update the CMakeLists.txt? I can't find howto anywhere!

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: How to add component to a project?

Postby ESP_igrr » Mon Mar 23, 2020 8:41 pm

Hi espOAK,
Perhaps you can start with one of the examples provided in ESP-IDF? You can start with an example for the driver you plan to be using. Examples are a good starting point because they demonstrate the project layout and also the driver APIs.


About the project layout and the component requirements, you can read here: https://docs.espressif.com/projects/esp ... le-project (link for the latest ESP-IDF; if you are using a different version, choose it in the version picker in the lower left corner)

Who is online

Users browsing this forum: No registered users and 66 guests