Conversation
Collaborator
lovyan03
commented
May 27, 2026
- add support StopWatch
- add support NanoH2
ci: add workflow to publish to ESP Component Registry
board: Add StopWatch support.
Add StopWatch RTC support.
…evelop # Conflicts: # src/M5Unified.cpp
Expose M5PaperMono's TF card SDMMC pins (4bit: CLK=13/CMD=12/D0-D3=11/10/9/8) via M5.getPin(). Unify the SD-SPI and SDMMC pin handling into a single _pin_table_sd[][7] (clk/cmd/d0/d1/d2/d3); sd_spi_* are now aliases of the SDMMC slots (sclk=clk, mosi=cmd, miso=d0, cs=d3), matching the SD card SPI-mode pinout. SPI-only boards leave d1/d2 unused (255). TF power enable / card detect via the PY32 IO expander are not handled yet (separate task).
- begin(): for all m5pm1 boards, disable I2C idle-sleep (I2C_CFG 0x09, SLP_TO=0) and watchdog (WDT_CNT 0x0A). M5Unified's generic I2C access has no PM1 wake handshake, and the always-on PMIC keeps these settings across MCU reset, so re-assert them at init to avoid intermittent comm failures and periodic resets. - M5PaperMono: re-enable battery charging (PWR_CFG 0x06 bit0, cleared on reset/download), add isCharging() via PWR_SRC (0x04) and getKeyState() via IRQ_STATUS3 (0x42).
PaperMono's battery charging is controlled by the IP2316 charger (reached over the IOE1 IO11 "CHARGE READ" enable line), not by PM1. Drive the charger and read its status accordingly. - begin(): drive IOE1 IO11 high, poll the IP2316 until it comes up (it answers ~1.3ms after the high level, measured), then enable charging (SYS_CTL1 0x01 bit0 = EN_CHG). - setBatteryCharge(): toggle IP2316 EN_CHG (0x01 bit0). - isCharging(): on battery power -> discharging; on external power read REG_CHG_STAT(0xC7) bit7 (charging in progress): set -> charging, else discharging (covers charge-complete and charge-disabled). Verified on hardware: setBatteryCharge(false) -> discharging (0xC7=0x00, Vbat drops), setBatteryCharge(true) -> charging (0xC7 bit7, Vbat recovers). The unit label reads IP2316; its 0x75/0x01/0xC7 layout matches IP2315.
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.