Skip to content

zephyr: Add ADC support #17615

@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 implementationsport-zephyr

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy