feat: Calibrating Differential Inputs ADC for G4 #3735
Merged
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.
This PR introduces a calibration step for the differential mode of the ADC in the STM32G4 series. Previously, the code only calibrated the single-ended mode. I've added the differential mode calibration immediately after the existing one. Although separating the calibration processes into individual functions might be a better approach, I opted to maintain compatibility with the existing code.
The changes have improved the differential ADC error on my STM32G431CBU6, so I believe it should work well. I've attached a screenshot from the reference manual that I used, hoping it will save you some time during the code review.