VREF-olutionary: VREF support/instantiation for ADCs#124
Merged
Conversation
ActuallyTaylor
requested changes
Oct 6, 2025
EvanHughes-dev
requested changes
Oct 6, 2025
EvanHughes-dev
left a comment
There was a problem hiding this comment.
Overall it looks good. There's just two comments (really the same comment) that needs clarification.
mjh9585
reviewed
Oct 10, 2025
ActuallyTaylor
approved these changes
Nov 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add configurable VREF voltage support to the ADC system for improved measurement accuracy.
The ADC bases its voltage calculations from the VREF pin on the STM32F302R8, but the ADC hardware doesn't implicitly know what the actual voltage at VREF is. Previously, the system assumed a hardcoded 3.3V reference, which could lead to inaccurate voltage readings when using different reference voltages.
This PR adds
setVref(float vref)andgetVref()methods to the ADC interface, enabling accurate measurements with various reference voltages (1.8V, 3.3V, 5.0V, etc.). The implementation replaces hardcoded VREF values with configurable runtime settings in both STM32F3xx and F4xx platforms.And do not fret, the default will always be 3.3V so old ADC code will not break