Skip to content

Runtime pin configuration #11918

Closed
Closed
@dhalbert

Description

@dhalbert

We're looking at porting CircuitPython to Zephyr. We currently support SAMD21, SAMD51, ESP8266, and nRF52832 and nrf52840. The nRF ports are in progress.

One feature we need (and most other language interpreters need as well) is dynamic pin configuration. The user's Python program can choose to use any pins for any purpose, within the limitations of the microcontroller. The pins are assigned at runtime in Python code and may even be changed during the life of the program. For instance, two pins might be used as GPIO or UART and then assigned to an I2C device drive.

My understanding is that Zephyr uses the device tree to assign pin functionality at build and startup time. I see a few issues about more flexibility: #8849, #9607, and maybe #9198. But I think these issues are about initial flexibility in assignment that is then not changed during the lifetime of the application.

Is there something in Zephyr now that would allow us to do dynamic pin configuration/assignment? Could we not provide a fixed device tree and use lower-level routines? Or is this a feature that would need to be added? I don't know Zephyr well enough to understand the issues, but would be grateful for suggestions and guidance. Thanks.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions