feat(expander): default MCP INT output to active-HIGH in begin()#303
Merged
JosipKuci merged 2 commits intoMay 19, 2026
Merged
Conversation
… polarity The MCP23017 power-on default for IOCON is 0x00 — which means INTPOL=0 (active-LOW): the INT pin drives HIGH when no interrupt is pending and only drives LOW when one fires. On Inkplate hardware (and any design that wires INT into a host MCU configured to wake on HIGH, e.g. ESP32 ESP_EXT1_WAKEUP_ANY_HIGH), this is exactly inverted from what is wanted, causing the host to see a permanently asserted wake line every time it sleeps. v11.0.1 restored the setIntOutput() API that v11.0.0 removed, but did not configure IOCON from begin(). This means each application that uses MCP- driven wake must remember to call setIntOutput() with the right parameters after display.begin(). For applications that don't, deep-sleep + MCP-driven wake is non-functional out of the box: the host wakes immediately on every sleep cycle regardless of pin activity. Call setIntOutput() from begin() with sensible Inkplate-correct defaults (active-HIGH, push-pull, ports not mirrored) so the library works correctly on standard Inkplate wiring without requiring application code to know about IOCON. Users with non-default wiring can still override by calling setIntOutput() after begin().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Inkplate 6 / 10 / 6PLUS the internal MCP23017's INT pin is wired to
an ESP32 GPIO that's used with
ESP_EXT1_WAKEUP_ANY_HIGHfor deep-sleepwake. The MCP power-on default for
IOCONis0x00(INTPOL=0,active-LOW) — meaning the INT pin idles HIGH whenever no interrupt is
pending. Result: ext1 wakeup fires immediately on every sleep call,
producing a continuous wake/sleep loop.
v11.0.1 restored the
setIntOutput()API (good) but doesn't call itfrom
begin(), so the library still doesn't work for deep-sleep wakeout of the box — every application has to know to call
setIntOutput()itself.Fix
Call
setIntOutput(PORTB, no-mirror, push-pull, active-HIGH)fromIOExpander::begin(). Applications with non-default needs can stilloverride after
display.begin().Verification
Inkplate 10 V1, arduino-esp32 3.3.7. Without the patch: device wakes
immediately every sleep cycle. With the patch: device sleeps for the
configured duration; ext1 only fires on real touchpad presses.
Compat / scope
Backward compatible — only changes a default; existing
setIntOutput()callers still win since they run after
begin(). File is gated toARDUINO_INKPLATE6 || ARDUINO_INKPLATE10 || ARDUINO_INKPLATE6PLUS, sono PCAL boards are affected.