M5StickC Plus - detect power button momentary press?
-
I can't find a way to detect a momentary press of the power button on the M5StickCPlus, only button A and button B detection is described. Is there any way to do this in C++?
-
Hello @bazman
according to the schematic the power button only is connected to the AXP192 and not to an ESP32 GPIO as are buttons A and B. Luckily the AXP192 can be setup to detect the power button short / long press via interrupt.
Checkout the AXP192 datasheet - you can find it here. The AXP192 registers dealing with short / long power button press interrupts are 0x42 (IRQ enable 3) and 0x46 (IRQ status 3).
Thanks
Felix