Skip to content

Firmware: the AMOLED-1.75C's PWR key sleeps and wakes the screen - #111

Merged
Adolanium merged 4 commits into
Adolanium:mainfrom
tozes:firmware/175c-pwr-key
Oct 11, 2026
Merged

Adolanium merged 4 commits into
Adolanium:mainfrom
tozes:firmware/175c-pwr-key

Conversation

@tozes

@tozes tozes commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What and why

On the 1.75C, PWR reaches only the AXP2101 (no TCA9554 mirrors it), so the firmware never saw it. The AXP2101 latches a short press in IRQ status 1 (0x49, bit 3) when IRQ enable 1 (0x41, bit 3) is set. The driver enables that bit, and the app polls it every 100 ms through a new Power::take_key_press() hook, clearing it by writing the bit back.

A short press turns the screen off (the same screen sleep as Screen timeout, with or without a timeout set), and the next press, a touch or BOOT turns it back on; Wi-Fi and the Hermes connection stay up. Holding PWR keeps the PMIC's own power-off. Other boards are unchanged.

Part of a series for the AMOLED-1.75C; the physical report is #103.

How you know it works

Tests on this branch (based on 8069101):

  • hermes-gadget build-sim --test: core 127/127. Five app tests (off and on without a timeout, other input only wakes, a prompt wakes, a lost connection wakes, a dimmed screen returns) and the driver's read-once-and-clear in test_power.cpp.
  • pytest without the simulator-window tests (no virtual display here): 269 passed, 29 skipped.
  • pio run builds: esp32s3-touch-amoled-175c, esp32s3-touch-amoled-175. CI builds every board.

Board: Waveshare ESP32-S3-Touch-AMOLED-1.75C, SKU 33691 (the unit in #103), with Hermes v0.21.6+199.g1744a19 on Fedora 44. The checks ran on builds of a working branch that combined this change with the others in this series (30f8bc0); this branch's own image was not installed on its own.

Physical: short presses turned the screen off and on, a touch woke it, and holding PWR still forced the board off.

Documentation and sources

docs/hardware.md (the 1.75C controls and AXP2101 row), docs/using-gadget.md and a changelog line. Register bits from X-Powers' AXP2101 datasheet (SWcharge v1.0, section 6.13), already linked from hardware.md.

Checklist

  • One change per PR, with a title that says what it does
  • Relevant docs updated, or the reason no changes apply is explained
  • Verification results and remaining limitations recorded
  • Applicable vendor sources, licenses, and contributor credit retained
  • For a new board: the checklist in CONTRIBUTING.md (not a new board)

On the 1.75C, PWR reaches only the AXP2101 (there is no TCA9554 to mirror
it), so the firmware never saw it. The AXP2101 latches a short press in
IRQ status 1 (0x49) bit 3 when IRQ enable 1 (0x41) bit 3 is set. The
driver enables that bit, and the app polls it every 100 ms through a new
Power::take_key_press() hook, clearing it by writing the bit back.

A short press turns the screen off (the same screen sleep as Screen
timeout, with or without a timeout set) and the next press, a touch or
BOOT turns it back on; Wi-Fi and the Hermes connection stay up. Holding
PWR keeps the PMIC's own power-off. Other boards are unchanged.

Register bits from X-Powers' AXP2101 datasheet (SWcharge v1.0, 6.13).
Tests: five in test_app.cpp (off and on without a timeout, other input
only wakes, a prompt wakes, a lost connection wakes, a dimmed screen comes
back), and the driver's read-once-and-clear in test_power.cpp.
@tozes
tozes force-pushed the firmware/175c-pwr-key branch from 983a893 to ced532b Compare October 10, 2026 07:40
@tozes
tozes marked this pull request as ready for review October 10, 2026 13:56
@Adolanium

Copy link
Copy Markdown
Owner

Thanks @tozes, merged. The driver test is careful: it checks that enabling the key keeps the other interrupt enables, drops a press latched before boot, and doesn't clear the long-press bit. Polling through Power::take_key_press() also keeps every other board unchanged.

I pushed three commits on top:

  • a merge with main after Firmware: AMOLED panels draw a true black background #106 and Firmware: battery savings on the AMOLED-1.75C #109 (changelog and validation-table conflicts)
  • a follow-up that credits you in the changelog and adds the PWR key to the 1.75C rows in supported-hardware.md and hardware-validation.md
  • a wording fix in using-gadget.md. It said a PWR press sleeps the screen "at any time", but power_tick wakes it again on the same tick while recording, playing, or in Wi-Fi setup, pairing or an update, so the guide now says that. I think that behavior is right; a press that does nothing during a reply is better than a screen that goes dark mid-answer.

Looking forward to the next batch.

@Adolanium
Adolanium merged commit 816ff82 into Adolanium:main Oct 11, 2026
21 checks passed
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.

2 participants