daniel-p-carvalho opened a new pull request, #20990: URL: https://github.com/apache/nuttx/pull/20990
## Summary The ADC is only calibrated when it is opened, so a device that stays open while the temperature changes a lot keeps the old calibration factor. Add a `calibrate` operation to the low-level ADC operations of the ADC IPv2 (STM32G4 and F3), so the board can run the calibration again. The ADC is disabled for the calibration and enabled again if it was enabled before. The operation returns `-EBUSY` while a conversion is running, so the caller has to stop it first. ## Impact - New feature added? YES, `calibrate` in `struct stm32_adc_ops_s` (only with `STM32_ADC_LL_OPS`) - Existing feature changed? NO - Impact on user (will user need to adapt to change)? NO - Impact on build? NO - Impact on hardware? YES, STM32G4 and F3 ADC, only when the operation is called - Impact on documentation? NO - Impact on security? NO - Impact on compatibility? NO ## Testing Host: Linux x86_64, arm-none-eabi-gcc 15.2.1. Target: custom STM32G474RE board, ADC1 with 8 channels, `STM32_ADC_LL_OPS` enabled. The operation was called through a temporary hook, four times with a group of conversions before and after each call. It returned the new calibration factor (63 or 64), the channel configuration was kept and the interrupt-driven conversions kept working. `checkpatch.sh -c -u -m -g` passes. Not tested: the `-EBUSY` path, the ADC IPv2 of the STM32F3, calibration with a large temperature change. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
