Hello everyone,
We are currently working on a project that uses the nPM2100 to power an nRF52840. Our application requires automatic enabling break-to-wake mode each time the SHPHLD pin is shorted (power switch based on the state of the SHPHLD pin)
At the moment, in our firmware (NCS 3.2.3), we are able to configure the controller through the overlay, but we do not see any way to enable this mode.
npm2100_pmic: pmic@74 {
compatible = "nordic,npm2100";
reg = <0x74>;
shiphold-longpress = "ship";
// shiphold-current = "low";
// shiphold-hibernate-wakeup;
npm2100_gpio: gpio-controller {
compatible = "nordic,npm2100-gpio";
gpio-controller;
#gpio-cells = <2>;
ngpios = <2>;
};
npm2100_regulators: regulators {
compatible = "nordic,npm2100-regulator";
npm2100_boost: BOOST {
regulator-always-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-init-microvolt = <3300000>;
regulator-init-microamp = <300000>;
regulator-initial-mode = <(NPM2100_REG_OPER_AUTO | NPM2100_REG_FORCE_PASS)>;
mode-gpios = <&npm2100_gpio 0 (GPIO_ACTIVE_LOW | GPIO_PULL_DOWN | NPM2100_GPIO_DEBOUNCE_OFF)>;
};
npm2100_ldosw: LDOSW {
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <3000000>;
regulator-initial-mode = <(NPM2100_REG_OPER_ULP | NPM2100_REG_LDSW_EN)>;
mode-gpios = <&npm2100_gpio 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN | NPM2100_GPIO_DEBOUNCE_OFF)>;
};
};
npm2100_wdt: watchdog {
compatible = "nordic,npm2100-wdt";
};
npm2100_vbat: vbat {
compatible = "nordic,npm2100-vbat";
};
};
Is it possible to configure break-to-wake mode using only the devicetree? I reviewed the driver itself and found options such as:
// shiphold-current = "low";
// shiphold-hibernate-wakeup;
Unfortunately, these do not seem to allow switching the mode itself.
If not, is there any example code available that enables it over I2C from the microcontroller? If I understand it correctly, I could use a callback from the SHPHLD pin and manually put the controller into break-to-wake mode.
Thank you in advance for any help. Perhaps someone has run into the same problem and managed to solve it.
Best regards,
Paweł