pico-sdk
pico-sdk copied to clipboard
ADC module lacks simple useful #defines
It would be pretty useful to have a defines for ADC module that state
- max reading in bits
- reference voltage
for actual reading conversion in applications. Also a simple macro for converting a GPIO pin to ADC channel could be implemented easily.
reference voltage
@Kucmasz this depends on hardware external to the RP2040 (ADC_AVDD). The datasheet plainly states that the ADC is 12-bit.
In practice there are often voltage dividers and other signal conditioning circuitry that would go from some application signal to the ADC input, so it doesn't seem that useful to have #define macros for this because:
#defineis horrible- everything ADC related in firmware is application specific