device-os
device-os copied to clipboard
[system] power: add method to specify the PMIC/FuelGauge interrupt pin.
NOTE: this PR is targeting the feature/auxiliary-power-control
branch
Problem
-
Currently the pin for PMIC interrupt is pre-defined per platform in DVOS and customer has to designed their own board according to the pin number for the PMIC interrupt.
-
We have allocated the A6 pin for the PMIC interrupt on the MSoM. For Muon, we'd like to make PMIC be capable of waking up device from hibernate mode, however the A6 pin doesn't not have this ability. Thus, for Muon we connect the PMIC interrupt pin to A7, which is capable of doing what we want. But DVOS doesn't has a method to change the default pin for PMIC interrupt.
Solution
Introduce a new method SystemPowerConfiguration::intPin(pin)
to specify another pin for PMIC/FuelGauge interrupt.
Steps to Test
Hardware: SoM Eval board + MSoM
- Flash the attached test app
- Remove the
PM_INT
jumper on the SoM EVAL board - Fly wire the
A7
with thePM_INT
pin - See if the system power manager behaves as expected
Example App
#include "application.h"
STARTUP(
System.setPowerConfiguration(SystemPowerConfiguration().feature(SystemPowerFeature::PMIC_DETECTION).intPin(A7));
);
SYSTEM_MODE(MANUAL);
Serial1LogHandler logHandler(115200, LOG_LEVEL_ALL);
void setup() {
}
void loop() {
}
References
N/A
Completeness
- [x] User is totes amazing for contributing!
- [x] Contributor has signed CLA (Info here)
- [x] Problem and Solution clearly stated
- [ ] Run unit/integration/application tests on device
- [ ] Added documentation
- [ ] Added to CHANGELOG.md after merging (add links to docs and issues)