lewisxhe / XPowersLib

Arduino,CircuitPython,Micropython, esp-idf library for x-powers power management series
MIT License
63 stars 18 forks source link

The library is not supported in pure C language #9

Closed vabatta closed 1 year ago

vabatta commented 1 year ago

Hi,

I've been trying to use the library in my project from PlatformIO (v0.1.7) but after having it included in my espidf pure C code, the compiler complains about hpp and tpp files (because they are actually not C friendly and cannot be compiled and included in a C project: see https://stackoverflow.com/questions/152555/h-or-hpp-for-your-class-definitions).

Can you please make it so it would be usable? Or is there an alternative to manage the PMU (I have T-7080G-S3) using other libs?

lyusupov commented 1 year ago

Example of use as ESP-IDF component:

This library (earlier version) was included in the Adafruit TinyUF2 project as an ESP32 'component' - https://github.com/adafruit/tinyuf2/tree/master/ports/espressif/components

You may try to pick some hints there...

This library is written in C++ (and Python) with heavy use of classes. There is no chance to build it with a plain C compiler.

lewisxhe commented 1 year ago

Thank you for Linar's reply. This library was originally designed for Arduino and IDF to use. It is open source and you can freely change it. Currently, I do not plan to be compatible with C