Closed
Description
sam/samd/arc32 architectures use analogReadResolution to set the analogRead() bit resolution and it looks like this will be a "normal" api call.
I see analogSetWidth in esp32-hal-adc.h. It would be extremely easy to put a compatible analogReadResolution in that calls analogSetWidth.
Something to keep in mind is that analogReadResolution can be set up to 16 bits. If the bit resolution exceeds the ADC's actual capabilities, analogRead is expected to bit-shift the ADC's result to get a 16-bit result.