@@ -163,16 +163,22 @@ public:
163
163
// ADCs clock source selection
164
164
enum class ClockSource : uint32_t
165
165
{
166
- NoClock = 0, // No clock selected.
167
166
%% if target["family"] in ["g4"]
167
+ NoClock = 0, // No clock selected.
168
168
%% if id in [1, 2]
169
169
Pll = RCC_{{ ccipr }}_ADC12SEL_0, // PLL “P” clock selected as ADC clock
170
170
SystemClock = RCC_{{ ccipr }}_ADC12SEL_1 , // System clock selected as ADCs clock
171
171
%% elif id in [3, 4, 5]
172
172
Pll = RCC_{{ ccipr }}_ADC345SEL_0, // PLL “P” clock selected as ADC clock
173
173
SystemClock = RCC_{{ ccipr }}_ADC345SEL_1 , // System clock selected as ADCs clock
174
174
%% endif
175
+ %% elif target["family"] in ["h7"]
176
+ Pll2P = 0,
177
+ Pll3R = RCC_{{ ccipr }}_ADCSEL_0,
178
+ PerClk = RCC_{{ ccipr }}_ADCSEL_1,
179
+ NoClock = PerClk, // for compatibility if sync. clock is used and setting is ignored
175
180
%% else
181
+ NoClock = 0, // No clock selected.
176
182
PllSai1 = RCC_{{ ccipr }}_ADCSEL_0, // PLLSAI1 "R" clock (PLLADC1CLK) selected as ADCs clock
177
183
%% if target["family"] != "l5"
178
184
PllSai2 = RCC_{{ ccipr }}_ADCSEL_1, // PLLSAI2 "R" clock (PLLADC2CLK) selected as ADCs clock
@@ -337,7 +343,11 @@ public:
337
343
static inline void
338
344
initialize( const ClockMode clk = ClockMode::DoNotChange,
339
345
%% if clock_mux
346
+ %% if target["family"] == "h7"
347
+ const ClockSource clk_src = ClockSource::PerClk,
348
+ %% else
340
349
const ClockSource clk_src = ClockSource::SystemClock,
350
+ %% endif
341
351
%% endif
342
352
const Prescaler pre = Prescaler::Disabled,
343
353
const CalibrationMode cal = CalibrationMode::DoNotCalibrate,
0 commit comments