File tree Expand file tree Collapse file tree
os/hal/ports/STM32/LLD/ADCv4 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -451,6 +451,22 @@ void adc_lld_start(ADCDriver *adcp) {
451451 adc_lld_vreg_on (adcp );
452452 adc_lld_calibrate (adcp );
453453
454+ /* Configure the ADC boost. */
455+ #if STM32_ADC_USE_ADC12 == TRUE
456+ if (& ADCD1 == adcp ) {
457+ adcp -> adcm -> CR |= STM32_ADC12_BOOST ;
458+ #if STM32_ADC_DUAL_MODE
459+ adcp -> adcs -> CR |= STM32_ADC12_BOOST ;
460+ #endif
461+ }
462+ #endif
463+
464+ #if STM32_ADC_USE_ADC3 == TRUE
465+ if (& ADCD3 == adcp ) {
466+ adcp -> adcm -> CR |= STM32_ADC3_BOOST ;
467+ }
468+ #endif
469+
454470 /* Master ADC enabled here in order to reduce conversions latencies.*/
455471 adc_lld_analog_on (adcp );
456472 }
Original file line number Diff line number Diff line change 420420#error "STM32_ADC3_CLOCK exceeding maximum frequency (STM32_ADCCLK_MAX)"
421421#endif
422422
423+ #if !defined(STM32_ENFORCE_H7_REV_XY )
424+ /* ADC boost checks.*/
425+ #if STM32_ADC12_CLOCK > 6250000
426+ #define STM32_ADC12_BOOST (1U << 8U)
427+ #elif STM32_ADC12_CLOCK > 12500000
428+ #define STM32_ADC12_BOOST (2U << 8U)
429+ #elif STM32_ADC12_CLOCK > 25000000
430+ #define STM32_ADC12_BOOST (3U << 8U)
431+ #else
432+ #define STM32_ADC12_BOOST (0U << 8U)
433+ #endif
434+
435+ #if STM32_ADC3_CLOCK > 6250000
436+ #define STM32_ADC3_BOOST (1U << 8U)
437+ #elif STM32_ADC3_CLOCK > 12500000
438+ #define STM32_ADC3_BOOST (2U << 8U)
439+ #elif STM32_ADC3_CLOCK > 25000000
440+ #define STM32_ADC3_BOOST (3U << 8U)
441+ #else
442+ #define STM32_ADC3_BOOST (0U << 8U)
443+ #endif
444+
445+ #else /* defined(STM32_ENFORCE_H7_REV_XY) */
446+
447+ #if STM32_ADC12_CLOCK > 20000000
448+ #define STM32_ADC12_BOOST (1U << 8U)
449+ #else
450+ #define STM32_ADC12_BOOST (0U << 8U)
451+ #endif
452+
453+ #if STM32_ADC3_CLOCK > 20000000
454+ #define STM32_ADC3_BOOST (1U << 8U)
455+ #else
456+ #define STM32_ADC3_BOOST (0U << 8U)
457+ #endif
458+
459+ #endif /* defined(STM32_ENFORCE_H7_REV_XY) */
460+
423461#if !defined(STM32_DMA_REQUIRED )
424462#define STM32_DMA_REQUIRED
425463#endif
You can’t perform that action at this time.
0 commit comments