Espidf and libraries (for ds3231 RTC)

I am looking at a project written with vscode/pio - where the platform is espressif32 and framework is espidf.

I am trying to figure out if some kind of library for a ds3231 real time clock can be added - but have had no success so far.

I assume, that this probably is caused by the fact, that most libraries are written for the arduino framework - and that they cannot work with espidf ?

Look into the ESP-IDF specific component registry then.

https://components.espressif.com/components?q=ds3231

Which will easily lead you to the library of e.g.

https://components.espressif.com/components/esp-idf-lib/ds3231/versions/1.1.7/readme

with an example of

https://github.com/esp-idf-lib/ds3231/tree/cbe14063d3f2bf39489e18d896c725b8111b5cc4/examples/default

You can include ESP-IDF components such as that library in your PlatformIO project by putting it in the idf_component.yml file of your project, example.

## IDF Component Manager Manifest File
dependencies:
  esp-idf-lib/ds3231: "1.1.7"

after which you have to do a clean rebuild of your project (delete .pio folder and hit ‘Build’ again)

I’ve uploaded a full example at