Skip to content

feat(toolbox): add original M5Stack M5Paper preset - #187

Open
gcormier wants to merge 3 commits into
OpenDisplay:mainfrom
gcormier:greg/awesome-dijkstra-5pq3ha
Open

gcormier wants to merge 3 commits into
OpenDisplay:mainfrom
gcormier:greg/awesome-dijkstra-5pq3ha

Conversation

@gcormier

Copy link
Copy Markdown

Adds a toolbox preset for the original M5Stack M5Paper (ESP32, 960×540 with an IT8951).

Requires the firmware from OpenDisplay/Firmware#175 (panel IC 3005).

Changes

  • config.yaml: add panel_ic_type 3005, m5paper_960x540.
  • simple-config-presets.json: add the m5-paper device preset and two display presets, m5-paper-960x540 (1bpp) and m5-paper-960x540-4gray (16-gray, the default). The device preset covers the IT8951 pins, GT911 touch (flags 0x06), buttons 37/38/39, the GPIO2 power latch, and battery sense with factor 0xAE. It installs the esp32-wrover-e-N4R8 firmware.
  • simple-config-id-registry.json: register device 33 and displays 47 and 48.

ID clash: #183 (also mine) registers display 47. Whichever merges second needs to move up one; I'll fix it in whichever is still open.

Testing

On an original M5Paper running OpenDisplay/Firmware#175, with the same values written over BLE using the firmware repo's tools/od-device-cli.py write-config:

  • Gray and mono both render correctly.
  • Touch coordinates come out the right way round with flags 0x06.
  • The board stays on with USB unplugged.
  • The battery reads 4.20 V at full charge with factor 0xAE. M5EPD assumes a 2:1 divider, and the board's ADC readings match that, not the 0.79 ratio on the schematic.

Not tested: the toolbox UI flow itself (selecting the preset and writing it from the browser), and the battery factor at lower charge or against a multimeter.

gcormier and others added 3 commits October 26, 2026 00:56
Adds the M5Paper (classic ESP32 + IT8951, 4.7" ED047TC1 960x540) as a
driverBoard plus mono and 4bpp-gray display entries, reusing the
existing esp32-wrover-e-N4R8_full.json manifest (same env as the
Inkplates).

- simple-config-presets.json: m5-paper (index 33), m5-paper-960x540 (47),
  m5-paper-960x540-4gray (48, color_scheme 6)
- simple-config-id-registry.json: matching id -> index appends
- config.yaml: panel_ic_type 3005 (m5paper_960x540)

Board: IT8951 SPI MOSI 12 / MISO 13 / SCK 14 / CS 15 / BUSY 27, reset
23 (IT8951 supply gate); MOSFET latch on GPIO2 (device_flags 0x8);
battery ADC GPIO35; rocker buttons 37/38/39; GT911 on I2C 21/22, INT 36.
Partial updates off for now. Default power is USB until the firmware's
RTC power-off wake lands. Voltage scaling and touch orientation still
need checking on hardware.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KZwG6PyfGku5uKoVTyB9MC
The M5Paper GT911 reports in portrait coordinates (540 wide, 960 tall). With
flags 0x0 the firmware clamps Y to 539 and taps land in the wrong place. Taps
at the four corners and the centre, logged on an original M5Paper with
SWAP_XY only, gave x correct and y inverted. 0x6 (SWAP_XY | INVERT_Y)
matches M5EPD's landscape (ROTATE_0) mapping.
Measured on hardware (original M5Paper, after a night on USB): the ESP32's
eFuse-calibrated reading (analogReadMilliVolts, temporary debug build) on
GPIO35 was 2.101 V, against a raw count of 2416. That is exactly 2:1 for a
charged 4.20 V cell, so the sense divider is 2:1 (as M5EPD assumes), not
the R83 3k / R86 11k on the schematic, which would put the cell at 2.67 V.
0xa1 reported 3.89 V; 0xae reports 4.20 V at this point.

Not verified: the cell voltage with a multimeter, and accuracy lower in the
discharge curve. The firmware scales the uncalibrated ADC count linearly,
so expect it to read slightly low near 3.3-3.7 V (estimate, not measured).
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.

1 participant