You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**<spanstyle="font-size: larger">This library is not recommended for new projects, nor for projects using M5Stack products other than _Basic_ and _Gray_. See [M5Unified](https://github.com/M5Stack/M5Unified) and [M5GFX](https://github.com/M5Stack/M5GFX) for libraries that are more up-to-date and with support for many newer M5Stack products.</span>**
11
12
12
-
***For the Detailed documentation of Gray, please [Click here](https://docs.m5stack.com/en/core/gray)**
13
+
## Usage
14
+
This library's functionality is available through the M5Stack class, referenced as `M5`, including:
15
+
- LCD display via `M5.Lcd`, a customized version of the [TFT_eSPI](https://github.com/Bodmer/TFT_eSPI) LCD library, adapted for Basic and Gray. The display resolution is 320x240 supporting 262K colors. Several fonts, graphics primitives, QR code rendering, and PNG/BMP/JPEG support are included.
16
+
- Power control, including device shutoff and battery level detection via `M5.Power` and the IP5306 power management chip
17
+
- Hardware buttons via `M5.BtnA`, `M5.BtnB`, `M5.BtnC`
18
+
- Speaker, via `M5.Speaker`, supporting tones, volume control, and basic wave audio playback using ESP32's DAC function
19
+
- Accelerometer, via `M5.Imu`, `M5.Mpu6886`, or `M5.Sh200Q` (accelerometer type depends on version of Basic/Gray)
13
20
14
-
***For the Detailed documentation of Basic, please [Click here](https://docs.m5stack.com/en/core/basic_v2.6)**
21
+
To use the M5Stack library, `#include "M5Stack.h"` must appear at the top of your sketch.
15
22
16
-
***In order to buy Gray, please [Click here](https://shop.m5stack.com/products/grey-development-core)**
23
+
The most productive way to become acquainted with the class is through the numerous included examples. Additional documentation within this library:
***In order to buy Basic, please [Click here](https://shop.m5stack.com/products/esp32-basic-core-iot-development-kit-v2-6)**
26
+
Additional optional include files:
27
+
-`M5Faces.h` for access to M5Stack Faces accessories (EOL)
28
+
-`LoRaWan.h`
19
29
20
-
*We have several master M5Cores with different configurations, this is the difference between them [Compared](https://docs.m5stack.com/en/products_selector).*
***Hardware documentation for [Gray v1.0 (EOL)](https://docs.m5stack.com/en/core/gray)**
24
33
25
-
## More Information
34
+
***Hardware documentation for [Basic v1.0 (EOL)](https://docs.m5stack.com/en/core/basic)[Basic v2.6 (EOL)](https://docs.m5stack.com/en/core/basic_v2.6)[Basic v2.7](https://docs.m5stack.com/en/core/basic_v2.7)**. The version number may be printed on the main circuit board next to the SD card slot.
*[M5StackHIDCtrlAltDel](https://github.com/mhama/M5StackHIDCtrlAltDel) - You can send ctrl+alt+del to your PC from M5Stack
94
+
*[M5StackHIDCtrlAltDel](https://github.com/mhama/M5StackHIDCtrlAltDel) - You can send ctrl+alt+del to your PC via Bluetooth from M5Stack
85
95
86
96
*[M5Stack Markdown Web Server](https://github.com/PartsandCircuits/M5Stack-MarkdownWebServer) - Markdown & icons loaded from an Micro SD card/TF card to run a web page
## 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 via M5.Power, which is implemented in
7
+
`src/utility/Power.h` and `src/utility/Power.cpp`, and becomes available 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?** If `isCharging()` or `isChargeFull()` true, probably on external power.
17
+
-**Can it detect the rate of charge or discharge?***probably not, but inference can probably be made by comparing `isChargeFull()` to the charge full current cutoff*
18
+
-**Can it tell if a battery is present or absent?***possibly, but not formally... an absent battery seems to always be reported as "charging", having a level of "100%", and never becomes "charge full"*
19
+
-**Can it tell the state of charge of the battery?** Yes, using `getBatteryLevel()`, which returns one of:
20
+
0, 25, 50, 75, 100 (representing a percentage), or -1 (if unable to read)
21
+
-**Can it read its battery voltage?** Not possible to read the voltage level directly, only the approximate percentage of 0/25/50/75/100.
22
+
-**Can communication with the IP5306 power controller be tested and confirmed?** Yes, with `canControl()`
23
+
-**Where does the IP5306 power controller get its own power?** Only from either the battery or the USB port. The 5V connection on the M5Stack
24
+
Core/Basic/Gray controller is not a power *source* for the IP5306 chip and is considered downstream from the chip (i.e. the *output*). If the M5Stack controller
25
+
is being powered through the 5V connection other than the USB port (for example, through a base or some other accessory), this power is not an *input* to the IP5306 chip,
26
+
and will not charge the battery. The IP5306 will shut down under this condition to minimize battery drain, unless configured not to.
27
+
When the chip is shut down, it will not respond to I2C communication
28
+
(for example, `getBatteryLevel()` will return -1)
29
+
-**What other capabilities?***(to be answered -- translation of Chinese-language datasheet is difficult to understand)*
30
+
-*auto shutoff settings - voltage low for how long causes a shutoff*
31
+
-*inhibit the power button, report it as an event?*
32
+
-*setting the charging voltage and current*
33
+
-*distinguish between a software/hardware/watchdog/sleep/poweron reset*
34
+
-*maintain any of the settings across power cycles and/or complete loss of all power*
35
+
-*how does setAutoBootOnLoad() work? when enabled, it seems the device can be powered back on simply by connecting a load -- such as
36
+
connecting another M5Stack controller to be powered from PORT_A -- if done before the shutdown_8s time expires*
0 commit comments