Skip to content

0.2.16#259

Merged
lovyan03 merged 17 commits into
masterfrom
develop
May 27, 2026
Merged

0.2.16#259
lovyan03 merged 17 commits into
masterfrom
develop

Conversation

@lovyan03
Copy link
Copy Markdown
Collaborator

  • add support StopWatch
  • add support NanoH2

ainyan03 and others added 17 commits May 15, 2026 17:22
ci: add workflow to publish to ESP Component Registry
Add StopWatch RTC support.
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.
@lovyan03 lovyan03 merged commit 8262224 into master May 27, 2026
44 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