libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
g0/rcc.h
Go to the documentation of this file.
1/** @defgroup rcc_defines RCC Defines
2 *
3 * @ingroup STM32G0xx_defines
4 *
5 * @brief <b>Defined Constants and Types for the STM32G0xx Reset and Clock Control</b>
6 *
7 * @version 1.0.0
8 *
9 * LGPL License Terms @ref lgpl_license
10 * */
11/*
12 * This file is part of the libopencm3 project.
13 *
14 * This library is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public License
25 * along with this library. If not, see <http://www.gnu.org/licenses/>.
26 *
27 */
28
29/**@{*/
30
31#ifndef LIBOPENCM3_RCC_H
32#define LIBOPENCM3_RCC_H
33
35
36/** @defgroup rcc_registers Reset and Clock Control Register
37@{*/
38#define RCC_CR MMIO32(RCC_BASE + 0x00)
39#define RCC_ICSCR MMIO32(RCC_BASE + 0x04)
40#define RCC_CFGR MMIO32(RCC_BASE + 0x08)
41#define RCC_PLLCFGR MMIO32(RCC_BASE + 0x0c)
42#define RCC_CIER MMIO32(RCC_BASE + 0x18)
43#define RCC_CIFR MMIO32(RCC_BASE + 0x1c)
44#define RCC_CICR MMIO32(RCC_BASE + 0x20)
45#define RCC_IOPRSTR_OFFSET 0x24
46#define RCC_IOPRSTR MMIO32(RCC_BASE + RCC_IOPRSTR_OFFSET)
47#define RCC_AHBRSTR_OFFSET 0x28
48#define RCC_AHBRSTR MMIO32(RCC_BASE + RCC_AHBRSTR_OFFSET)
49#define RCC_APBRSTR1_OFFSET 0x2c
50#define RCC_APBRSTR1 MMIO32(RCC_BASE + RCC_APBRSTR1_OFFSET)
51#define RCC_APBRSTR2_OFFSET 0x30
52#define RCC_APBRSTR2 MMIO32(RCC_BASE + RCC_APBRSTR2_OFFSET)
53#define RCC_IOPENR_OFFSET 0x34
54#define RCC_IOPENR MMIO32(RCC_BASE + RCC_IOPENR_OFFSET)
55#define RCC_AHBENR_OFFSET 0x38
56#define RCC_AHBENR MMIO32(RCC_BASE + RCC_AHBENR_OFFSET)
57#define RCC_APBENR1_OFFSET 0x3c
58#define RCC_APBENR1 MMIO32(RCC_BASE + RCC_APBENR1_OFFSET)
59#define RCC_APBENR2_OFFSET 0x40
60#define RCC_APBENR2 MMIO32(RCC_BASE + RCC_APBENR2_OFFSET)
61#define RCC_IOPSMENR_OFFSET 0x44
62#define RCC_IOPSMENR MMIO32(RCC_BASE + RCC_IOPSMENR_OFFSET)
63#define RCC_AHBSMENR_OFFSET 0x48
64#define RCC_AHBSMENR MMIO32(RCC_BASE + RCC_AHBSMENR_OFFSET)
65#define RCC_APBSMENR1_OFFSET 0x4c
66#define RCC_APBSMENR1 MMIO32(RCC_BASE + RCC_APBSMENR1_OFFSET)
67#define RCC_APBSMENR2_OFFSET 0x50
68#define RCC_APBSMENR2 MMIO32(RCC_BASE + RCC_APBSMENR2_OFFSET)
69#define RCC_CCIPR MMIO32(RCC_BASE + 0x54)
70#define RCC_BDCR MMIO32(RCC_BASE + 0x5c)
71#define RCC_CSR MMIO32(RCC_BASE + 0x60)
72/**@}*/
73
74/** @defgroup rcc_cr CR Clock control Register
75@{*/
76#define RCC_CR_PLLRDY (1 << 25)
77#define RCC_CR_PLLON (1 << 24)
78#define RCC_CR_CSSON (1 << 19)
79#define RCC_CR_HSEBYP (1 << 18)
80#define RCC_CR_HSERDY (1 << 17)
81#define RCC_CR_HSEON (1 << 16)
82
83#define RCC_CR_HSIDIV_SHIFT 11
84#define RCC_CR_HSIDIV_MASK 0x7
85/** @defgroup rcc_cr_hsidiv HSI Div
86 * @brief Division factor of the HSI16 oscillator to produce HSISYS clock
87@sa rcc_cr_hsidiv
88@{*/
89#define RCC_CR_HSIDIV_DIV1 0
90#define RCC_CR_HSIDIV_DIV2 1
91#define RCC_CR_HSIDIV_DIV4 2
92#define RCC_CR_HSIDIV_DIV8 3
93#define RCC_CR_HSIDIV_DIV16 4
94#define RCC_CR_HSIDIV_DIV32 5
95#define RCC_CR_HSIDIV_DIV64 6
96#define RCC_CR_HSIDIV_DIV128 7
97/**@}*/
98
99#define RCC_CR_HSIRDY (1 << 10)
100#define RCC_CR_HSIKERON (1 << 9)
101#define RCC_CR_HSION (1 << 8)
102/**@}*/
103
104
105/** @defgroup rcc_icscr ICSCR Internal Clock Source Calibration Register
106@{*/
107#define RCC_ICSCR_HSITRIM_SHIFT 8
108#define RCC_ICSCR_HSITRIM_MASK 0x1f
109#define RCC_ICSCR_HSICAL_SHIFT 0
110#define RCC_ICSCR_HSICAL_MASK 0xff
111/**@}*/
112
113
114/** @defgroup rcc_cfgr CFGR Configuration Register
115@{*/
116#define RCC_CFGR_MCOPRE_SHIFT 28
117#define RCC_CFGR_MCOPRE_MASK 0x7
118/** @defgroup rcc_cfgr_mcopre MCO Pre
119 * @brief Division factor of microcontroler clock output
120@sa rcc_cfgr_mcopre
121@{*/
122#define RCC_CFGR_MCOPRE_DIV1 0
123#define RCC_CFGR_MCOPRE_DIV2 1
124#define RCC_CFGR_MCOPRE_DIV4 2
125#define RCC_CFGR_MCOPRE_DIV8 3
126#define RCC_CFGR_MCOPRE_DIV16 4
127#define RCC_CFGR_MCOPRE_DIV32 5
128#define RCC_CFGR_MCOPRE_DIV64 6
129#define RCC_CFGR_MCOPRE_DIV128 7
130/**@}*/
131
132#define RCC_CFGR_MCO_SHIFT 24
133#define RCC_CFGR_MCO_MASK 0xf
134
135/** @defgroup rcc_cfgr_mcosel MCO Sel
136 * @brief Microcontroler clock output selector
137@sa rcc_cfgr_mcosel
138@{*/
139#define RCC_CFGR_MCO_NOCLK 0x0
140#define RCC_CFGR_MCO_SYSCLK 0x1
141#define RCC_CFGR_MCO_HSI16 0x3
142#define RCC_CFGR_MCO_HSE 0x4
143#define RCC_CFGR_MCO_PLLRCLK 0x5
144#define RCC_CFGR_MCO_LSI 0x6
145#define RCC_CFGR_MCO_LSE 0x7
146/**@}*/
147
148#define RCC_CFGR_PPRE_MASK 0x7
149#define RCC_CFGR_PPRE_SHIFT 12
150
151/** @defgroup rcc_cfgr_ppre PPRE
152 * @brief APB Prescaler
153@sa rcc_cfgr_ppre
154@{*/
155#define RCC_CFGR_PPRE_NODIV 0x0
156#define RCC_CFGR_PPRE_DIV2 0x4
157#define RCC_CFGR_PPRE_DIV4 0x5
158#define RCC_CFGR_PPRE_DIV8 0x6
159#define RCC_CFGR_PPRE_DIV16 0x7
160/**@}*/
161
162#define RCC_CFGR_HPRE_MASK 0xf
163#define RCC_CFGR_HPRE_SHIFT 8
164/** @defgroup rcc_cfgr_hpre HPRE
165 * @brief APB Prescaler
166@sa rcc_cfgr_hpre
167@{*/
168#define RCC_CFGR_HPRE_NODIV 0x0
169#define RCC_CFGR_HPRE_DIV2 0x8
170#define RCC_CFGR_HPRE_DIV4 0x9
171#define RCC_CFGR_HPRE_DIV8 0xa
172#define RCC_CFGR_HPRE_DIV16 0xb
173#define RCC_CFGR_HPRE_DIV64 0xc
174#define RCC_CFGR_HPRE_DIV128 0xd
175#define RCC_CFGR_HPRE_DIV256 0xe
176#define RCC_CFGR_HPRE_DIV512 0xf
177/**@}*/
178
179#define RCC_CFGR_SWS_MASK 0x3
180#define RCC_CFGR_SWS_SHIFT 3
181/** @defgroup rcc_cfgr_sws SWS
182 * @brief System clock switch status
183@sa rcc_cfgr_sws
184@{*/
185#define RCC_CFGR_SWS_HSISYS 0x0
186#define RCC_CFGR_SWS_HSE 0x1
187#define RCC_CFGR_SWS_PLLRCLK 0x2
188#define RCC_CFGR_SWS_LSI 0x3
189#define RCC_CFGR_SWS_LSE 0x4
190/**@}*/
191
192#define RCC_CFGR_SW_MASK 0x3
193#define RCC_CFGR_SW_SHIFT 0
194/** @defgroup rcc_cfgr_sw SW
195 * @brief System clock switch
196@sa rcc_cfgr_sw
197@{*/
198#define RCC_CFGR_SW_HSISYS 0x0
199#define RCC_CFGR_SW_HSE 0x1
200#define RCC_CFGR_SW_PLLRCLK 0x2
201#define RCC_CFGR_SW_LSI 0x3
202#define RCC_CFGR_SW_LSE 0x4
203/**@}*/
204/**@}*/
205
206
207
208/** @defgroup rcc_pllcfgr PLLCFGR PLL Configuration Register
209@{*/
210#define RCC_PLLCFGR_PLLR_SHIFT 29
211#define RCC_PLLCFGR_PLLR_MASK 0x7
212/** @defgroup rcc_pllcfgr_pllr PLLR
213 * @brief VCO Division factor R for PLLRCLK clock output [2..8]. Frequency must not exceed 64mhz in voltage range 1, or 16mhz in voltage range 2.
214@sa rcc_pllcfgr_pllr
215@{*/
216#define RCC_PLLCFGR_PLLR_DIV(x) ((x)-1)
217/**@}*/
218
219#define RCC_PLLCFGR_PLLREN (1<<28)
220
221#define RCC_PLLCFGR_PLLQ_SHIFT 25
222#define RCC_PLLCFGR_PLLQ_MASK 0x7
223/** @defgroup rcc_pllcfgr_pllq PLLQ
224 * @brief VCO Division factor Q for PLLQCLK clock output [2..8]. Frequency must not exceed 128mhz in voltage range 1, or 32mhz in range 2
225@sa rcc_pllcfgr_pllq
226@{*/
227#define RCC_PLLCFGR_PLLQ_DIV(x) ((x)-1)
228/**@}*/
229
230#define RCC_PLLCFGR_PLLQEN (1 << 24)
231
232#define RCC_PLLCFGR_PLLP_SHIFT 17
233#define RCC_PLLCFGR_PLLP_MASK 0x1f
234/** @defgroup rcc_pllcfgr_pllp PLLP
235 * @brief VCO Division factor P for PLLPCLK clock output [2..32]. Frequency must not exceed 122mhz in voltage range 1, or 40mhz in range 2
236@sa rcc_pllcfgr_pllp
237@{*/
238#define RCC_PLLCFGR_PLLP_DIV(x) ((x)-1)
239/**@}*/
240
241#define RCC_PLLCFGR_PLLPEN (1 << 16)
242
243#define RCC_PLLCFGR_PLLN_SHIFT 0x8
244#define RCC_PLLCFGR_PLLN_MASK 0x7f
245/** @defgroup rcc_pllcfgr_plln PLLN
246 * @brief Multiplication factor N [8..86] for PLL VCO output frequency. Frequency must be between 64mhz and 344mhz.
247@{*/
248#define RCC_PLLCFGR_PLLN_MUL(x) (x)
249/**@}*/
250
251#define RCC_PLLCFGR_PLLM_SHIFT 0x4
252#define RCC_PLLCFGR_PLLM_MASK 0x7
253/** @defgroup rcc_pllcfgr_pllm PLLM
254 * @brief Division factor M [1..8] for PLL input clock. Input frequency must be between 4mhz and 16mhz.
255@{*/
256#define RCC_PLLCFGR_PLLM_DIV(x) ((x)-1)
257/**@}*/
258
259#define RCC_PLLCFGR_PLLSRC_SHIFT 0
260#define RCC_PLLCFGR_PLLSRC_MASK 0x3
261/** @defgroup rcc_pllcfgr_pllsrc PLLSRC
262 * @brief PLL input clock source
263@sa rcc_pllcfgr_pllsrc
264@{*/
265#define RCC_PLLCFGR_PLLSRC_NONE 0
266#define RCC_PLLCFGR_PLLSRC_HSI16 2
267#define RCC_PLLCFGR_PLLSRC_HSE 3
268/**@}*/
269/**@}*/
270
271/** @defgroup rcc_cier CIER Clock Interrupt Enable Register
272@{*/
273#define RCC_CIER_PLLRDYIE (1 << 5)
274#define RCC_CIER_HSERDYIE (1 << 4)
275#define RCC_CIER_HSIRDYIE (1 << 3)
276#define RCC_CIER_LSERDYIE (1 << 1)
277#define RCC_CIER_LSIRDYIE (1 << 0)
278/**@}*/
279
280/** @defgroup rcc_cifr CIFR Clock Interrupt Flag Register
281@{*/
282#define RCC_CIFR_LSECSSF (1 << 9)
283#define RCC_CIFR_CSSF (1 << 8)
284#define RCC_CIFR_PLLRDYF (1 << 5)
285#define RCC_CIFR_HSERDYF (1 << 4)
286#define RCC_CIFR_HSIRDYF (1 << 3)
287#define RCC_CIFR_LSERDYF (1 << 1)
288#define RCC_CIFR_LSIRDYF (1 << 0)
289/**@}*/
290
291/** @defgroup rcc_cicr CICR Clock Interrupt Clear Register
292@{*/
293#define RCC_CICR_LSECSSC (1 << 9)
294#define RCC_CICR_CSSC (1 << 8)
295#define RCC_CICR_PLLRDYC (1 << 5)
296#define RCC_CICR_HSERDYC (1 << 4)
297#define RCC_CICR_HSIRDYC (1 << 3)
298#define RCC_CICR_LSERDYC (1 << 1)
299#define RCC_CICR_LSIRDYC (1 << 0)
300/**@}*/
301
302/** @defgroup rcc_ahbrstr_rst RCC_AHBRSTR reset values
303@{*/
304#define RCC_AHBRSTR_RNGRST (1 << 18)
305#define RCC_AHBRSTR_AESRST (1 << 16)
306#define RCC_AHBRSTR_CRCRST (1 << 12)
307#define RCC_AHBRSTR_FLASHRST (1 << 8)
308#define RCC_AHBRSTR_DMA2RST (1 << 1)
309#define RCC_AHBRSTR_DMA1RST (1 << 0)
310#define RCC_AHBRSTR_DMARST RCC_AHBRSTR_DMA1RST
311/**@}*/
312
313/** @defgroup rcc_apb1rstr_rst RCC_APBRSTRx reset values (full set)
314@{*/
315/** @defgroup rcc_apbrstr1_rst RCC_APBRSTR1 reset values
316@{*/
317#define RCC_APBRSTR1_LPTIM1RST (1 << 31)
318#define RCC_APBRSTR1_LPTIM2RST (1 << 30)
319#define RCC_APBRSTR1_DAC1RST (1 << 29)
320#define RCC_APBRSTR1_PWRRST (1 << 28)
321#define RCC_APBRSTR1_DBGRST (1 << 27)
322#define RCC_APBRSTR1_UCPD2RST (1 << 26)
323#define RCC_APBRSTR1_UCPD1RST (1 << 25)
324#define RCC_APBRSTR1_CECRST (1 << 24)
325#define RCC_APBRSTR1_I2C3RST (1 << 23)
326#define RCC_APBRSTR1_I2C2RST (1 << 22)
327#define RCC_APBRSTR1_I2C1RST (1 << 21)
328#define RCC_APBRSTR1_LPUART1RST (1 << 20)
329#define RCC_APBRSTR1_USART4RST (1 << 19)
330#define RCC_APBRSTR1_USART3RST (1 << 18)
331#define RCC_APBRSTR1_USART2RST (1 << 17)
332#define RCC_APBRSTR1_CRSRST (1 << 16)
333#define RCC_APBRSTR1_SPI3RST (1 << 15)
334#define RCC_APBRSTR1_SPI2RST (1 << 14)
335#define RCC_APBRSTR1_USBRST (1 << 13)
336#define RCC_APBRSTR1_FDCANRST (1 << 12)
337#define RCC_APBRSTR1_USART6RST (1 << 9)
338#define RCC_APBRSTR1_USART5RST (1 << 8)
339#define RCC_APBRSTR1_LPUART2RST (1 << 7)
340#define RCC_APBRSTR1_TIM7RST (1 << 5)
341#define RCC_APBRSTR1_TIM6RST (1 << 4)
342#define RCC_APBRSTR1_TIM4RST (1 << 2)
343#define RCC_APBRSTR1_TIM3RST (1 << 1)
344#define RCC_APBRSTR1_TIM2RST (1 << 0)
345/**@}*/
346
347/** @defgroup rcc_apbrstr2_rst RCC_APBRSTR2 reset values
348@{*/
349#define RCC_APBRSTR2_ADCRST (1 << 20)
350#define RCC_APBRSTR2_TIM17RST (1 << 18)
351#define RCC_APBRSTR2_TIM16RST (1 << 17)
352#define RCC_APBRSTR2_TIM15RST (1 << 16)
353#define RCC_APBRSTR2_TIM14RST (1 << 15)
354#define RCC_APBRSTR2_USART1RST (1 << 14)
355#define RCC_APBRSTR2_SPI1RST (1 << 12)
356#define RCC_APBRSTR2_TIM1RST (1 << 11)
357#define RCC_APBRSTR2_SYSCFGRST (1 << 0)
358/**@}*/
359/**@}*/
360
361/** @defgroup rcc_ahbenr_en RCC_AHBENR enable values
362@{*/
363#define RCC_AHBENR_RNGEN (1 << 18)
364#define RCC_AHBENR_AESEN (1 << 16)
365#define RCC_AHBENR_CRCEN (1 << 12)
366#define RCC_AHBENR_FLASHEN (1 << 8)
367#define RCC_AHBENR_DMA2EN (1 << 1)
368#define RCC_AHBENR_DMA1EN (1 << 0)
369#define RCC_AHBENR_DMAEN RCC_AHBENR_DMA1EN
370/**@}*/
371
372/** @defgroup rcc_apb1enr_en RCC_APBENRx enable values (full set)
373@{*/
374/** @defgroup rcc_apbenr1_en RCC_APBENR1 enable values
375@{*/
376#define RCC_APBENR1_LPTIM1EN (1 << 31)
377#define RCC_APBENR1_LPTIM2EN (1 << 30)
378#define RCC_APBENR1_DAC1EN (1 << 29)
379#define RCC_APBENR1_PWREN (1 << 28)
380#define RCC_APBENR1_DBGEN (1 << 27)
381#define RCC_APBENR1_UCPD2EN (1 << 26)
382#define RCC_APBENR1_UCPD1EN (1 << 25)
383#define RCC_APBENR1_CECEN (1 << 24)
384#define RCC_APBENR1_I2C2EN (1 << 22)
385#define RCC_APBENR1_I2C1EN (1 << 21)
386#define RCC_APBENR1_LPUART1EN (1 << 20)
387#define RCC_APBENR1_USART4EN (1 << 19)
388#define RCC_APBENR1_USART3EN (1 << 18)
389#define RCC_APBENR1_USART2EN (1 << 17)
390#define RCC_APBENR1_SPI2EN (1 << 14)
391#define RCC_APBENR1_WWDGEN (1 << 11)
392#define RCC_APBENR1_RTCAPBEN (1 << 10)
393#define RCC_APBENR1_TIM7EN (1 << 5)
394#define RCC_APBENR1_TIM6EN (1 << 4)
395#define RCC_APBENR1_TIM3EN (1 << 1)
396#define RCC_APBENR1_TIM2EN (1 << 0)
397/**@}*/
398
399/** @defgroup rcc_apbenr2_en RCC_APBENR2 enable values
400@{*/
401#define RCC_APBENR2_ADCEN (1 << 20)
402#define RCC_APBENR2_TIM17EN (1 << 18)
403#define RCC_APBENR2_TIM16EN (1 << 17)
404#define RCC_APBENR2_TIM16EN (1 << 17)
405#define RCC_APBENR2_TIM15EN (1 << 16)
406#define RCC_APBENR2_TIM14EN (1 << 15)
407#define RCC_APBENR2_USART1EN (1 << 14)
408#define RCC_APBENR2_SPI1EN (1 << 12)
409#define RCC_APBENR2_TIM1EN (1 << 11)
410#define RCC_APBENR2_SYSCFGEN (1 << 0)
411/**@}*/
412/**@}*/
413
414/** @defgroup rcc_aphbsmenr_en RCC_AHBSMENR enable in sleep/stop mode values
415@{*/
416#define RCC_AHBSMENR_RNGSMEN (1 << 18)
417#define RCC_AHBSMENR_AESSMEN (1 << 16)
418#define RCC_AHBSMENR_CRCSMEN (1 << 12)
419#define RCC_AHBSMENR_SRAMSMEN (1 << 9)
420#define RCC_AHBSMENR_FLASHSMEN (1 << 8)
421#define RCC_AHBSMENR_DMASMEN (1 << 0)
422/**@}*/
423
424/** @defgroup rcc_apbsmenr_en RCC_APBSMENR1 enable in sleep/stop mode values
425@{*/
426#define RCC_APBSMENR1_LPTIM1SMEN (1 << 31)
427#define RCC_APBSMENR1_LPTIM2SMEN (1 << 30)
428#define RCC_APBSMENR1_DAC1SMEN (1 << 29)
429#define RCC_APBSMENR1_PWRSMEN (1 << 28)
430#define RCC_APBSMENR1_DBGSMEN (1 << 27)
431#define RCC_APBSMENR1_UCPD2SMEN (1 << 26)
432#define RCC_APBSMENR1_UCPD1SMEN (1 << 25)
433#define RCC_APBSMENR1_CECSMEN (1 << 24)
434#define RCC_APBSMENR1_I2C2SMEN (1 << 22)
435#define RCC_APBSMENR1_I2C1SMEN (1 << 21)
436#define RCC_APBSMENR1_LPUART1SMEN (1 << 20)
437#define RCC_APBSMENR1_USART4SMEN (1 << 19)
438#define RCC_APBSMENR1_USART3SMEN (1 << 18)
439#define RCC_APBSMENR1_USART2SMEN (1 << 17)
440#define RCC_APBSMENR1_SPI2SMEN (1 << 14)
441#define RCC_APBSMENR1_WWDGSMEN (1 << 11)
442#define RCC_APBSMENR1_RTCAPBSMEN (1 << 10)
443#define RCC_APBSMENR1_TIM7SMEN (1 << 5)
444#define RCC_APBSMENR1_TIM6SMEN (1 << 4)
445#define RCC_APBSMENR1_TIM3SMEN (1 << 1)
446#define RCC_APBSMENR1_TIM2SMEN (1 << 0)
447/**@}*/
448
449/** @defgroup rcc_apbsmenr2_en RCC_APBSMENR2 enable in sleep/stop mode values
450@{*/
451#define RCC_APBSMENR2_ADCSMEN (1 << 20)
452#define RCC_APBSMENR2_TIM17SMEN (1 << 18)
453#define RCC_APBSMENR2_TIM16SMEN (1 << 17)
454#define RCC_APBSMENR2_TIM15SMEN (1 << 16)
455#define RCC_APBSMENR2_TIM14SMEN (1 << 15)
456#define RCC_APBSMENR2_USART1SMEN (1 << 14)
457#define RCC_APBSMENR2_SPI1SMEN (1 << 12)
458#define RCC_APBSMENR2_TIM1SMEN (1 << 11)
459#define RCC_APBSMENR2_SYSCFGSMEN (1 << 0)
460/**@}*/
461
462
463/** @defgroup rcc_ccipr CCIPR Peripherals Independent Clock Config Register
464@{*/
465#define RCC_CCIPR_ADCSEL_MASK 0x3
466#define RCC_CCIPR_ADCSEL_SHIFT 30
467/** @defgroup rcc_ccipr_adcsel ADCSEL
468@{*/
469#define RCC_CCIPR_ADCSEL_SYSCLK 0
470#define RCC_CCIPR_ADCSEL_PLLPCLK 1
471#define RCC_CCIPR_ADCSEL_HSI16 2
472/**@}*/
473
474#define RCC_CCIPR_RNGDIV_MASK 0x3
475#define RCC_CCIPR_RNGDIV_SHIFT 28
476/** @defgroup rcc_ccipr_rngdiv RNGDIV
477@{*/
478#define RCC_CCIPR_RNGDIV_1 0
479#define RCC_CCIPR_RNGDIV_2 1
480#define RCC_CCIPR_RNGDIV_4 2
481#define RCC_CCIPR_RNGDIV_8 3
482/**@}*/
483
484#define RCC_CCIPR_RNGSEL_MASK 0x3
485#define RCC_CCIPR_RNGSEL_SHIFT 26
486/** @defgroup rcc_ccipr_rngsel RNGSEL
487@{*/
488#define RCC_CCIPR_RNGSEL_NONE 0
489#define RCC_CCIPR_RNGSEL_HSI16 1
490#define RCC_CCIPR_RNGSEL_SYSCLK 2
491#define RCC_CCIPR_RNGSEL_PLLQCLK 3
492/**@}*/
493
494#define RCC_CCIPR_TIM15SEL_MASK 0x1
495#define RCC_CCIPR_TIM15SEL_SHIFT 24
496/** @defgroup rcc_ccipr_tim15sel TIM15SEL
497@{*/
498#define RCC_CCIPR_TIM15SEL_TIMPCLK 0
499#define RCC_CCIPR_TIM15SEL_PLLQCLK 1
500/**@}*/
501
502#define RCC_CCIPR_TIM1SEL_MASK 0x1
503#define RCC_CCIPR_TIM1SEL_SHIFT 22
504/** @defgroup rcc_ccipr_tim1sel TIM1SEL
505@{*/
506#define RCC_CCIPR_TIM1SEL_TIMPCLK 0
507#define RCC_CCIPR_TIM1SEL_PLLQCLK 1
508/**@}*/
509
510#define RCC_CCIPR_LPTIM2SEL_MASK 0x3
511#define RCC_CCIPR_LPTIM2SEL_SHIFT 20
512/** @defgroup rcc_ccipr_lptim2sel LPTIM2SEL LPTIM2 Clock source selection
513@{*/
514#define RCC_CCIPR_LPTIM2SEL_PCLK 0
515#define RCC_CCIPR_LPTIM2SEL_LSI 1
516#define RCC_CCIPR_LPTIM2SEL_HSI16 2
517#define RCC_CCIPR_LPTIM2SEL_LSE 3
518/**@}*/
519
520#define RCC_CCIPR_LPTIM1SEL_MASK 0x3
521#define RCC_CCIPR_LPTIM1SEL_SHIFT 18
522/** @defgroup rcc_ccipr_lptim1sel LPTIM1SEL LPTIM1 Clock source selection
523@{*/
524#define RCC_CCIPR_LPTIM1SEL_PCLK 0
525#define RCC_CCIPR_LPTIM1SEL_LSI 1
526#define RCC_CCIPR_LPTIM1SEL_HSI16 2
527#define RCC_CCIPR_LPTIM1SEL_LSE 3
528/**@}*/
529
530#define RCC_CCIPR_I2S1SEL_MASK 0x3
531#define RCC_CCIPR_I2S1SEL_SHIFT 14
532/** @defgroup rcc_ccipr_i2s1sel I2S1SEL I2S1 Clock source selection
533@{*/
534#define RCC_CCIPR_I2S1SEL_SYSCLK 0
535#define RCC_CCIPR_I2S1SEL_PLLPLCK 1
536#define RCC_CCIPR_I2S1SEL_HSI16 2
537#define RCC_CCIPR_I2S1SEL_I2S_CKIN 3
538/**@}*/
539
540#define RCC_CCIPR_I2CxSEL_MASK 0x3
541#define RCC_CCIPR_I2C1SEL_SHIFT 12
542#define RCC_CCIPR_I2C2SEL_SHIFT 14
543/** @defgroup rcc_ccipr_i2c1sel I2C1SEL I2C1 Clock source selection
544@{*/
545#define RCC_CCIPR_I2CxSEL_PCLK 0
546#define RCC_CCIPR_I2CxSEL_SYSCLK 1
547#define RCC_CCIPR_I2CxSEL_HSI16 2
548/**@}*/
549
550#define RCC_CCIPR_LPUARTxSEL_MASK 0x3
551#define RCC_CCIPR_LPUART1SEL_SHIFT 10
552#define RCC_CCIPR_LPUART2SEL_SHIFT 8
553/** @defgroup rcc_ccipr_lpuartxsel LPUARTxSEL LPUART1 Clock source selection
554@{*/
555#define RCC_CCIPR_LPUARTxSEL_PCLK 0
556#define RCC_CCIPR_LPUARTxSEL_SYSCLK 1
557#define RCC_CCIPR_LPUARTxSEL_HSI16 2
558#define RCC_CCIPR_LPUARTxSEL_LSE 3
559/**@}*/
560
561#define RCC_CCIPR_CECSEL_MASK 0x1
562#define RCC_CCIPR_CECSEL_SHIFT 6
563/** @defgroup rcc_ccipr_cecsel CECSEL CEC Clock souce selection
564@{*/
565#define RCC_CCIPR_CECSEL_HSI16 0
566#define RCC_CCIPR_CECSEL_LSE 1
567/**@}*/
568
569#define RCC_CCIPR_USARTxSEL_MASK RCC_CCIPR_LPUARTxSEL_MASK
570#define RCC_CCIPR_USART3SEL_SHIFT 4
571#define RCC_CCIPR_USART2SEL_SHIFT 2
572#define RCC_CCIPR_USART1SEL_SHIFT 0
573/** @defgroup rcc_ccipr_usartxsel USARTxSEL USARTx Clock source selection
574@{*/
575#define RCC_CCIPR_USARTxSEL_PCLK RCC_CCIPR_LPUARTxSEL_PCLK
576#define RCC_CCIPR_USARTxSEL_SYSCLK RCC_CCIPR_LPUARTxSEL_SYSCLK
577#define RCC_CCIPR_USARTxSEL_HSI16 RCC_CCIPR_LPUARTxSEL_HSI16
578#define RCC_CCIPR_USARTxSEL_LSE RCC_CCIPR_LPUARTxSEL_LSE
579/**@}*/
580
581/**@}*/
582
583/** @defgroup rcc_bdcr BDCR Backup Domain Control Register
584@{*/
585#define RCC_BDCR_LSCOSEL (1 << 25)
586#define RCC_BDCR_LSCOEN (1 << 24)
587#define RCC_BDCR_BDRST (1 << 16)
588#define RCC_BDCR_RTCEN (1 << 15)
589
590#define RCC_BDCR_RTCSEL_SHIFT 8
591#define RCC_BDCR_RTCSEL_MASK 0x3
592/** @defgroup rcc_bdcr_rtcsel RTCSEL RTC Clock source selection
593@{*/
594#define RCC_BDCR_RTCSEL_NONE 0
595#define RCC_BDCR_RTCSEL_LSE 1
596#define RCC_BDCR_RTCSEL_LSI 2
597#define RCC_BDCR_RTCSEL_HSE_DIV32 3
598/**@}*/
599
600#define RCC_BDCR_LSEDRV_SHIFT 3
601#define RCC_BDCR_LSEDRV_MASK 0x3
602/** @defgroup rcc_bdcr_lsedrv LSEDRV LSE Oscillator drive capacity
603@{*/
604#define RCC_BDCR_LSEDRV_LOW 0
605#define RCC_BDCR_LSEDRV_MEDLOW 1
606#define RCC_BDCR_LSEDRV_MEDHIGH 2
607#define RCC_BDCR_LSEDRV_HIGH 3
608/**@}*/
609
610#define RCC_BDCR_LSEBYP (1 << 2)
611#define RCC_BDCR_LSERDY (1 << 1)
612#define RCC_BDCR_LSEON (1 << 0)
613/**@}*/
614
615/** @defgroup rcc_csr CSR Control and Status Register
616@{*/
617#define RCC_CSR_LPWRRSTF (1 << 31)
618#define RCC_CSR_WWDGRSTF (1 << 30)
619#define RCC_CSR_IWDGRSTF (1 << 29)
620#define RCC_CSR_SFTRSTF (1 << 28)
621#define RCC_CSR_PWRRSTF (1 << 27)
622#define RCC_CSR_PINRSTF (1 << 26)
623#define RCC_CSR_OBLRSTF (1 << 25)
624#define RCC_CSR_RMVF (1 << 23)
625#define RCC_CSR_LSIRDY (1 << 1)
626#define RCC_CSR_LSION (1 << 0)
627/**@}*/
628
629/* --- Variable definitions ------------------------------------------------ */
630
631extern uint32_t rcc_ahb_frequency;
632extern uint32_t rcc_apb1_frequency;
633/*
634 * as done for F0, fake out apb2_frequency as the device does not really have
635 * apb2 clock.
636 */
637#define rcc_apb2_frequency rcc_apb1_frequency
638
639/* --- Function prototypes ------------------------------------------------- */
640
641#define _REG_BIT(offset, bit) (((offset) << 5) + (bit))
642
649};
650
658
665 RCC_DMA = _REG_BIT(RCC_AHBENR_OFFSET, 0), /* Compatibility */
666
697
707
714
722 SCC_DMA = _REG_BIT(RCC_AHBSMENR_OFFSET, 0), /* Compatibility */
723
753
763};
764
772
779 RST_DMA = _REG_BIT(RCC_AHBRSTR_OFFSET, 0), /* Compatibility */
780
809
819};
820
823
824 /* PLL as sysclock source cfg */
825 uint8_t pll_source;
826 uint8_t pll_div;
827 uint8_t pll_mul;
828 uint8_t pllp_div;
829 uint8_t pllq_div;
830 uint8_t pllr_div;
831
832 /* HSI as sysclock source cfg */
833 uint8_t hsisys_div;
834
835 uint8_t hpre;
836 uint8_t ppre;
841};
842
852
854
856
858
859void rcc_osc_on(enum rcc_osc osc);
860void rcc_osc_off(enum rcc_osc osc);
861
862void rcc_css_enable(void);
863void rcc_css_disable(void);
864void rcc_css_int_clear(void);
865int rcc_css_int_flag(void);
866
867void rcc_set_sysclk_source(enum rcc_osc osc);
870
871void rcc_set_pll_source(uint32_t pllsrc);
872void rcc_set_main_pll(uint32_t source, uint32_t pllm, uint32_t plln, uint32_t pllp, uint32_t pllq, uint32_t pllr);
873void rcc_enable_pllp(bool enable);
874void rcc_enable_pllq(bool enable);
875void rcc_enable_pllr(bool enable);
876
877void rcc_set_ppre(uint32_t ppre);
878void rcc_set_hpre(uint32_t hpre);
879void rcc_set_hsisys_div(uint32_t hsidiv);
880void rcc_set_mcopre(uint32_t mcopre);
881
882void rcc_clock_setup(const struct rcc_clock_scale *clock);
883
884void rcc_set_rng_clk_div(uint32_t rng_div);
885void rcc_set_peripheral_clk_sel(uint32_t periph, uint32_t sel);
886uint32_t rcc_get_usart_clk_freq(uint32_t usart);
887uint32_t rcc_get_timer_clk_freq(uint32_t timer);
888uint32_t rcc_get_i2c_clk_freq(uint32_t i2c);
889uint32_t rcc_get_spi_clk_freq(uint32_t spi);
890
892
893/**@}*/
894
895#endif
#define END_DECLS
Definition: common.h:34
#define BEGIN_DECLS
Definition: common.h:33
pwr_vos_scale
Definition: g0/pwr.h:181
void rcc_set_ppre(uint32_t ppre)
Configure APB peripheral clock prescaler.
Definition: rcc.c:387
void rcc_enable_pllr(bool enable)
Enable PLL R clock output.
Definition: rcc.c:374
int rcc_css_int_flag(void)
Definition: rcc.c:216
rcc_clock
Definition: g0/rcc.h:843
void rcc_enable_pllp(bool enable)
Enable PLL P clock output.
Definition: rcc.c:348
void rcc_set_main_pll(uint32_t source, uint32_t pllm, uint32_t plln, uint32_t pllp, uint32_t pllq, uint32_t pllr)
Configure pll source and output frequencies.
Definition: rcc.c:333
void rcc_css_disable(void)
Definition: rcc.c:206
enum rcc_osc rcc_system_clock_source(void)
Return the clock source which is used as system clock.
Definition: rcc.c:260
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:615
void rcc_set_pll_source(uint32_t pllsrc)
Configure pll source.
Definition: rcc.c:315
uint32_t rcc_get_timer_clk_freq(uint32_t timer)
Get the peripheral clock speed for the Timer at base specified.
Definition: rcc.c:590
uint32_t rcc_get_usart_clk_freq(uint32_t usart)
Get the peripheral clock speed for the USART at base specified.
Definition: rcc.c:570
void rcc_set_hsisys_div(uint32_t hsidiv)
Configure HSI16 clock division factor to feed SYSCLK.
Definition: rcc.c:413
rcc_periph_rst
Definition: g0/rcc.h:765
rcc_periph_clken
Definition: g0/rcc.h:651
void rcc_enable_pllq(bool enable)
Enable PLL Q clock output.
Definition: rcc.c:361
rcc_osc
Definition: g0/rcc.h:643
void rcc_set_peripheral_clk_sel(uint32_t periph, uint32_t sel)
Set the peripheral clock source.
Definition: rcc.c:503
void rcc_osc_on(enum rcc_osc osc)
Definition: rcc.c:128
uint32_t rcc_ahb_frequency
Definition: rcc.c:42
void rcc_osc_off(enum rcc_osc osc)
Definition: rcc.c:152
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:601
void rcc_clock_setup(const struct rcc_clock_scale *clock)
Setup sysclock with desired source (HSE/HSI/PLL/LSE/LSI).
Definition: rcc.c:439
const struct rcc_clock_scale rcc_clock_config[RCC_CLOCK_CONFIG_END]
Definition: rcc.c:45
#define _REG_BIT(offset, bit)
Definition: g0/rcc.h:641
uint32_t rcc_apb1_frequency
Definition: rcc.c:43
void rcc_wait_for_sysclk_status(enum rcc_osc osc)
Wait until system clock switched to given oscillator.
Definition: rcc.c:283
void rcc_css_int_clear(void)
Definition: rcc.c:211
void rcc_set_rng_clk_div(uint32_t rng_div)
Setup RNG Peripheral Clock Divider.
Definition: rcc.c:492
void rcc_css_enable(void)
Definition: rcc.c:201
void rcc_set_hpre(uint32_t hpre)
Configure AHB peripheral clock prescaler.
Definition: rcc.c:400
void rcc_set_mcopre(uint32_t mcopre)
Configure mco prescaler.
Definition: rcc.c:426
void rcc_set_sysclk_source(enum rcc_osc osc)
Set the Source for the System Clock.
Definition: rcc.c:225
@ RCC_CLOCK_CONFIG_HSE_12MHZ_PLL_64MHZ
Definition: g0/rcc.h:849
@ RCC_CLOCK_CONFIG_HSI_PLL_32MHZ
Definition: g0/rcc.h:847
@ RCC_CLOCK_CONFIG_HSI_4MHZ
Definition: g0/rcc.h:845
@ RCC_CLOCK_CONFIG_LSI_32KHZ
Definition: g0/rcc.h:844
@ RCC_CLOCK_CONFIG_HSI_PLL_64MHZ
Definition: g0/rcc.h:848
@ RCC_CLOCK_CONFIG_HSI_16MHZ
Definition: g0/rcc.h:846
@ RCC_CLOCK_CONFIG_END
Definition: g0/rcc.h:850
@ RST_CRS
Definition: g0/rcc.h:796
@ RST_DMA2
Definition: g0/rcc.h:777
@ RST_USART5
Definition: g0/rcc.h:802
@ RST_DMA1
Definition: g0/rcc.h:778
@ RST_LPTIM2
Definition: g0/rcc.h:782
@ RST_SPI1
Definition: g0/rcc.h:816
@ RST_I2C3
Definition: g0/rcc.h:789
@ RST_CEC
Definition: g0/rcc.h:788
@ RST_USART6
Definition: g0/rcc.h:801
@ RST_FDCAN
Definition: g0/rcc.h:800
@ RST_TIM16
Definition: g0/rcc.h:812
@ RST_RNG
Definition: g0/rcc.h:773
@ RST_TIM14
Definition: g0/rcc.h:814
@ RST_GPIOF
Definition: g0/rcc.h:766
@ RST_AES
Definition: g0/rcc.h:774
@ RST_SPI2
Definition: g0/rcc.h:798
@ RST_TIM15
Definition: g0/rcc.h:813
@ RST_FLASH
Definition: g0/rcc.h:776
@ RST_TIM3
Definition: g0/rcc.h:807
@ RST_TIM17
Definition: g0/rcc.h:811
@ RST_DMA
Definition: g0/rcc.h:779
@ RST_LPTIM1
Definition: g0/rcc.h:781
@ RST_GPIOA
Definition: g0/rcc.h:771
@ RST_GPIOC
Definition: g0/rcc.h:769
@ RST_TIM6
Definition: g0/rcc.h:805
@ RST_GPIOB
Definition: g0/rcc.h:770
@ RST_TIM1
Definition: g0/rcc.h:817
@ RST_SPI3
Definition: g0/rcc.h:797
@ RST_USART3
Definition: g0/rcc.h:794
@ RST_ADC
Definition: g0/rcc.h:810
@ RST_TIM7
Definition: g0/rcc.h:804
@ RST_TIM2
Definition: g0/rcc.h:808
@ RST_UCPD1
Definition: g0/rcc.h:787
@ RST_CRC
Definition: g0/rcc.h:775
@ RST_GPIOD
Definition: g0/rcc.h:768
@ RST_USB
Definition: g0/rcc.h:799
@ RST_TIM4
Definition: g0/rcc.h:806
@ RST_USART4
Definition: g0/rcc.h:793
@ RST_SYSCFG
Definition: g0/rcc.h:818
@ RST_LPUART2
Definition: g0/rcc.h:803
@ RST_GPIOE
Definition: g0/rcc.h:767
@ RST_I2C2
Definition: g0/rcc.h:790
@ RST_PWR
Definition: g0/rcc.h:784
@ RST_USART1
Definition: g0/rcc.h:815
@ RST_I2C1
Definition: g0/rcc.h:791
@ RST_LPUART1
Definition: g0/rcc.h:792
@ RST_UCPD2
Definition: g0/rcc.h:786
@ RST_DAC1
Definition: g0/rcc.h:783
@ RST_USART2
Definition: g0/rcc.h:795
@ RST_DBG
Definition: g0/rcc.h:785
@ SCC_CRC
Definition: g0/rcc.h:717
@ SCC_TIM14
Definition: g0/rcc.h:758
@ RCC_CRS
Definition: g0/rcc.h:682
@ SCC_SPI3
Definition: g0/rcc.h:740
@ RCC_RNG
Definition: g0/rcc.h:659
@ RCC_FLASH
Definition: g0/rcc.h:662
@ RCC_LPUART2
Definition: g0/rcc.h:691
@ SCC_GPIOD
Definition: g0/rcc.h:710
@ SCC_UCPD1
Definition: g0/rcc.h:730
@ RCC_SPI2
Definition: g0/rcc.h:684
@ RCC_WWDG
Definition: g0/rcc.h:687
@ SCC_TIM1
Definition: g0/rcc.h:761
@ RCC_TIM3
Definition: g0/rcc.h:695
@ SCC_SPI2
Definition: g0/rcc.h:741
@ SCC_TIM16
Definition: g0/rcc.h:756
@ RCC_TIM1
Definition: g0/rcc.h:705
@ SCC_ADC
Definition: g0/rcc.h:754
@ RCC_USART5
Definition: g0/rcc.h:690
@ SCC_LPTIM2
Definition: g0/rcc.h:725
@ SCC_CRS
Definition: g0/rcc.h:739
@ RCC_GPIOA
Definition: g0/rcc.h:657
@ RCC_CEC
Definition: g0/rcc.h:674
@ RCC_DMA
Definition: g0/rcc.h:665
@ SCC_FDCAN
Definition: g0/rcc.h:743
@ SCC_RNG
Definition: g0/rcc.h:715
@ RCC_TIM17
Definition: g0/rcc.h:699
@ RCC_DBG
Definition: g0/rcc.h:671
@ SCC_GPIOA
Definition: g0/rcc.h:713
@ SCC_DMA2
Definition: g0/rcc.h:720
@ RCC_FDCAN
Definition: g0/rcc.h:686
@ RCC_TIM2
Definition: g0/rcc.h:696
@ SCC_USART6
Definition: g0/rcc.h:746
@ SCC_TIM6
Definition: g0/rcc.h:750
@ SCC_TIM2
Definition: g0/rcc.h:752
@ SCC_UCPD2
Definition: g0/rcc.h:729
@ SCC_RTCAPB
Definition: g0/rcc.h:745
@ SCC_LPUART1
Definition: g0/rcc.h:735
@ SCC_TIM3
Definition: g0/rcc.h:751
@ RCC_PWR
Definition: g0/rcc.h:670
@ RCC_CRC
Definition: g0/rcc.h:661
@ SCC_CEC
Definition: g0/rcc.h:731
@ SCC_USART2
Definition: g0/rcc.h:738
@ RCC_RTCAPB
Definition: g0/rcc.h:688
@ RCC_TIM14
Definition: g0/rcc.h:702
@ SCC_USART3
Definition: g0/rcc.h:737
@ RCC_UCPD2
Definition: g0/rcc.h:672
@ SCC_I2C2
Definition: g0/rcc.h:733
@ SCC_USB
Definition: g0/rcc.h:742
@ RCC_USART1
Definition: g0/rcc.h:703
@ SCC_WWDG
Definition: g0/rcc.h:744
@ SCC_PWR
Definition: g0/rcc.h:727
@ RCC_DAC1
Definition: g0/rcc.h:669
@ SCC_SYSCFG
Definition: g0/rcc.h:762
@ SCC_TIM15
Definition: g0/rcc.h:757
@ RCC_TIM4
Definition: g0/rcc.h:694
@ RCC_I2C1
Definition: g0/rcc.h:677
@ RCC_USART4
Definition: g0/rcc.h:679
@ SCC_SPI1
Definition: g0/rcc.h:760
@ SCC_DBG
Definition: g0/rcc.h:728
@ SCC_DMA1
Definition: g0/rcc.h:721
@ SCC_USART4
Definition: g0/rcc.h:736
@ RCC_USB
Definition: g0/rcc.h:685
@ SCC_USART5
Definition: g0/rcc.h:747
@ SCC_SRAM
Definition: g0/rcc.h:718
@ RCC_UCPD1
Definition: g0/rcc.h:673
@ RCC_USART2
Definition: g0/rcc.h:681
@ SCC_GPIOE
Definition: g0/rcc.h:709
@ RCC_TIM16
Definition: g0/rcc.h:700
@ SCC_DMA
Definition: g0/rcc.h:722
@ SCC_USART1
Definition: g0/rcc.h:759
@ RCC_USART3
Definition: g0/rcc.h:680
@ SCC_TIM17
Definition: g0/rcc.h:755
@ SCC_I2C1
Definition: g0/rcc.h:734
@ RCC_SPI1
Definition: g0/rcc.h:704
@ RCC_SYSCFG
Definition: g0/rcc.h:706
@ SCC_GPIOC
Definition: g0/rcc.h:711
@ RCC_LPTIM2
Definition: g0/rcc.h:668
@ RCC_I2C2
Definition: g0/rcc.h:676
@ SCC_FLASH
Definition: g0/rcc.h:719
@ RCC_AES
Definition: g0/rcc.h:660
@ RCC_GPIOB
Definition: g0/rcc.h:656
@ RCC_TIM7
Definition: g0/rcc.h:692
@ RCC_LPTIM1
Definition: g0/rcc.h:667
@ RCC_GPIOF
Definition: g0/rcc.h:652
@ SCC_GPIOF
Definition: g0/rcc.h:708
@ RCC_GPIOC
Definition: g0/rcc.h:655
@ RCC_TIM6
Definition: g0/rcc.h:693
@ SCC_I2C3
Definition: g0/rcc.h:732
@ SCC_GPIOB
Definition: g0/rcc.h:712
@ RCC_DMA1
Definition: g0/rcc.h:664
@ RCC_SPI3
Definition: g0/rcc.h:683
@ SCC_LPUART2
Definition: g0/rcc.h:748
@ SCC_DAC1
Definition: g0/rcc.h:726
@ RCC_GPIOD
Definition: g0/rcc.h:654
@ RCC_TIM15
Definition: g0/rcc.h:701
@ RCC_I2C3
Definition: g0/rcc.h:675
@ RCC_GPIOE
Definition: g0/rcc.h:653
@ RCC_ADC
Definition: g0/rcc.h:698
@ SCC_TIM7
Definition: g0/rcc.h:749
@ RCC_USART6
Definition: g0/rcc.h:689
@ RCC_DMA2
Definition: g0/rcc.h:663
@ SCC_LPTIM1
Definition: g0/rcc.h:724
@ SCC_AES
Definition: g0/rcc.h:716
@ RCC_LPUART1
Definition: g0/rcc.h:678
@ RCC_HSI
Definition: g0/rcc.h:644
@ RCC_LSI
Definition: g0/rcc.h:648
@ RCC_PLL
Definition: g0/rcc.h:646
@ RCC_LSE
Definition: g0/rcc.h:647
@ RCC_HSE
Definition: g0/rcc.h:645
#define RCC_AHBRSTR_OFFSET
Definition: g0/rcc.h:47
#define RCC_APBSMENR2_OFFSET
Definition: g0/rcc.h:67
#define RCC_APBSMENR1_OFFSET
Definition: g0/rcc.h:65
#define RCC_IOPRSTR_OFFSET
Definition: g0/rcc.h:45
#define RCC_APBENR2_OFFSET
Definition: g0/rcc.h:59
#define RCC_AHBSMENR_OFFSET
Definition: g0/rcc.h:63
#define RCC_AHBENR_OFFSET
Definition: g0/rcc.h:55
#define RCC_APBRSTR1_OFFSET
Definition: g0/rcc.h:49
#define RCC_IOPSMENR_OFFSET
Definition: g0/rcc.h:61
#define RCC_APBRSTR2_OFFSET
Definition: g0/rcc.h:51
#define RCC_APBENR1_OFFSET
Definition: g0/rcc.h:57
#define RCC_IOPENR_OFFSET
Definition: g0/rcc.h:53
uint8_t ppre
Definition: g0/rcc.h:836
uint8_t pll_div
Definition: g0/rcc.h:826
uint8_t flash_waitstates
Definition: g0/rcc.h:837
uint8_t pllr_div
Definition: g0/rcc.h:830
uint8_t pllq_div
Definition: g0/rcc.h:829
uint8_t pll_mul
Definition: g0/rcc.h:827
uint32_t ahb_frequency
Definition: g0/rcc.h:839
uint8_t pllp_div
Definition: g0/rcc.h:828
enum pwr_vos_scale voltage_scale
Definition: g0/rcc.h:838
enum rcc_osc sysclock_source
Definition: g0/rcc.h:822
uint8_t hpre
Definition: g0/rcc.h:835
uint32_t apb_frequency
Definition: g0/rcc.h:840
uint8_t pll_source
Definition: g0/rcc.h:825
uint8_t hsisys_div
Definition: g0/rcc.h:833