stm32/adc: Add ADC auto-calibration for L4 MCUs.

This increases the precision of the ADC.
This commit is contained in:
Tobias Badertscher 2018-11-16 19:37:31 +01:00 committed by Damien George
parent 7c85c7c210
commit 9acc32b40f
1 changed files with 3 additions and 0 deletions

View File

@ -263,6 +263,9 @@ STATIC void adcx_init_periph(ADC_HandleTypeDef *adch, uint32_t resolution) {
#if defined(STM32H7) #if defined(STM32H7)
HAL_ADCEx_Calibration_Start(adch, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED); HAL_ADCEx_Calibration_Start(adch, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED);
#endif #endif
#if defined(STM32L4)
HAL_ADCEx_Calibration_Start(adch, ADC_SINGLE_ENDED);
#endif
} }
STATIC void adc_init_single(pyb_obj_adc_t *adc_obj) { STATIC void adc_init_single(pyb_obj_adc_t *adc_obj) {