Skip to content

Add support for M5Stack CoreMatrix (ESP32-C61) - #242

Merged
lovyan03 merged 2 commits into
m5stack:developfrom
ainyan03:corematrix
Aug 10, 2026
Merged

Add support for M5Stack CoreMatrix (ESP32-C61)#242
lovyan03 merged 2 commits into
m5stack:developfrom
ainyan03:corematrix

Conversation

@ainyan03

Copy link
Copy Markdown
Contributor

Adds support for the upcoming M5Stack CoreMatrix (ESP32-C61 + TM1680 16x16 LED matrix).

  • New Panel_TM1680 driver (I2C, 24ROW x 16COM mode): the frame buffer keeps the Panel_1bitOLED page layout and is converted to the TM1680 RAM layout when pushed by display(). The controller does not respond to I2C reads and has no display-invert command, so the driver probes by address ACK only and applies inversion while packing. Brightness maps to the global 16-step PWM duty.
  • Autodetect for board_M5CoreMatrix: probes the M5PM1 and M5IOE1 over software I2C first, then powers the LED matrix rail through M5IOE1 PIN4 before checking for the TM1680 (the controller sits on that rail and does not respond until powered).
  • Default rotation is 1 with offset_rotation 3, which shows upright with the ABC buttons at the top.

Verified on hardware: autodetect, drawing, 16-step brightness, and setRotation 0-7 including the mirrored modes.

A companion M5Unified PR follows.

I2C driver for the Titan Micro TM1680 in 24ROW x 16COM mode,
used as a 16x16 monochrome LED matrix.

- The frame buffer keeps the Panel_1bitOLED page layout and is
  converted to the TM1680 RAM layout (row bits A3-A0 in the upper
  nibble half) when pushed by display().
- The whole frame is only 32 bytes, so display() always sends it
  in full as a single transaction.
- The controller does not respond to I2C reads, so init() skips
  the read probe used by other 1bit panels.
- There is no display-invert command; inversion is applied while
  packing the buffer.
- Brightness maps to the global 16-step PWM duty.
Autodetect probes the M5PM1 and M5IOE1 over software I2C first,
then powers the LED matrix rail through M5IOE1 PIN4 before checking
for the TM1680: the controller sits on that rail and does not
respond on I2C until powered. The TM1680 has no ID register, so
presence is confirmed by an address ACK only.

The default rotation is 1 with offset_rotation 3, which shows
upright with the ABC buttons at the top (verified on hardware).
@lovyan03
lovyan03 merged commit 62b2dc1 into m5stack:develop Aug 10, 2026
23 checks passed
@lovyan03
lovyan03 requested a lite review from Copilot August 10, 2026 05:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class support for the upcoming M5Stack CoreMatrix (ESP32-C61 + TM1680 16×16 LED matrix) by introducing a dedicated TM1680 panel driver and wiring it into ESP-IDF target autodetection and board naming.

Changes:

  • Added Panel_TM1680 (I2C, 24ROW×16COM) with framebuffer-to-TM1680 RAM packing on display().
  • Implemented ESP32-C61 board_M5CoreMatrix autodetect flow, including powering the LED matrix rail via M5IOE1 before probing TM1680 by address ACK.
  • Registered board_M5CoreMatrix in the board title mapping.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/M5GFX.cpp Adds ESP32-C61-specific autodetect + TM1680 bus/panel setup and board title string.
src/lgfx/v1/panel/Panel_TM1680.hpp Declares the new TM1680 panel driver interface and init command list.
src/lgfx/v1/panel/Panel_TM1680.cpp Implements TM1680 initialization, sleep/brightness control, and buffer packing + push.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@lovyan03
lovyan03 deleted the corematrix branch August 10, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants