Skip to content

ADC module lacks simple useful #defines #1512

Open

Description

@Kucmasz

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.

Activity

  1. vkottler commented on Oct 29, 2023

    @vkottler

    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:

    1. #define is horrible
    2. everything ADC related in firmware is application specific
  2. added this to the none milestone on Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions