Commit 6cab8dae authored by Damien George's avatar Damien George

stm32/adc: Increase ADC sampling time for internal sources on H7 MCUs.

parent 0555ada2
......@@ -306,7 +306,13 @@ STATIC void adc_config_channel(ADC_HandleTypeDef *adc_handle, uint32_t channel)
#elif defined(STM32F4) || defined(STM32F7)
sConfig.SamplingTime = ADC_SAMPLETIME_15CYCLES;
#elif defined(STM32H7)
sConfig.SamplingTime = ADC_SAMPLETIME_8CYCLES_5;
if (channel == ADC_CHANNEL_VREFINT
|| channel == ADC_CHANNEL_TEMPSENSOR
|| channel == ADC_CHANNEL_VBAT) {
sConfig.SamplingTime = ADC_SAMPLETIME_387CYCLES_5;
} else {
sConfig.SamplingTime = ADC_SAMPLETIME_8CYCLES_5;
}
sConfig.SingleDiff = ADC_SINGLE_ENDED;
sConfig.OffsetNumber = ADC_OFFSET_NONE;
sConfig.OffsetRightShift = DISABLE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment