Using code from the npm13xx_one_button sample, going into ship mode from event_callback(const struct device *dev, struct gpio_callback *cb, uint32_t pins) works fine on a button release with the following function call:
Using code from the npm13xx_one_button sample, going into ship mode from event_callback(const struct device *dev, struct gpio_callback *cb, uint32_t pins) works fine on a button release with the following function call:
Hi Keith,
Checking this internally with experts and will get back to you.
-Priyanka
Hi Keith,
Checking this internally with experts and will get back to you.
-Priyanka
Thank you, but I discovered a different way to do this.
That's great.
I suspect that it's because the parent is only 'known' inside the handler.
This is not the case.
Since the SHPHLD button is also used to wake up the device, we guess what you are experiencing is that the regulator_parent_ship_mode call succeeds, but the device immediately wakes up since the button remains pressed (wakeup is level-triggered).
If you want a power off button-like behaviour, you could utilize one of the GPIOs to do that if available. One could get fall/rise events on any GPIO too.
-Priyanka