libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
g4/rcc.h
Go to the documentation of this file.
1/** @defgroup rcc_defines RCC Defines
2 *
3 * @ingroup STM32G4xx_defines
4 *
5 * @brief <b>Defined Constants and Types for the STM32G4xx Reset and Clock
6 * Control</b>
7 *
8 * @version 1.0.0
9 *
10 * @author @htmlonly &copy; @endhtmlonly 2020 Karl Palsson <karlp@tweak.net.au>
11 * @author @htmlonly &copy; @endhtmlonly 2020 Sam Kirkham <sam.kirkham@codethink.co.uk>
12 * @author @htmlonly &copy; @endhtmlonly 2020 Ben Brewer <ben.brewer@codethink.co.uk>
13 *
14 * LGPL License Terms @ref lgpl_license
15 */
16
17/*
18 * This file is part of the libopencm3 project.
19 *
20 * Copyright (C) 2020 Karl Palsson <karlp@tweak.net.au>
21 * Copyright (C) 2020 Sam Kirkham <sam.kirkham@codethink.co.uk>
22 * Copyright (C) 2020 Ben Brewer <ben.brewer@codethink.co.uk>
23 *
24 * This library is free software: you can redistribute it and/or modify
25 * it under the terms of the GNU Lesser General Public License as published by
26 * the Free Software Foundation, either version 3 of the License, or
27 * (at your option) any later version.
28 *
29 * This library is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU Lesser General Public License for more details.
33 *
34 * You should have received a copy of the GNU Lesser General Public License
35 * along with this library. If not, see <http://www.gnu.org/licenses/>.
36 *
37 */
38
39/**@{*/
40
41#ifndef LIBOPENCM3_RCC_H
42#define LIBOPENCM3_RCC_H
43
45
46/** @defgroup rcc_registers RCC Registers
47 * @{
48 */
49#define RCC_CR MMIO32(RCC_BASE + 0x00)
50#define RCC_ICSCR MMIO32(RCC_BASE + 0x04)
51#define RCC_CFGR MMIO32(RCC_BASE + 0x08)
52#define RCC_PLLCFGR MMIO32(RCC_BASE + 0x0c)
53#define RCC_CIER MMIO32(RCC_BASE + 0x18)
54#define RCC_CIFR MMIO32(RCC_BASE + 0x1c)
55#define RCC_CICR MMIO32(RCC_BASE + 0x20)
56#define RCC_AHB1RSTR_OFFSET 0x28
57#define RCC_AHB1RSTR MMIO32(RCC_BASE + RCC_AHB1RSTR_OFFSET)
58#define RCC_AHB2RSTR_OFFSET 0x2c
59#define RCC_AHB2RSTR MMIO32(RCC_BASE + RCC_AHB2RSTR_OFFSET)
60#define RCC_AHB3RSTR_OFFSET 0x30
61#define RCC_AHB3RSTR MMIO32(RCC_BASE + RCC_AHB3RSTR_OFFSET)
62#define RCC_APB1RSTR1_OFFSET 0x38
63#define RCC_APB1RSTR1 MMIO32(RCC_BASE + RCC_APB1RSTR1_OFFSET)
64#define RCC_APB1RSTR2_OFFSET 0x3c
65#define RCC_APB1RSTR2 MMIO32(RCC_BASE + RCC_APB1RSTR2_OFFSET)
66#define RCC_APB2RSTR_OFFSET 0x40
67#define RCC_APB2RSTR MMIO32(RCC_BASE + RCC_APB2RSTR_OFFSET)
68#define RCC_AHB1ENR_OFFSET 0x48
69#define RCC_AHB1ENR MMIO32(RCC_BASE + RCC_AHB1ENR_OFFSET)
70#define RCC_AHB2ENR_OFFSET 0x4c
71#define RCC_AHB2ENR MMIO32(RCC_BASE + RCC_AHB2ENR_OFFSET)
72#define RCC_AHB3ENR_OFFSET 0x50
73#define RCC_AHB3ENR MMIO32(RCC_BASE + RCC_AHB3ENR_OFFSET)
74#define RCC_APB1ENR1_OFFSET 0x58
75#define RCC_APB1ENR1 MMIO32(RCC_BASE + RCC_APB1ENR1_OFFSET)
76#define RCC_APB1ENR2_OFFSET 0x5c
77#define RCC_APB1ENR2 MMIO32(RCC_BASE + RCC_APB1ENR2_OFFSET)
78#define RCC_APB2ENR_OFFSET 0x60
79#define RCC_APB2ENR MMIO32(RCC_BASE + RCC_APB2ENR_OFFSET)
80#define RCC_AHB1SMENR_OFFSET 0x68
81#define RCC_AHB1SMENR MMIO32(RCC_BASE + RCC_AHB1SMENR_OFFSET)
82#define RCC_AHB2SMENR_OFFSET 0x6c
83#define RCC_AHB2SMENR MMIO32(RCC_BASE + RCC_AHB2SMENR_OFFSET)
84#define RCC_AHB3SMENR_OFFSET 0x70
85#define RCC_AHB3SMENR MMIO32(RCC_BASE + RCC_AHB3SMENR_OFFSET)
86#define RCC_APB1SMENR1_OFFSET 0x78
87#define RCC_APB1SMENR1 MMIO32(RCC_BASE + RCC_APB1SMENR1_OFFSET)
88#define RCC_APB1SMENR2_OFFSET 0x7c
89#define RCC_APB1SMENR2 MMIO32(RCC_BASE + RCC_APB1SMENR2_OFFSET)
90#define RCC_APB2SMENR_OFFSET 0x80
91#define RCC_APB2SMENR MMIO32(RCC_BASE + RCC_APB2SMENR_OFFSET)
92#define RCC_CCIPR MMIO32(RCC_BASE + 0x88)
93#define RCC_BDCR MMIO32(RCC_BASE + 0x90)
94#define RCC_CSR MMIO32(RCC_BASE + 0x94)
95#define RCC_CRRCR MMIO32(RCC_BASE + 0x98)
96#define RCC_CCIPR2 MMIO32(RCC_BASE + 0x9c)
97/**@}*/
98
99
100/** @defgroup rcc_cr_values RCC_CR values
101 * @{
102 */
103#define RCC_CR_PLLRDY (1 << 25)
104#define RCC_CR_PLLON (1 << 24)
105#define RCC_CR_CSSON (1 << 19)
106#define RCC_CR_HSEBYP (1 << 18)
107#define RCC_CR_HSERDY (1 << 17)
108#define RCC_CR_HSEON (1 << 16)
109#define RCC_CR_HSIRDY (1 << 10)
110#define RCC_CR_HSIKERON (1 << 9)
111#define RCC_CR_HSION (1 << 8)
112/**@}*/
113
114/** @defgroup rcc_icscr_values RCC_ICSCR values
115 * @{
116 */
117#define RCC_ICSCR_HSITRIM_SHIFT 24
118#define RCC_ICSCR_HSITRIM_MASK 0x7f
119#define RCC_ICSCR_HSICAL_SHIFT 16
120#define RCC_ICSCR_HSICAL_MASK 0xff
121/**@}*/
122
123/** @defgroup rcc_cfgr_values RCC_CFGR values
124 * @{
125 */
126/** @defgroup rcc_cfgr_mcopre MCOPRE MCO prescaler
127 * @{
128 */
129#define RCC_CFGR_MCOPRE_DIV1 0
130#define RCC_CFGR_MCOPRE_DIV2 1
131#define RCC_CFGR_MCOPRE_DIV4 2
132#define RCC_CFGR_MCOPRE_DIV8 3
133#define RCC_CFGR_MCOPRE_DIV16 4
134/**@}*/
135#define RCC_CFGR_MCOPRE_SHIFT 28
136#define RCC_CFGR_MCOPRE_MASK 0x7
137
138/** @defgroup rcc_cfgr_mco MCO: Microcontroller clock output
139 * @{
140 */
141#define RCC_CFGR_MCO_NOCLK 0x0
142#define RCC_CFGR_MCO_SYSCLK 0x1
143#define RCC_CFGR_MCO_HSI16 0x3
144#define RCC_CFGR_MCO_HSE 0x4
145#define RCC_CFGR_MCO_PLL 0x5
146#define RCC_CFGR_MCO_LSI 0x6
147#define RCC_CFGR_MCO_LSE 0x7
148#define RCC_CFGR_MCO_HSI48 0x8
149/**@}*/
150#define RCC_CFGR_MCO_SHIFT 24
151#define RCC_CFGR_MCO_MASK 0xf
152
153/** @defgroup rcc_cfgr_pprex PPREx: APBx prescaler
154 * @{
155 */
156#define RCC_CFGR_PPREx_NODIV 0x0
157#define RCC_CFGR_PPREx_DIV2 0x4
158#define RCC_CFGR_PPREx_DIV4 0x5
159#define RCC_CFGR_PPREx_DIV8 0x6
160#define RCC_CFGR_PPREx_DIV16 0x7
161/**@}*/
162#define RCC_CFGR_PPRE2_MASK 0x7
163#define RCC_CFGR_PPRE2_SHIFT 11
164#define RCC_CFGR_PPRE1_MASK 0x7
165#define RCC_CFGR_PPRE1_SHIFT 8
166
167
168/** @defgroup rcc_cfgr_hpre HPRE: AHB prescaler
169 * @{
170 */
171#define RCC_CFGR_HPRE_NODIV 0x0
172#define RCC_CFGR_HPRE_DIV2 0x8
173#define RCC_CFGR_HPRE_DIV4 0x9
174#define RCC_CFGR_HPRE_DIV8 0xa
175#define RCC_CFGR_HPRE_DIV16 0xb
176#define RCC_CFGR_HPRE_DIV64 0xc
177#define RCC_CFGR_HPRE_DIV128 0xd
178#define RCC_CFGR_HPRE_DIV256 0xe
179#define RCC_CFGR_HPRE_DIV512 0xf
180/**@}*/
181#define RCC_CFGR_HPRE_MASK 0xf
182#define RCC_CFGR_HPRE_SHIFT 4
183
184/** @defgroup rcc_cfgr_swx SW/SWS System clock switch (status)
185 * @{
186 */
187#define RCC_CFGR_SWx_HSI16 0x1
188#define RCC_CFGR_SWx_HSE 0x2
189#define RCC_CFGR_SWx_PLL 0x3
190/**@}*/
191#define RCC_CFGR_SWS_MASK 0x3
192#define RCC_CFGR_SWS_SHIFT 2
193#define RCC_CFGR_SW_MASK 0x3
194#define RCC_CFGR_SW_SHIFT 0
195/**@}*/
196
197/** @defgroup rcc_pllcfgr_values RCC_PLLCFGR - PLL Configuration Register
198 * @{
199 */
200#define RCC_PLLCFGR_PLLPDIV_MASK 0x1f
201#define RCC_PLLCFGR_PLLPDIV_SHIFT 27
202
203/** @defgroup rcc_pllcfgr_pllr RCC_PLLCFGR PLLR values
204 * Set these bits correctly not to exceed 170 MHz on this domain.
205 * @{*/
206#define RCC_PLLCFGR_PLLR_DIV2 0
207#define RCC_PLLCFGR_PLLR_DIV4 1
208#define RCC_PLLCFGR_PLLR_DIV6 2
209#define RCC_PLLCFGR_PLLR_DIV8 3
210/**@}*/
211#define RCC_PLLCFGR_PLLR_SHIFT 25
212#define RCC_PLLCFGR_PLLR_MASK 0x3
213
214#define RCC_PLLCFGR_PLLREN BIT24
215
216#define RCC_PLLCFGR_PLLQ_DIV2 0
217#define RCC_PLLCFGR_PLLQ_DIV4 1
218#define RCC_PLLCFGR_PLLQ_DIV6 2
219#define RCC_PLLCFGR_PLLQ_DIV8 3
220#define RCC_PLLCFGR_PLLQ_SHIFT 21
221#define RCC_PLLCFGR_PLLQ_MASK 0x3
222
223#define RCC_PLLCFGR_PLLQEN BIT20
224
225/* Division for PLLSAI3CLK, 0 == 7, 1 == 17 */
226#define RCC_PLLCFGR_PLLP BIT17
227#define RCC_PLLCFGR_PLLP_DIV7 0
228#define RCC_PLLCFGR_PLLP_DIV17 RCC_PLLCFGR_PLLP
229#define RCC_PLLCFGR_PLLPEN (1 << 16)
230
231/** @defgroup rcc_pllcfgr_plln RCC_PLLCFGR PLLN values
232 * Allowed values 8 <= n <= 127, VCO output limits specified in datasheet
233 * @{*/
234#define RCC_PLLCFGR_PLLN_SHIFT 8
235#define RCC_PLLCFGR_PLLN_MASK 0x7f
236/**@}*/
237
238/** @defgroup rcc_pllcfgr_pllm RCC_PLLCFGR PLLM values
239 * Allowed values 1 <= m <= 16, VCO input limits specified in datasheet
240 * @{*/
241#define RCC_PLLCFGR_PLLM_SHIFT 0x4
242#define RCC_PLLCFGR_PLLM_MASK 0xf
243#define RCC_PLLCFGR_PLLM(x) ((x)-1)
244/**@}*/
245
246#define RCC_PLLCFGR_PLLSRC_NONE 0
247#define RCC_PLLCFGR_PLLSRC_HSI16 2
248#define RCC_PLLCFGR_PLLSRC_HSE 3
249#define RCC_PLLCFGR_PLLSRC_SHIFT 0
250#define RCC_PLLCFGR_PLLSRC_MASK 0x3
251
252/**@}*/
253
254
255/** @defgroup rcc_cier_values RCC_CIER - Clock interrupt enable register
256 * @{
257 */
258#define RCC_CIER_HSI48RDYIE (1 << 10)
259#define RCC_CIER_LSE_CSSIE (1 << 9)
260/* OSC ready interrupt enable bits */
261#define RCC_CIER_PLLRDYIE (1 << 5)
262#define RCC_CIER_HSERDYIE (1 << 4)
263#define RCC_CIER_HSIRDYIE (1 << 3)
264#define RCC_CIER_LSERDYIE (1 << 1)
265#define RCC_CIER_LSIRDYIE (1 << 0)
266/**@}*/
267
268/** @defgroup rcc_cifr_values RCC_CIFR - Clock interrupt flag register
269 * @{
270 */
271#define RCC_CIFR_HSI48RDYF (1 << 10)
272#define RCC_CIFR_LSECSSF (1 << 9)
273#define RCC_CIFR_CSSF (1 << 8)
274#define RCC_CIFR_PLLRDYF (1 << 5)
275#define RCC_CIFR_HSERDYF (1 << 4)
276#define RCC_CIFR_HSIRDYF (1 << 3)
277#define RCC_CIFR_LSERDYF (1 << 1)
278#define RCC_CIFR_LSIRDYF (1 << 0)
279/**@}*/
280
281/** @defgroup rcc_cicr_values RCC_CICR - Clock interrupt clear register
282 * @{
283 */
284#define RCC_CICR_HSI48RDYC (1 << 10)
285#define RCC_CICR_LSECSSC (1 << 9)
286#define RCC_CICR_CSSC (1 << 8)
287#define RCC_CICR_PLLRDYC (1 << 5)
288#define RCC_CICR_HSERDYC (1 << 4)
289#define RCC_CICR_HSIRDYC (1 << 3)
290#define RCC_CICR_LSERDYC (1 << 1)
291#define RCC_CICR_LSIRDYC (1 << 0)
292/**@}*/
293
294/** @defgroup rcc_ahbrstr_rst RCC_AHBxRSTR reset values (full set)
295@{*/
296/** @defgroup rcc_ahb1rstr_rst RCC_AHB1RSTR reset values
297@{*/
298#define RCC_AHB1RSTR_CRCRST (1 << 12)
299#define RCC_AHB1RSTR_FLASHRST (1 << 8)
300#define RCC_AHB1RSTR_FMACRST (1 << 4)
301#define RCC_AHB1RSTR_CORDICRST (1 << 3)
302#define RCC_AHB1RSTR_DMAMUX1RST (1 << 2)
303#define RCC_AHB1RSTR_DMA2RST (1 << 1)
304#define RCC_AHB1RSTR_DMA1RST (1 << 0)
305/**@}*/
306
307/** @defgroup rcc_ahb2rstr_rst RCC_AHB2RSTR reset values
308@{*/
309#define RCC_AHB2RSTR_RNGRST (1 << 26)
310#define RCC_AHB2RSTR_AESRST (1 << 24)
311#define RCC_AHB2RSTR_DAC4RST (1 << 19)
312#define RCC_AHB2RSTR_DAC3RST (1 << 18)
313#define RCC_AHB2RSTR_DAC2RST (1 << 17)
314#define RCC_AHB2RSTR_DAC1RST (1 << 16)
315#define RCC_AHB2RSTR_ADC345RST (1 << 14)
316#define RCC_AHB2RSTR_ADC12RST (1 << 13)
317#define RCC_AHB2RSTR_GPIOGRST (1 << 6)
318#define RCC_AHB2RSTR_GPIOFRST (1 << 5)
319#define RCC_AHB2RSTR_GPIOERST (1 << 4)
320#define RCC_AHB2RSTR_GPIODRST (1 << 3)
321#define RCC_AHB2RSTR_GPIOCRST (1 << 2)
322#define RCC_AHB2RSTR_GPIOBRST (1 << 1)
323#define RCC_AHB2RSTR_GPIOARST (1 << 0)
324
325/**@}*/
326
327/** @defgroup rcc_ahb3rstr_rst RCC_AHB3RSTR reset values
328@{*/
329#define RCC_AHB3RSTR_QSPIRST (1 << 8)
330#define RCC_AHB3RSTR_FMCRST (1 << 0)
331/**@}*/
332/**@}*/
333
334/** @defgroup rcc_apb1rstr_rst RCC_APB1RSTRx reset values (full set)
335@{*/
336/** @defgroup rcc_apb1rstr1_rst RCC_APB1RSTR1 reset values
337@{*/
338#define RCC_APB1RSTR1_LPTIM1RST (1 << 31)
339#define RCC_APB1RSTR1_I2C3RST (1 << 30)
340#define RCC_APB1RSTR1_PWRRST (1 << 28)
341#define RCC_APB1RSTR1_FDCANRST (1 << 25)
342#define RCC_APB1RSTR1_USBRST (1 << 23)
343#define RCC_APB1RSTR1_I2C2RST (1 << 22)
344#define RCC_APB1RSTR1_I2C1RST (1 << 21)
345#define RCC_APB1RSTR1_UART5RST (1 << 20)
346#define RCC_APB1RSTR1_UART4RST (1 << 19)
347#define RCC_APB1RSTR1_USART3RST (1 << 18)
348#define RCC_APB1RSTR1_USART2RST (1 << 17)
349#define RCC_APB1RSTR1_SPI3RST (1 << 15)
350#define RCC_APB1RSTR1_SPI2RST (1 << 14)
351#define RCC_APB1RSTR1_CRSRST (1 << 8)
352#define RCC_APB1RSTR1_TIM7RST (1 << 5)
353#define RCC_APB1RSTR1_TIM6RST (1 << 4)
354#define RCC_APB1RSTR1_TIM5RST (1 << 3)
355#define RCC_APB1RSTR1_TIM4RST (1 << 2)
356#define RCC_APB1RSTR1_TIM3RST (1 << 1)
357#define RCC_APB1RSTR1_TIM2RST (1 << 0)
358/**@}*/
359
360/** @defgroup rcc_apb1rstr2_rst RCC_APB1RSTR2 reset values
361@{*/
362#define RCC_APB1RSTR2_UCPD1RST (1 << 8)
363#define RCC_APB1RSTR2_I2C4RST (1 << 1)
364#define RCC_APB1RSTR2_LPUART1RST (1 << 0)
365/**@}*/
366/**@}*/
367
368/** @defgroup rcc_apb2rstr_rst RCC_APB2RSTR reset values
369@{*/
370#define RCC_APB2RSTR_HRTIM1RST (1 << 26)
371#define RCC_APB2RSTR_SAI1RST (1 << 21)
372#define RCC_APB2RSTR_TIM20RST (1 << 20)
373#define RCC_APB2RSTR_TIM17RST (1 << 18)
374#define RCC_APB2RSTR_TIM16RST (1 << 17)
375#define RCC_APB2RSTR_TIM15RST (1 << 16)
376#define RCC_APB2RSTR_SPI4RST (1 << 15)
377#define RCC_APB2RSTR_USART1RST (1 << 14)
378#define RCC_APB2RSTR_TIM8RST (1 << 13)
379#define RCC_APB2RSTR_SPI1RST (1 << 12)
380#define RCC_APB2RSTR_TIM1RST (1 << 11)
381#define RCC_APB2RSTR_SYSCFGRST (1 << 0)
382/**@}*/
383
384/** @defgroup rcc_ahbenr_en RCC_AHBxENR enable values (full set)
385 *@{*/
386/** @defgroup rcc_ahb1enr_en RCC_AHB1ENR enable values
387 *@{*/
388#define RCC_AHB1ENR_CRCEN (1 << 12)
389#define RCC_AHB1ENR_FLASHEN (1 << 8)
390#define RCC_AHB1ENR_FMACEN (1 << 4)
391#define RCC_AHB1ENR_CORDICEN (1 << 3)
392#define RCC_AHB1ENR_DMAMUX1EN (1 << 2)
393#define RCC_AHB1ENR_DMA2EN (1 << 1)
394#define RCC_AHB1ENR_DMA1EN (1 << 0)
395/**@}*/
396
397/** @defgroup rcc_ahb2enr_en RCC_AHB2ENR enable values
398 *@{*/
399#define RCC_AHB2ENR_RNGEN (1 << 26)
400#define RCC_AHB2ENR_AESEN (1 << 24)
401#define RCC_AHB2ENR_DAC4EN (1 << 19)
402#define RCC_AHB2ENR_DAC3EN (1 << 18)
403#define RCC_AHB2ENR_DAC2EN (1 << 17)
404#define RCC_AHB2ENR_DAC1EN (1 << 16)
405#define RCC_AHB2ENR_ADC345EN (1 << 14)
406#define RCC_AHB2ENR_ADC12EN (1 << 13)
407#define RCC_AHB2ENR_GPIOGEN (1 << 6)
408#define RCC_AHB2ENR_GPIOFEN (1 << 5)
409#define RCC_AHB2ENR_GPIOEEN (1 << 4)
410#define RCC_AHB2ENR_GPIODEN (1 << 3)
411#define RCC_AHB2ENR_GPIOCEN (1 << 2)
412#define RCC_AHB2ENR_GPIOBEN (1 << 1)
413#define RCC_AHB2ENR_GPIOAEN (1 << 0)
414/**@}*/
415
416/** @defgroup rcc_ahb3enr_en RCC_AHB3ENR enable values
417 *@{*/
418#define RCC_AHB3ENR_QSPIEN (1 << 8)
419#define RCC_AHB3ENR_FMCEN (1 << 0)
420/**@}*/
421
422/**@}*/
423
424/** @defgroup rcc_apb1enr_en RCC_APB1ENRx enable values (full set)
425 *@{*/
426/** @defgroup rcc_apb1enr1_en RCC_APB1ENR1 enable values
427 *@{*/
428#define RCC_APB1ENR1_LPTIM1EN (1 << 31)
429#define RCC_APB1ENR1_I2C3EN (1 << 30)
430#define RCC_APB1ENR1_PWREN (1 << 28)
431#define RCC_APB1ENR1_FDCANEN (1 << 25)
432#define RCC_APB1ENR1_USBEN (1 << 23)
433#define RCC_APB1ENR1_I2C2EN (1 << 22)
434#define RCC_APB1ENR1_I2C1EN (1 << 21)
435#define RCC_APB1ENR1_UART5EN (1 << 20)
436#define RCC_APB1ENR1_UART4EN (1 << 19)
437#define RCC_APB1ENR1_USART3EN (1 << 18)
438#define RCC_APB1ENR1_USART2EN (1 << 17)
439#define RCC_APB1ENR1_SPI3EN (1 << 15)
440#define RCC_APB1ENR1_SPI2EN (1 << 14)
441#define RCC_APB1ENR1_WWDGEN (1 << 11)
442#define RCC_APB1ENR1_RTCAPBEN (1 << 10)
443#define RCC_APB1ENR1_CRSEN (1 << 8)
444#define RCC_APB1ENR1_TIM7EN (1 << 5)
445#define RCC_APB1ENR1_TIM6EN (1 << 4)
446#define RCC_APB1ENR1_TIM5EN (1 << 3)
447#define RCC_APB1ENR1_TIM4EN (1 << 2)
448#define RCC_APB1ENR1_TIM3EN (1 << 1)
449#define RCC_APB1ENR1_TIM2EN (1 << 0)
450/**@}*/
451
452/** @defgroup rcc_apb1enr2_en RCC_APB1ENR2 enable values
453 *@{*/
454#define RCC_APB1ENR2_UCPD1EN (1 << 8)
455#define RCC_APB1ENR2_I2C4EN (1 << 1)
456#define RCC_APB1ENR2_LPUART1EN (1 << 0)
457/**@}*/
458/**@}*/
459
460/** @defgroup rcc_apb2enr_en RCC_APB2ENR enable values
461 *@{*/
462#define RCC_APB2ENR_HRTIM1EN (1 << 26)
463#define RCC_APB2ENR_SAI1EN (1 << 21)
464#define RCC_APB2ENR_TIM20EN (1 << 20)
465#define RCC_APB2ENR_TIM17EN (1 << 18)
466#define RCC_APB2ENR_TIM16EN (1 << 17)
467#define RCC_APB2ENR_TIM15EN (1 << 16)
468#define RCC_APB2ENR_SPI4EN (1 << 15)
469#define RCC_APB2ENR_USART1EN (1 << 14)
470#define RCC_APB2ENR_TIM8EN (1 << 13)
471#define RCC_APB2ENR_SPI1EN (1 << 12)
472#define RCC_APB2ENR_TIM1EN (1 << 11)
473#define RCC_APB2ENR_SYSCFGEN (1 << 0)
474/**@}*/
475
476/** @defgroup rcc_ahb1smenr_values RCC_AHB1SMENR - AHB1 periph clock in sleep mode
477 * @{
478 */
479#define RCC_AHB1SMENR_CRCSMEN (1 << 12)
480#define RCC_AHB1SMENR_SRAM1SMEN (1 << 9)
481#define RCC_AHB1SMENR_FLASHSMEN (1 << 8)
482#define RCC_AHB1SMENR_FMACSMEN (1 << 4)
483#define RCC_AHB1SMENR_CORFDICSMEN (1 << 3)
484#define RCC_AHB1SMENR_DMAMUX1SMEN (1 << 2)
485#define RCC_AHB1SMENR_DMA2SMEN (1 << 1)
486#define RCC_AHB1SMENR_DMA1SMEN (1 << 0)
487/**@}*/
488
489/** @defgroup rcc_ahb2smenr RCC_AHB2SMENR - AHB2 periph clock in sleep mode
490 * @{
491 */
492#define RCC_AHB2SMENR_RNGSMEN (1 << 26)
493#define RCC_AHB2SMENR_AESSMEN (1 << 24)
494#define RCC_AHB2SMENR_DAC4SMEN (1 << 19)
495#define RCC_AHB2SMENR_DAC3SMEN (1 << 18)
496#define RCC_AHB2SMENR_DAC2SMEN (1 << 17)
497#define RCC_AHB2SMENR_DAC1SMEN (1 << 16)
498#define RCC_AHB2SMENR_ADC345SMEN (1 << 14)
499#define RCC_AHB2SMENR_ADC12SMEN (1 << 13)
500#define RCC_AHB2SMENR_SRAM2SMEN (1 << 10)
501#define RCC_AHB2SMENR_CCMSRAMSMEN (1 << 9)
502#define RCC_AHB2SMENR_GPIOGSMEN (1 << 6)
503#define RCC_AHB2SMENR_GPIOFSMEN (1 << 5)
504#define RCC_AHB2SMENR_GPIOESMEN (1 << 4)
505#define RCC_AHB2SMENR_GPIODSMEN (1 << 3)
506#define RCC_AHB2SMENR_GPIOCSMEN (1 << 2)
507#define RCC_AHB2SMENR_GPIOBSMEN (1 << 1)
508#define RCC_AHB2SMENR_GPIOASMEN (1 << 0)
509/**@}*/
510
511/** @defgroup rcc_ahb3smenr RCC_AHB3SMENR - AHB3 periph clock in sleep mode
512 * @{
513 */
514#define RCC_AHB3SMENR_QSPISMEN (1 << 8)
515#define RCC_AHB3SMENR_FMCSMEN (1 << 0)
516/**@}*/
517
518/** @defgroup rcc_apb1smenr1 RCC_APB1SMENR1 - APB1 periph clock in sleep mode
519 * @{
520 */
521#define RCC_APB1SMENR1_LPTIM1SMEN (1 << 31)
522#define RCC_APB1SMENR1_I2C3SMEN (1 << 30)
523#define RCC_APB1SMENR1_PWRSMEN (1 << 28)
524#define RCC_APB1SMENR1_FDCANSMEN (1 << 25)
525#define RCC_APB1SMENR1_USBSMEN (1 << 23)
526#define RCC_APB1SMENR1_I2C2SMEN (1 << 22)
527#define RCC_APB1SMENR1_I2C1SMEN (1 << 21)
528#define RCC_APB1SMENR1_UART5SMEN (1 << 20)
529#define RCC_APB1SMENR1_UART4SMEN (1 << 19)
530#define RCC_APB1SMENR1_USART3SMEN (1 << 18)
531#define RCC_APB1SMENR1_USART2SMEN (1 << 17)
532#define RCC_APB1SMENR1_SPI3SMEN (1 << 15)
533#define RCC_APB1SMENR1_SPI2SMEN (1 << 14)
534#define RCC_APB1SMENR1_WWDGSMEN (1 << 11)
535#define RCC_APB1SMENR1_RTCAPBSMEN (1 << 10)
536#define RCC_APB1SMENR1_TIM7SMEN (1 << 5)
537#define RCC_APB1SMENR1_TIM6SMEN (1 << 4)
538#define RCC_APB1SMENR1_TIM5SMEN (1 << 3)
539#define RCC_APB1SMENR1_TIM4SMEN (1 << 2)
540#define RCC_APB1SMENR1_TIM3SMEN (1 << 1)
541#define RCC_APB1SMENR1_TIM2SMEN (1 << 0)
542/**@}*/
543
544/** @defgroup rcc_apb1smenr2 RCC_APB1SMENR2 - APB1 periph clock in sleep mode
545 * @{
546 */
547#define RCC_APB1SMENR2_UCPD1SMEN (1 << 8)
548#define RCC_APB1SMENR2_I2C4SMEN (1 << 1)
549#define RCC_APB1SMENR2_LPUART1SMEN (1 << 0)
550/**@}*/
551
552/** @defgroup rcc_apb2smenr RCC_APB2SMENR - APB2 periph clock in sleep mode
553 * @{
554 */
555#define RCC_APB2SMENR_HRTIM1SMEN (1 << 26)
556#define RCC_APB2SMENR_SAI1SMEN (1 << 21)
557#define RCC_APB2SMENR_TIM20SMEN (1 << 20)
558#define RCC_APB2SMENR_TIM17SMEN (1 << 18)
559#define RCC_APB2SMENR_TIM16SMEN (1 << 17)
560#define RCC_APB2SMENR_TIM15SMEN (1 << 16)
561#define RCC_APB2SMENR_SPI4SMEN (1 << 15)
562#define RCC_APB2SMENR_USART1SMEN (1 << 14)
563#define RCC_APB2SMENR_TIM8SMEN (1 << 13)
564#define RCC_APB2SMENR_SPI1SMEN (1 << 12)
565#define RCC_APB2SMENR_TIM1SMEN (1 << 11)
566#define RCC_APB2SMENR_SYSCFGSMEN (1 << 0)
567/**@}*/
568
569/** @defgroup rcc_ccipr_values RCC_CCIPR - Peripherals independent clock config register
570 * @{
571 */
572/* all fields are 2 bits */
573#define RCC_CCIPR_SEL_MASK 0x3
574
575#define RCC_CCIPR_ADC345SEL_NONE 0
576#define RCC_CCIPR_ADC345SEL_PLLP 1
577#define RCC_CCIPR_ADC345SEL_SYSCLK 2
578#define RCC_CCIPR_ADC345SEL_SHIFT 30
579
580#define RCC_CCIPR_ADC12SEL_NONE 0
581#define RCC_CCIPR_ADC12SEL_PLLP 1
582#define RCC_CCIPR_ADC12SEL_SYSCLK 2
583#define RCC_CCIPR_ADC12SEL_SHIFT 28
584
585#define RCC_CCIPR_CLK48SEL_HSI48 0
586#define RCC_CCIPR_CLK48SEL_PLLQ 2
587#define RCC_CCIPR_CLK48SEL_SHIFT 26
588
589#define RCC_CCIPR_FDCANSEL_HSE 0
590#define RCC_CCIPR_FDCANSEL_PLLQ 1
591#define RCC_CCIPR_FDCANSEL_PCLK 2
592#define RCC_CCIPR_FDCANSEL_SHIFT 24
593
594#define RCC_CCIPR_I2S23SEL_SYSCLK 0
595#define RCC_CCIPR_I2S23SEL_PLLQ 1
596#define RCC_CCIPR_I2S23SEL_EXT 2
597#define RCC_CCIPR_I2S23SEL_SHI16 3
598#define RCC_CCIPR_I2S23SEL_SHIFT 22
599
600#define RCC_CCIPR_SAI1SEL_SYSCLK 0
601#define RCC_CCIPR_SAI1SEL_PLLQ 1
602#define RCC_CCIPR_SAI1SEL_EXT 2
603#define RCC_CCIPR_SAI1SEL_HSI16 3
604#define RCC_CCIPR_SAI1SEL_SHIFT 20
605
606#define RCC_CCIPR_LPTIM1SEL_PCLK 0
607#define RCC_CCIPR_LPTIM1SEL_LSI 1
608#define RCC_CCIPR_LPTIM1SEL_HSI16 2
609#define RCC_CCIPR_LPTIM1SEL_LSE 3
610#define RCC_CCIPR_LPTIM1SEL_SHIFT 18
611
612#define RCC_CCIPR_I2CxSEL_PCLK 0
613#define RCC_CCIPR_I2CxSEL_SYSCLK 1
614#define RCC_CCIPR_I2CxSEL_HSI16 2
615#define RCC_CCIPR_I2C3SEL_SHIFT 16
616#define RCC_CCIPR_I2C2SEL_SHIFT 14
617#define RCC_CCIPR_I2C1SEL_SHIFT 12
618
619#define RCC_CCIPR_USARTxSEL_PCLK 0
620#define RCC_CCIPR_USARTxSEL_SYSCLK 1
621#define RCC_CCIPR_USARTxSEL_HSI16 2
622#define RCC_CCIPR_USARTxSEL_LSE 3
623
624#define RCC_CCIPR_LPUARTxSEL_PCLK RCC_CCIPR_USARTx_PCLK
625#define RCC_CCIPR_LPUARTxSEL_SYSCLK RCC_CCIPR_USARTx_SYSCLK
626#define RCC_CCIPR_LPUARTxSEL_HSI16 RCC_CCIPR_USARTx_HSI16
627#define RCC_CCIPR_LPUARTxSEL_LSE RCC_CCIPR_USARTx_LSE
628#define RCC_CCIPR_LPUART1SEL_SHIFT 10
629
630#define RCC_CCIPR_UARTxSEL_PCLK RCC_CCIPR_USARTx_PCLK
631#define RCC_CCIPR_UARTxSEL_SYSCLK RCC_CCIPR_USARTx_SYSCLK
632#define RCC_CCIPR_UARTxSEL_HSI16 RCC_CCIPR_USARTx_HSI16
633#define RCC_CCIPR_UARTxSEL_LSE RCC_CCIPR_USARTx_LSE
634#define RCC_CCIPR_UART5SEL_SHIFT 8
635#define RCC_CCIPR_UART4SEL_SHIFT 6
636#define RCC_CCIPR_USART3SEL_SHIFT 4
637#define RCC_CCIPR_USART2SEL_SHIFT 2
638#define RCC_CCIPR_USART1SEL_SHIFT 0
639/**@}*/
640
641/** defgroup rcc_ccipr2_values RCC_CCIPR2 - Peripherals independent clock config register 2
642 * @{
643 */
644#define RCC_CCIPR2_SEL_MASK 0x3
645
646#define RCC_CCIPR2_QSPI_SYS 0
647#define RCC_CCIPR2_QSPI_HSI16 1
648#define RCC_CCIPR2_QSPI_PLLQ 2
649#define RCC_CCIPR2_QSPI_SHIFT 20
650
651#define RCC_CCIPR2_I2C4_PCLK 0
652#define RCC_CCIPR2_I2C4_SYS 1
653#define RCC_CCIPR2_I2C4_HSI16 2
654#define RCC_CCIPR2_I2C4_SHIFT 0
655/**@}*/
656
657/** @defgroup rcc_bdcr_values RCC_BDCR - Backup domain control register
658 * @{
659 */
660
661#define RCC_BDCR_LSCOSEL (1 << 25)
662#define RCC_BDCR_LSCOEN (1 << 24)
663#define RCC_BDCR_BDRST (1 << 16)
664#define RCC_BDCR_RTCEN (1 << 15)
665
666#define RCC_BDCR_RTCSEL_NONE 0
667#define RCC_BDCR_RTCSEL_LSE 1
668#define RCC_BDCR_RTCSEL_LSI 2
669#define RCC_BDCR_RTCSEL_HSEDIV32 3
670#define RCC_BDCR_RTCSEL_SHIFT 8
671#define RCC_BDCR_RTCSEL_MASK 0x3
672
673#define RCC_BDCR_LSECSSD (1 << 6)
674#define RCC_BDCR_LSECSSON (1 << 5)
675
676#define RCC_BDCR_LSEDRV_LOW 0
677#define RCC_BDCR_LSEDRV_MEDLOW 1
678#define RCC_BDCR_LSEDRV_MEDHIGH 2
679#define RCC_BDCR_LSEDRV_HIGH 3
680#define RCC_BDCR_LSEDRV_SHIFT 3
681#define RCC_BDCR_LSEDRV_MASK 0x3
682
683#define RCC_BDCR_LSEBYP (1 << 2)
684#define RCC_BDCR_LSERDY (1 << 1)
685#define RCC_BDCR_LSEON (1 << 0)
686/**@}*/
687
688/** @defgroup rcc_csr_values RCC_CSR - Control/Status register
689 * @{
690 */
691#define RCC_CSR_LPWRRSTF (1 << 31)
692#define RCC_CSR_WWDGRSTF (1 << 30)
693#define RCC_CSR_IWDGRSTF (1 << 29)
694#define RCC_CSR_SFTRSTF (1 << 28)
695#define RCC_CSR_BORRSTF (1 << 27)
696#define RCC_CSR_PINRSTF (1 << 26)
697#define RCC_CSR_OBLRSTF (1 << 25)
698#define RCC_CSR_RMVF (1 << 23)
699#define RCC_CSR_RESET_FLAGS (RCC_CSR_LPWRRSTF | RCC_CSR_WWDGRSTF |\
700 RCC_CSR_IWDGRSTF | RCC_CSR_SFTRSTF | RCC_CSR_BORRSTF |\
701 RCC_CSR_PINRSTF | RCC_CSR_OBLRSTF)
702
703#define RCC_CSR_LSIRDY (1 << 1)
704#define RCC_CSR_LSION (1 << 0)
705/**@}*/
706
707/** @defgroup rcc_crrcr RCC_CRRCR Clock Recovery RC register
708 * @{
709 */
710#define RCC_CRRCR_HSI48VAL_MASK 0x1ff
711#define RCC_CRRCR_HSI48VAL_SHIFT 7
712
713#define RCC_CRRCR_HSI48RDY BIT1
714#define RCC_CRRCR_HSI48ON BIT0
715/**@}*/
716
717/** Enumerations for core system/bus clocks for user/driver/system access to base bus clocks
718 * not directly associated with a peripheral. */
725 RCC_AHBCLK, /* AHB1,2,4 all share base HCLK. */
726 RCC_APB1CLK, /* Note: APB1 and PCLK1 in manual */
727 RCC_APB2CLK, /* Note: APB2 and PCLK2 in manual */
728};
729
730/* --- Variable definitions ------------------------------------------------ */
731
732extern uint32_t rcc_ahb_frequency;
733extern uint32_t rcc_apb1_frequency;
734extern uint32_t rcc_apb2_frequency;
735
736/* --- Function prototypes ------------------------------------------------- */
737
745
747 uint8_t pllm;
748 uint16_t plln;
749 uint8_t pllp;
750 uint8_t pllq;
751 uint8_t pllr;
752 uint8_t pll_source;
753 uint8_t hpre;
754 uint8_t ppre1;
755 uint8_t ppre2;
757 bool boost;
758 uint32_t flash_config;
763};
764
769
776 RCC_LSI
778
779#define _REG_BIT(base, bit) (((base) << 5) + (bit))
780
782
783 /* AHB1 peripherals */
791
792 /* AHB2 peripherals */
801 RCC_ADC1 = _REG_BIT(RCC_AHB2ENR_OFFSET, 13), /* Compatibility */
809
810 /* AHB3 peripherals */
813
814 /* APB1 peripherals */
837 /* apb1-2 */
841
842 /* APB2 peripherals */
855
856 /* AHB1 peripherals in sleep mode */
865
866 /* AHB2 peripherals in sleep mode */
875 SCC_ADC1 = _REG_BIT(RCC_AHB2SMENR_OFFSET, 13), /* Compatibility */
885
886 /* AHB3 peripherals in sleep mode */
889
890 /* APB1 peripherals in sleep mode */
913 /* apb1-2 */
917
918 /* APB2 peripherals in sleep mode */
931};
932
934 /* AHB1 peripherals */
942
943 /* AHB2 peripherals */
952 RST_ADC1 = _REG_BIT(RCC_AHB2RSTR_OFFSET, 13), /* Compatibility */
960
961 /* AHB3 peripherals */
964
965 /* APB1 peripherals */
986 /* apb1-2 */
990
991 /* APB2 peripherals */
1004
1005};
1006
1007#undef _REG_BIT
1008
1010
1012
1013void rcc_osc_ready_int_clear(enum rcc_osc osc);
1014void rcc_osc_ready_int_enable(enum rcc_osc osc);
1015void rcc_osc_ready_int_disable(enum rcc_osc osc);
1016int rcc_osc_ready_int_flag(enum rcc_osc osc);
1017void rcc_css_int_clear(void);
1018int rcc_css_int_flag(void);
1019void rcc_wait_for_sysclk_status(enum rcc_osc osc);
1020void rcc_osc_on(enum rcc_osc osc);
1021void rcc_osc_off(enum rcc_osc osc);
1022void rcc_css_enable(void);
1023void rcc_css_disable(void);
1024void rcc_set_sysclk_source(uint32_t clk);
1025void rcc_set_pll_source(uint32_t pllsrc);
1026void rcc_set_ppre2(uint32_t ppre2);
1027void rcc_set_ppre1(uint32_t ppre1);
1028void rcc_set_hpre(uint32_t hpre);
1029void rcc_set_main_pll(uint32_t pllsrc, uint32_t pllm, uint32_t plln,
1030 uint32_t pllp, uint32_t pllq, uint32_t pllr);
1031uint32_t rcc_system_clock_source(void);
1032void rcc_clock_setup_pll(const struct rcc_clock_scale *clock);
1033void __attribute__((deprecated("Use rcc_clock_setup_pll as direct replacement"))) rcc_clock_setup_hse_3v3(const struct rcc_clock_scale *clock);
1034void rcc_set_clock48_source(uint32_t clksel);
1035/**
1036 * Get the peripheral clock speed for the specified (LP)UxART
1037 * @param usart Base address of USART to get clock frequency for.
1038 */
1039uint32_t rcc_get_usart_clk_freq(uint32_t usart);
1040
1042
1043/**@}*/
1044
1045#endif
#define END_DECLS
Definition: common.h:34
#define BEGIN_DECLS
Definition: common.h:33
pwr_vos_scale
Definition: g4/pwr.h:173
int rcc_osc_ready_int_flag(enum rcc_osc osc)
Definition: rcc.c:434
void rcc_clock_setup_hse_3v3(const struct rcc_clock_scale *clock)
Setup clocks with the HSE.
Definition: rcc.c:747
int rcc_css_int_flag(void)
Definition: rcc.c:458
void rcc_set_clock48_source(uint32_t clksel)
Set clock source for 48MHz clock.
Definition: rcc.c:760
void rcc_osc_ready_int_clear(enum rcc_osc osc)
Definition: rcc.c:362
void rcc_css_disable(void)
Definition: rcc.c:561
void rcc_set_sysclk_source(uint32_t clk)
Definition: rcc.c:566
uint32_t rcc_apb2_frequency
Definition: rcc.c:57
void rcc_set_pll_source(uint32_t pllsrc)
Definition: rcc.c:575
uint32_t rcc_system_clock_source(void)
Definition: rcc.c:651
const struct rcc_clock_scale rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_END]
Definition: rcc.c:134
uint32_t rcc_get_usart_clk_freq(uint32_t usart)
Get the peripheral clock speed for the specified (LP)UxART.
Definition: rcc.c:783
const struct rcc_clock_scale rcc_hsi_configs[RCC_CLOCK_3V3_END]
Definition: rcc.c:59
void rcc_clock_setup_pll(const struct rcc_clock_scale *clock)
Setup clocks to run from PLL.
Definition: rcc.c:665
rcc_periph_rst
Definition: g4/rcc.h:933
rcc_periph_clken
Definition: g4/rcc.h:781
const struct rcc_clock_scale rcc_hse_12mhz_3v3[RCC_CLOCK_3V3_END]
Definition: rcc.c:210
void rcc_osc_ready_int_enable(enum rcc_osc osc)
Definition: rcc.c:386
rcc_osc
Definition: g4/rcc.h:770
void rcc_osc_ready_int_disable(enum rcc_osc osc)
Definition: rcc.c:410
void rcc_osc_on(enum rcc_osc osc)
Definition: rcc.c:508
#define _REG_BIT(base, bit)
Definition: g4/rcc.h:779
uint32_t rcc_ahb_frequency
Definition: rcc.c:55
void rcc_osc_off(enum rcc_osc osc)
Definition: rcc.c:532
rcc_clock_3v3
Definition: g4/rcc.h:738
uint32_t rcc_apb1_frequency
Definition: rcc.c:56
void rcc_wait_for_sysclk_status(enum rcc_osc osc)
Definition: rcc.c:487
void rcc_set_ppre1(uint32_t ppre1)
Definition: rcc.c:593
void rcc_css_int_clear(void)
Definition: rcc.c:453
void rcc_set_main_pll(uint32_t pllsrc, uint32_t pllm, uint32_t plln, uint32_t pllp, uint32_t pllq, uint32_t pllr)
Reconfigures the main PLL for a HSE source.
Definition: rcc.c:621
void rcc_set_ppre2(uint32_t ppre2)
Definition: rcc.c:584
void rcc_css_enable(void)
Definition: rcc.c:556
void rcc_set_hpre(uint32_t hpre)
Definition: rcc.c:602
rcc_clock_source
Enumerations for core system/bus clocks for user/driver/system access to base bus clocks not directly...
Definition: g4/rcc.h:719
const struct rcc_clock_scale rcc_hse_16mhz_3v3[RCC_CLOCK_3V3_END]
Definition: rcc.c:285
@ RST_FMAC
Definition: g4/rcc.h:937
@ RST_SPI4
Definition: g4/rcc.h:998
@ RST_CRS
Definition: g4/rcc.h:979
@ RST_DAC4
Definition: g4/rcc.h:946
@ RST_DMA2
Definition: g4/rcc.h:940
@ RST_QSPI
Definition: g4/rcc.h:962
@ RST_DMA1
Definition: g4/rcc.h:941
@ RST_SPI1
Definition: g4/rcc.h:1001
@ RST_CORDIC
Definition: g4/rcc.h:938
@ RST_I2C3
Definition: g4/rcc.h:967
@ RST_ADC12
Definition: g4/rcc.h:951
@ RST_FDCAN
Definition: g4/rcc.h:969
@ RST_GPIOG
Definition: g4/rcc.h:953
@ RST_ADC1
Definition: g4/rcc.h:952
@ RST_ADC345
Definition: g4/rcc.h:950
@ RST_TIM16
Definition: g4/rcc.h:996
@ RST_SAI1
Definition: g4/rcc.h:993
@ RST_RNG
Definition: g4/rcc.h:944
@ RST_GPIOF
Definition: g4/rcc.h:954
@ RST_AES
Definition: g4/rcc.h:945
@ RST_SPI2
Definition: g4/rcc.h:978
@ RST_UART4
Definition: g4/rcc.h:974
@ RST_TIM8
Definition: g4/rcc.h:1000
@ RST_TIM15
Definition: g4/rcc.h:997
@ RST_FLASH
Definition: g4/rcc.h:936
@ RST_TIM3
Definition: g4/rcc.h:984
@ RST_DMAMUX1
Definition: g4/rcc.h:939
@ RST_TIM17
Definition: g4/rcc.h:995
@ RST_HRTIM1
Definition: g4/rcc.h:992
@ RST_LPTIM1
Definition: g4/rcc.h:966
@ RST_GPIOA
Definition: g4/rcc.h:959
@ RST_GPIOC
Definition: g4/rcc.h:957
@ RST_TIM6
Definition: g4/rcc.h:981
@ RST_GPIOB
Definition: g4/rcc.h:958
@ RST_TIM1
Definition: g4/rcc.h:1002
@ RST_SPI3
Definition: g4/rcc.h:977
@ RST_USART3
Definition: g4/rcc.h:975
@ RST_TIM20
Definition: g4/rcc.h:994
@ RST_TIM7
Definition: g4/rcc.h:980
@ RST_TIM2
Definition: g4/rcc.h:985
@ RST_UCPD1
Definition: g4/rcc.h:987
@ RST_CRC
Definition: g4/rcc.h:935
@ RST_GPIOD
Definition: g4/rcc.h:956
@ RST_I2C4
Definition: g4/rcc.h:988
@ RST_USB
Definition: g4/rcc.h:970
@ RST_TIM4
Definition: g4/rcc.h:983
@ RST_TIM5
Definition: g4/rcc.h:982
@ RST_SYSCFG
Definition: g4/rcc.h:1003
@ RST_UART5
Definition: g4/rcc.h:973
@ RST_GPIOE
Definition: g4/rcc.h:955
@ RST_I2C2
Definition: g4/rcc.h:971
@ RST_PWR
Definition: g4/rcc.h:968
@ RST_USART1
Definition: g4/rcc.h:999
@ RST_DAC2
Definition: g4/rcc.h:948
@ RST_I2C1
Definition: g4/rcc.h:972
@ RST_LPUART1
Definition: g4/rcc.h:989
@ RST_DAC1
Definition: g4/rcc.h:949
@ RST_FMC
Definition: g4/rcc.h:963
@ RST_USART2
Definition: g4/rcc.h:976
@ RST_DAC3
Definition: g4/rcc.h:947
@ SCC_CRC
Definition: g4/rcc.h:857
@ RCC_DAC3
Definition: g4/rcc.h:796
@ RCC_TIM8
Definition: g4/rcc.h:851
@ RCC_CRS
Definition: g4/rcc.h:830
@ SCC_TIM8
Definition: g4/rcc.h:927
@ SCC_SPI3
Definition: g4/rcc.h:902
@ RCC_SAI1
Definition: g4/rcc.h:844
@ RCC_UART5
Definition: g4/rcc.h:822
@ RCC_RNG
Definition: g4/rcc.h:793
@ RCC_FLASH
Definition: g4/rcc.h:785
@ RCC_FMC
Definition: g4/rcc.h:812
@ SCC_FMAC
Definition: g4/rcc.h:860
@ SCC_GPIOD
Definition: g4/rcc.h:881
@ SCC_UCPD1
Definition: g4/rcc.h:914
@ RCC_SPI2
Definition: g4/rcc.h:827
@ RCC_WWDG
Definition: g4/rcc.h:828
@ SCC_TIM1
Definition: g4/rcc.h:929
@ RCC_TIM3
Definition: g4/rcc.h:835
@ SCC_SPI2
Definition: g4/rcc.h:903
@ SCC_QSPI
Definition: g4/rcc.h:887
@ SCC_TIM16
Definition: g4/rcc.h:923
@ RCC_TIM1
Definition: g4/rcc.h:853
@ RCC_HRTIM1
Definition: g4/rcc.h:843
@ SCC_UART4
Definition: g4/rcc.h:899
@ SCC_SRAM1
Definition: g4/rcc.h:858
@ SCC_CRS
Definition: g4/rcc.h:906
@ RCC_GPIOA
Definition: g4/rcc.h:808
@ SCC_FDCAN
Definition: g4/rcc.h:894
@ SCC_RNG
Definition: g4/rcc.h:867
@ RCC_TIM17
Definition: g4/rcc.h:846
@ SCC_GPIOA
Definition: g4/rcc.h:884
@ RCC_TIM20
Definition: g4/rcc.h:845
@ SCC_DMA2
Definition: g4/rcc.h:863
@ RCC_FDCAN
Definition: g4/rcc.h:818
@ RCC_CORDIC
Definition: g4/rcc.h:787
@ RCC_TIM2
Definition: g4/rcc.h:836
@ SCC_ADC12
Definition: g4/rcc.h:874
@ SCC_TIM6
Definition: g4/rcc.h:908
@ SCC_ADC1
Definition: g4/rcc.h:875
@ RCC_QSPI
Definition: g4/rcc.h:811
@ SCC_TIM2
Definition: g4/rcc.h:912
@ SCC_RTCAPB
Definition: g4/rcc.h:905
@ SCC_LPUART1
Definition: g4/rcc.h:916
@ SCC_TIM3
Definition: g4/rcc.h:911
@ RCC_GPIOG
Definition: g4/rcc.h:802
@ SCC_CCMSRAM
Definition: g4/rcc.h:876
@ RCC_PWR
Definition: g4/rcc.h:817
@ RCC_CRC
Definition: g4/rcc.h:784
@ SCC_USART2
Definition: g4/rcc.h:901
@ SCC_ADC345
Definition: g4/rcc.h:873
@ RCC_RTCAPB
Definition: g4/rcc.h:829
@ SCC_USART3
Definition: g4/rcc.h:900
@ SCC_I2C2
Definition: g4/rcc.h:896
@ SCC_USB
Definition: g4/rcc.h:895
@ RCC_ADC345
Definition: g4/rcc.h:799
@ RCC_USART1
Definition: g4/rcc.h:850
@ SCC_WWDG
Definition: g4/rcc.h:904
@ SCC_PWR
Definition: g4/rcc.h:893
@ RCC_DAC1
Definition: g4/rcc.h:798
@ SCC_SYSCFG
Definition: g4/rcc.h:930
@ SCC_TIM15
Definition: g4/rcc.h:924
@ RCC_TIM4
Definition: g4/rcc.h:834
@ RCC_I2C1
Definition: g4/rcc.h:821
@ RCC_ADC1
Definition: g4/rcc.h:801
@ RCC_ADC12
Definition: g4/rcc.h:800
@ RCC_I2C4
Definition: g4/rcc.h:839
@ SCC_I2C4
Definition: g4/rcc.h:915
@ SCC_SRAM2
Definition: g4/rcc.h:877
@ SCC_SPI1
Definition: g4/rcc.h:928
@ SCC_HRTIM1
Definition: g4/rcc.h:919
@ SCC_DAC3
Definition: g4/rcc.h:870
@ SCC_DMA1
Definition: g4/rcc.h:864
@ RCC_USB
Definition: g4/rcc.h:819
@ RCC_DAC2
Definition: g4/rcc.h:797
@ SCC_SPI4
Definition: g4/rcc.h:925
@ SCC_TIM20
Definition: g4/rcc.h:921
@ RCC_UCPD1
Definition: g4/rcc.h:838
@ RCC_USART2
Definition: g4/rcc.h:825
@ SCC_GPIOE
Definition: g4/rcc.h:880
@ RCC_TIM16
Definition: g4/rcc.h:847
@ SCC_CORDIC
Definition: g4/rcc.h:861
@ SCC_USART1
Definition: g4/rcc.h:926
@ RCC_USART3
Definition: g4/rcc.h:824
@ SCC_TIM17
Definition: g4/rcc.h:922
@ SCC_I2C1
Definition: g4/rcc.h:897
@ RCC_TIM5
Definition: g4/rcc.h:833
@ RCC_SPI1
Definition: g4/rcc.h:852
@ RCC_SYSCFG
Definition: g4/rcc.h:854
@ SCC_GPIOC
Definition: g4/rcc.h:882
@ RCC_FMAC
Definition: g4/rcc.h:786
@ RCC_DAC4
Definition: g4/rcc.h:795
@ RCC_I2C2
Definition: g4/rcc.h:820
@ SCC_FLASH
Definition: g4/rcc.h:859
@ RCC_AES
Definition: g4/rcc.h:794
@ RCC_GPIOB
Definition: g4/rcc.h:807
@ RCC_TIM7
Definition: g4/rcc.h:831
@ RCC_LPTIM1
Definition: g4/rcc.h:815
@ RCC_GPIOF
Definition: g4/rcc.h:803
@ SCC_GPIOF
Definition: g4/rcc.h:879
@ RCC_DMAMUX1
Definition: g4/rcc.h:788
@ RCC_GPIOC
Definition: g4/rcc.h:806
@ SCC_DMAMUX1
Definition: g4/rcc.h:862
@ RCC_TIM6
Definition: g4/rcc.h:832
@ RCC_UART4
Definition: g4/rcc.h:823
@ SCC_TIM5
Definition: g4/rcc.h:909
@ SCC_I2C3
Definition: g4/rcc.h:892
@ SCC_DAC2
Definition: g4/rcc.h:871
@ SCC_GPIOB
Definition: g4/rcc.h:883
@ RCC_DMA1
Definition: g4/rcc.h:790
@ RCC_SPI3
Definition: g4/rcc.h:826
@ SCC_DAC1
Definition: g4/rcc.h:872
@ SCC_GPIOG
Definition: g4/rcc.h:878
@ RCC_GPIOD
Definition: g4/rcc.h:805
@ RCC_TIM15
Definition: g4/rcc.h:848
@ SCC_FMC
Definition: g4/rcc.h:888
@ RCC_I2C3
Definition: g4/rcc.h:816
@ RCC_GPIOE
Definition: g4/rcc.h:804
@ SCC_DAC4
Definition: g4/rcc.h:869
@ SCC_SAI1
Definition: g4/rcc.h:920
@ SCC_UART5
Definition: g4/rcc.h:898
@ SCC_TIM7
Definition: g4/rcc.h:907
@ RCC_DMA2
Definition: g4/rcc.h:789
@ SCC_LPTIM1
Definition: g4/rcc.h:891
@ SCC_AES
Definition: g4/rcc.h:868
@ RCC_SPI4
Definition: g4/rcc.h:849
@ SCC_TIM4
Definition: g4/rcc.h:910
@ RCC_LPUART1
Definition: g4/rcc.h:840
@ RCC_HSI48
Definition: g4/rcc.h:771
@ RCC_LSI
Definition: g4/rcc.h:776
@ RCC_PLL
Definition: g4/rcc.h:772
@ RCC_LSE
Definition: g4/rcc.h:775
@ RCC_HSE
Definition: g4/rcc.h:773
@ RCC_HSI16
Definition: g4/rcc.h:774
@ RCC_CLOCK_3V3_24MHZ
Definition: g4/rcc.h:739
@ RCC_CLOCK_3V3_END
Definition: g4/rcc.h:743
@ RCC_CLOCK_3V3_170MHZ
Definition: g4/rcc.h:742
@ RCC_CLOCK_3V3_96MHZ
Definition: g4/rcc.h:741
@ RCC_CLOCK_3V3_48MHZ
Definition: g4/rcc.h:740
@ RCC_APB1CLK
Definition: g4/rcc.h:726
@ RCC_SYSCLK
Definition: g4/rcc.h:721
@ RCC_SYSTICKCLK
Definition: g4/rcc.h:723
@ RCC_PERCLK
Definition: g4/rcc.h:722
@ RCC_APB2CLK
Definition: g4/rcc.h:727
@ RCC_HCLK3
Definition: g4/rcc.h:724
@ RCC_CPUCLK
Definition: g4/rcc.h:720
@ RCC_AHBCLK
Definition: g4/rcc.h:725
#define RCC_APB2RSTR_OFFSET
Definition: g4/rcc.h:66
#define RCC_AHB1SMENR_OFFSET
Definition: g4/rcc.h:80
#define RCC_APB1ENR2_OFFSET
Definition: g4/rcc.h:76
#define RCC_AHB3RSTR_OFFSET
Definition: g4/rcc.h:60
#define RCC_AHB1RSTR_OFFSET
Definition: g4/rcc.h:56
#define RCC_APB1ENR1_OFFSET
Definition: g4/rcc.h:74
#define RCC_APB2SMENR_OFFSET
Definition: g4/rcc.h:90
#define RCC_AHB3ENR_OFFSET
Definition: g4/rcc.h:72
#define RCC_AHB3SMENR_OFFSET
Definition: g4/rcc.h:84
#define RCC_APB1RSTR1_OFFSET
Definition: g4/rcc.h:62
#define RCC_AHB2RSTR_OFFSET
Definition: g4/rcc.h:58
#define RCC_APB2ENR_OFFSET
Definition: g4/rcc.h:78
#define RCC_AHB2ENR_OFFSET
Definition: g4/rcc.h:70
#define RCC_AHB2SMENR_OFFSET
Definition: g4/rcc.h:82
#define RCC_APB1RSTR2_OFFSET
Definition: g4/rcc.h:64
#define RCC_APB1SMENR2_OFFSET
Definition: g4/rcc.h:88
#define RCC_AHB1ENR_OFFSET
Definition: g4/rcc.h:68
#define RCC_APB1SMENR1_OFFSET
Definition: g4/rcc.h:86
uint8_t ppre1
Definition: g4/rcc.h:754
uint8_t pllq
Definition: g4/rcc.h:750
uint8_t flash_waitstates
Definition: g4/rcc.h:759
uint8_t ppre2
Definition: g4/rcc.h:755
uint8_t pllp
Definition: g4/rcc.h:749
uint32_t apb1_frequency
Definition: g4/rcc.h:761
uint8_t pllm
Definition: g4/rcc.h:747
uint32_t ahb_frequency
Definition: g4/rcc.h:760
enum pwr_vos_scale vos_scale
Definition: g4/rcc.h:756
uint16_t plln
Definition: g4/rcc.h:748
uint8_t pllr
Definition: g4/rcc.h:751
uint32_t flash_config
Definition: g4/rcc.h:758
uint8_t hpre
Definition: g4/rcc.h:753
uint32_t apb2_frequency
Definition: g4/rcc.h:762
uint8_t pll_source
Definition: g4/rcc.h:752