pdf-icon

M5.getBoard()

List of development boards that can be obtained with M5.getBoard()

Board Value
M5Stack m5::board_t::board_M5Stack
M5StackCore2 m5::board_t::board_M5StackCore2
M5StickC m5::board_t::board_M5StickC
M5StickCPlus m5::board_t::board_M5StickCPlus
M5StackCoreInk m5::board_t::board_M5StackCoreInk
M5Paper m5::board_t::board_M5Paper
M5Tough m5::board_t::board_M5Tough
M5Station m5::board_t::board_M5Station
M5Atom m5::board_t::board_M5Atom
M5AtomPsram m5::board_t::board_M5AtomPsram
M5AtomU m5::board_t::board_M5AtomU
M5TimerCam m5::board_t::board_M5TimerCam
M5StampPico m5::board_t::board_M5StampPico
M5StampC3 m5::board_t::board_M5StampC3
M5StampC3U m5::board_t::board_M5StampC3U

M5.config()

List of items that can be set by M5.config()

Argument Type Description Initial Value Remarks
serial_baudrate uint32_t USB serial baud rate 115200 Arduino-esp32 only
clear_display bool clear the screen when the device is started or not true valid only for devices with a screen
output_power bool external 5V output ON(true)/OFF(false) true only for devices with AXP192
internal_imu bool whether internal IMU is used or not true valid only for models with IMU
internal_rtc bool whether to use built-in RTC or not true only for the models with RTC
internal_spk bool whether to use built-in speaker or not true only available on models with speaker
internal_mic bool whether to use built-in microphone or not true available only for the model with microphone
external_imu bool whether to use Unit IMU or Accel false for Unit IMU(*1) and Accel(*2)
external_rtc bool Whether Unit RTC is used or not false For Unit RTC(*3)
external_spk bool use external speaker or not false for SPK_HAT(*4) or ATOMIC_SPK(*5)
led_brightness uint8_t brightness of built-in LED (0~255) 0 valid only for models with built-in LED (not for RGBLED)

*1 Unit IMU

*2 Unit Accel

*3 Unit RTC

*4 SPK HAT

*5 ATOM Speaker Kit

M5.Speaker.config()

List of items that can be set by M5.Speaker.config()

Item Type Parameter Initial value Remarks
pin_data_out int I2S Data Out -1 GPIO
pin_bck int I2S bck -1 GPIO
pin_ws int I2S WS(LRCK) -1 GPIO
sample_rate uint32_t sample rate(Hz) 64000 stereo
stereo bool whether the data to be handled is stereo or not false
buzzer bool whether buzzer output is used or not false if buzzer is used, only pin_data_out needs to be set
use_dac bool use built-in DAC for output false setting is only for pin_data_out (GPIO_NUM_25 or GPIO_NUM_26)
dac_zero_level unit8_t zero level reference value when DAC is used 0 0: Dynamic Change
magnification uint8_t multiplier for output value 16 16
dma_buf_len size_t length of I2S DMA buffer 128
dma_buf_count size_t number of I2S DMA buffers 8
task_priority UBasetype_t priority of speaker playback task 2
task_pinned_core Basetype_t core to which speaker playback task is assigned -1
i2s_port i2s_port_t I2S port i2s_port_t::I2S_NUM_0 0 or 1

About buttons

The buttons available for each model are as follows.

Device BtnA BtnB BtnC BtnPWR BtnEXT
M5Stack Basic/Gray/Fire GPIO39 GPIO38 GPIO37 - -
M5Stack Core2 TouchA TouchB TouchC -
M5Stick C/CPlus GPIO39 GPIO37 - AXP192 -
M5Stack CoreInk GPIO37(Up) GPIO38(Press) GPIO39(Down) GPIO27 GPIO5 (*1)
M5Paper GPIO37(Up) GPIO38(Press) GPIO39(Down) - -
M5Station GPIO37 GPIO38 GPIO39 AXP192 -
M5Tough - - - AXP192 -
M5Atom/M5StampPico GPIO39 - - - -
M5StampC3 GPIO3 - - - -
M5StacmC3U GPIO9 - - - -

*1. Top button of CoreInk

On This Page