Description
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