8000 zephyr: Add ADC support · Issue #17615 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content
zephyr: Add ADC support #17615
Open
Open
@bikeNomad

Description

@bikeNomad

Description

The Zephyr port is currently lacking machine.ADC. The Zephyr ADC API is relatively simple, though it requires the ADC channels to be set up in the devicetree (typically using an overlay). See this example:
https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/drivers/adc/adc_dt
We could use the same tuple method as the Pin constructor to access channels: ADC(('adc0', 1), ...).
There is also an API for channel sequencing; perhaps this API could be made available through (new) ADCBlock methods.

Code Size

This should be optional code, enabled by MICROPY_PY_MACHINE_ADC.
The ADCBlock sequencing/control API can be enabled by MICROPY_PY_MACHINE_ADC_BLOCK.

Implementation

I intend to implement this feature and would submit a Pull Request if desirable

Code of Conduct

Yes, I agree

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature requests, new feature implementations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0