Page 1 of 1

Cpp Programming in ESP-IDF

Posted: Wed Nov 30, 2022 9:28 am
by Manimekalai
Can I convert all ESP-IDF examples to C++.If it is yes then what I have to do?

Re: Cpp Programming in ESP-IDF

Posted: Fri Dec 02, 2022 2:49 am
by mbratch
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.

Re: Cpp Programming in ESP-IDF

Posted: Tue Dec 06, 2022 2:07 pm
by gtjoseph
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