libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
l0/rcc.h
Go to the documentation of this file.
1/** @defgroup rcc_defines RCC Defines
2 *
3 * @ingroup STM32L0xx_defines
4 *
5 * @brief <b>Defined Constants and Types for the STM32L0xx Reset and Clock
6 * Control</b>
7 *
8 * @version 1.0.0
9 *
10 * @author @htmlonly &copy; @endhtmlonly 2014
11 * Karl Palsson <karlp@tweak.net.au>
12 *
13 * @date 17 November 2014
14 *
15 * LGPL License Terms @ref lgpl_license
16 * */
17
18/*
19 * This file is part of the libopencm3 project.
20 *
21 * Copyright (C) 2014 Karl Palsson <karlp@tweak.net.au>
22 *
23 * This library is free software: you can redistribute it and/or modify
24 * it under the terms of the GNU Lesser General Public License as published by
25 * the Free Software Foundation, either version 3 of the License, or
26 * (at your option) any later version.
27 *
28 * This library is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU Lesser General Public License for more details.
32 *
33 * You should have received a copy of the GNU Lesser General Public License
34 * along with this library. If not, see <http://www.gnu.org/licenses/>.
35 *
36 */
37
38/**@{*/
39
40#ifndef LIBOPENCM3_RCC_H
41#define LIBOPENCM3_RCC_H
42
43#include <stdbool.h>
44#include <stdint.h>
46
47/* --- RCC registers ------------------------------------------------------- */
48
49#define RCC_CR MMIO32(RCC_BASE + 0x00)
50#define RCC_ICSCR MMIO32(RCC_BASE + 0x04)
51#define RCC_CRRCR MMIO32(RCC_BASE + 0x08)
52#define RCC_CFGR MMIO32(RCC_BASE + 0x0c)
53#define RCC_CIER MMIO32(RCC_BASE + 0x10)
54#define RCC_CIFR MMIO32(RCC_BASE + 0x14)
55#define RCC_CICR MMIO32(RCC_BASE + 0x18)
56#define RCC_IOPRSTR MMIO32(RCC_BASE + 0x1c)
57#define RCC_AHBRSTR MMIO32(RCC_BASE + 0x20)
58#define RCC_APB2RSTR MMIO32(RCC_BASE + 0x24)
59#define RCC_APB1RSTR MMIO32(RCC_BASE + 0x28)
60#define RCC_IOPENR MMIO32(RCC_BASE + 0x2c)
61#define RCC_AHBENR MMIO32(RCC_BASE + 0x30)
62#define RCC_APB2ENR MMIO32(RCC_BASE + 0x34)
63#define RCC_APB1ENR MMIO32(RCC_BASE + 0x38)
64#define RCC_IOPSMEN MMIO32(RCC_BASE + 0x3c)
65#define RCC_AHBSMENR MMIO32(RCC_BASE + 0x40)
66#define RCC_APB2SMENR MMIO32(RCC_BASE + 0x44)
67#define RCC_APB1SMENR MMIO32(RCC_BASE + 0x48)
68#define RCC_CCIPR MMIO32(RCC_BASE + 0x4c)
69#define RCC_CSR MMIO32(RCC_BASE + 0x50)
70
71/* --- RCC_CR values ------------------------------------------------------- */
72
73#define RCC_CR_PLLRDY (1 << 25)
74#define RCC_CR_PLLON (1 << 24)
75#define RCC_CR_RTCPRE_SHIFT 20
76#define RCC_CR_RTCPRE_MASK 0x3
77#define RCC_CR_RTCPRE_DIV2 0
78#define RCC_CR_RTCPRE_DIV4 1
79#define RCC_CR_RTCPRE_DIV8 2
80#define RCC_CR_RTCPRE_DIV16 3
81#define RCC_CR_CSSHSEON (1 << 19)
82#define RCC_CR_HSEBYP (1 << 18)
83#define RCC_CR_HSERDY (1 << 17)
84#define RCC_CR_HSEON (1 << 16)
85#define RCC_CR_MSIRDY (1 << 9)
86#define RCC_CR_MSION (1 << 8)
87#define RCC_CR_HSI16DIVF (1 << 4)
88#define RCC_CR_HSI16DIVEN (1 << 3)
89#define RCC_CR_HSI16RDY (1 << 2)
90#define RCC_CR_HSI16KERON (1 << 1)
91#define RCC_CR_HSI16ON (1 << 0)
92
93
94/* --- RCC_ICSCR values ---------------------------------------------------- */
95
96#define RCC_ICSCR_MSITRIM_SHIFT 24
97#define RCC_ICSCR_MSITRIM_MASK 0xff
98#define RCC_ICSCR_MSICAL_SHIFT 16
99#define RCC_ICSCR_MSICAL_MASK 0xff
100
101#define RCC_ICSCR_MSIRANGE_SHIFT 13
102#define RCC_ICSCR_MSIRANGE_MASK 0x7
103#define RCC_ICSCR_MSIRANGE_65KHZ 0x0
104#define RCC_ICSCR_MSIRANGE_131KHZ 0x1
105#define RCC_ICSCR_MSIRANGE_262KHZ 0x2
106#define RCC_ICSCR_MSIRANGE_524KHZ 0x3
107#define RCC_ICSCR_MSIRANGE_1MHZ 0x4
108#define RCC_ICSCR_MSIRANGE_2MHZ 0x5
109#define RCC_ICSCR_MSIRANGE_4MHZ 0x6
110
111#define RCC_ICSCR_HSI16TRIM_SHIFT 8
112#define RCC_ICSCR_HSI16TRIM_MASK 0x1f
113#define RCC_ICSCR_HSI16CAL_SHIFT 0
114#define RCC_ICSCR_HSI16CAL_MASK 0xff
115
116/* --- RCC_CRRCR register */
117
118#define RCC_CRRCR_HSI48CAL_SHIFT 8
119#define RCC_CRRCR_HSI48CAL_MASK 0xff
120#define RCC_CRRCR_HSI48RDY (1<<1)
121#define RCC_CRRCR_HSI48ON (1<<0)
122
123/* --- RCC_CFGR values ----------------------------------------------------- */
124
125/* MCOPRE */
126#define RCC_CFGR_MCOPRE_DIV1 0
127#define RCC_CFGR_MCOPRE_DIV2 1
128#define RCC_CFGR_MCOPRE_DIV4 2
129#define RCC_CFGR_MCOPRE_DIV8 3
130#define RCC_CFGR_MCOPRE_DIV16 4
131
132/* MCO: Microcontroller clock output */
133#define RCC_CFGR_MCO_NOCLK 0x0
134#define RCC_CFGR_MCO_SYSCLK 0x1
135#define RCC_CFGR_MCO_HSI16 0x2
136#define RCC_CFGR_MCO_MSI 0x3
137#define RCC_CFGR_MCO_HSE 0x4
138#define RCC_CFGR_MCO_PLL 0x5
139#define RCC_CFGR_MCO_LSI 0x6
140#define RCC_CFGR_MCO_LSE 0x7
141#define RCC_CFGR_MCO_HSI48 0x8
142#define RCC_CFGR_MCO_SHIFT 24
143#define RCC_CFGR_MCO_MASK 0xf
144
145/** @defgroup rcc_cfgr_pdf PLLDIV PLL division factor
146 @{*/
147#define RCC_CFGR_PLLDIV_DIV2 0x1
148#define RCC_CFGR_PLLDIV_DIV3 0x2
149#define RCC_CFGR_PLLDIV_DIV4 0x3
150/**@}*/
151#define RCC_CFGR_PLLDIV_SHIFT 22
152#define RCC_CFGR_PLLDIV_MASK 0x3
153
154/** @defgroup rcc_cfgr_pmf PLLMUL PLL multiplication factor
155 @{*/
156#define RCC_CFGR_PLLMUL_MUL3 0x0
157#define RCC_CFGR_PLLMUL_MUL4 0x1
158#define RCC_CFGR_PLLMUL_MUL6 0x2
159#define RCC_CFGR_PLLMUL_MUL8 0x3
160#define RCC_CFGR_PLLMUL_MUL12 0x4
161#define RCC_CFGR_PLLMUL_MUL16 0x5
162#define RCC_CFGR_PLLMUL_MUL24 0x6
163#define RCC_CFGR_PLLMUL_MUL32 0x7
164#define RCC_CFGR_PLLMUL_MUL48 0x8
165/**@}*/
166#define RCC_CFGR_PLLMUL_SHIFT 18
167#define RCC_CFGR_PLLMUL_MASK 0xf
168
169/* PLLSRC: PLL entry clock source */
170#define RCC_CFGR_PLLSRC_HSI16_CLK 0x0
171#define RCC_CFGR_PLLSRC_HSE_CLK 0x1
172
173/* Wakeup from stop clock selection */
174#define RCC_CFGR_STOPWUCK_MSI (0<<15)
175#define RCC_CFGR_STOPWUCK_HSI16 (1<<15)
176
177#define RCC_CFGR_PPRE2_SHIFT 11
178#define RCC_CFGR_PPRE2_MASK 0x7
179#define RCC_CFGR_PPRE1_SHIFT 8
180#define RCC_CFGR_PPRE1_MASK 0x7
181/** @defgroup rcc_cfgr_apbxpre RCC_CFGR APBx prescale factors
182 * These can be used for both APB1 and APB2 prescaling
183 * @{
184 */
185#define RCC_CFGR_PPRE_NODIV 0x0
186#define RCC_CFGR_PPRE_DIV2 0x4
187#define RCC_CFGR_PPRE_DIV4 0x5
188#define RCC_CFGR_PPRE_DIV8 0x6
189#define RCC_CFGR_PPRE_DIV16 0x7
190/**@}*/
191
192/* HPRE: AHB prescaler */
193/** @defgroup rcc_cfgr_ahbpre RCC_CFGR AHB prescale Factors
194@{*/
195#define RCC_CFGR_HPRE_NODIV 0x0
196#define RCC_CFGR_HPRE_DIV2 0x8
197#define RCC_CFGR_HPRE_DIV4 0x9
198#define RCC_CFGR_HPRE_DIV8 0xa
199#define RCC_CFGR_HPRE_DIV16 0xb
200#define RCC_CFGR_HPRE_DIV64 0xc
201#define RCC_CFGR_HPRE_DIV128 0xd
202#define RCC_CFGR_HPRE_DIV256 0xe
203#define RCC_CFGR_HPRE_DIV512 0xf
204/**@}*/
205#define RCC_CFGR_HPRE_MASK 0xf
206#define RCC_CFGR_HPRE_SHIFT 4
207
208/* SWS: System clock switch status */
209#define RCC_CFGR_SWS_MSI 0x0
210#define RCC_CFGR_SWS_HSI16 0x1
211#define RCC_CFGR_SWS_HSE 0x2
212#define RCC_CFGR_SWS_PLL 0x3
213#define RCC_CFGR_SWS_MASK 0x3
214#define RCC_CFGR_SWS_SHIFT 2
215
216/* SW: System clock switch */
217#define RCC_CFGR_SW_MSI 0x0
218#define RCC_CFGR_SW_HSI16 0x1
219#define RCC_CFGR_SW_HSE 0x2
220#define RCC_CFGR_SW_PLL 0x3
221#define RCC_CFGR_SW_MASK 0x3
222#define RCC_CFGR_SW_SHIFT 0
223
224/** Older compatible definitions to ease migration
225 * @defgroup rcc_cfgr_deprecated RCC_CFGR Deprecated dividers
226 * @deprecated Use _CFGR_xPRE_DIVn form instead, across all families
227 * @{
228 */
229#define RCC_CFGR_PPRE2_NODIV 0x0
230#define RCC_CFGR_PPRE2_DIV2 0x4
231#define RCC_CFGR_PPRE2_DIV4 0x5
232#define RCC_CFGR_PPRE2_DIV8 0x6
233#define RCC_CFGR_PPRE2_DIV16 0x7
234
235#define RCC_CFGR_PPRE1_NODIV 0x0
236#define RCC_CFGR_PPRE1_DIV2 0x4
237#define RCC_CFGR_PPRE1_DIV4 0x5
238#define RCC_CFGR_PPRE1_DIV8 0x6
239#define RCC_CFGR_PPRE1_DIV16 0x7
240/**@}*/
241
242/* --- RCC_CIER - Clock interrupt enable register */
243
244#define RCC_CIER_CSSLSE (1 << 7)
245/* OSC ready interrupt enable bits */
246#define RCC_CIER_HSI48RDYIE (1 << 6)
247#define RCC_CIER_MSIRDYIE (1 << 5)
248#define RCC_CIER_PLLRDYIE (1 << 4)
249#define RCC_CIER_HSERDYIE (1 << 3)
250#define RCC_CIER_HSI16RDYIE (1 << 2)
251#define RCC_CIER_LSERDYIE (1 << 1)
252#define RCC_CIER_LSIRDYIE (1 << 0)
253
254/* --- RCC_CIFR - Clock interrupt flag register */
255
256#define RCC_CIFR_CSSHSEF (1 << 8)
257#define RCC_CIFR_CSSLSEF (1 << 7)
258#define RCC_CIFR_HSI48RDYF (1 << 6)
259#define RCC_CIFR_MSIRDYF (1 << 5)
260#define RCC_CIFR_PLLRDYF (1 << 4)
261#define RCC_CIFR_HSERDYF (1 << 3)
262#define RCC_CIFR_HSI16RDYF (1 << 2)
263#define RCC_CIFR_LSERDYF (1 << 1)
264#define RCC_CIFR_LSIRDYF (1 << 0)
265
266/* --- RCC_CICR - Clock interrupt clear register */
267
268#define RCC_CICR_CSSHSEC (1 << 8)
269#define RCC_CICR_CSSLSEC (1 << 7)
270#define RCC_CICR_HSI48RDYC (1 << 6)
271#define RCC_CICR_MSIRDYC (1 << 5)
272#define RCC_CICR_PLLRDYC (1 << 4)
273#define RCC_CICR_HSERDYC (1 << 3)
274#define RCC_CICR_HSI16RDYC (1 << 2)
275#define RCC_CICR_LSERDYC (1 << 1)
276#define RCC_CICR_LSIRDYC (1 << 0)
277
278/* --- RCC_IOPRSTR - GPIO Reset Register */
279
280#define RCC_IOPPRSTR_IOPHRST (1<<7)
281#define RCC_IOPPRSTR_IOPERST (1<<4)
282#define RCC_IOPPRSTR_IOPDRST (1<<3)
283#define RCC_IOPPRSTR_IOPCRST (1<<2)
284#define RCC_IOPPRSTR_IOPBRST (1<<1)
285#define RCC_IOPPRSTR_IOPARST (1<<0)
286
287/** @defgroup rcc_ahbrstr_rst RCC_AHBRSTR reset values
288@{*/
289#define RCC_AHBRSTR_CRYPRST (1 << 24)
290#define RCC_AHBRSTR_RNGRST (1 << 20)
291#define RCC_AHBRSTR_TSCRST (1 << 16)
292#define RCC_AHBRSTR_CRCRST (1 << 12)
293#define RCC_AHBRSTR_MIFRST (1 << 8)
294#define RCC_AHBRSTR_DMARST (1 << 0)
295/**@}*/
296
297/** @defgroup rcc_apb2rstr_rst RCC_APB2RSTR reset values
298@{*/
299#define RCC_APB2RSTR_DBGRST (1 << 22)
300#define RCC_APB2RSTR_USART1RST (1 << 14)
301#define RCC_APB2RSTR_SPI1RST (1 << 12)
302#define RCC_APB2RSTR_ADC1RST (1 << 9)
303#define RCC_APB2RSTR_TIM22RST (1 << 5)
304#define RCC_APB2RSTR_TIM21RST (1 << 2)
305#define RCC_APB2RSTR_SYSCFGRST (1 << 0)
306/**@}*/
307
308/** @defgroup rcc_apb1rstr_rst RCC_APB1RSTR reset values
309@{*/
310#define RCC_APB1RSTR_LPTIM1RST (1 << 31)
311#define RCC_APB1RSTR_I2C3RST (1 << 30)
312#define RCC_APB1RSTR_DACRST (1 << 29)
313#define RCC_APB1RSTR_PWRRST (1 << 28)
314#define RCC_APB1RSTR_CRSRST (1 << 27)
315#define RCC_APB1RSTR_USBRST (1 << 23)
316#define RCC_APB1RSTR_I2C2RST (1 << 22)
317#define RCC_APB1RSTR_I2C1RST (1 << 21)
318#define RCC_APB1RSTR_USART5RST (1 << 20)
319#define RCC_APB1RSTR_USART4RST (1 << 19)
320#define RCC_APB1RSTR_LPUART1RST (1 << 18)
321#define RCC_APB1RSTR_USART2RST (1 << 17)
322#define RCC_APB1RSTR_SPI2RST (1 << 14)
323#define RCC_APB1RSTR_WWDGRST (1 << 11)
324#define RCC_APB1RSTR_LCDRST (1 << 9)
325#define RCC_APB1RSTR_TIM7RST (1 << 5)
326#define RCC_APB1RSTR_TIM6RST (1 << 4)
327#define RCC_APB1RSTR_TIM3RST (1 << 1)
328#define RCC_APB1RSTR_TIM2RST (1 << 0)
329/**@}*/
330
331/* --- RCC_IOPENR - GPIO clock enable register */
332
333#define RCC_IOPENR_IOPHEN (1<<7)
334#define RCC_IOPENR_IOPEEN (1<<4)
335#define RCC_IOPENR_IOPDEN (1<<3)
336#define RCC_IOPENR_IOPCEN (1<<2)
337#define RCC_IOPENR_IOPBEN (1<<1)
338#define RCC_IOPENR_IOPAEN (1<<0)
339
340/** @defgroup rcc_ahbenr_en RCC_APHBENR enable values
341@{*/
342#define RCC_AHBENR_CRYPEN (1 << 24)
343#define RCC_AHBENR_RNGEN (1 << 20)
344#define RCC_AHBENR_TSCEN (1 << 16)
345#define RCC_AHBENR_CRCEN (1 << 12)
346#define RCC_AHBENR_MIFEN (1 << 8)
347#define RCC_AHBENR_DMAEN (1 << 0)
348/**@}*/
349
350/** @defgroup rcc_apb2enr_en RCC_APPB2ENR enable values
351@{*/
352#define RCC_APB2ENR_DBGEN (1 << 22)
353#define RCC_APB2ENR_USART1EN (1 << 14)
354#define RCC_APB2ENR_SPI1EN (1 << 12)
355#define RCC_APB2ENR_ADC1EN (1 << 9)
356#define RCC_APB2ENR_MIFEN (1 << 7)
357#define RCC_APB2ENR_TIM22EN (1 << 5)
358#define RCC_APB2ENR_TIM21EN (1 << 2)
359#define RCC_APB2ENR_SYSCFGEN (1 << 0)
360/**@}*/
361
362/** @defgroup rcc_apb1enr_en RCC_APB1ENR enable values
363@{*/
364#define RCC_APB1ENR_LPTIM1EN (1 << 31)
365#define RCC_APB1ENR_DACEN (1 << 29)
366#define RCC_APB1ENR_PWREN (1 << 28)
367#define RCC_APB1ENR_CRSEN (1 << 27)
368#define RCC_APB1ENR_USBEN (1 << 23)
369#define RCC_APB1ENR_I2C2EN (1 << 22)
370#define RCC_APB1ENR_I2C1EN (1 << 21)
371#define RCC_APB1ENR_USART5EN (1 << 20)
372#define RCC_APB1ENR_USART4EN (1 << 19)
373#define RCC_APB1ENR_LPUART1EN (1 << 18)
374#define RCC_APB1ENR_USART2EN (1 << 17)
375#define RCC_APB1ENR_SPI2EN (1 << 14)
376#define RCC_APB1ENR_WWDGEN (1 << 11)
377#define RCC_APB1ENR_LCDEN (1 << 9)
378#define RCC_APB1ENR_TIM7EN (1 << 5)
379#define RCC_APB1ENR_TIM6EN (1 << 4)
380#define RCC_APB1ENR_TIM3EN (1 << 1)
381#define RCC_APB1ENR_TIM2EN (1 << 0)
382/**@}*/
383
384/* --- RCC_IOPSMENR - GPIO Clock enable in sleep mode */
385
386#define RCC_IOPSMENR_IOPHSMEN (1<<7)
387#define RCC_IOPSMENR_IOPESMEN (1<<4)
388#define RCC_IOPSMENR_IOPDSMEN (1<<3)
389#define RCC_IOPSMENR_IOPCSMEN (1<<2)
390#define RCC_IOPSMENR_IOPBSMEN (1<<1)
391#define RCC_IOPSMENR_IOPASMEN (1<<0)
392
393/* --- RCC_AHBSMENR - AHB periph clock in sleep mode */
394
395#define RCC_AHBSMENR_CRYPSMEN (1 << 24)
396#define RCC_AHBSMENR_RNGSMEN (1 << 20)
397#define RCC_AHBSMENR_TSCSMEN (1 << 16)
398#define RCC_AHBSMENR_CRCSMEN (1 << 12)
399#define RCC_AHBSMENR_MIFSMEN (1 << 8)
400#define RCC_AHBSMENR_DMASMEN (1 << 0)
401
402/* --- RCC_APB2SMENR - APB2 periph clock in sleep mode */
403
404#define RCC_APB2SMENR_DBGSMEN (1 << 22)
405#define RCC_APB2SMENR_USART1SMEN (1 << 14)
406#define RCC_APB2SMENR_SPI1SMEN (1 << 12)
407#define RCC_APB2SMENR_ADC1SMEN (1 << 9)
408#define RCC_APB2SMENR_MIFSMEN (1 << 7)
409#define RCC_APB2SMENR_TIM22SMEN (1 << 5)
410#define RCC_APB2SMENR_TIM21SMEN (1 << 2)
411#define RCC_APB2SMENR_SYSCFGSMEN (1 << 0)
412
413/* --- RCC_APB1SMENR - APB1 periph clock in sleep mode */
414
415#define RCC_APB1SMENR_LPTIM1SMEN (1 << 31)
416#define RCC_APB1SMENR_I2C3SMEN (1 << 30)
417#define RCC_APB1SMENR_DACSMEN (1 << 29)
418#define RCC_APB1SMENR_PWRSMEN (1 << 28)
419#define RCC_APB1SMENR_CRSSMEN (1 << 27)
420#define RCC_APB1SMENR_USBSMEN (1 << 23)
421#define RCC_APB1SMENR_I2C2SMEN (1 << 22)
422#define RCC_APB1SMENR_I2C1SMEN (1 << 21)
423#define RCC_APB1SMENR_USART5SMEN (1 << 20)
424#define RCC_APB1SMENR_USART4SMEN (1 << 19)
425#define RCC_APB1SMENR_LPUART1SMEN (1 << 18)
426#define RCC_APB1SMENR_USART2SMEN (1 << 17)
427#define RCC_APB1SMENR_SPI2SMEN (1 << 14)
428#define RCC_APB1SMENR_WWDGSMEN (1 << 11)
429#define RCC_APB1SMENR_LCDSMEN (1 << 9)
430#define RCC_APB1SMENR_TIM7SMEN (1 << 5)
431#define RCC_APB1SMENR_TIM6SMEN (1 << 4)
432#define RCC_APB1SMENR_TIM3SMEN (1 << 1)
433#define RCC_APB1SMENR_TIM2SMEN (1 << 0)
434
435/* --- RCC_CCIPR - Clock config register */
436
437#define RCC_CCIPR_HSI48SEL (1<<26)
438
439#define RCC_CCIPR_LPTIM1SEL_APB 0
440#define RCC_CCIPR_LPTIM1SEL_LSI 1
441#define RCC_CCIPR_LPTIM1SEL_HSI16 2
442#define RCC_CCIPR_LPTIM1SEL_LSE 3
443#define RCC_CCIPR_LPTIM1SEL_SHIFT 18
444#define RCC_CCIPR_LPTIM1SEL_MASK 0x3
445
446/** @defgroup rcc_ccipr_i2c_clksel I2C Clock source selections
447 * @{
448 */
449#define RCC_CCIPR_I2CxSEL_PCLK 0
450#define RCC_CCIPR_I2CxSEL_SYSCLK 1
451#define RCC_CCIPR_I2CxSEL_HSI 2
452/**@}*/
453#define RCC_CCIPR_I2CxSEL_MASK 0x3
454
455/** @defgroup rcc_ccipr_i2c_choices I2C for clock source selecting
456 * @note This is only used internally.
457 * @{
458 */
459#define RCC_CCIPR_I2C3SEL_SHIFT 16
460#define RCC_CCIPR_I2C1SEL_SHIFT 12
461/**@}*/
462
463/** @defgroup rcc_ccipr_uart_clksel UART Clock source selections
464 * @{
465 */
466#define RCC_CCIPR_USARTxSEL_PCLK 0
467#define RCC_CCIPR_USARTxSEL_SYSCLK 1
468#define RCC_CCIPR_USARTxSEL_HSI 2
469#define RCC_CCIPR_USARTxSEL_LSE 3
470/**@}*/
471
472#define RCC_CCIPR_LPUARTxSEL_PCLK RCC_CCIPR_USARTxSEL_PCLK
473#define RCC_CCIPR_LPUARTxSEL_SYSCK RCC_CCIPR_USARTxSEL_SYSCLK
474#define RCC_CCIPR_LPUARTxSEL_HSI RCC_CCIPR_USARTxSEL_HSI
475#define RCC_CCIPR_LPUARTxSEL_LSE RCC_CCIPR_USARTxSEL_LSE
476
477#define RCC_CCIPR_LPUARTxSEL_MASK 0x3
478#define RCC_CCIPR_USARTxSEL_MASK RCC_CCIPR_LPUARTxSEL_MASK
479
480/** @defgroup rcc_ccipr_uart_choices UART for clock source selecting
481 * @note This is only used internally.
482 * @{
483 */
484#define RCC_CCIPR_LPUART1SEL_SHIFT 10
485#define RCC_CCIPR_USART2SEL_SHIFT 2
486#define RCC_CCIPR_USART1SEL_SHIFT 0
487/**@}*/
488
489/* --- RCC_CSRT - Control/Status register */
490
491#define RCC_CSR_LPWRRSTF (1 << 31)
492#define RCC_CSR_WWDGRSTF (1 << 30)
493#define RCC_CSR_IWDGRSTF (1 << 29)
494#define RCC_CSR_SFTRSTF (1 << 28)
495#define RCC_CSR_PORRSTF (1 << 27)
496#define RCC_CSR_PINRSTF (1 << 26)
497#define RCC_CSR_OBLRSTF (1 << 25)
498#define RCC_CSR_FWRSTF (1 << 24)
499#define RCC_CSR_RMVF (1 << 23)
500#define RCC_CSR_RESET_FLAGS (RCC_CSR_LPWRRSTF | RCC_CSR_WWDGRSTF |\
501 RCC_CSR_IWDGRSTF | RCC_CSR_SFTRSTF | RCC_CSR_PORRSTF |\
502 RCC_CSR_PINRSTF | RCC_CSR_OBLRSTF | RCC_CSR_FWRSTF)
503#define RCC_CSR_RTCRST (1 << 19)
504#define RCC_CSR_RTCEN (1 << 18)
505#define RCC_CSR_RTCSEL_SHIFT (16)
506#define RCC_CSR_RTCSEL_MASK (0x3)
507#define RCC_CSR_RTCSEL_NONE (0x0)
508#define RCC_CSR_RTCSEL_LSE (0x1)
509#define RCC_CSR_RTCSEL_LSI (0x2)
510#define RCC_CSR_RTCSEL_HSE (0x3)
511#define RCC_CSR_CSSLSED (1 << 14)
512#define RCC_CSR_CSSLSEON (1 << 13)
513#define RCC_CSR_LSEDRV_SHIFT 11
514#define RCC_CSR_LSEDRV_MASK 0x3
515#define RCC_CSR_LSEDRV_LOWEST 0
516#define RCC_CSR_LSEDRV_MLOW 1
517#define RCC_CSR_LSEDRV_MHIGH 2
518#define RCC_CSR_LSEDRV_HIGHEST 3
519#define RCC_CSR_LSEBYP (1 << 10)
520#define RCC_CSR_LSERDY (1 << 9)
521#define RCC_CSR_LSEON (1 << 8)
522#define RCC_CSR_LSIRDY (1 << 1)
523#define RCC_CSR_LSION (1 << 0)
524
526 uint8_t pll_mul;
527 uint16_t pll_div;
528 uint8_t pll_source;
531 uint8_t hpre;
532 uint8_t ppre1;
533 uint8_t ppre2;
534 // FIXME enum pwr_vos_scale voltage_scale;
538 uint8_t msi_range;
539};
540
541/* --- Variable definitions ------------------------------------------------ */
542extern uint32_t rcc_ahb_frequency;
543extern uint32_t rcc_apb1_frequency;
544extern uint32_t rcc_apb2_frequency;
545
546/* --- Function prototypes ------------------------------------------------- */
547
551
552
553#define _REG_BIT(base, bit) (((base) << 5) + (bit))
554
556 /* GPIO peripherals */
557 RCC_GPIOA = _REG_BIT(0x2c, 0),
558 RCC_GPIOB = _REG_BIT(0x2c, 1),
559 RCC_GPIOC = _REG_BIT(0x2c, 2),
560 RCC_GPIOD = _REG_BIT(0x2c, 3),
561 RCC_GPIOE = _REG_BIT(0x2c, 4),
562 RCC_GPIOH = _REG_BIT(0x2c, 7),
563
564 /* AHB peripherals */
565 RCC_DMA = _REG_BIT(0x30, 0),
566 RCC_MIF = _REG_BIT(0x30, 8),
567 RCC_CRC = _REG_BIT(0x30, 12),
568 RCC_TSC = _REG_BIT(0x30, 16),
569 RCC_RNG = _REG_BIT(0x30, 20),
570 RCC_CRYPT = _REG_BIT(0x30, 24),
571
572 /* APB2 peripherals */
574 RCC_TIM21 = _REG_BIT(0x34, 2),
575 RCC_TIM22 = _REG_BIT(0x34, 5),
576 RCC_FW = _REG_BIT(0x34, 7),
577 RCC_ADC1 = _REG_BIT(0x34, 9),
578 RCC_SPI1 = _REG_BIT(0x34, 12),
579 RCC_USART1 = _REG_BIT(0x34, 14),
580 RCC_DBG = _REG_BIT(0x34, 22),
581
582 /* APB1 peripherals */
583 RCC_TIM2 = _REG_BIT(0x38, 0),
584 RCC_TIM3 = _REG_BIT(0x38, 1),
585 RCC_TIM6 = _REG_BIT(0x38, 4),
586 RCC_TIM7 = _REG_BIT(0x38, 5),
587 RCC_LCD = _REG_BIT(0x38, 9),
588 RCC_WWDG = _REG_BIT(0x38, 11),
589 RCC_SPI2 = _REG_BIT(0x38, 14),
590 RCC_USART2 = _REG_BIT(0x38, 17),
592 RCC_USART4 = _REG_BIT(0x38, 19),
593 RCC_USART5 = _REG_BIT(0x38, 20),
594 RCC_I2C1 = _REG_BIT(0x38, 21),
595 RCC_I2C2 = _REG_BIT(0x38, 22),
596 RCC_USB = _REG_BIT(0x38, 23),
597 RCC_CRS = _REG_BIT(0x38, 27),
598 RCC_PWR = _REG_BIT(0x38, 28),
599 RCC_DAC = _REG_BIT(0x38, 29),
600 RCC_I2C3 = _REG_BIT(0x38, 30),
601 RCC_LPTIM1 = _REG_BIT(0x38, 31),
602
603 /* GPIO peripherals in sleep mode */
604 SCC_GPIOA = _REG_BIT(0x3c, 0),
605 SCC_GPIOB = _REG_BIT(0x3c, 1),
606 SCC_GPIOC = _REG_BIT(0x3c, 2),
607 SCC_GPIOD = _REG_BIT(0x3c, 3),
608 SCC_GPIOE = _REG_BIT(0x3c, 4),
609 SCC_GPIOH = _REG_BIT(0x3c, 7),
610
611 /* AHB peripherals in sleep mode */
612 SCC_DMA = _REG_BIT(0x40, 0),
613 SCC_MIF = _REG_BIT(0x40, 8),
614 SCC_SRAM = _REG_BIT(0x40, 12),
615 SCC_CRC = _REG_BIT(0x40, 12),
616 SCC_TSC = _REG_BIT(0x40, 16),
617 SCC_RNG = _REG_BIT(0x40, 20),
618 SCC_CRYPT = _REG_BIT(0x40, 24),
619
620 /* APB2 peripherals in sleep mode */
622 SCC_TIM21 = _REG_BIT(0x44, 2),
623 SCC_TIM22 = _REG_BIT(0x44, 5),
624 SCC_ADC1 = _REG_BIT(0x44, 9),
625 SCC_SPI1 = _REG_BIT(0x44, 12),
626 SCC_USART1 = _REG_BIT(0x44, 14),
627 SCC_DBG = _REG_BIT(0x44, 22),
628
629 /* APB1 peripherals in sleep mode */
630 SCC_TIM2 = _REG_BIT(0x48, 0),
631 SCC_TIM3 = _REG_BIT(0x48, 1),
632 SCC_TIM6 = _REG_BIT(0x48, 4),
633 SCC_TIM7 = _REG_BIT(0x48, 5),
634 SCC_LCD = _REG_BIT(0x48, 9),
635 SCC_WWDG = _REG_BIT(0x48, 11),
636 SCC_SPI2 = _REG_BIT(0x48, 14),
637 SCC_USART2 = _REG_BIT(0x48, 17),
639 SCC_USART4 = _REG_BIT(0x48, 19),
640 SCC_USART5 = _REG_BIT(0x48, 20),
641 SCC_I2C1 = _REG_BIT(0x48, 21),
642 SCC_I2C2 = _REG_BIT(0x48, 22),
643 SCC_USB = _REG_BIT(0x48, 23),
644 SCC_CRS = _REG_BIT(0x48, 27),
645 SCC_PWR = _REG_BIT(0x48, 28),
646 SCC_DAC = _REG_BIT(0x48, 29),
647 SCC_I2C3 = _REG_BIT(0x48, 30),
648 SCC_LPTIM1 = _REG_BIT(0x48, 31),
649};
650
652 /* GPIO peripherals */
653 RST_GPIOA = _REG_BIT(0x1c, 0),
654 RST_GPIOB = _REG_BIT(0x1c, 1),
655 RST_GPIOC = _REG_BIT(0x1c, 2),
656 RST_GPIOD = _REG_BIT(0x1c, 3),
657 RST_GPIOE = _REG_BIT(0x1c, 4),
658 RST_GPIOH = _REG_BIT(0x1c, 7),
659
660 /* AHB peripherals */
661 RST_DMA = _REG_BIT(0x20, 0),
662 RST_MIF = _REG_BIT(0x20, 8),
663 RST_CRC = _REG_BIT(0x20, 12),
664 RST_TSC = _REG_BIT(0x20, 16),
665 RST_RNG = _REG_BIT(0x20, 20),
666 RST_CRYPT = _REG_BIT(0x20, 24),
667
668 /* APB2 peripherals */
670 RST_TIM21 = _REG_BIT(0x24, 2),
671 RST_TIM22 = _REG_BIT(0x24, 5),
672 RST_ADC1 = _REG_BIT(0x24, 9),
673 RST_SPI1 = _REG_BIT(0x24, 12),
674 RST_USART1 = _REG_BIT(0x24, 14),
675 RST_DBG = _REG_BIT(0x24, 22),
676
677 /* APB1 peripherals*/
678 RST_TIM2 = _REG_BIT(0x28, 0),
679 RST_TIM3 = _REG_BIT(0x28, 1),
680 RST_TIM6 = _REG_BIT(0x28, 4),
681 RST_TIM7 = _REG_BIT(0x28, 5),
682 RST_LCD = _REG_BIT(0x28, 9),
683 RST_WWDG = _REG_BIT(0x28, 11),
684 RST_SPI2 = _REG_BIT(0x28, 14),
685 RST_USART2 = _REG_BIT(0x28, 17),
687 RST_USART4 = _REG_BIT(0x28, 19),
688 RST_USART5 = _REG_BIT(0x28, 20),
689 RST_I2C1 = _REG_BIT(0x28, 21),
690 RST_I2C2 = _REG_BIT(0x28, 22),
691 RST_USB = _REG_BIT(0x28, 23),
692 RST_CRS = _REG_BIT(0x28, 27),
693 RST_PWR = _REG_BIT(0x28, 28),
694 RST_DAC = _REG_BIT(0x28, 29),
695 RST_I2C3 = _REG_BIT(0x28, 30),
696 RST_LPTIM1 = _REG_BIT(0x28, 31),
697};
699
701
702void rcc_osc_on(enum rcc_osc osc);
703void rcc_osc_off(enum rcc_osc osc);
704void rcc_osc_ready_int_clear(enum rcc_osc osc);
705void rcc_osc_ready_int_enable(enum rcc_osc osc);
707int rcc_osc_ready_int_flag(enum rcc_osc osc);
709void rcc_set_hsi48_source_pll(void);
710void rcc_set_sysclk_source(enum rcc_osc osc);
711void rcc_set_pll_multiplier(uint32_t factor);
712void rcc_set_pll_divider(uint32_t factor);
713void rcc_set_pll_source(uint32_t pllsrc);
714void rcc_set_ppre2(uint32_t ppre2);
715void rcc_set_ppre1(uint32_t ppre1);
716void rcc_set_hpre(uint32_t hpre);
717void rcc_clock_setup_pll(const struct rcc_clock_scale *clock);
718
719void rcc_set_msi_range(uint32_t msi_range);
720
721void rcc_set_peripheral_clk_sel(uint32_t periph, uint32_t sel);
722void rcc_set_lptim1_sel(uint32_t lptim1_sel);
723void rcc_set_lpuart1_sel(uint32_t lpupart1_sel);
724void rcc_set_usart1_sel(uint32_t usart1_sel);
725void rcc_set_usart2_sel(uint32_t usart2_sel);
726uint32_t rcc_get_usart_clk_freq(uint32_t usart);
727uint32_t rcc_get_timer_clk_freq(uint32_t timer);
728uint32_t rcc_get_i2c_clk_freq(uint32_t i2c);
729uint32_t rcc_get_spi_clk_freq(uint32_t spi);
730
732
733/**@}*/
734
735#endif
#define END_DECLS
Definition: common.h:34
#define BEGIN_DECLS
Definition: common.h:33
void rcc_set_pll_divider(uint32_t factor)
RCC Set the PLL Division Factor.
Definition: rcc.c:331
int rcc_osc_ready_int_flag(enum rcc_osc osc)
RCC Read the Oscillator Ready Interrupt Flag.
Definition: rcc.c:207
void rcc_set_msi_range(uint32_t msi_range)
Set the range of the MSI oscillator.
Definition: rcc.c:398
void rcc_osc_ready_int_clear(enum rcc_osc osc)
RCC Clear the Oscillator Ready Interrupt Flag.
Definition: rcc.c:110
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:567
uint32_t rcc_apb2_frequency
Definition: rcc.c:45
void rcc_set_pll_source(uint32_t pllsrc)
Set the pll source.
Definition: rcc.c:342
uint32_t rcc_get_timer_clk_freq(uint32_t timer)
Get the peripheral clock speed for the Timer at base specified.
Definition: rcc.c:533
uint32_t rcc_get_usart_clk_freq(uint32_t usart)
Get the peripheral clock speed for the USART at base specified.
Definition: rcc.c:518
void rcc_clock_setup_pll(const struct rcc_clock_scale *clock)
RCC Setup PLL and use it as Sysclk source.
Definition: rcc.c:580
rcc_periph_rst
Definition: l0/rcc.h:651
rcc_periph_clken
Definition: l0/rcc.h:555
void rcc_osc_ready_int_enable(enum rcc_osc osc)
RCC Enable the Oscillator Ready Interrupt.
Definition: rcc.c:142
rcc_osc
Definition: l0/rcc.h:548
void rcc_set_usart1_sel(uint32_t usart1_sel)
Set the USART1 clock source.
Definition: rcc.c:432
void rcc_set_usart2_sel(uint32_t usart2_sel)
Set the USART2 clock source.
Definition: rcc.c:443
void rcc_set_hsi48_source_pll(void)
RCC Set HSI48 clock source to the PLL.
Definition: rcc.c:274
void rcc_set_peripheral_clk_sel(uint32_t periph, uint32_t sel)
Set the peripheral clock source.
Definition: rcc.c:454
void rcc_osc_ready_int_disable(enum rcc_osc osc)
RCC Disable the Oscillator Ready Interrupt.
Definition: rcc.c:174
void rcc_osc_on(enum rcc_osc osc)
Definition: rcc.c:47
#define _REG_BIT(base, bit)
Definition: l0/rcc.h:553
uint32_t rcc_ahb_frequency
Definition: rcc.c:43
void rcc_osc_off(enum rcc_osc osc)
Definition: rcc.c:74
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
void rcc_set_lpuart1_sel(uint32_t lpupart1_sel)
Set the LPUART1 clock source.
Definition: rcc.c:421
uint32_t rcc_apb1_frequency
Definition: rcc.c:44
void rcc_set_ppre1(uint32_t ppre1)
RCC Set the APB1 Prescale Factor.
Definition: rcc.c:359
void rcc_set_lptim1_sel(uint32_t lptim1_sel)
Set the LPTIM1 clock source.
Definition: rcc.c:409
void rcc_set_ppre2(uint32_t ppre2)
RCC Set the APB2 Prescale Factor.
Definition: rcc.c:374
void rcc_set_hsi48_source_rc48(void)
RCC Set HSI48 clock source to the RC48 (CRS)
Definition: rcc.c:266
void rcc_set_hpre(uint32_t hpre)
RCC Set the AHB Prescale Factor.
Definition: rcc.c:387
void rcc_set_pll_multiplier(uint32_t factor)
RCC Set the PLL Multiplication Factor.
Definition: rcc.c:315
void rcc_set_sysclk_source(enum rcc_osc osc)
RCC Set the Source for the System Clock.
Definition: rcc.c:285
@ RST_MIF
Definition: l0/rcc.h:662
@ RST_CRS
Definition: l0/rcc.h:692
@ RST_USART5
Definition: l0/rcc.h:688
@ RST_SPI1
Definition: l0/rcc.h:673
@ RST_CRYPT
Definition: l0/rcc.h:666
@ RST_I2C3
Definition: l0/rcc.h:695
@ RST_ADC1
Definition: l0/rcc.h:672
@ RST_TSC
Definition: l0/rcc.h:664
@ RST_RNG
Definition: l0/rcc.h:665
@ RST_SPI2
Definition: l0/rcc.h:684
@ RST_GPIOH
Definition: l0/rcc.h:658
@ RST_TIM3
Definition: l0/rcc.h:679
@ RST_DMA
Definition: l0/rcc.h:661
@ RST_LPTIM1
Definition: l0/rcc.h:696
@ RST_GPIOA
Definition: l0/rcc.h:653
@ RST_GPIOC
Definition: l0/rcc.h:655
@ RST_TIM6
Definition: l0/rcc.h:680
@ RST_GPIOB
Definition: l0/rcc.h:654
@ RST_DAC
Definition: l0/rcc.h:694
@ RST_TIM7
Definition: l0/rcc.h:681
@ RST_TIM2
Definition: l0/rcc.h:678
@ RST_CRC
Definition: l0/rcc.h:663
@ RST_GPIOD
Definition: l0/rcc.h:656
@ RST_USB
Definition: l0/rcc.h:691
@ RST_USART4
Definition: l0/rcc.h:687
@ RST_SYSCFG
Definition: l0/rcc.h:669
@ RST_TIM21
Definition: l0/rcc.h:670
@ RST_GPIOE
Definition: l0/rcc.h:657
@ RST_I2C2
Definition: l0/rcc.h:690
@ RST_PWR
Definition: l0/rcc.h:693
@ RST_USART1
Definition: l0/rcc.h:674
@ RST_TIM22
Definition: l0/rcc.h:671
@ RST_WWDG
Definition: l0/rcc.h:683
@ RST_I2C1
Definition: l0/rcc.h:689
@ RST_LPUART1
Definition: l0/rcc.h:686
@ RST_LCD
Definition: l0/rcc.h:682
@ RST_USART2
Definition: l0/rcc.h:685
@ RST_DBG
Definition: l0/rcc.h:675
@ SCC_CRC
Definition: l0/rcc.h:615
@ RCC_TIM21
Definition: l0/rcc.h:574
@ RCC_CRS
Definition: l0/rcc.h:597
@ RCC_RNG
Definition: l0/rcc.h:569
@ SCC_GPIOD
Definition: l0/rcc.h:607
@ RCC_SPI2
Definition: l0/rcc.h:589
@ RCC_WWDG
Definition: l0/rcc.h:588
@ RCC_TIM3
Definition: l0/rcc.h:584
@ SCC_SPI2
Definition: l0/rcc.h:636
@ RCC_LCD
Definition: l0/rcc.h:587
@ RCC_USART5
Definition: l0/rcc.h:593
@ SCC_CRS
Definition: l0/rcc.h:644
@ RCC_GPIOA
Definition: l0/rcc.h:557
@ SCC_GPIOH
Definition: l0/rcc.h:609
@ RCC_DMA
Definition: l0/rcc.h:565
@ SCC_RNG
Definition: l0/rcc.h:617
@ RCC_MIF
Definition: l0/rcc.h:566
@ RCC_DBG
Definition: l0/rcc.h:580
@ SCC_GPIOA
Definition: l0/rcc.h:604
@ SCC_MIF
Definition: l0/rcc.h:613
@ RCC_TIM2
Definition: l0/rcc.h:583
@ SCC_TIM6
Definition: l0/rcc.h:632
@ SCC_ADC1
Definition: l0/rcc.h:624
@ SCC_TIM2
Definition: l0/rcc.h:630
@ SCC_LPUART1
Definition: l0/rcc.h:638
@ SCC_TIM3
Definition: l0/rcc.h:631
@ RCC_GPIOH
Definition: l0/rcc.h:562
@ RCC_PWR
Definition: l0/rcc.h:598
@ RCC_CRC
Definition: l0/rcc.h:567
@ SCC_USART2
Definition: l0/rcc.h:637
@ SCC_TIM21
Definition: l0/rcc.h:622
@ SCC_I2C2
Definition: l0/rcc.h:642
@ SCC_USB
Definition: l0/rcc.h:643
@ RCC_USART1
Definition: l0/rcc.h:579
@ SCC_WWDG
Definition: l0/rcc.h:635
@ SCC_PWR
Definition: l0/rcc.h:645
@ SCC_SYSCFG
Definition: l0/rcc.h:621
@ RCC_I2C1
Definition: l0/rcc.h:594
@ RCC_USART4
Definition: l0/rcc.h:592
@ SCC_DAC
Definition: l0/rcc.h:646
@ SCC_LCD
Definition: l0/rcc.h:634
@ RCC_ADC1
Definition: l0/rcc.h:577
@ SCC_SPI1
Definition: l0/rcc.h:625
@ RCC_TSC
Definition: l0/rcc.h:568
@ SCC_DBG
Definition: l0/rcc.h:627
@ SCC_USART4
Definition: l0/rcc.h:639
@ RCC_USB
Definition: l0/rcc.h:596
@ RCC_FW
Definition: l0/rcc.h:576
@ SCC_USART5
Definition: l0/rcc.h:640
@ SCC_SRAM
Definition: l0/rcc.h:614
@ RCC_CRYPT
Definition: l0/rcc.h:570
@ RCC_USART2
Definition: l0/rcc.h:590
@ SCC_GPIOE
Definition: l0/rcc.h:608
@ SCC_DMA
Definition: l0/rcc.h:612
@ SCC_USART1
Definition: l0/rcc.h:626
@ SCC_TIM22
Definition: l0/rcc.h:623
@ SCC_I2C1
Definition: l0/rcc.h:641
@ RCC_SPI1
Definition: l0/rcc.h:578
@ RCC_SYSCFG
Definition: l0/rcc.h:573
@ SCC_GPIOC
Definition: l0/rcc.h:606
@ SCC_TSC
Definition: l0/rcc.h:616
@ RCC_I2C2
Definition: l0/rcc.h:595
@ RCC_GPIOB
Definition: l0/rcc.h:558
@ RCC_TIM7
Definition: l0/rcc.h:586
@ RCC_LPTIM1
Definition: l0/rcc.h:601
@ RCC_GPIOC
Definition: l0/rcc.h:559
@ RCC_TIM6
Definition: l0/rcc.h:585
@ SCC_I2C3
Definition: l0/rcc.h:647
@ SCC_GPIOB
Definition: l0/rcc.h:605
@ RCC_TIM22
Definition: l0/rcc.h:575
@ RCC_DAC
Definition: l0/rcc.h:599
@ RCC_GPIOD
Definition: l0/rcc.h:560
@ RCC_I2C3
Definition: l0/rcc.h:600
@ RCC_GPIOE
Definition: l0/rcc.h:561
@ SCC_TIM7
Definition: l0/rcc.h:633
@ SCC_LPTIM1
Definition: l0/rcc.h:648
@ SCC_CRYPT
Definition: l0/rcc.h:618
@ RCC_LPUART1
Definition: l0/rcc.h:591
@ RCC_HSI48
Definition: l0/rcc.h:549
@ RCC_LSI
Definition: l0/rcc.h:549
@ RCC_PLL
Definition: l0/rcc.h:549
@ RCC_MSI
Definition: l0/rcc.h:549
@ RCC_LSE
Definition: l0/rcc.h:549
@ RCC_HSE
Definition: l0/rcc.h:549
@ RCC_HSI16
Definition: l0/rcc.h:549
pwr_vos_scale
Voltage scales for internal regulator.
Definition: pwr_common_v2.h:82
uint8_t ppre1
Definition: l0/rcc.h:532
uint8_t flash_waitstates
Definition: l0/rcc.h:529
uint8_t ppre2
Definition: l0/rcc.h:533
uint32_t apb1_frequency
Definition: l0/rcc.h:536
uint8_t pll_mul
Definition: l0/rcc.h:526
uint32_t ahb_frequency
Definition: l0/rcc.h:535
enum pwr_vos_scale voltage_scale
Definition: l0/rcc.h:530
uint16_t pll_div
Definition: l0/rcc.h:527
uint8_t msi_range
Definition: l0/rcc.h:538
uint8_t hpre
Definition: l0/rcc.h:531
uint32_t apb2_frequency
Definition: l0/rcc.h:537
uint8_t pll_source
Definition: l0/rcc.h:528