Closed
Description
In the example BasicUsage.ino, we call the Arduino_PMIC.h
header file.
This is problematic for two main reasons:
- Firstly, the naming implies that there is a single unified interface for dealing with PMIC across the Arduino ecosystem. Which there isn't: we have four in active use AFAIK. This leads to confusion from a documentation point of view.
- Secondly, given the way files are arranged library conflicts may occur between the BQ24195 and PF1550 library since both have a
Arduino_PMIC.h
file. Depending upon which library is loaded first, it can block the other library from loading.Arduino_PF1550/src/Arduino_PMIC.h
Line 19 in 2852629
Possible Solutions
- Quick fix: In our examples, we directly call the relevant library. So instead of
Arduino_PMIC.h
we would useBQ24195.h
orPF1550.h
. This should be possible. Users are then advised to check which board they have and select the PMIC library accordingly. This would slightly reduce the portability of the code, but ensure that it runs correctly - Intensive Fix: Have a wrapper library, which contains
Arduino_PMIC.h
that calls the relevant PMIC library based on the board selected in the IDE or (optionally) an option in the sketch directly. I assume this would require more work (and potentially break things). Yet it would make the user experience more fluid. - The third option would be to integrate the PMIC library directly into the core variant. @giulcioffi and @facchinm have done this for the https://github.com/arduino/ArduinoCore-mbed/blob/master/libraries/Nicla_System/src/BQ25120A.h
Until a solution is decided upon & delivered, is it safe to use PF1550.h
inside newly developed tutorials & app notes?
Related to: arduino-libraries/Arduino_BQ24195#23