Unified library for M5Stack series
This library provides access to the built-in hardware of M5Stack controllers. Library functionality is available through the m5 namespace, and includes the following:
M5Unified requires M5GFX to be installed.
#include "M5Unified.h"
In the Arduino IDE, once the M5Unified library is installed through Library Manager, the following example programs are available under File > Examples > M5Unified > Basic.
The following functionality is built in to the ESP32 framework or available elsewhere, independent of any hardware included in the M5Stack products, and do not require or have explicit support in the M5Unified library. To use these functions, simply use existing ESP32 or Arduino supporting libraries. This list is provided for the benefit of newcomers who may be asking where the "M5Unified" support for a particular feature is found, before discovering that it's either already part of the basic ESP32 platform, or a device that is generic enough (e.g. I2C or SPI) to be fully supported with generic libraries found online, including in the Arduino library manager, that work with any platform.
When arduino-esp32 is used as an ESP-IDF component together with this library, the library links
the Arduino component automatically (it looks for a component named arduino, arduino-esp32 or
espressif__arduino-esp32 in the build) so that it is compiled with the same ARDUINO definitions
as the application. Without that, the application and the library would see different layouts of the
same classes. Set M5UNIFIED_ARDUINO_COMPONENT= (CMake cache variable) if your Arduino component
has another name, or M5UNIFIED_ARDUINO_COMPONENT=OFF to disable this.
| |M5Stack BASIC GRAY |M5Stack GO/FIRE |M5Stack Core2(AWS) Tough |M5Stick C/CPlus |M5Stick CPlus2 |M5Stack CoreInk |M5Paper |M5Station |M5ATOM Lite/Matrix ECHO/U PSRAM |M5STAMP
PICO | |
|:------------------:|:---------------------------------:|:---------------------------------:|:-------------------------------------:|:----------------------------:|:-------------------------:|:----------------------:|:---------------------:|:---------------------:|:---------------------------------------:|:------------------:|:------------------:|
|GPIO 0
ADC2_CH1|M-Bus
IIS_MK |M-Bus
IIS_MK |M-Bus
SPK_LRCK
PDM_C(Core2)|HAT
PAD
PDM_C |HAT
PDM_C |EPD_RST | --- | --- | --- | |GPIO 0
ADC2_CH1|
|GPIO 1
USB_TX |M-Bus
Serial |M-Bus
Serial |M-Bus
Serial |Serial |Serial |Serial |Serial |Serial |Serial |Serial |GPIO 1
USB_TX |
|GPIO 2
ADC2_CH2|M-Bus
|M-Bus
|M-Bus
SPK_D |PAD
Beep(CPlus) |Beep |Beep |PW_Hold |ReadEn | --- | --- |GPIO 2
ADC2_CH2|
|GPIO 3
USB_RX |M-Bus
Serial |M-Bus
Serial |M-Bus
Serial |Serial |Serial |Serial |Serial |Serial |Serial |Serial |GPIO 3
USB_RX |
|GPIO 4
ADC2_CH0|TF_CS |TF_CS |TF_CS | --- |PW_Hold |EPD_BUSY |TF_CS |RGB LED | --- | --- |GPIO 4
ADC2_CH0|
|GPIO 5 |M-Bus |M-Bus |LCD_CS |LCD_CS |LCD_CS |BTN_HAT |EXT_5V |LCD_CS |Bus(P)
PDM_C(U) | --- |GPIO 5 |
|GPIO 9 | --- | --- | --- |InfraRed | --- |EPD_CS | --- | --- | --- | --- |GPIO 9 |
|GPIO10 | --- | --- | --- |LED | --- |LED | --- | --- | --- | --- |GPIO10 |
|GPIO12
ADC2_CH5|M-Bus
IIS_SK |M-Bus
IIS_SK |SPK_BCLK | --- |LCD_RST |PW_Hold |SPI_MOSI |USB_PW |InfraRed | --- |GPIO12
ADC2_CH5|
|GPIO13
ADC2_CH4|M-Bus
IIS_WS |M-Bus
IIS_WS |M-Bus
RXD2 |SPI_SCLK |SPI_SCLK |MI-Bus
RXD2 |SPI_MISO |PORT.C1 | --- | --- |GPIO13
ADC2_CH4|
|GPIO14
ADC2_CH6|LCD_CS |LCD_CS |M-Bus
TXD2 | --- |LCD_D/C |MI-Bus
TXD2 |SPI_SCLK |PORT.C1 | --- | --- |GPIO14
ADC2_CH6|
|GPIO15
ADC2_CH3|M-Bus
IIS_OUT |M-Bus
RGB LED |LCD_D/C |SPI_MOSI |SPI_MOSI |EPD_D/C |EPD_CS |LCD_RST | --- | --- |GPIO15
ADC2_CH3|
|GPIO16
PSRAM |M-Bus
RXD2 |M-Bus
PORT.C
RXD2 | --- | --- |--- | --- | --- |PORT.C2
RXD2 | --- | --- |GPIO16
PSRAM |
|GPIO17
PSRAM |M-Bus
TXD2 |M-Bus
PORT.C
TXD2 | --- | --- |--- | --- | ---
No open issues yet, or sync has not completed.