Cpp Programming in ESP-IDF

Manimekalai
Posts: 1
Joined: Wed Nov 30, 2022 9:04 am

Cpp Programming in ESP-IDF

Postby Manimekalai » Wed Nov 30, 2022 9:28 am

Can I convert all ESP-IDF examples to C++.If it is yes then what I have to do?

User avatar
mbratch
Posts: 298
Joined: Fri Jun 11, 2021 1:51 pm

Re: Cpp Programming in ESP-IDF

Postby mbratch » Fri Dec 02, 2022 2:49 am

Yes, they could be converted. I'm not sure I understand the question about what would need to be done. You would need to comprehend what the example is doing and write a C++ program that does what the example does. You can call the ESP-IDF API functions from C++. If you need to provide a call-back, FreeRTOS task/timer, or an event handler, you can use a static class method if desired.

User avatar
gtjoseph
Posts: 81
Joined: Fri Oct 15, 2021 10:55 pm

Re: Cpp Programming in ESP-IDF

Postby gtjoseph » Tue Dec 06, 2022 2:07 pm

There's also the esp-idf-cxx component that provides c++ interfaces for things like events, timers, gpio, i2c and spi.
https://github.com/espressif/esp-idf-cxx

Who is online

Users browsing this forum: No registered users and 99 guests