Skip to content

Header file conflict with PF1550 library #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
aliphys opened this issue Aug 8, 2022 · 0 comments
Open

Header file conflict with PF1550 library #23

aliphys opened this issue Aug 8, 2022 · 0 comments
Labels
topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project

Comments

@aliphys
Copy link
Contributor

aliphys commented Aug 8, 2022

In the example BatteryCharger.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.
    • BQ24195 (this one)
    • PF1550 (used in the Portenta family, apart from the X8)
    • BD71847 (for the X8), and
    • BQ25120
  • 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.

Possible Solutions

  • Quick fix: In our examples, we directly call the relevant library. So instead of Arduino_PMIC.h we would use BQ24195.h or PF1550.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 BQ24195.h inside newly developed tutorials & app notes?


Related to: arduino-libraries/Arduino_PF1550#3

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: documentation Related to documentation for the project labels Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants