device-os icon indicating copy to clipboard operation
device-os copied to clipboard

[system] power: add method to specify the PMIC/FuelGauge interrupt pin.

Open XuGuohui opened this issue 8 months ago • 0 comments

NOTE: this PR is targeting the feature/auxiliary-power-control branch

Problem

  1. 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.

  2. 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

  1. Flash the attached test app
  2. Remove the PM_INT jumper on the SoM EVAL board
  3. Fly wire the A7 with the PM_INT pin
  4. 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)

XuGuohui avatar May 29 '24 15:05 XuGuohui