Update 2026-09-15: Pin.init done, Pin.pull/Pin.irq split into precise HAL/compiler tickets
machine.Pin.init(value=...) is implemented (src/pymcu_micropython/machine.py), forwarding
to the HAL's own init() which already had value/drive/alt; mode/pull's sentinel
default is now the literal -1 MicroPython itself uses (verified byte-identical to the old
255 spelling). drive=/alt= raise, matching what the HAL already does for them (this
chip's GPIO has neither a pin-mux nor a drive-strength register). This closes the
machine.Pin.init allowlist entry.
Remaining two, now precisely filed:
Original report
Compared against micropython-rp2-stubs:
machine.Pin.init(mode=-1, pull=-1, *, value=None, drive=None, alt=None) -- this layer's
init(mode=255, pull=255) had neither value= nor drive=/alt=.
machine.Pin.pull() -- a getter for the currently configured pull mode; only the setter
(init(pull=...)) existed.
machine.Pin.irq(handler, trigger, *, priority=1, wake=None, hard=False) -- this layer's
irq(handler, trigger) has none of priority=/wake=/hard=; on this chip none of the
three map onto anything real (documented limitation, not a gap to close).
Repo choice
machine.Pin.pull()'s getter needs PyMCU/PyMCU#448 (HAL). machine.Pin.irq() needs
#12 (compiler, positional-only /).
Update 2026-09-15: Pin.init done, Pin.pull/Pin.irq split into precise HAL/compiler tickets
machine.Pin.init(value=...)is implemented (src/pymcu_micropython/machine.py), forwardingto the HAL's own
init()which already hadvalue/drive/alt;mode/pull's sentineldefault is now the literal
-1MicroPython itself uses (verified byte-identical to the old255 spelling).
drive=/alt=raise, matching what the HAL already does for them (thischip's GPIO has neither a pin-mux nor a drive-strength register). This closes the
machine.Pin.initallowlist entry.Remaining two, now precisely filed:
machine.Pin.pull()-- needs a no-arg getter overload onpymcu.hal.avr.gpio.Pin.pull(), the same wayPin.mode()right below it already reads backwhat it maintains. Filed with the exact function and signature at pymcu.hal.avr.gpio.Pin.pull() has no no-arg getter overload PyMCU#448
(milestone Peripherals).
machine.Pin.irq()--handler/triggerare stub-declared positional-only(
self, /, handler=None, ...), the same compiler gap machine/micropython/time/utime can't match MicroPython's positional-only C-function signatures: the compiler has no PEP 3102/syntax #12 alreadytracks;
priority=/wake=/hard=don't map to anything on this chip (documentedlimitation), but the signature cannot match at all until
/lands regardless. Blocked onmachine/micropython/time/utime can't match MicroPython's positional-only C-function signatures: the compiler has no PEP 3102
/syntax #12, no new ticket needed.Original report
Compared against
micropython-rp2-stubs:machine.Pin.init(mode=-1, pull=-1, *, value=None, drive=None, alt=None)-- this layer'sinit(mode=255, pull=255)had neithervalue=nordrive=/alt=.machine.Pin.pull()-- a getter for the currently configured pull mode; only the setter(
init(pull=...)) existed.machine.Pin.irq(handler, trigger, *, priority=1, wake=None, hard=False)-- this layer'sirq(handler, trigger)has none ofpriority=/wake=/hard=; on this chip none of thethree map onto anything real (documented limitation, not a gap to close).
Repo choice
machine.Pin.pull()'s getter needs PyMCU/PyMCU#448 (HAL).machine.Pin.irq()needs#12 (compiler, positional-only
/).