|
| 1 | +## Power management capabilities of M5Stack Core / Basic / Gray |
| 2 | + |
| 3 | +Document v0.1 |
| 4 | + |
| 5 | +The power management capabilities are provided by the IP5306 power controller, specifically the IP5306_I2C version of the controller, |
| 6 | +that can be accessed on the I2C bus at address 0x75. Access is possible using the `POWER` class, |
| 7 | +located in `Power.h` and `Power.cpp`, automatically included with `#include "M5Stack.h"`. |
| 8 | + |
| 9 | +### Capabilities |
| 10 | + |
| 11 | +- **Can the M5Stack Core turn itself off?** Yes, using `powerOFF()`, which shuts off the LED backlight, the WiFi radio, the |
| 12 | + Bluetooth stack, and then asks the chip to remove the power before putting the ESP into deep sleep mode. If called when the device is externally powered, |
| 13 | + these actions (including the deep sleep mode) will give the appearance and effect of being powered off. Pressing the power/reset button turns it back on. |
| 14 | +- **Can it wake itself back up after a pre-determined delay or at a specific time?** |
| 15 | + No, since it doesn't have a real-time clock chip (RTC), but ESP32 sleep modes may provide a suitable alternative. |
| 16 | +- **Can it tell if it is running on external versus battery power?** |
| 17 | +- **Can it tell if the battery is being charged or discharged?** |
| 18 | +- **Can it tell if a battery is present or absent?** *possibly, but not formally* |
| 19 | +- **Can it tell the state of charge of the battery?** Yes, using `getBatteryLevel()`, which returns one of: 25, 50, 75, 100 (representing a percentage), or -1 (if unable to read) |
| 20 | +- **Can it read its battery voltage?** Not possible to read the voltage level directly, only the approximate percentage of 25/50/75/100. |
| 21 | +- **Can communication with the IP5306 power controller be tested and confirmed?** Yes, with `canControl()` |
| 22 | +- **What other capabilities?** *(to be answered -- translation of Chinese-language datasheet is difficult to understand)* |
| 23 | + - *auto shutoff settings - voltage low for how long causes a shutoff* |
| 24 | + - *inhibit the power button, report it as an event?* |
| 25 | + - *setting the charging voltage and current* |
| 26 | + - *distinguish between a software/hardware/watchdog/poweron reset* |
| 27 | + - *maintain any of the settings across power cycles and/or complete loss of all power* |
0 commit comments