Skip to content

Support pin muxing in Zephyr through IOBroker - #11420

Merged
dhalbert merged 7 commits into
adafruit:mainfrom
tannewt:zephyr_pin_muxing
Sep 22, 2026
Merged

dhalbert merged 7 commits into
adafruit:mainfrom
tannewt:zephyr_pin_muxing

Conversation

@tannewt

@tannewt tannewt commented Sep 18, 2026

Copy link
Copy Markdown
Member

IOBroker is a new zephyr module that maps package pins to peripherals and uses Zephyr's dynamic pinctrl to prep a device for use. It does resource use tracking for pads and peripherals/devices as well.

This does have a couple issues that need to be fixed in follow up:

  • I2C scanning on the nRF54LM20 is broken in Zephyr. Works on the nRF52840 though.
  • No bulk resets implemented so objects that aren't finalized will leak pins and peripherals. Will follow up with a macro to enable finalizers in shared-bindings (and disable never_reset).

IOBroker is a new zephyr module that maps package pins to peripherals
and uses Zephyr's dynamic pinctrl to prep a device for use. It does
resource use tracking for pads and peripherals/devices as well.
@tannewt
tannewt requested a review from dhalbert September 21, 2026 23:13

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems quite clean to me, thanks! Various questions and requests in the review.

It's too bad you have to undo the supplied device tree entries, but without defining all-new boards, I don't see a way around it. This is going to be a maintenance issue when they change.

Comment thread ports/zephyr-cp/common-hal/busio/I2C.h Outdated
Comment thread ports/zephyr-cp/common-hal/busio/SPI.c
Comment thread ports/zephyr-cp/common-hal/rotaryio/IncrementalEncoder.c Outdated
Comment thread ports/zephyr-cp/modules/iobroker/include/iobroker/iobroker.h Outdated
Comment thread ports/zephyr-cp/modules/iobroker/Kconfig.packages
Comment thread ports/zephyr-cp/modules/iobroker/README.md
@tannewt

tannewt commented Sep 22, 2026

Copy link
Copy Markdown
Member Author

It's too bad you have to undo the supplied device tree entries, but without defining all-new boards, I don't see a way around it. This is going to be a maintenance issue when they change.

Yeah, some zephyr stuff is weird. I'm hopeful LLMs + hardware in the loop will make maintenance easier.

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One q

Comment thread ports/zephyr-cp/common-hal/rotaryio/IncrementalEncoder.c

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice solution!

@dhalbert
dhalbert merged commit d81985f into adafruit:main Sep 22, 2026
48 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