Skip to content

Commit 5d03d53

Browse files
committed
[stm32] Fix STM32G0 ADC
The internal voltage regulator is not enabled and calibration never suceeds.
1 parent a05cc62 commit 5d03d53

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/modm/platform/adc/stm32f0/adc_impl.hpp.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ modm::platform::Adc{{ id }}::initialize()
2828
{
2929
Rcc::enable<Peripheral::Adc{{ id }}>();
3030

31+
%% if target.family in ["g0"]
32+
ADC1->CR |= ADC_CR_ADVREGEN;
33+
modm::delay_us(20);
34+
%% endif
35+
3136
if constexpr (mode == ClockMode::Synchronous) {
3237
constexpr auto result = Prescaler::from_power(
3338
SystemClock::Apb, frequency, {{2 if target.family in ["f0"] else 1}}, 4);

0 commit comments

Comments
 (0)