libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
f7/rcc.h
Go to the documentation of this file.
1/** @defgroup rcc_defines RCC Defines
2 *
3 * @brief <b>Defined Constants and Types for the STM32F7xx Reset and Clock
4 * Control</b>
5 *
6 * @ingroup STM32F7xx_defines
7 *
8 * @version 1.0.0
9 *
10 * @author @htmlonly &copy; @endhtmlonly 2015
11 * Karl Palsson <karlp@tweak.net.au>
12 *
13 * @date October, 2015
14 *
15 * LGPL License Terms @ref lgpl_license
16 * */
17/*
18 * This file is part of the libopencm3 project.
19 *
20 * Copyright (C) 2015 Karl Palsson <karlp@tweak.net.au>
21 *
22 * This library is free software: you can redistribute it and/or modify
23 * it under the terms of the GNU Lesser General Public License as published by
24 * the Free Software Foundation, either version 3 of the License, or
25 * (at your option) any later version.
26 *
27 * This library is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU Lesser General Public License for more details.
31 *
32 * You should have received a copy of the GNU Lesser General Public License
33 * along with this library. If not, see <http://www.gnu.org/licenses/>.
34 */
35
36#ifndef LIBOPENCM3_RCC_H
37#define LIBOPENCM3_RCC_H
38
40
41/**@{*/
42
43/* --- RCC registers ------------------------------------------------------- */
44
45#define RCC_CR MMIO32(RCC_BASE + 0x00)
46#define RCC_PLLCFGR MMIO32(RCC_BASE + 0x04)
47#define RCC_CFGR MMIO32(RCC_BASE + 0x08)
48#define RCC_CIR MMIO32(RCC_BASE + 0x0c)
49#define RCC_AHB1RSTR MMIO32(RCC_BASE + 0x10)
50#define RCC_AHB2RSTR MMIO32(RCC_BASE + 0x14)
51#define RCC_AHB3RSTR MMIO32(RCC_BASE + 0x18)
52#define RCC_APB1RSTR MMIO32(RCC_BASE + 0x20)
53#define RCC_APB2RSTR MMIO32(RCC_BASE + 0x24)
54#define RCC_AHB1ENR MMIO32(RCC_BASE + 0x30)
55#define RCC_AHB2ENR MMIO32(RCC_BASE + 0x34)
56#define RCC_AHB3ENR MMIO32(RCC_BASE + 0x38)
57#define RCC_APB1ENR MMIO32(RCC_BASE + 0x40)
58#define RCC_APB2ENR MMIO32(RCC_BASE + 0x44)
59#define RCC_AHB1LPENR MMIO32(RCC_BASE + 0x50)
60#define RCC_AHB2LPENR MMIO32(RCC_BASE + 0x54)
61#define RCC_AHB3LPENR MMIO32(RCC_BASE + 0x58)
62#define RCC_APB1LPENR MMIO32(RCC_BASE + 0x60)
63#define RCC_APB2LPENR MMIO32(RCC_BASE + 0x64)
64#define RCC_BDCR MMIO32(RCC_BASE + 0x70)
65#define RCC_CSR MMIO32(RCC_BASE + 0x74)
66#define RCC_SSCGR MMIO32(RCC_BASE + 0x80)
67#define RCC_PLLI2SCFGR MMIO32(RCC_BASE + 0x84)
68#define RCC_PLLSAICFGR MMIO32(RCC_BASE + 0x88)
69#define RCC_DCKCFGR1 MMIO32(RCC_BASE + 0x8C)
70#define RCC_DCKCFGR2 MMIO32(RCC_BASE + 0x90)
71
72/* --- RCC_CR values ------------------------------------------------------- */
73
74#define RCC_CR_PLLSAIRDY (1 << 29)
75#define RCC_CR_PLLSAION (1 << 28)
76#define RCC_CR_PLLI2SRDY (1 << 27)
77#define RCC_CR_PLLI2SON (1 << 26)
78#define RCC_CR_PLLRDY (1 << 25)
79#define RCC_CR_PLLON (1 << 24)
80#define RCC_CR_CSSON (1 << 19)
81#define RCC_CR_HSEBYP (1 << 18)
82#define RCC_CR_HSERDY (1 << 17)
83#define RCC_CR_HSEON (1 << 16)
84#define RCC_CR_HSICAL_MASK 0xff
85#define RCC_CR_HSICAL_SHIFT 8
86#define RCC_CR_HSITRIM_MASK 0x1f
87#define RCC_CR_HSITRIM_SHIFT 3
88#define RCC_CR_HSIRDY (1 << 1)
89#define RCC_CR_HSION (1 << 0)
90
91/* --- RCC_PLLCFGR values -------------------------------------------------- */
92
93#define RCC_PLLCFGR_PLLQ_MASK 0xf
94#define RCC_PLLCFGR_PLLQ_SHIFT 24
95#define RCC_PLLCFGR_PLLSRC (1 << 22)
96#define RCC_PLLCFGR_PLLP_MASK 0x3
97#define RCC_PLLCFGR_PLLP_SHIFT 16
98#define RCC_PLLCFGR_PLLN_MASK 0x1ff
99#define RCC_PLLCFGR_PLLN_SHIFT 6
100#define RCC_PLLCFGR_PLLM_MASK 0x3f
101#define RCC_PLLCFGR_PLLM_SHIFT 0
102
103/* --- RCC_CFGR values ----------------------------------------------------- */
104
105/* MCO2: Microcontroller clock output 2 */
106#define RCC_CFGR_MCO2_MASK 0x3
107#define RCC_CFGR_MCO2_SHIFT 30
108#define RCC_CFGR_MCO2_SYSCLK 0x0
109#define RCC_CFGR_MCO2_PLLI2S 0x1
110#define RCC_CFGR_MCO2_HSE 0x2
111#define RCC_CFGR_MCO2_PLL 0x3
112
113/* MCO1/2PRE: MCO Prescalers */
114#define RCC_CFGR_MCOPRE_MASK 0x7
115#define RCC_CFGR_MCO2PRE_SHIFT 27
116#define RCC_CFGR_MCO1PRE_SHIFT 24
117#define RCC_CFGR_MCOPRE_DIV_NONE 0x0
118#define RCC_CFGR_MCOPRE_DIV_2 0x4
119#define RCC_CFGR_MCOPRE_DIV_3 0x5
120#define RCC_CFGR_MCOPRE_DIV_4 0x6
121#define RCC_CFGR_MCOPRE_DIV_5 0x7
122
123/* I2SSRC: I2S clock selection */
124#define RCC_CFGR_I2SSRC (1 << 23)
125
126/* MCO1: Microcontroller clock output 1 */
127#define RCC_CFGR_MCO1_MASK 0x3
128#define RCC_CFGR_MCO1_SHIFT 21
129#define RCC_CFGR_MCO1_HSI 0x0
130#define RCC_CFGR_MCO1_LSE 0x1
131#define RCC_CFGR_MCO1_HSE 0x2
132#define RCC_CFGR_MCO1_PLL 0x3
133#define RCC_CFGR_MCO_SHIFT RCC_CFGR_MCO1_SHIFT
134#define RCC_CFGR_MCO_MASK RCC_CFGR_MCO1_MASK
135
136/* RTCPRE: HSE division factor for RTC clock */
137#define RCC_CFGR_RTCPRE_SHIFT 16
138#define RCC_CFGR_RTCPRE_MASK 0x1f
139
140#define RCC_CFGR_PPRE2_SHIFT 13
141#define RCC_CFGR_PPRE2_MASK 0x7
142#define RCC_CFGR_PPRE1_SHIFT 10
143#define RCC_CFGR_PPRE1_MASK 0x7
144/** @defgroup rcc_cfgr_apbxpre RCC_CFGR APBx prescale factors
145 * These can be used for both APB1 and APB2 prescaling
146 * @{
147 */
148#define RCC_CFGR_PPRE_NODIV 0x0
149#define RCC_CFGR_PPRE_DIV2 0x4
150#define RCC_CFGR_PPRE_DIV4 0x5
151#define RCC_CFGR_PPRE_DIV8 0x6
152#define RCC_CFGR_PPRE_DIV16 0x7
153/**@}*/
154
155#define RCC_CFGR_HPRE_SHIFT 4
156#define RCC_CFGR_HPRE_MASK 0xf
157/** @defgroup rcc_cfgr_ahbpre RCC_CFGR AHB prescale factors
158@{*/
159#define RCC_CFGR_HPRE_NODIV 0x0
160#define RCC_CFGR_HPRE_DIV2 (0x8 + 0)
161#define RCC_CFGR_HPRE_DIV4 (0x8 + 1)
162#define RCC_CFGR_HPRE_DIV8 (0x8 + 2)
163#define RCC_CFGR_HPRE_DIV16 (0x8 + 3)
164#define RCC_CFGR_HPRE_DIV64 (0x8 + 4)
165#define RCC_CFGR_HPRE_DIV128 (0x8 + 5)
166#define RCC_CFGR_HPRE_DIV256 (0x8 + 6)
167#define RCC_CFGR_HPRE_DIV512 (0x8 + 7)
168/**@}*/
169
170/* SWS: System clock switch status */
171#define RCC_CFGR_SWS_SHIFT 2
172#define RCC_CFGR_SWS_MASK 0x3
173#define RCC_CFGR_SWS_HSI 0x0
174#define RCC_CFGR_SWS_HSE 0x1
175#define RCC_CFGR_SWS_PLL 0x2
176
177/* SW: System clock switch */
178#define RCC_CFGR_SW_SHIFT 0
179#define RCC_CFGR_SW_MASK 0x3
180#define RCC_CFGR_SW_HSI 0x0
181#define RCC_CFGR_SW_HSE 0x1
182#define RCC_CFGR_SW_PLL 0x2
183
184/** Older compatible definitions to ease migration
185 * @defgroup rcc_cfgr_deprecated RCC_CFGR Deprecated dividers
186 * @deprecated Use _CFGR_xPRE_DIVn form instead, across all families
187 * @{
188 */
189#define RCC_CFGR_PPRE_DIV_NONE 0x0
190#define RCC_CFGR_PPRE_DIV_2 0x4
191#define RCC_CFGR_PPRE_DIV_4 0x5
192#define RCC_CFGR_PPRE_DIV_8 0x6
193#define RCC_CFGR_PPRE_DIV_16 0x7
194
195#define RCC_CFGR_HPRE_DIV_NONE 0x0
196#define RCC_CFGR_HPRE_DIV_2 (0x8 + 0)
197#define RCC_CFGR_HPRE_DIV_4 (0x8 + 1)
198#define RCC_CFGR_HPRE_DIV_8 (0x8 + 2)
199#define RCC_CFGR_HPRE_DIV_16 (0x8 + 3)
200#define RCC_CFGR_HPRE_DIV_64 (0x8 + 4)
201#define RCC_CFGR_HPRE_DIV_128 (0x8 + 5)
202#define RCC_CFGR_HPRE_DIV_256 (0x8 + 6)
203#define RCC_CFGR_HPRE_DIV_512 (0x8 + 7)
204/**@}*/
205
206/* --- RCC_CIR values ------------------------------------------------------ */
207
208/* Clock security system interrupt clear bit */
209#define RCC_CIR_CSSC (1 << 23)
210
211/* OSC ready interrupt clear bits */
212#define RCC_CIR_PLLSAIRDYC (1 << 22)
213#define RCC_CIR_PLLI2SRDYC (1 << 21)
214#define RCC_CIR_PLLRDYC (1 << 20)
215#define RCC_CIR_HSERDYC (1 << 19)
216#define RCC_CIR_HSIRDYC (1 << 18)
217#define RCC_CIR_LSERDYC (1 << 17)
218#define RCC_CIR_LSIRDYC (1 << 16)
219
220/* OSC ready interrupt enable bits */
221#define RCC_CIR_PLLSAIRDYIE (1 << 14)
222#define RCC_CIR_PLLI2SRDYIE (1 << 13)
223#define RCC_CIR_PLLRDYIE (1 << 12)
224#define RCC_CIR_HSERDYIE (1 << 11)
225#define RCC_CIR_HSIRDYIE (1 << 10)
226#define RCC_CIR_LSERDYIE (1 << 9)
227#define RCC_CIR_LSIRDYIE (1 << 8)
228
229/* Clock security system interrupt flag bit */
230#define RCC_CIR_CSSF (1 << 7)
231
232/* OSC ready interrupt flag bits */
233#define RCC_CIR_PLLSAIRDYF (1 << 6)
234#define RCC_CIR_PLLI2SRDYF (1 << 5)
235#define RCC_CIR_PLLRDYF (1 << 4)
236#define RCC_CIR_HSERDYF (1 << 3)
237#define RCC_CIR_HSIRDYF (1 << 2)
238#define RCC_CIR_LSERDYF (1 << 1)
239#define RCC_CIR_LSIRDYF (1 << 0)
240
241/** @defgroup rcc_ahbrstr_rst RCC_AHBxRSTR reset values (full set)
242@{*/
243/** @defgroup rcc_ahb1rstr_rst RCC_AHB1RSTR reset values
244@{*/
245#define RCC_AHB1RSTR_OTGHSRST (1 << 29)
246#define RCC_AHB1RSTR_ETHMACRST (1 << 25)
247#define RCC_AHB1RSTR_DMA2DRST (1 << 23)
248#define RCC_AHB1RSTR_DMA2RST (1 << 22)
249#define RCC_AHB1RSTR_DMA1RST (1 << 21)
250#define RCC_AHB1RSTR_CRCRST (1 << 12)
251#define RCC_AHB1RSTR_GPIOKRST (1 << 10)
252#define RCC_AHB1RSTR_GPIOJRST (1 << 9)
253#define RCC_AHB1RSTR_GPIOIRST (1 << 8)
254#define RCC_AHB1RSTR_GPIOHRST (1 << 7)
255#define RCC_AHB1RSTR_GPIOGRST (1 << 6)
256#define RCC_AHB1RSTR_GPIOFRST (1 << 5)
257#define RCC_AHB1RSTR_GPIOERST (1 << 4)
258#define RCC_AHB1RSTR_GPIODRST (1 << 3)
259#define RCC_AHB1RSTR_GPIOCRST (1 << 2)
260#define RCC_AHB1RSTR_GPIOBRST (1 << 1)
261#define RCC_AHB1RSTR_GPIOARST (1 << 0)
262/**@}*/
263
264/** @defgroup rcc_ahb2rstr_rst RCC_AHB2RSTR reset values
265@{*/
266#define RCC_AHB2RSTR_OTGFSRST (1 << 7)
267#define RCC_AHB2RSTR_RNGRST (1 << 6)
268#define RCC_AHB2RSTR_HASHRST (1 << 5)
269#define RCC_AHB2RSTR_CRYPRST (1 << 4)
270#define RCC_AHB2RSTR_DCMIRST (1 << 0)
271/**@}*/
272
273/** @defgroup rcc_ahb3rstr_rst RCC_AHB3RSTR reset values
274@{*/
275#define RCC_AHB3RSTR_QSPIRST (1 << 1)
276#define RCC_AHB3RSTR_FSMCRST (1 << 0)
277/**@}*/
278/**@}*/
279
280/** @defgroup rcc_apb1rstr_rst RCC_APB1RSTR reset values
281@{*/
282#define RCC_APB1RSTR_UART8RST (1 << 31)
283#define RCC_APB1RSTR_UART7RST (1 << 30)
284#define RCC_APB1RSTR_DACRST (1 << 29)
285#define RCC_APB1RSTR_PWRRST (1 << 28)
286#define RCC_APB1RSTR_CECRST (1 << 27)
287#define RCC_APB1RSTR_CAN2RST (1 << 26)
288#define RCC_APB1RSTR_CAN1RST (1 << 25)
289#define RCC_APB1RSTR_I2C4RST (1 << 24)
290#define RCC_APB1RSTR_I2C3RST (1 << 23)
291#define RCC_APB1RSTR_I2C2RST (1 << 22)
292#define RCC_APB1RSTR_I2C1RST (1 << 21)
293#define RCC_APB1RSTR_UART5RST (1 << 20)
294#define RCC_APB1RSTR_UART4RST (1 << 19)
295#define RCC_APB1RSTR_UART3RST (1 << 18)
296#define RCC_APB1RSTR_UART2RST (1 << 17)
297#define RCC_APB1RSTR_SPDIFRXRST (1 << 16)
298#define RCC_APB1RSTR_SPI3RST (1 << 15)
299#define RCC_APB1RSTR_SPI2RST (1 << 14)
300#define RCC_APB1RSTR_WWDGRST (1 << 11)
301#define RCC_APB1RSTR_LPTIM1RST (1 << 9)
302#define RCC_APB1RSTR_TIM14RST (1 << 8)
303#define RCC_APB1RSTR_TIM13RST (1 << 7)
304#define RCC_APB1RSTR_TIM12RST (1 << 6)
305#define RCC_APB1RSTR_TIM7RST (1 << 5)
306#define RCC_APB1RSTR_TIM6RST (1 << 4)
307#define RCC_APB1RSTR_TIM5RST (1 << 3)
308#define RCC_APB1RSTR_TIM4RST (1 << 2)
309#define RCC_APB1RSTR_TIM3RST (1 << 1)
310#define RCC_APB1RSTR_TIM2RST (1 << 0)
311/**@}*/
312
313/** @defgroup rcc_apb2rstr_rst RCC_APB2RSTR reset values
314@{*/
315#define RCC_APB2RSTR_LTDCRST (1 << 26)
316#define RCC_APB2RSTR_SAI2RST (1 << 23)
317#define RCC_APB2RSTR_SAI1RST (1 << 22)
318#define RCC_APB2RSTR_SPI6RST (1 << 21)
319#define RCC_APB2RSTR_SPI5RST (1 << 20)
320#define RCC_APB2RSTR_TIM11RST (1 << 18)
321#define RCC_APB2RSTR_TIM10RST (1 << 17)
322#define RCC_APB2RSTR_TIM9RST (1 << 16)
323#define RCC_APB2RSTR_SYSCFGRST (1 << 14)
324#define RCC_APB2RSTR_SPI4RST (1 << 13)
325#define RCC_APB2RSTR_SPI1RST (1 << 12)
326#define RCC_APB2RSTR_SDMMC1RST (1 << 11)
327#define RCC_APB2RSTR_ADCRST (1 << 8)
328#define RCC_APB2RSTR_USART6RST (1 << 5)
329#define RCC_APB2RSTR_USART1RST (1 << 4)
330#define RCC_APB2RSTR_TIM8RST (1 << 1)
331#define RCC_APB2RSTR_TIM1RST (1 << 0)
332/**@}*/
333
334/** @defgroup rcc_ahbenr_en RCC_AHBxENR enable values (full set)
335@{*/
336/** @defgroup rcc_ahb1enr_en RCC_AHB1ENR enable values
337@{*/
338#define RCC_AHB1ENR_OTGHSULPIEN (1 << 30)
339#define RCC_AHB1ENR_OTGHSEN (1 << 29)
340#define RCC_AHB1ENR_ETHMACPTPEN (1 << 28)
341#define RCC_AHB1ENR_ETHMACRXEN (1 << 27)
342#define RCC_AHB1ENR_ETHMACTXEN (1 << 26)
343#define RCC_AHB1ENR_ETHMACEN (1 << 25)
344#define RCC_AHB1ENR_DMA2DEN (1 << 23)
345#define RCC_AHB1ENR_DMA2EN (1 << 22)
346#define RCC_AHB1ENR_DMA1EN (1 << 21)
347#define RCC_AHB1ENR_DTCMRAMEN (1 << 20)
348#define RCC_AHB1ENR_BKPSRAMEN (1 << 18)
349#define RCC_AHB1ENR_CRCEN (1 << 12)
350#define RCC_AHB1ENR_GPIOKEN (1 << 10)
351#define RCC_AHB1ENR_GPIOJEN (1 << 9)
352#define RCC_AHB1ENR_GPIOIEN (1 << 8)
353#define RCC_AHB1ENR_GPIOHEN (1 << 7)
354#define RCC_AHB1ENR_GPIOGEN (1 << 6)
355#define RCC_AHB1ENR_GPIOFEN (1 << 5)
356#define RCC_AHB1ENR_GPIOEEN (1 << 4)
357#define RCC_AHB1ENR_GPIODEN (1 << 3)
358#define RCC_AHB1ENR_GPIOCEN (1 << 2)
359#define RCC_AHB1ENR_GPIOBEN (1 << 1)
360#define RCC_AHB1ENR_GPIOAEN (1 << 0)
361/**@}*/
362
363/** @defgroup rcc_ahb2enr_en RCC_AHB2ENR enable values
364@{*/
365#define RCC_AHB2ENR_OTGFSEN (1 << 7)
366#define RCC_AHB2ENR_RNGEN (1 << 6)
367#define RCC_AHB2ENR_HASHEN (1 << 5)
368#define RCC_AHB2ENR_CRYPEN (1 << 4)
369#define RCC_AHB2ENR_DCMIEN (1 << 0)
370/**@}*/
371
372/** @defgroup rcc_ahb3enr_en RCC_AHB3ENR enable values
373@{*/
374#define RCC_AHB3ENR_QSPIEN (1 << 1)
375#define RCC_AHB3ENR_FMCEN (1 << 0)
376/**@}*/
377/**@}*/
378
379/** @defgroup rcc_apb1enr_en RCC_APB1ENR enable values
380@{*/
381#define RCC_APB1ENR_UART8EN (1 << 31)
382#define RCC_APB1ENR_UART7EN (1 << 30)
383#define RCC_APB1ENR_DACEN (1 << 29)
384#define RCC_APB1ENR_PWREN (1 << 28)
385#define RCC_APB1ENR_CECEN (1 << 27)
386#define RCC_APB1ENR_CAN2EN (1 << 26)
387#define RCC_APB1ENR_CAN1EN (1 << 25)
388#define RCC_APB1ENR_I2C4EN (1 << 24)
389#define RCC_APB1ENR_I2C3EN (1 << 23)
390#define RCC_APB1ENR_I2C2EN (1 << 22)
391#define RCC_APB1ENR_I2C1EN (1 << 21)
392#define RCC_APB1ENR_UART5EN (1 << 20)
393#define RCC_APB1ENR_UART4EN (1 << 19)
394#define RCC_APB1ENR_USART3EN (1 << 18)
395#define RCC_APB1ENR_USART2EN (1 << 17)
396#define RCC_APB1ENR_SPIDIFRXEN (1 << 16)
397#define RCC_APB1ENR_SPI3EN (1 << 15)
398#define RCC_APB1ENR_SPI2EN (1 << 14)
399#define RCC_APB1ENR_WWDGEN (1 << 11)
400#define RCC_APB1ENR_LPTIM1EN (1 << 9)
401#define RCC_APB1ENR_TIM14EN (1 << 8)
402#define RCC_APB1ENR_TIM13EN (1 << 7)
403#define RCC_APB1ENR_TIM12EN (1 << 6)
404#define RCC_APB1ENR_TIM7EN (1 << 5)
405#define RCC_APB1ENR_TIM6EN (1 << 4)
406#define RCC_APB1ENR_TIM5EN (1 << 3)
407#define RCC_APB1ENR_TIM4EN (1 << 2)
408#define RCC_APB1ENR_TIM3EN (1 << 1)
409#define RCC_APB1ENR_TIM2EN (1 << 0)
410/**@}*/
411
412/** @defgroup rcc_apb2enr_en RCC_APB2ENR enable values
413@{*/
414#define RCC_APB2ENR_LTDCEN (1 << 26)
415#define RCC_APB2ENR_SAI2EN (1 << 23)
416#define RCC_APB2ENR_SAI1EN (1 << 22)
417#define RCC_APB2ENR_SPI6EN (1 << 21)
418#define RCC_APB2ENR_SPI5EN (1 << 20)
419#define RCC_APB2ENR_TIM11EN (1 << 18)
420#define RCC_APB2ENR_TIM10EN (1 << 17)
421#define RCC_APB2ENR_TIM9EN (1 << 16)
422#define RCC_APB2ENR_SYSCFGEN (1 << 14)
423#define RCC_APB2ENR_SPI4EN (1 << 13)
424#define RCC_APB2ENR_SPI1EN (1 << 12)
425#define RCC_APB2ENR_SDMMC1EN (1 << 11)
426#define RCC_APB2ENR_ADC3EN (1 << 10)
427#define RCC_APB2ENR_ADC2EN (1 << 9)
428#define RCC_APB2ENR_ADC1EN (1 << 8)
429#define RCC_APB2ENR_USART6EN (1 << 5)
430#define RCC_APB2ENR_USART1EN (1 << 4)
431#define RCC_APB2ENR_TIM8EN (1 << 1)
432#define RCC_APB2ENR_TIM1EN (1 << 0)
433/**@}*/
434
435/* --- RCC_AHB1LPENR values ------------------------------------------------- */
436
437#define RCC_AHB1LPENR_OTGHSULPILPEN (1 << 30)
438#define RCC_AHB1LPENR_OTGHSLPEN (1 << 29)
439#define RCC_AHB1LPENR_ETHMACPTPLPEN (1 << 28)
440#define RCC_AHB1LPENR_ETHMACRXLPEN (1 << 27)
441#define RCC_AHB1LPENR_ETHMACTXLPEN (1 << 26)
442#define RCC_AHB1LPENR_ETHMACLPEN (1 << 25)
443#define RCC_AHB1LPENR_DMA2DLPEN (1 << 23)
444#define RCC_AHB1LPENR_DMA2LPEN (1 << 22)
445#define RCC_AHB1LPENR_DMA1LPEN (1 << 21)
446#define RCC_AHB1LPENR_DTCMLPEN (1 << 20)
447#define RCC_AHB1LPENR_BKPSRAMLPEN (1 << 18)
448#define RCC_AHB1LPENR_SRAM2LPEN (1 << 17)
449#define RCC_AHB1LPENR_SRAM1LPEN (1 << 16)
450#define RCC_AHB1LPENR_FLITFLPEN (1 << 15)
451#define RCC_AHB1LPENR_AXILPEN (1 << 13)
452#define RCC_AHB1LPENR_CRCLPEN (1 << 12)
453#define RCC_AHB1LPENR_GPIOKLPEN (1 << 10)
454#define RCC_AHB1LPENR_GPIOJLPEN (1 << 9)
455#define RCC_AHB1LPENR_GPIOILPEN (1 << 8)
456#define RCC_AHB1LPENR_GPIOHLPEN (1 << 7)
457#define RCC_AHB1LPENR_GPIOGLPEN (1 << 6)
458#define RCC_AHB1LPENR_GPIOFLPEN (1 << 5)
459#define RCC_AHB1LPENR_GPIOELPEN (1 << 4)
460#define RCC_AHB1LPENR_GPIODLPEN (1 << 3)
461#define RCC_AHB1LPENR_GPIOCLPEN (1 << 2)
462#define RCC_AHB1LPENR_GPIOBLPEN (1 << 1)
463#define RCC_AHB1LPENR_GPIOALPEN (1 << 0)
464
465/* --- RCC_AHB2LPENR values ------------------------------------------------- */
466
467#define RCC_AHB2LPENR_OTGFSLPEN (1 << 7)
468#define RCC_AHB2LPENR_RNGLPEN (1 << 6)
469#define RCC_AHB2LPENR_HASHLPEN (1 << 5)
470#define RCC_AHB2LPENR_CRYPLPEN (1 << 4)
471#define RCC_AHB2LPENR_DCMILPEN (1 << 0)
472
473/* --- RCC_AHB3LPENR values ------------------------------------------------- */
474
475#define RCC_AHB3LPENR_QSPILPEN (1 << 1)
476#define RCC_AHB3LPENR_FMCLPEN (1 << 0)
477
478/* --- RCC_APB1LPENR values ------------------------------------------------- */
479
480#define RCC_APB1LPENR_UART8LPEN (1 << 31)
481#define RCC_APB1LPENR_UART7LPEN (1 << 30)
482#define RCC_APB1LPENR_DACLPEN (1 << 29)
483#define RCC_APB1LPENR_PWRLPEN (1 << 28)
484#define RCC_APB1LPENR_CECLPEN (1 << 27)
485#define RCC_APB1LPENR_CAN2LPEN (1 << 26)
486#define RCC_APB1LPENR_CAN1LPEN (1 << 25)
487#define RCC_APB1LPENR_I2C4LPEN (1 << 24)
488#define RCC_APB1LPENR_I2C3LPEN (1 << 23)
489#define RCC_APB1LPENR_I2C2LPEN (1 << 22)
490#define RCC_APB1LPENR_I2C1LPEN (1 << 21)
491#define RCC_APB1LPENR_UART5LPEN (1 << 20)
492#define RCC_APB1LPENR_UART4LPEN (1 << 19)
493#define RCC_APB1LPENR_USART3LPEN (1 << 18)
494#define RCC_APB1LPENR_USART2LPEN (1 << 17)
495#define RCC_APB1LPENR_SPIDIFRXLPEN (1 << 16)
496#define RCC_APB1LPENR_SPI3LPEN (1 << 15)
497#define RCC_APB1LPENR_SPI2LPEN (1 << 14)
498#define RCC_APB1LPENR_WWDGLPEN (1 << 11)
499#define RCC_APB1LPENR_LPTIM1LPEN (1 << 9)
500#define RCC_APB1LPENR_TIM14LPEN (1 << 8)
501#define RCC_APB1LPENR_TIM13LPEN (1 << 7)
502#define RCC_APB1LPENR_TIM12LPEN (1 << 6)
503#define RCC_APB1LPENR_TIM7LPEN (1 << 5)
504#define RCC_APB1LPENR_TIM6LPEN (1 << 4)
505#define RCC_APB1LPENR_TIM5LPEN (1 << 3)
506#define RCC_APB1LPENR_TIM4LPEN (1 << 2)
507#define RCC_APB1LPENR_TIM3LPEN (1 << 1)
508#define RCC_APB1LPENR_TIM2LPEN (1 << 0)
509
510/* --- RCC_APB2LPENR values ------------------------------------------------- */
511
512#define RCC_APB2LPENR_LTDCLPEN (1 << 26)
513#define RCC_APB2LPENR_SAI2LPEN (1 << 23)
514#define RCC_APB2LPENR_SAI1LPEN (1 << 22)
515#define RCC_APB2LPENR_SPI6LPEN (1 << 21)
516#define RCC_APB2LPENR_SPI5LPEN (1 << 20)
517#define RCC_APB2LPENR_TIM11LPEN (1 << 18)
518#define RCC_APB2LPENR_TIM10LPEN (1 << 17)
519#define RCC_APB2LPENR_TIM9LPEN (1 << 16)
520#define RCC_APB2LPENR_SYSCFGLPEN (1 << 14)
521#define RCC_APB2LPENR_SPI4LPEN (1 << 13)
522#define RCC_APB2LPENR_SPI1LPEN (1 << 12)
523#define RCC_APB2LPENR_SDMMC1LPEN (1 << 11)
524#define RCC_APB2LPENR_ADC3LPEN (1 << 10)
525#define RCC_APB2LPENR_ADC2LPEN (1 << 9)
526#define RCC_APB2LPENR_ADC1LPEN (1 << 8)
527#define RCC_APB2LPENR_USART6LPEN (1 << 5)
528#define RCC_APB2LPENR_USART1LPEN (1 << 4)
529#define RCC_APB2LPENR_TIM8LPEN (1 << 1)
530#define RCC_APB2LPENR_TIM1LPEN (1 << 0)
531
532/* --- RCC_BDCR values ----------------------------------------------------- */
533
534#define RCC_BDCR_BDRST (1 << 16)
535#define RCC_BDCR_RTCEN (1 << 15)
536#define RCC_BDCR_RTCSEL_MASK 0x3
537#define RCC_BDCR_RTCSEL_SHIFT 8
538#define RCC_BDCR_RTCSEL_NONE 0
539#define RCC_BDCR_RTCSEL_LSE 1
540#define RCC_BDCR_RTCSEL_LSI 2
541#define RCC_BDCR_RTCSEL_HSE 3
542#define RCC_BDCR_LSEDRV_MASK 0x3
543#define RCC_BDCR_LSEDRV_SHIFT 3
544#define RCC_BDCR_LSEDRV_LOW 0
545#define RCC_BDCR_LSEDRV_MEDH 1 /* good job st */
546#define RCC_BDCR_LSEDRV_MEDL 2
547#define RCC_BDCR_LSEDRV_HIGH 3
548#define RCC_BDCR_LSEBYP (1 << 2)
549#define RCC_BDCR_LSERDY (1 << 1)
550#define RCC_BDCR_LSEON (1 << 0)
551
552/* --- RCC_CSR values ------------------------------------------------------ */
553
554#define RCC_CSR_LPWRRSTF (1 << 31)
555#define RCC_CSR_WWDGRSTF (1 << 30)
556#define RCC_CSR_IWDGRSTF (1 << 29)
557#define RCC_CSR_SFTRSTF (1 << 28)
558#define RCC_CSR_PORRSTF (1 << 27)
559#define RCC_CSR_PINRSTF (1 << 26)
560#define RCC_CSR_BORRSTF (1 << 25)
561#define RCC_CSR_RMVF (1 << 24)
562#define RCC_CSR_RESET_FLAGS (RCC_CSR_LPWRRSTF | RCC_CSR_WWDGRSTF |\
563 RCC_CSR_IWDGRSTF | RCC_CSR_SFTRSTF | RCC_CSR_PORRSTF |\
564 RCC_CSR_PINRSTF | RCC_CSR_BORRSTF)
565#define RCC_CSR_LSIRDY (1 << 1)
566#define RCC_CSR_LSION (1 << 0)
567
568/* --- RCC_SSCGR values ---------------------------------------------------- */
569
570#define RCC_SSCGR_SSCGEN (1 << 31)
571#define RCC_SSCGR_SPREADSEL (1 << 30)
572#define RCC_SSCGR_INCSTEP_MASK 0x7fff
573#define RCC_SSCGR_INCSTEP_SHIFT 13
574#define RCC_SSCGR_MODPER_MASK 0x1fff
575#define RCC_SSCGR_MODPER_SHIFT 0
576
577/* --- RCC_PLLI2SCFGR values ----------------------------------------------- */
578
579/* RCC_PLLI2SCFGR[30:28]: PLLI2SR */
580#define RCC_PLLI2SCFGR_PLLI2S_MASK 0x7
581#define RCC_PLLI2SCFGR_PLLI2S_SHIFT 28
582#define RCC_PLLI2SCFGR_PLLI2SQ_MASK 0xf
583#define RCC_PLLI2SCFGR_PLLI2SQ_SHIFT 24
584#define RCC_PLLI2SCFGR_PLLI2SP_MASK 0x3
585#define RCC_PLLI2SCFGR_PLLI2SP_SHIFT 16
586#define RCC_PLLI2SCFGR_PLLI2SN_MASK 0x1ff
587#define RCC_PLLI2SCFGR_PLLI2SN_SHIFT 6
588
589/* --- RCC_PLLSAICFGR values ----------------------------------------------- */
590
591#define RCC_PLLSAICFGR_PLLSAIR_MASK 0x7
592#define RCC_PLLSAICFGR_PLLSAIR_SHIFT 28
593#define RCC_PLLSAICFGR_PLLSAIQ_MASK 0xf
594#define RCC_PLLSAICFGR_PLLSAIQ_SHIFT 24
595#define RCC_PLLSAICFGR_PLLSAIP_MASK 0x3
596#define RCC_PLLSAICFGR_PLLSAIP_SHIFT 16
597#define RCC_PLLSAICFGR_PLLSAIN_MASK 0x1FF
598#define RCC_PLLSAICFGR_PLLSAIN_SHIFT 6
599
600/* --- RCC_DCKCFGR1 values -------------------------------------------------- */
601
602#define RCC_DCKCFGR1_TIMPRE (1<<24)
603#define RCC_DCKCFGR1_SAI2SEL_MASK 0x3
604#define RCC_DCKCFGR1_SAI2SEL_SHIFT 22
605#define RCC_DCKCFGR1_SAI1SEL_MASK 0x3
606#define RCC_DCKCFGR1_SAI1SEL_SHIFT 20
607#define RCC_DCKCFGR1_PLLSAIDIVR_MASK 0x3
608#define RCC_DCKCFGR1_PLLSAIDIVR_SHIFT 16
609#define RCC_DCKCFGR1_PLLSAIDIVR_DIVR_2 0
610#define RCC_DCKCFGR1_PLLSAIDIVR_DIVR_4 1
611#define RCC_DCKCFGR1_PLLSAIDIVR_DIVR_8 2
612#define RCC_DCKCFGR1_PLLSAIDIVR_DIVR_16 3
613#define RCC_DCKCFGR1_PLLSAIDIVQ_MASK 0x1f
614#define RCC_DCKCFGR1_PLLSAIDIVQ_SHIFT 8
615#define RCC_DCKCFGR1_PLLI2SDIVQ_MASK 0x1f
616#define RCC_DCKCFGR1_PLLI2SDIVQ_SHIFT 0
617
618/* --- RCC_DCKCFGR2 values -------------------------------------------------- */
619
620#define RCC_DCKCFGR2_SDMMCSEL (1<<28)
621#define RCC_DCKCFGR2_CK48MSEL (1<<27)
622#define RCC_DCKCFGR2_CECSEL (1<<26)
623#define RCC_DCKCFGR2_LPTIM1SEL_MASK 0x3
624#define RCC_DCKCFGR2_LPTIM1SEL_SHIFT 24
625#define RCC_DCKCFGR2_I2CxSEL_MASK 0x3
626#define RCC_DCKCFGR2_I2C4SEL_SHIFT 22
627#define RCC_DCKCFGR2_I2C3SEL_SHIFT 20
628#define RCC_DCKCFGR2_I2C2SEL_SHIFT 18
629#define RCC_DCKCFGR2_I2C1SEL_SHIFT 16
630
631#define RCC_DCKCFGR2_UARTxSEL_MASK 0x3
632/** @defgroup rcc_dckcfgr2_uart_choices UART for clock source selecting
633 * @note This is only used internally.
634 * @{
635 */
636#define RCC_DCKCFGR2_UART8SEL_SHIFT 14
637#define RCC_DCKCFGR2_UART7SEL_SHIFT 12
638#define RCC_DCKCFGR2_USART6SEL_SHIFT 10
639#define RCC_DCKCFGR2_UART5SEL_SHIFT 8
640#define RCC_DCKCFGR2_UART4SEL_SHIFT 6
641#define RCC_DCKCFGR2_UART3SEL_SHIFT 4
642#define RCC_DCKCFGR2_UART2SEL_SHIFT 2
643#define RCC_DCKCFGR2_UART1SEL_SHIFT 0
644/**@}*/
645
646/** @defgroup rcc_dckcfgr2_uart_clksel UART Clock source selections
647 * @{
648 */
649#define RCC_DCKCFGR2_UARTxSEL_PCLK 0x0
650#define RCC_DCKCFGR2_UARTxSEL_SYSCLK 0x1
651#define RCC_DCKCFGR2_UARTxSEL_HSI 0x2
652#define RCC_DCKCFGR2_UARTxSEL_LSE 0x3
653/**@}*/
654
655
656
657extern uint32_t rcc_ahb_frequency;
658extern uint32_t rcc_apb1_frequency;
659extern uint32_t rcc_apb2_frequency;
660
670
672 // PLLM not specified here because it depends on input clock freq.
673 uint16_t plln;
674 uint8_t pllp;
675 uint8_t pllq;
677 uint8_t hpre;
678 uint8_t ppre1;
679 uint8_t ppre2;
681 uint8_t overdrive;
685};
686
687extern const struct rcc_clock_scale rcc_3v3[RCC_CLOCK_3V3_END];
688
694 RCC_LSI
696
697#define _REG_BIT(base, bit) (((base) << 5) + (bit))
698
700 /* AHB1 peripherals*/
701 RCC_GPIOA = _REG_BIT(0x30, 0),
702 RCC_GPIOB = _REG_BIT(0x30, 1),
703 RCC_GPIOC = _REG_BIT(0x30, 2),
704 RCC_GPIOD = _REG_BIT(0x30, 3),
705 RCC_GPIOE = _REG_BIT(0x30, 4),
706 RCC_GPIOF = _REG_BIT(0x30, 5),
707 RCC_GPIOG = _REG_BIT(0x30, 6),
708 RCC_GPIOH = _REG_BIT(0x30, 7),
709 RCC_GPIOI = _REG_BIT(0x30, 8),
710 RCC_GPIOJ = _REG_BIT(0x30, 9),
711 RCC_GPIOK = _REG_BIT(0x30, 10),
712 RCC_CRC = _REG_BIT(0x30, 12),
715 RCC_DMA1 = _REG_BIT(0x30, 21),
716 RCC_DMA2 = _REG_BIT(0x30, 22),
717 RCC_DMA2D = _REG_BIT(0x30, 23),
718 RCC_ETHMAC = _REG_BIT(0x30, 25),
722 RCC_OTGHS = _REG_BIT(0x30, 29),
724
725 /* AHB2 peripherals */
726 RCC_DCMI = _REG_BIT(0x34, 0),
727 RCC_CRYP = _REG_BIT(0x34, 4),
728 RCC_HASH = _REG_BIT(0x34, 5),
729 RCC_RNG = _REG_BIT(0x34, 6),
730 RCC_OTGFS = _REG_BIT(0x34, 7),
731
732 /* AHB3 peripherals */
733 RCC_QSPI = _REG_BIT(0x38, 1),
734 RCC_FMC = _REG_BIT(0x38, 0),
735
736 /* APB1 peripherals*/
737 RCC_TIM2 = _REG_BIT(0x40, 0),
738 RCC_TIM3 = _REG_BIT(0x40, 1),
739 RCC_TIM4 = _REG_BIT(0x40, 2),
740 RCC_TIM5 = _REG_BIT(0x40, 3),
741 RCC_TIM6 = _REG_BIT(0x40, 4),
742 RCC_TIM7 = _REG_BIT(0x40, 5),
743 RCC_TIM12 = _REG_BIT(0x40, 6),
744 RCC_TIM13 = _REG_BIT(0x40, 7),
745 RCC_TIM14 = _REG_BIT(0x40, 8),
747 RCC_WWDG = _REG_BIT(0x40, 11),
748 RCC_SPI2 = _REG_BIT(0x40, 14),
749 RCC_SPI3 = _REG_BIT(0x40, 15),
751 RCC_USART2 = _REG_BIT(0x40, 17),
752 RCC_USART3 = _REG_BIT(0x40, 18),
753 RCC_UART4 = _REG_BIT(0x40, 19),
754 RCC_UART5 = _REG_BIT(0x40, 20),
755 RCC_I2C1 = _REG_BIT(0x40, 21),
756 RCC_I2C2 = _REG_BIT(0x40, 22),
757 RCC_I2C3 = _REG_BIT(0x40, 23),
758 RCC_I2C4 = _REG_BIT(0x40, 24),
759 RCC_CAN1 = _REG_BIT(0x40, 25),
760 RCC_CAN2 = _REG_BIT(0x40, 26),
761 RCC_CEC = _REG_BIT(0x40, 27),
762 RCC_PWR = _REG_BIT(0x40, 28),
763 RCC_DAC = _REG_BIT(0x40, 29),
764 RCC_UART7 = _REG_BIT(0x40, 30),
765 RCC_UART8 = _REG_BIT(0x40, 31),
766
767 /* APB2 peripherals */
768 RCC_TIM1 = _REG_BIT(0x44, 0),
769 RCC_TIM8 = _REG_BIT(0x44, 1),
772 RCC_ADC1 = _REG_BIT(0x44, 8),
773 RCC_ADC2 = _REG_BIT(0x44, 9),
774 RCC_ADC3 = _REG_BIT(0x44, 10),
775 RCC_SDMMC1 = _REG_BIT(0x44, 11),
776 RCC_SPI1 = _REG_BIT(0x44, 12),
777 RCC_SPI4 = _REG_BIT(0x44, 13),
778 RCC_SYSCFG = _REG_BIT(0x44, 14),
779 RCC_TIM9 = _REG_BIT(0x44, 16),
780 RCC_TIM10 = _REG_BIT(0x44, 17),
781 RCC_TIM11 = _REG_BIT(0x44, 18),
782 RCC_SPI5 = _REG_BIT(0x44, 20),
783 RCC_SPI6 = _REG_BIT(0x44, 21),
784 RCC_SAI1EN = _REG_BIT(0x44, 22),
785 RCC_SAI2EN = _REG_BIT(0x44, 23),
786 RCC_LTDC = _REG_BIT(0x44, 26),
787
788
789 /* BDCR */
790 RCC_RTC = _REG_BIT(0x70, 15),
791
792 /* AHB1 peripherals*/
793 SCC_GPIOA = _REG_BIT(0x50, 0),
794 SCC_GPIOB = _REG_BIT(0x50, 1),
795 SCC_GPIOC = _REG_BIT(0x50, 2),
796 SCC_GPIOD = _REG_BIT(0x50, 3),
797 SCC_GPIOE = _REG_BIT(0x50, 4),
798 SCC_GPIOF = _REG_BIT(0x50, 5),
799 SCC_GPIOG = _REG_BIT(0x50, 6),
800 SCC_GPIOH = _REG_BIT(0x50, 7),
801 SCC_GPIOI = _REG_BIT(0x50, 8),
802 SCC_GPIOJ = _REG_BIT(0x50, 9),
803 SCC_GPIOK = _REG_BIT(0x50, 10),
804 SCC_CRC = _REG_BIT(0x50, 12),
805 SCC_AXI = _REG_BIT(0x50, 13),
806 SCC_FLTIF = _REG_BIT(0x50, 15),
807 SCC_SRAM1 = _REG_BIT(0x50, 16),
808 SCC_SRAM2 = _REG_BIT(0x50, 17),
810 SCC_DTCM = _REG_BIT(0x50, 20),
811 SCC_DMA1 = _REG_BIT(0x50, 21),
812 SCC_DMA2 = _REG_BIT(0x50, 22),
813 SCC_DMA2D = _REG_BIT(0x50, 23),
814 SCC_ETHMAC = _REG_BIT(0x50, 25),
818 SCC_OTGHS = _REG_BIT(0x50, 29),
820
821 /* AHB2 peripherals */
822 SCC_DCMI = _REG_BIT(0x54, 0),
823 SCC_CRYP = _REG_BIT(0x54, 4),
824 SCC_HASH = _REG_BIT(0x54, 5),
825 SCC_RNG = _REG_BIT(0x54, 6),
826 SCC_OTGFS = _REG_BIT(0x54, 7),
827
828 /* AHB3 peripherals */
829 SCC_QSPI = _REG_BIT(0x58, 1),
830 SCC_FMC = _REG_BIT(0x58, 0),
831
832 /* APB1 peripherals*/
833 SCC_TIM2 = _REG_BIT(0x60, 0),
834 SCC_TIM3 = _REG_BIT(0x60, 1),
835 SCC_TIM4 = _REG_BIT(0x60, 2),
836 SCC_TIM5 = _REG_BIT(0x60, 3),
837 SCC_TIM6 = _REG_BIT(0x60, 4),
838 SCC_TIM7 = _REG_BIT(0x60, 5),
839 SCC_TIM12 = _REG_BIT(0x60, 6),
840 SCC_TIM13 = _REG_BIT(0x60, 7),
841 SCC_TIM14 = _REG_BIT(0x60, 8),
843 SCC_WWDG = _REG_BIT(0x60, 11),
844 SCC_SPI2 = _REG_BIT(0x60, 14),
845 SCC_SPI3 = _REG_BIT(0x60, 15),
847 SCC_USART2 = _REG_BIT(0x60, 17),
848 SCC_USART3 = _REG_BIT(0x60, 18),
849 SCC_UART4 = _REG_BIT(0x60, 19),
850 SCC_UART5 = _REG_BIT(0x60, 20),
851 SCC_I2C1 = _REG_BIT(0x60, 21),
852 SCC_I2C2 = _REG_BIT(0x60, 22),
853 SCC_I2C3 = _REG_BIT(0x60, 23),
854 SCC_I2C4 = _REG_BIT(0x60, 24),
855 SCC_CAN1 = _REG_BIT(0x60, 25),
856 SCC_CAN2 = _REG_BIT(0x60, 26),
857 SCC_CEC = _REG_BIT(0x60, 27),
858 SCC_PWR = _REG_BIT(0x60, 28),
859 SCC_DAC = _REG_BIT(0x60, 29),
860 SCC_UART7 = _REG_BIT(0x60, 30),
861 SCC_UART8 = _REG_BIT(0x60, 31),
862
863 /* APB2 peripherals */
864 SCC_TIM1 = _REG_BIT(0x64, 0),
865 SCC_TIM8 = _REG_BIT(0x64, 1),
868 SCC_ADC1 = _REG_BIT(0x64, 8),
869 SCC_ADC2 = _REG_BIT(0x64, 9),
870 SCC_ADC3 = _REG_BIT(0x64, 10),
871 SCC_SDMMC1 = _REG_BIT(0x64, 11),
872 SCC_SPI1 = _REG_BIT(0x64, 12),
873 SCC_SPI4 = _REG_BIT(0x64, 13),
874 SCC_SYSCFG = _REG_BIT(0x64, 14),
875 SCC_TIM9 = _REG_BIT(0x64, 16),
876 SCC_TIM10 = _REG_BIT(0x64, 17),
877 SCC_TIM11 = _REG_BIT(0x64, 18),
878 SCC_SPI5 = _REG_BIT(0x64, 20),
879 SCC_SPI6 = _REG_BIT(0x64, 21),
880 SCC_SAI1 = _REG_BIT(0x64, 22),
881 SCC_SAI2 = _REG_BIT(0x64, 23),
882 SCC_LTDC = _REG_BIT(0x64, 26),
883};
884
886 /* AHB1 peripherals*/
887 RST_GPIOA = _REG_BIT(0x10, 0),
888 RST_GPIOB = _REG_BIT(0x10, 1),
889 RST_GPIOC = _REG_BIT(0x10, 2),
890 RST_GPIOD = _REG_BIT(0x10, 3),
891 RST_GPIOE = _REG_BIT(0x10, 4),
892 RST_GPIOF = _REG_BIT(0x10, 5),
893 RST_GPIOG = _REG_BIT(0x10, 6),
894 RST_GPIOH = _REG_BIT(0x10, 7),
895 RST_GPIOI = _REG_BIT(0x10, 8),
896 RST_GPIOJ = _REG_BIT(0x10, 9),
897 RST_GPIOK = _REG_BIT(0x10, 10),
898 RST_CRC = _REG_BIT(0x10, 12),
899 RST_DMA1 = _REG_BIT(0x10, 21),
900 RST_DMA2 = _REG_BIT(0x10, 22),
901 RST_DMA2D = _REG_BIT(0x10, 23),
902 RST_ETHMAC = _REG_BIT(0x10, 25),
903 RST_OTGHS = _REG_BIT(0x10, 29),
904
905 /* AHB2 peripherals */
906 RST_DCMI = _REG_BIT(0x14, 0),
907 RST_CRYP = _REG_BIT(0x14, 4),
908 RST_HASH = _REG_BIT(0x14, 5),
909 RST_RNG = _REG_BIT(0x14, 6),
910 RST_OTGFS = _REG_BIT(0x14, 7),
911
912 /* AHB3 peripherals */
913 RST_QSPI = _REG_BIT(0x18, 1),
914 RST_FMC = _REG_BIT(0x18, 0),
915
916 /* APB1 peripherals*/
917 RST_TIM2 = _REG_BIT(0x20, 0),
918 RST_TIM3 = _REG_BIT(0x20, 1),
919 RST_TIM4 = _REG_BIT(0x20, 2),
920 RST_TIM5 = _REG_BIT(0x20, 3),
921 RST_TIM6 = _REG_BIT(0x20, 4),
922 RST_TIM7 = _REG_BIT(0x20, 5),
923 RST_TIM12 = _REG_BIT(0x20, 6),
924 RST_TIM13 = _REG_BIT(0x20, 7),
925 RST_TIM14 = _REG_BIT(0x20, 8),
927 RST_WWDG = _REG_BIT(0x20, 11),
928 RST_SPI2 = _REG_BIT(0x20, 14),
929 RST_SPI3 = _REG_BIT(0x20, 15),
931 RST_UART2 = _REG_BIT(0x20, 17),
932 RST_UART3 = _REG_BIT(0x20, 18),
933 RST_UART4 = _REG_BIT(0x20, 19),
934 RST_UART5 = _REG_BIT(0x20, 20),
935 RST_I2C1 = _REG_BIT(0x20, 21),
936 RST_I2C2 = _REG_BIT(0x20, 22),
937 RST_I2C3 = _REG_BIT(0x20, 23),
938 RST_I2C4 = _REG_BIT(0x20, 24),
939 RST_CAN1 = _REG_BIT(0x20, 25),
940 RST_CAN2 = _REG_BIT(0x20, 26),
941 RST_CEC = _REG_BIT(0x20, 27),
942 RST_PWR = _REG_BIT(0x20, 28),
943 RST_DAC = _REG_BIT(0x20, 29),
944 RST_UART7 = _REG_BIT(0x20, 30),
945 RST_UART8 = _REG_BIT(0x20, 31),
946
947 /* APB2 peripherals */
948 RST_TIM1 = _REG_BIT(0x24, 0),
949 RST_TIM8 = _REG_BIT(0x24, 1),
952 RST_ADC = _REG_BIT(0x24, 8),
953 RST_SDMMC1 = _REG_BIT(0x24, 11),
954 RST_SPI1 = _REG_BIT(0x24, 12),
955 RST_SPI4 = _REG_BIT(0x24, 13),
956 RST_SYSCFG = _REG_BIT(0x24, 14),
957 RST_TIM9 = _REG_BIT(0x24, 16),
958 RST_TIM10 = _REG_BIT(0x24, 17),
959 RST_TIM11 = _REG_BIT(0x24, 18),
960 RST_SPI5 = _REG_BIT(0x24, 20),
961 RST_SPI6 = _REG_BIT(0x24, 21),
964 RST_LTDC = _REG_BIT(0x24, 26),
965};
966
967#undef _REG_BIT
968
970
972void rcc_osc_ready_int_clear(enum rcc_osc osc);
973void rcc_osc_ready_int_enable(enum rcc_osc osc);
975int rcc_osc_ready_int_flag(enum rcc_osc osc);
976void rcc_css_int_clear(void);
977int rcc_css_int_flag(void);
979void rcc_osc_on(enum rcc_osc osc);
980void rcc_osc_off(enum rcc_osc osc);
981void rcc_css_enable(void);
982void rcc_css_disable(void);
983void rcc_set_sysclk_source(uint32_t clk);
984void rcc_set_pll_source(uint32_t pllsrc);
985void rcc_set_ppre2(uint32_t ppre2);
986void rcc_set_ppre1(uint32_t ppre1);
987void rcc_set_hpre(uint32_t hpre);
988void rcc_set_rtcpre(uint32_t rtcpre);
989void rcc_set_main_pll_hsi(uint32_t pllm, uint32_t plln, uint32_t pllp,
990 uint32_t pllq);
991void rcc_set_main_pll_hse(uint32_t pllm, uint32_t plln, uint32_t pllp,
992 uint32_t pllq);
993uint32_t rcc_system_clock_source(void);
994void rcc_clock_setup_hse(const struct rcc_clock_scale *clock, uint32_t hse_mhz);
995void rcc_clock_setup_hsi(const struct rcc_clock_scale *clock);
996uint32_t rcc_get_usart_clk_freq(uint32_t usart);
997uint32_t rcc_get_timer_clk_freq(uint32_t timer);
998uint32_t rcc_get_i2c_clk_freq(uint32_t i2c);
999uint32_t rcc_get_spi_clk_freq(uint32_t spi);
1000
1002
1003/**@}*/
1004
1005#endif
#define END_DECLS
Definition: common.h:34
#define BEGIN_DECLS
Definition: common.h:33
pwr_vos_scale
Definition: f7/pwr.h:281
int rcc_osc_ready_int_flag(enum rcc_osc osc)
Definition: rcc.c:173
int rcc_css_int_flag(void)
Definition: rcc.c:201
void rcc_osc_ready_int_clear(enum rcc_osc osc)
Definition: rcc.c:110
void rcc_css_disable(void)
Definition: rcc.c:292
uint32_t rcc_get_spi_clk_freq(uint32_t spi)
Get the peripheral clock speed for the SPI device at base specified.
Definition: rcc.c:569
void rcc_set_sysclk_source(uint32_t clk)
Definition: rcc.c:297
uint32_t rcc_apb2_frequency
Definition: rcc.c:19
void rcc_set_pll_source(uint32_t pllsrc)
Definition: rcc.c:306
uint32_t rcc_get_timer_clk_freq(uint32_t timer)
Get the peripheral clock speed for the Timer at base specified.
Definition: rcc.c:534
uint32_t rcc_system_clock_source(void)
Definition: rcc.c:370
uint32_t rcc_get_usart_clk_freq(uint32_t usart)
Get the peripheral clock speed for the USART at base specified.
Definition: rcc.c:508
rcc_periph_rst
Definition: f7/rcc.h:885
rcc_periph_clken
Definition: f7/rcc.h:699
void rcc_set_rtcpre(uint32_t rtcpre)
Definition: rcc.c:342
void rcc_osc_ready_int_enable(enum rcc_osc osc)
Definition: rcc.c:131
rcc_osc
Definition: f7/rcc.h:689
void rcc_clock_setup_hse(const struct rcc_clock_scale *clock, uint32_t hse_mhz)
Definition: rcc.c:376
const struct rcc_clock_scale rcc_3v3[RCC_CLOCK_3V3_END]
Definition: rcc.c:23
void rcc_osc_ready_int_disable(enum rcc_osc osc)
Definition: rcc.c:152
void rcc_osc_on(enum rcc_osc osc)
Definition: rcc.c:245
#define _REG_BIT(base, bit)
Definition: f7/rcc.h:697
uint32_t rcc_ahb_frequency
Definition: rcc.c:17
void rcc_osc_off(enum rcc_osc osc)
Definition: rcc.c:266
uint32_t rcc_get_i2c_clk_freq(uint32_t i2c)
Get the peripheral clock speed for the I2C device at base specified.
Definition: rcc.c:552
rcc_clock_3v3
Definition: f7/rcc.h:661
uint32_t rcc_apb1_frequency
Definition: rcc.c:18
void rcc_wait_for_sysclk_status(enum rcc_osc osc)
Definition: rcc.c:227
void rcc_set_ppre1(uint32_t ppre1)
Definition: rcc.c:324
void rcc_css_int_clear(void)
Definition: rcc.c:196
void rcc_set_ppre2(uint32_t ppre2)
Definition: rcc.c:315
void rcc_set_main_pll_hse(uint32_t pllm, uint32_t plln, uint32_t pllp, uint32_t pllq)
Definition: rcc.c:360
void rcc_set_main_pll_hsi(uint32_t pllm, uint32_t plln, uint32_t pllp, uint32_t pllq)
Definition: rcc.c:351
void rcc_css_enable(void)
Definition: rcc.c:287
void rcc_set_hpre(uint32_t hpre)
Definition: rcc.c:333
void rcc_clock_setup_hsi(const struct rcc_clock_scale *clock)
Definition: rcc.c:437
@ RST_SPI4
Definition: f7/rcc.h:955
@ RST_DMA2
Definition: f7/rcc.h:900
@ RST_QSPI
Definition: f7/rcc.h:913
@ RST_DMA1
Definition: f7/rcc.h:899
@ RST_UART3
Definition: f7/rcc.h:932
@ RST_SPI1
Definition: f7/rcc.h:954
@ RST_I2C3
Definition: f7/rcc.h:937
@ RST_SPI6
Definition: f7/rcc.h:961
@ RST_UART2
Definition: f7/rcc.h:931
@ RST_CEC
Definition: f7/rcc.h:941
@ RST_USART6
Definition: f7/rcc.h:951
@ RST_GPIOI
Definition: f7/rcc.h:895
@ RST_OTGHS
Definition: f7/rcc.h:903
@ RST_GPIOG
Definition: f7/rcc.h:893
@ RST_DMA2D
Definition: f7/rcc.h:901
@ RST_SAI2RST
Definition: f7/rcc.h:963
@ RST_RNG
Definition: f7/rcc.h:909
@ RST_TIM14
Definition: f7/rcc.h:925
@ RST_GPIOF
Definition: f7/rcc.h:892
@ RST_UART7
Definition: f7/rcc.h:944
@ RST_SPI2
Definition: f7/rcc.h:928
@ RST_GPIOH
Definition: f7/rcc.h:894
@ RST_TIM9
Definition: f7/rcc.h:957
@ RST_UART4
Definition: f7/rcc.h:933
@ RST_TIM8
Definition: f7/rcc.h:949
@ RST_TIM3
Definition: f7/rcc.h:918
@ RST_TIM12
Definition: f7/rcc.h:923
@ RST_TIM10
Definition: f7/rcc.h:958
@ RST_DCMI
Definition: f7/rcc.h:906
@ RST_LPTIM1
Definition: f7/rcc.h:926
@ RST_GPIOA
Definition: f7/rcc.h:887
@ RST_ETHMAC
Definition: f7/rcc.h:902
@ RST_GPIOC
Definition: f7/rcc.h:889
@ RST_TIM6
Definition: f7/rcc.h:921
@ RST_GPIOB
Definition: f7/rcc.h:888
@ RST_TIM1
Definition: f7/rcc.h:948
@ RST_SPI3
Definition: f7/rcc.h:929
@ RST_CRYP
Definition: f7/rcc.h:907
@ RST_DAC
Definition: f7/rcc.h:943
@ RST_ADC
Definition: f7/rcc.h:952
@ RST_TIM13
Definition: f7/rcc.h:924
@ RST_TIM7
Definition: f7/rcc.h:922
@ RST_SPI5
Definition: f7/rcc.h:960
@ RST_TIM2
Definition: f7/rcc.h:917
@ RST_CAN2
Definition: f7/rcc.h:940
@ RST_CRC
Definition: f7/rcc.h:898
@ RST_GPIOD
Definition: f7/rcc.h:890
@ RST_I2C4
Definition: f7/rcc.h:938
@ RST_GPIOK
Definition: f7/rcc.h:897
@ RST_GPIOJ
Definition: f7/rcc.h:896
@ RST_SDMMC1
Definition: f7/rcc.h:953
@ RST_TIM4
Definition: f7/rcc.h:919
@ RST_TIM5
Definition: f7/rcc.h:920
@ RST_SYSCFG
Definition: f7/rcc.h:956
@ RST_UART5
Definition: f7/rcc.h:934
@ RST_GPIOE
Definition: f7/rcc.h:891
@ RST_HASH
Definition: f7/rcc.h:908
@ RST_I2C2
Definition: f7/rcc.h:936
@ RST_CAN1
Definition: f7/rcc.h:939
@ RST_SPDIFRX
Definition: f7/rcc.h:930
@ RST_UART8
Definition: f7/rcc.h:945
@ RST_PWR
Definition: f7/rcc.h:942
@ RST_USART1
Definition: f7/rcc.h:950
@ RST_WWDG
Definition: f7/rcc.h:927
@ RST_I2C1
Definition: f7/rcc.h:935
@ RST_FMC
Definition: f7/rcc.h:914
@ RST_OTGFS
Definition: f7/rcc.h:910
@ RST_TIM11
Definition: f7/rcc.h:959
@ RST_SAI1RST
Definition: f7/rcc.h:962
@ RST_LTDC
Definition: f7/rcc.h:964
@ SCC_CRC
Definition: f7/rcc.h:804
@ SCC_TIM14
Definition: f7/rcc.h:841
@ RCC_TIM8
Definition: f7/rcc.h:769
@ SCC_TIM8
Definition: f7/rcc.h:865
@ SCC_SPI3
Definition: f7/rcc.h:845
@ RCC_UART5
Definition: f7/rcc.h:754
@ RCC_RNG
Definition: f7/rcc.h:729
@ SCC_TIM11
Definition: f7/rcc.h:877
@ RCC_GPIOJ
Definition: f7/rcc.h:710
@ RCC_TIM9
Definition: f7/rcc.h:779
@ RCC_FMC
Definition: f7/rcc.h:734
@ SCC_CAN2
Definition: f7/rcc.h:856
@ SCC_GPIOD
Definition: f7/rcc.h:796
@ RCC_SPDIFRX
Definition: f7/rcc.h:750
@ SCC_TIM12
Definition: f7/rcc.h:839
@ RCC_SPI2
Definition: f7/rcc.h:748
@ RCC_WWDG
Definition: f7/rcc.h:747
@ SCC_TIM1
Definition: f7/rcc.h:864
@ RCC_TIM3
Definition: f7/rcc.h:738
@ SCC_SPI2
Definition: f7/rcc.h:844
@ SCC_QSPI
Definition: f7/rcc.h:829
@ RCC_TIM1
Definition: f7/rcc.h:768
@ RCC_ETHMACPTP
Definition: f7/rcc.h:721
@ SCC_ETHMACTX
Definition: f7/rcc.h:815
@ SCC_SPI6
Definition: f7/rcc.h:879
@ SCC_UART4
Definition: f7/rcc.h:849
@ SCC_SDMMC1
Definition: f7/rcc.h:871
@ RCC_CAN2
Definition: f7/rcc.h:760
@ SCC_SRAM1
Definition: f7/rcc.h:807
@ RCC_GPIOA
Definition: f7/rcc.h:701
@ SCC_GPIOH
Definition: f7/rcc.h:800
@ RCC_CEC
Definition: f7/rcc.h:761
@ SCC_RNG
Definition: f7/rcc.h:825
@ RCC_SPI6
Definition: f7/rcc.h:783
@ RCC_RTC
Definition: f7/rcc.h:790
@ SCC_TIM13
Definition: f7/rcc.h:840
@ SCC_GPIOA
Definition: f7/rcc.h:793
@ RCC_SDMMC1
Definition: f7/rcc.h:775
@ SCC_ADC2
Definition: f7/rcc.h:869
@ SCC_DMA2
Definition: f7/rcc.h:812
@ RCC_GPIOK
Definition: f7/rcc.h:711
@ RCC_TIM2
Definition: f7/rcc.h:737
@ SCC_USART6
Definition: f7/rcc.h:867
@ SCC_TIM6
Definition: f7/rcc.h:837
@ SCC_ADC1
Definition: f7/rcc.h:868
@ RCC_BKPSRAM
Definition: f7/rcc.h:713
@ RCC_QSPI
Definition: f7/rcc.h:733
@ SCC_TIM2
Definition: f7/rcc.h:833
@ SCC_AXI
Definition: f7/rcc.h:805
@ SCC_TIM3
Definition: f7/rcc.h:834
@ SCC_DMA2D
Definition: f7/rcc.h:813
@ SCC_TIM9
Definition: f7/rcc.h:875
@ RCC_GPIOG
Definition: f7/rcc.h:707
@ RCC_UART8
Definition: f7/rcc.h:765
@ RCC_GPIOH
Definition: f7/rcc.h:708
@ RCC_TIM10
Definition: f7/rcc.h:780
@ RCC_CAN1
Definition: f7/rcc.h:759
@ RCC_PWR
Definition: f7/rcc.h:762
@ RCC_CRC
Definition: f7/rcc.h:712
@ SCC_CEC
Definition: f7/rcc.h:857
@ RCC_ETHMACRX
Definition: f7/rcc.h:720
@ SCC_USART2
Definition: f7/rcc.h:847
@ RCC_TIM14
Definition: f7/rcc.h:745
@ RCC_OTGHSULPI
Definition: f7/rcc.h:723
@ RCC_OTGHS
Definition: f7/rcc.h:722
@ SCC_USART3
Definition: f7/rcc.h:848
@ SCC_GPIOJ
Definition: f7/rcc.h:802
@ SCC_I2C2
Definition: f7/rcc.h:852
@ SCC_UART8
Definition: f7/rcc.h:861
@ RCC_USART1
Definition: f7/rcc.h:770
@ SCC_WWDG
Definition: f7/rcc.h:843
@ SCC_PWR
Definition: f7/rcc.h:858
@ RCC_DTCMRAM
Definition: f7/rcc.h:714
@ SCC_SYSCFG
Definition: f7/rcc.h:874
@ RCC_TIM4
Definition: f7/rcc.h:739
@ RCC_I2C1
Definition: f7/rcc.h:755
@ RCC_ADC2
Definition: f7/rcc.h:773
@ RCC_DMA2D
Definition: f7/rcc.h:717
@ SCC_DCMI
Definition: f7/rcc.h:822
@ RCC_TIM13
Definition: f7/rcc.h:744
@ SCC_DAC
Definition: f7/rcc.h:859
@ SCC_ETHMAC
Definition: f7/rcc.h:814
@ RCC_SAI2EN
Definition: f7/rcc.h:785
@ RCC_ADC1
Definition: f7/rcc.h:772
@ SCC_DTCM
Definition: f7/rcc.h:810
@ RCC_I2C4
Definition: f7/rcc.h:758
@ SCC_I2C4
Definition: f7/rcc.h:854
@ SCC_SRAM2
Definition: f7/rcc.h:808
@ RCC_LTDC
Definition: f7/rcc.h:786
@ SCC_SPI1
Definition: f7/rcc.h:872
@ RCC_DCMI
Definition: f7/rcc.h:726
@ SCC_DMA1
Definition: f7/rcc.h:811
@ SCC_ETHMACRX
Definition: f7/rcc.h:816
@ SCC_ADC3
Definition: f7/rcc.h:870
@ SCC_SPI4
Definition: f7/rcc.h:873
@ SCC_LTDC
Definition: f7/rcc.h:882
@ RCC_ETHMACTX
Definition: f7/rcc.h:719
@ RCC_USART2
Definition: f7/rcc.h:751
@ SCC_GPIOE
Definition: f7/rcc.h:797
@ RCC_ADC3
Definition: f7/rcc.h:774
@ RCC_TIM12
Definition: f7/rcc.h:743
@ SCC_USART1
Definition: f7/rcc.h:866
@ RCC_USART3
Definition: f7/rcc.h:752
@ SCC_I2C1
Definition: f7/rcc.h:851
@ RCC_TIM5
Definition: f7/rcc.h:740
@ SCC_SAI2
Definition: f7/rcc.h:881
@ RCC_SPI1
Definition: f7/rcc.h:776
@ RCC_SYSCFG
Definition: f7/rcc.h:778
@ SCC_GPIOC
Definition: f7/rcc.h:795
@ RCC_HASH
Definition: f7/rcc.h:728
@ RCC_UART7
Definition: f7/rcc.h:764
@ SCC_SPI5
Definition: f7/rcc.h:878
@ RCC_ETHMAC
Definition: f7/rcc.h:718
@ RCC_I2C2
Definition: f7/rcc.h:756
@ SCC_HASH
Definition: f7/rcc.h:824
@ RCC_GPIOB
Definition: f7/rcc.h:702
@ RCC_TIM7
Definition: f7/rcc.h:742
@ RCC_SPI5
Definition: f7/rcc.h:782
@ RCC_LPTIM1
Definition: f7/rcc.h:746
@ RCC_GPIOF
Definition: f7/rcc.h:706
@ SCC_GPIOF
Definition: f7/rcc.h:798
@ SCC_OTGFS
Definition: f7/rcc.h:826
@ SCC_ETHMACPTP
Definition: f7/rcc.h:817
@ RCC_GPIOC
Definition: f7/rcc.h:703
@ SCC_FLTIF
Definition: f7/rcc.h:806
@ RCC_CRYP
Definition: f7/rcc.h:727
@ RCC_TIM6
Definition: f7/rcc.h:741
@ RCC_UART4
Definition: f7/rcc.h:753
@ SCC_CAN1
Definition: f7/rcc.h:855
@ SCC_TIM5
Definition: f7/rcc.h:836
@ SCC_I2C3
Definition: f7/rcc.h:853
@ SCC_GPIOB
Definition: f7/rcc.h:794
@ RCC_DMA1
Definition: f7/rcc.h:715
@ RCC_GPIOI
Definition: f7/rcc.h:709
@ RCC_SPI3
Definition: f7/rcc.h:749
@ SCC_GPIOI
Definition: f7/rcc.h:801
@ SCC_GPIOG
Definition: f7/rcc.h:799
@ RCC_DAC
Definition: f7/rcc.h:763
@ RCC_GPIOD
Definition: f7/rcc.h:704
@ SCC_OTGHS
Definition: f7/rcc.h:818
@ SCC_GPIOK
Definition: f7/rcc.h:803
@ SCC_CRYP
Definition: f7/rcc.h:823
@ SCC_FMC
Definition: f7/rcc.h:830
@ RCC_I2C3
Definition: f7/rcc.h:757
@ RCC_GPIOE
Definition: f7/rcc.h:705
@ SCC_SAI1
Definition: f7/rcc.h:880
@ SCC_UART7
Definition: f7/rcc.h:860
@ SCC_SPDIFRX
Definition: f7/rcc.h:846
@ RCC_OTGFS
Definition: f7/rcc.h:730
@ SCC_OTGHSULPI
Definition: f7/rcc.h:819
@ SCC_BKPSRAM
Definition: f7/rcc.h:809
@ SCC_UART5
Definition: f7/rcc.h:850
@ SCC_TIM7
Definition: f7/rcc.h:838
@ RCC_USART6
Definition: f7/rcc.h:771
@ RCC_DMA2
Definition: f7/rcc.h:716
@ RCC_SAI1EN
Definition: f7/rcc.h:784
@ SCC_LPTIM1
Definition: f7/rcc.h:842
@ RCC_SPI4
Definition: f7/rcc.h:777
@ RCC_TIM11
Definition: f7/rcc.h:781
@ SCC_TIM4
Definition: f7/rcc.h:835
@ SCC_TIM10
Definition: f7/rcc.h:876
@ RCC_HSI
Definition: f7/rcc.h:692
@ RCC_LSI
Definition: f7/rcc.h:694
@ RCC_PLL
Definition: f7/rcc.h:690
@ RCC_LSE
Definition: f7/rcc.h:693
@ RCC_HSE
Definition: f7/rcc.h:691
@ RCC_CLOCK_3V3_120MHZ
Definition: f7/rcc.h:664
@ RCC_CLOCK_3V3_72MHZ
Definition: f7/rcc.h:665
@ RCC_CLOCK_3V3_24MHZ
Definition: f7/rcc.h:667
@ RCC_CLOCK_3V3_END
Definition: f7/rcc.h:668
@ RCC_CLOCK_3V3_168MHZ
Definition: f7/rcc.h:663
@ RCC_CLOCK_3V3_48MHZ
Definition: f7/rcc.h:666
@ RCC_CLOCK_3V3_216MHZ
Definition: f7/rcc.h:662
uint8_t ppre1
Definition: f7/rcc.h:678
uint8_t pllq
Definition: f7/rcc.h:675
uint8_t ppre2
Definition: f7/rcc.h:679
uint8_t pllp
Definition: f7/rcc.h:674
uint32_t apb1_frequency
Definition: f7/rcc.h:683
uint32_t ahb_frequency
Definition: f7/rcc.h:682
enum pwr_vos_scale vos_scale
Definition: f7/rcc.h:680
uint16_t plln
Definition: f7/rcc.h:673
uint8_t hpre
Definition: f7/rcc.h:677
uint32_t apb2_frequency
Definition: f7/rcc.h:684
uint8_t overdrive
Definition: f7/rcc.h:681
uint32_t flash_waitstates
Definition: f7/rcc.h:676