40#ifndef LIBOPENCM3_RCC_H
41#define LIBOPENCM3_RCC_H
48#define RCC_CR MMIO32(RCC_BASE + 0x00)
49#define RCC_CFGR MMIO32(RCC_BASE + 0x04)
50#define RCC_CIR MMIO32(RCC_BASE + 0x08)
51#define RCC_APB2RSTR MMIO32(RCC_BASE + 0x0c)
52#define RCC_APB1RSTR MMIO32(RCC_BASE + 0x10)
53#define RCC_AHBENR MMIO32(RCC_BASE + 0x14)
54#define RCC_APB2ENR MMIO32(RCC_BASE + 0x18)
55#define RCC_APB1ENR MMIO32(RCC_BASE + 0x1c)
56#define RCC_BDCR MMIO32(RCC_BASE + 0x20)
57#define RCC_CSR MMIO32(RCC_BASE + 0x24)
58#define RCC_AHBRSTR MMIO32(RCC_BASE + 0x28)
59#define RCC_CFGR2 MMIO32(RCC_BASE + 0x2c)
63#define RCC_CR_PLL3RDY (1 << 29)
64#define RCC_CR_PLL3ON (1 << 28)
65#define RCC_CR_PLL2RDY (1 << 27)
66#define RCC_CR_PLL2ON (1 << 26)
67#define RCC_CR_PLLRDY (1 << 25)
68#define RCC_CR_PLLON (1 << 24)
69#define RCC_CR_CSSON (1 << 19)
70#define RCC_CR_HSEBYP (1 << 18)
71#define RCC_CR_HSERDY (1 << 17)
72#define RCC_CR_HSEON (1 << 16)
75#define RCC_CR_HSIRDY (1 << 1)
76#define RCC_CR_HSION (1 << 0)
80#define RCC_CFGR_OTGFSPRE (1 << 22)
81#define RCC_CFGR_USBPRE (1 << 22)
83#define RCC_CFGR_PLLMUL_SHIFT 18
84#define RCC_CFGR_PLLMUL (0xF << RCC_CFGR_PLLMUL_SHIFT)
86#define RCC_CFGR_PLLXTPRE (1 << 17)
87#define RCC_CFGR_PLLSRC (1 << 16)
89#define RCC_CFGR_ADCPRE_SHIFT 14
90#define RCC_CFGR_ADCPRE (3 << RCC_CFGR_ADCPRE_SHIFT)
92#define RCC_CFGR_PPRE2_SHIFT 11
93#define RCC_CFGR_PPRE2 (7 << RCC_CFGR_PPRE2_SHIFT)
95#define RCC_CFGR_PPRE1_SHIFT 8
96#define RCC_CFGR_PPRE1 (7 << RCC_CFGR_PPRE1_SHIFT)
98#define RCC_CFGR_HPRE_SHIFT 4
99#define RCC_CFGR_HPRE (0xF << RCC_CFGR_HPRE_SHIFT)
101#define RCC_CFGR_SWS_SHIFT 2
102#define RCC_CFGR_SWS (3 << RCC_CFGR_SWS_SHIFT)
104#define RCC_CFGR_SW_SHIFT 0
105#define RCC_CFGR_SW (3 << RCC_CFGR_SW_SHIFT)
112#define RCC_CFGR_MCO_SHIFT 24
113#define RCC_CFGR_MCO_MASK 0xf
114#define RCC_CFGR_MCO_NOCLK 0x0
115#define RCC_CFGR_MCO_SYSCLK 0x4
116#define RCC_CFGR_MCO_HSI 0x5
117#define RCC_CFGR_MCO_HSE 0x6
118#define RCC_CFGR_MCO_PLL_DIV2 0x7
119#define RCC_CFGR_MCO_PLL2 0x8
120#define RCC_CFGR_MCO_PLL3_DIV2 0x9
121#define RCC_CFGR_MCO_XT1 0xa
122#define RCC_CFGR_MCO_PLL3 0xb
130#define RCC_CFGR_USBPRE_PLL_CLK_DIV1_5 0x0
131#define RCC_CFGR_USBPRE_PLL_CLK_NODIV 0x1
135#define RCC_CFGR_USBPRE_PLL_VCO_CLK_DIV3 0x0
136#define RCC_CFGR_USBPRE_PLL_VCO_CLK_DIV2 0x1
143#define RCC_CFGR_PLLMUL_PLL_CLK_MUL2 0x0
144#define RCC_CFGR_PLLMUL_PLL_CLK_MUL3 0x1
145#define RCC_CFGR_PLLMUL_PLL_CLK_MUL4 0x2
146#define RCC_CFGR_PLLMUL_PLL_CLK_MUL5 0x3
147#define RCC_CFGR_PLLMUL_PLL_CLK_MUL6 0x4
148#define RCC_CFGR_PLLMUL_PLL_CLK_MUL7 0x5
149#define RCC_CFGR_PLLMUL_PLL_CLK_MUL8 0x6
150#define RCC_CFGR_PLLMUL_PLL_CLK_MUL9 0x7
151#define RCC_CFGR_PLLMUL_PLL_CLK_MUL10 0x8
152#define RCC_CFGR_PLLMUL_PLL_CLK_MUL11 0x9
153#define RCC_CFGR_PLLMUL_PLL_CLK_MUL12 0xa
154#define RCC_CFGR_PLLMUL_PLL_CLK_MUL13 0xb
155#define RCC_CFGR_PLLMUL_PLL_CLK_MUL14 0xc
156#define RCC_CFGR_PLLMUL_PLL_CLK_MUL15 0xd
157#define RCC_CFGR_PLLMUL_PLL_CLK_MUL6_5 0xd
159#define RCC_CFGR_PLLMUL_PLL_CLK_MUL16 0xe
169#define RCC_CFGR_PLLXTPRE_HSE_CLK 0x0
170#define RCC_CFGR_PLLXTPRE_HSE_CLK_DIV2 0x1
178#define RCC_CFGR_PLLSRC_HSI_CLK_DIV2 0x0
179#define RCC_CFGR_PLLSRC_HSE_CLK 0x1
180#define RCC_CFGR_PLLSRC_PREDIV1_CLK 0x1
189#define RCC_CFGR_ADCPRE_DIV2 0x0
190#define RCC_CFGR_ADCPRE_DIV4 0x1
191#define RCC_CFGR_ADCPRE_DIV6 0x2
192#define RCC_CFGR_ADCPRE_DIV8 0x3
195#define RCC_CFGR_PPRE2_SHIFT 11
196#define RCC_CFGR_PPRE2_MASK 0x7
197#define RCC_CFGR_PPRE1_SHIFT 8
198#define RCC_CFGR_PPRE1_MASK 0x7
203#define RCC_CFGR_PPRE_NODIV 0x0
204#define RCC_CFGR_PPRE_DIV2 0x4
205#define RCC_CFGR_PPRE_DIV4 0x5
206#define RCC_CFGR_PPRE_DIV8 0x6
207#define RCC_CFGR_PPRE_DIV16 0x7
215#define RCC_CFGR_HPRE_NODIV 0x0
216#define RCC_CFGR_HPRE_DIV2 0x8
217#define RCC_CFGR_HPRE_DIV4 0x9
218#define RCC_CFGR_HPRE_DIV8 0xa
219#define RCC_CFGR_HPRE_DIV16 0xb
220#define RCC_CFGR_HPRE_DIV64 0xc
221#define RCC_CFGR_HPRE_DIV128 0xd
222#define RCC_CFGR_HPRE_DIV256 0xe
223#define RCC_CFGR_HPRE_DIV512 0xf
227#define RCC_CFGR_SWS_SYSCLKSEL_HSICLK 0x0
228#define RCC_CFGR_SWS_SYSCLKSEL_HSECLK 0x1
229#define RCC_CFGR_SWS_SYSCLKSEL_PLLCLK 0x2
236#define RCC_CFGR_SW_SYSCLKSEL_HSICLK 0x0
237#define RCC_CFGR_SW_SYSCLKSEL_HSECLK 0x1
238#define RCC_CFGR_SW_SYSCLKSEL_PLLCLK 0x2
246#define RCC_CFGR_ADCPRE_PCLK2_DIV2 0x0
247#define RCC_CFGR_ADCPRE_PCLK2_DIV4 0x1
248#define RCC_CFGR_ADCPRE_PCLK2_DIV6 0x2
249#define RCC_CFGR_ADCPRE_PCLK2_DIV8 0x3
251#define RCC_CFGR_PPRE2_HCLK_NODIV 0x0
252#define RCC_CFGR_PPRE2_HCLK_DIV2 0x4
253#define RCC_CFGR_PPRE2_HCLK_DIV4 0x5
254#define RCC_CFGR_PPRE2_HCLK_DIV8 0x6
255#define RCC_CFGR_PPRE2_HCLK_DIV16 0x7
257#define RCC_CFGR_PPRE1_HCLK_NODIV 0x0
258#define RCC_CFGR_PPRE1_HCLK_DIV2 0x4
259#define RCC_CFGR_PPRE1_HCLK_DIV4 0x5
260#define RCC_CFGR_PPRE1_HCLK_DIV8 0x6
261#define RCC_CFGR_PPRE1_HCLK_DIV16 0x7
263#define RCC_CFGR_HPRE_SYSCLK_NODIV 0x0
264#define RCC_CFGR_HPRE_SYSCLK_DIV2 0x8
265#define RCC_CFGR_HPRE_SYSCLK_DIV4 0x9
266#define RCC_CFGR_HPRE_SYSCLK_DIV8 0xa
267#define RCC_CFGR_HPRE_SYSCLK_DIV16 0xb
268#define RCC_CFGR_HPRE_SYSCLK_DIV64 0xc
269#define RCC_CFGR_HPRE_SYSCLK_DIV128 0xd
270#define RCC_CFGR_HPRE_SYSCLK_DIV256 0xe
271#define RCC_CFGR_HPRE_SYSCLK_DIV512 0xf
278#define RCC_CIR_CSSC (1 << 23)
281#define RCC_CIR_PLL3RDYC (1 << 22)
282#define RCC_CIR_PLL2RDYC (1 << 21)
283#define RCC_CIR_PLLRDYC (1 << 20)
284#define RCC_CIR_HSERDYC (1 << 19)
285#define RCC_CIR_HSIRDYC (1 << 18)
286#define RCC_CIR_LSERDYC (1 << 17)
287#define RCC_CIR_LSIRDYC (1 << 16)
290#define RCC_CIR_PLL3RDYIE (1 << 14)
291#define RCC_CIR_PLL2RDYIE (1 << 13)
292#define RCC_CIR_PLLRDYIE (1 << 12)
293#define RCC_CIR_HSERDYIE (1 << 11)
294#define RCC_CIR_HSIRDYIE (1 << 10)
295#define RCC_CIR_LSERDYIE (1 << 9)
296#define RCC_CIR_LSIRDYIE (1 << 8)
299#define RCC_CIR_CSSF (1 << 7)
302#define RCC_CIR_PLL3RDYF (1 << 6)
303#define RCC_CIR_PLL2RDYF (1 << 5)
304#define RCC_CIR_PLLRDYF (1 << 4)
305#define RCC_CIR_HSERDYF (1 << 3)
306#define RCC_CIR_HSIRDYF (1 << 2)
307#define RCC_CIR_LSERDYF (1 << 1)
308#define RCC_CIR_LSIRDYF (1 << 0)
316#define RCC_APB2RSTR_TIM17RST (1 << 18)
317#define RCC_APB2RSTR_TIM16RST (1 << 17)
318#define RCC_APB2RSTR_TIM15RST (1 << 16)
319#define RCC_APB2RSTR_ADC3RST (1 << 15)
320#define RCC_APB2RSTR_USART1RST (1 << 14)
321#define RCC_APB2RSTR_TIM8RST (1 << 13)
322#define RCC_APB2RSTR_SPI1RST (1 << 12)
323#define RCC_APB2RSTR_TIM1RST (1 << 11)
324#define RCC_APB2RSTR_ADC2RST (1 << 10)
325#define RCC_APB2RSTR_ADC1RST (1 << 9)
326#define RCC_APB2RSTR_IOPGRST (1 << 8)
327#define RCC_APB2RSTR_IOPFRST (1 << 7)
328#define RCC_APB2RSTR_IOPERST (1 << 6)
329#define RCC_APB2RSTR_IOPDRST (1 << 5)
330#define RCC_APB2RSTR_IOPCRST (1 << 4)
331#define RCC_APB2RSTR_IOPBRST (1 << 3)
332#define RCC_APB2RSTR_IOPARST (1 << 2)
333#define RCC_APB2RSTR_AFIORST (1 << 0)
342#define RCC_APB1RSTR_DACRST (1 << 29)
343#define RCC_APB1RSTR_PWRRST (1 << 28)
344#define RCC_APB1RSTR_BKPRST (1 << 27)
345#define RCC_APB1RSTR_CAN2RST (1 << 26)
346#define RCC_APB1RSTR_CAN1RST (1 << 25)
347#define RCC_APB1RSTR_CANRST (1 << 25)
349#define RCC_APB1RSTR_USBRST (1 << 23)
350#define RCC_APB1RSTR_I2C2RST (1 << 22)
351#define RCC_APB1RSTR_I2C1RST (1 << 21)
352#define RCC_APB1RSTR_UART5RST (1 << 20)
353#define RCC_APB1RSTR_UART4RST (1 << 19)
354#define RCC_APB1RSTR_USART3RST (1 << 18)
355#define RCC_APB1RSTR_USART2RST (1 << 17)
356#define RCC_APB1RSTR_SPI3RST (1 << 15)
357#define RCC_APB1RSTR_SPI2RST (1 << 14)
358#define RCC_APB1RSTR_WWDGRST (1 << 11)
359#define RCC_APB1RSTR_TIM7RST (1 << 5)
360#define RCC_APB1RSTR_TIM6RST (1 << 4)
361#define RCC_APB1RSTR_TIM5RST (1 << 3)
362#define RCC_APB1RSTR_TIM4RST (1 << 2)
363#define RCC_APB1RSTR_TIM3RST (1 << 1)
364#define RCC_APB1RSTR_TIM2RST (1 << 0)
373#define RCC_AHBENR_ETHMACENRX (1 << 16)
374#define RCC_AHBENR_ETHMACENTX (1 << 15)
375#define RCC_AHBENR_ETHMACEN (1 << 14)
376#define RCC_AHBENR_OTGFSEN (1 << 12)
377#define RCC_AHBENR_SDIOEN (1 << 10)
378#define RCC_AHBENR_FSMCEN (1 << 8)
379#define RCC_AHBENR_CRCEN (1 << 6)
380#define RCC_AHBENR_FLITFEN (1 << 4)
381#define RCC_AHBENR_SRAMEN (1 << 2)
382#define RCC_AHBENR_DMA2EN (1 << 1)
383#define RCC_AHBENR_DMA1EN (1 << 0)
392#define RCC_APB2ENR_TIM17EN (1 << 18)
393#define RCC_APB2ENR_TIM16EN (1 << 17)
394#define RCC_APB2ENR_TIM15EN (1 << 16)
395#define RCC_APB2ENR_ADC3EN (1 << 15)
396#define RCC_APB2ENR_USART1EN (1 << 14)
397#define RCC_APB2ENR_TIM8EN (1 << 13)
398#define RCC_APB2ENR_SPI1EN (1 << 12)
399#define RCC_APB2ENR_TIM1EN (1 << 11)
400#define RCC_APB2ENR_ADC2EN (1 << 10)
401#define RCC_APB2ENR_ADC1EN (1 << 9)
402#define RCC_APB2ENR_IOPGEN (1 << 8)
403#define RCC_APB2ENR_IOPFEN (1 << 7)
404#define RCC_APB2ENR_IOPEEN (1 << 6)
405#define RCC_APB2ENR_IOPDEN (1 << 5)
406#define RCC_APB2ENR_IOPCEN (1 << 4)
407#define RCC_APB2ENR_IOPBEN (1 << 3)
408#define RCC_APB2ENR_IOPAEN (1 << 2)
409#define RCC_APB2ENR_AFIOEN (1 << 0)
418#define RCC_APB1ENR_DACEN (1 << 29)
419#define RCC_APB1ENR_PWREN (1 << 28)
420#define RCC_APB1ENR_BKPEN (1 << 27)
421#define RCC_APB1ENR_CAN2EN (1 << 26)
422#define RCC_APB1ENR_CAN1EN (1 << 25)
423#define RCC_APB1ENR_CANEN (1 << 25)
425#define RCC_APB1ENR_USBEN (1 << 23)
426#define RCC_APB1ENR_I2C2EN (1 << 22)
427#define RCC_APB1ENR_I2C1EN (1 << 21)
428#define RCC_APB1ENR_UART5EN (1 << 20)
429#define RCC_APB1ENR_UART4EN (1 << 19)
430#define RCC_APB1ENR_USART3EN (1 << 18)
431#define RCC_APB1ENR_USART2EN (1 << 17)
432#define RCC_APB1ENR_SPI3EN (1 << 15)
433#define RCC_APB1ENR_SPI2EN (1 << 14)
434#define RCC_APB1ENR_WWDGEN (1 << 11)
435#define RCC_APB1ENR_TIM7EN (1 << 5)
436#define RCC_APB1ENR_TIM6EN (1 << 4)
437#define RCC_APB1ENR_TIM5EN (1 << 3)
438#define RCC_APB1ENR_TIM4EN (1 << 2)
439#define RCC_APB1ENR_TIM3EN (1 << 1)
440#define RCC_APB1ENR_TIM2EN (1 << 0)
445#define RCC_BDCR_BDRST (1 << 16)
446#define RCC_BDCR_RTCEN (1 << 15)
448#define RCC_BDCR_LSEBYP (1 << 2)
449#define RCC_BDCR_LSERDY (1 << 1)
450#define RCC_BDCR_LSEON (1 << 0)
454#define RCC_CSR_LPWRRSTF (1 << 31)
455#define RCC_CSR_WWDGRSTF (1 << 30)
456#define RCC_CSR_IWDGRSTF (1 << 29)
457#define RCC_CSR_SFTRSTF (1 << 28)
458#define RCC_CSR_PORRSTF (1 << 27)
459#define RCC_CSR_PINRSTF (1 << 26)
460#define RCC_CSR_RMVF (1 << 24)
461#define RCC_CSR_RESET_FLAGS (RCC_CSR_LPWRRSTF | RCC_CSR_WWDGRSTF |\
462 RCC_CSR_IWDGRSTF | RCC_CSR_SFTRSTF | RCC_CSR_PORRSTF |\
464#define RCC_CSR_LSIRDY (1 << 1)
465#define RCC_CSR_LSION (1 << 0)
473#define RCC_AHBRSTR_ETHMACRST (1 << 14)
474#define RCC_AHBRSTR_OTGFSRST (1 << 12)
480#define RCC_CFGR2_I2S3SRC_SYSCLK 0x0
481#define RCC_CFGR2_I2S3SRC_PLL3_VCO_CLK 0x1
484#define RCC_CFGR2_I2S2SRC_SYSCLK 0x0
485#define RCC_CFGR2_I2S2SRC_PLL3_VCO_CLK 0x1
486#define RCC_CFGR2_I2S2SRC (1 << 17)
489#define RCC_CFGR2_PREDIV1SRC_HSE_CLK 0x0
490#define RCC_CFGR2_PREDIV1SRC_PLL2_CLK 0x1
491#define RCC_CFGR2_PREDIV1SRC (1 << 16)
493#define RCC_CFGR2_PLL3MUL_SHIFT 12
494#define RCC_CFGR2_PLL3MUL (0xF << RCC_CFGR2_PLL3MUL_SHIFT)
496#define RCC_CFGR2_PLL2MUL_SHIFT 8
497#define RCC_CFGR2_PLL2MUL (0xF << RCC_CFGR2_PLL2MUL_SHIFT)
499#define RCC_CFGR2_PREDIV2_SHIFT 4
500#define RCC_CFGR2_PREDIV2 (0xF << RCC_CFGR2_PREDIV2_SHIFT)
502#define RCC_CFGR2_PREDIV1_SHIFT 0
503#define RCC_CFGR2_PREDIV1 (0xF << RCC_CFGR2_PREDIV1_SHIFT)
506#define RCC_CFGR2_PLL3MUL_PLL3_CLK_MUL8 0x6
507#define RCC_CFGR2_PLL3MUL_PLL3_CLK_MUL9 0x7
508#define RCC_CFGR2_PLL3MUL_PLL3_CLK_MUL10 0x8
509#define RCC_CFGR2_PLL3MUL_PLL3_CLK_MUL11 0x9
510#define RCC_CFGR2_PLL3MUL_PLL3_CLK_MUL12 0xa
511#define RCC_CFGR2_PLL3MUL_PLL3_CLK_MUL13 0xb
512#define RCC_CFGR2_PLL3MUL_PLL3_CLK_MUL14 0xc
513#define RCC_CFGR2_PLL3MUL_PLL3_CLK_MUL16 0xe
514#define RCC_CFGR2_PLL3MUL_PLL3_CLK_MUL20 0xf
517#define RCC_CFGR2_PLL2MUL_PLL2_CLK_MUL8 0x6
518#define RCC_CFGR2_PLL2MUL_PLL2_CLK_MUL9 0x7
519#define RCC_CFGR2_PLL2MUL_PLL2_CLK_MUL10 0x8
520#define RCC_CFGR2_PLL2MUL_PLL2_CLK_MUL11 0x9
521#define RCC_CFGR2_PLL2MUL_PLL2_CLK_MUL12 0xa
522#define RCC_CFGR2_PLL2MUL_PLL2_CLK_MUL13 0xb
523#define RCC_CFGR2_PLL2MUL_PLL2_CLK_MUL14 0xc
524#define RCC_CFGR2_PLL2MUL_PLL2_CLK_MUL16 0xe
525#define RCC_CFGR2_PLL2MUL_PLL2_CLK_MUL20 0xf
528#define RCC_CFGR2_PREDIV_NODIV 0x0
529#define RCC_CFGR2_PREDIV_DIV2 0x1
530#define RCC_CFGR2_PREDIV_DIV3 0x2
531#define RCC_CFGR2_PREDIV_DIV4 0x3
532#define RCC_CFGR2_PREDIV_DIV5 0x4
533#define RCC_CFGR2_PREDIV_DIV6 0x5
534#define RCC_CFGR2_PREDIV_DIV7 0x6
535#define RCC_CFGR2_PREDIV_DIV8 0x7
536#define RCC_CFGR2_PREDIV_DIV9 0x8
537#define RCC_CFGR2_PREDIV_DIV10 0x9
538#define RCC_CFGR2_PREDIV_DIV11 0xa
539#define RCC_CFGR2_PREDIV_DIV12 0xb
540#define RCC_CFGR2_PREDIV_DIV13 0xc
541#define RCC_CFGR2_PREDIV_DIV14 0xd
542#define RCC_CFGR2_PREDIV_DIV15 0xe
543#define RCC_CFGR2_PREDIV_DIV16 0xf
546#define RCC_CFGR2_PREDIV2_NODIV 0x0
547#define RCC_CFGR2_PREDIV2_DIV2 0x1
548#define RCC_CFGR2_PREDIV2_DIV3 0x2
549#define RCC_CFGR2_PREDIV2_DIV4 0x3
550#define RCC_CFGR2_PREDIV2_DIV5 0x4
551#define RCC_CFGR2_PREDIV2_DIV6 0x5
552#define RCC_CFGR2_PREDIV2_DIV7 0x6
553#define RCC_CFGR2_PREDIV2_DIV8 0x7
554#define RCC_CFGR2_PREDIV2_DIV9 0x8
555#define RCC_CFGR2_PREDIV2_DIV10 0x9
556#define RCC_CFGR2_PREDIV2_DIV11 0xa
557#define RCC_CFGR2_PREDIV2_DIV12 0xb
558#define RCC_CFGR2_PREDIV2_DIV13 0xc
559#define RCC_CFGR2_PREDIV2_DIV14 0xd
560#define RCC_CFGR2_PREDIV2_DIV15 0xe
561#define RCC_CFGR2_PREDIV2_DIV16 0xf
574#define _REG_BIT(base, bit) (((base) << 5) + (bit))
#define LIBOPENCM3_DEPRECATED(x)
int rcc_osc_ready_int_flag(enum rcc_osc osc)
RCC Read the Oscillator Ready Interrupt Flag.
void rcc_clock_setup_in_hse_8mhz_out_72mhz(void) LIBOPENCM3_DEPRECATED("use rcc_clock_setup_pll( &rcc_hse_configs[RCC_CLOCK_HSE8_72MHZ])")
void rcc_clock_setup_in_hsi_out_24mhz(void) LIBOPENCM3_DEPRECATED("use rcc_clock_setup_pll( &rcc_hsi_configs[RCC_CLOCK_HSI_24MHZ])")
int rcc_css_int_flag(void)
RCC Read the Clock Security System Interrupt Flag.
void rcc_set_adcpre(uint32_t adcpre)
ADC Setup the A/D Clock.
void rcc_set_rtc_clock_source(enum rcc_osc clock_source)
RCC Set the Source for the RTC clock.
void rcc_osc_ready_int_clear(enum rcc_osc osc)
RCC Clear the Oscillator Ready Interrupt Flag.
void rcc_css_disable(void)
RCC Disable the Clock Security System.
uint32_t rcc_get_spi_clk_freq(uint32_t spi)
void rcc_set_sysclk_source(uint32_t clk)
RCC Set the Source for the System Clock.
void rcc_set_prediv1_source(uint32_t rccsrc)
uint32_t rcc_apb2_frequency
void rcc_set_pll_source(uint32_t pllsrc)
RCC Set the PLL Clock Source.
void rcc_set_prediv1(uint32_t prediv)
uint32_t rcc_get_timer_clk_freq(uint32_t timer)
Get the peripheral clock speed for the Timer at base specified.
uint32_t rcc_system_clock_source(void)
RCC Get the System Clock Source.
void rcc_set_prediv2(uint32_t prediv)
uint32_t rcc_get_usart_clk_freq(uint32_t usart)
Get the peripheral clock speed for the USART at base specified.
void rcc_clock_setup_pll(const struct rcc_clock_scale *clock)
Switch sysclock to PLL with the given parameters.
const struct rcc_clock_scale rcc_hsi_configs[RCC_CLOCK_HSI_END]
void rcc_set_pll3_multiplication_factor(uint32_t mul)
RCC Set the PLL3 Multiplication Factor.
void rcc_set_pll2_multiplication_factor(uint32_t mul)
RCC Set the PLL2 Multiplication Factor.
void rcc_osc_ready_int_enable(enum rcc_osc osc)
RCC Enable the Oscillator Ready Interrupt.
void rcc_clock_setup_in_hse_8mhz_out_24mhz(void) LIBOPENCM3_DEPRECATED("use rcc_clock_setup_pll( &rcc_hse_configs[RCC_CLOCK_HSE8_24MHZ])")
void rcc_osc_ready_int_disable(enum rcc_osc osc)
RCC Disable the Oscillator Ready Interrupt.
void rcc_osc_on(enum rcc_osc osc)
RCC Turn on an Oscillator.
#define _REG_BIT(base, bit)
uint32_t rcc_ahb_frequency
void rcc_osc_off(enum rcc_osc osc)
RCC Turn off an Oscillator.
void rcc_clock_setup_in_hsi_out_48mhz(void) LIBOPENCM3_DEPRECATED("use rcc_clock_setup_pll( &rcc_hsi_configs[RCC_CLOCK_HSI_48MHZ])")
uint32_t rcc_get_i2c_clk_freq(uint32_t i2c)
Get the peripheral clock speed for the I2C device at base specified.
void rcc_set_pll_multiplication_factor(uint32_t mul)
RCC Set the PLL Multiplication Factor.
const struct rcc_clock_scale rcc_hse_configs[RCC_CLOCK_HSE_END]
void rcc_backupdomain_reset(void)
RCC Reset the Backup Domain.
uint32_t rcc_apb1_frequency
Set the default clock frequencies.
void rcc_clock_setup_in_hse_25mhz_out_72mhz(void) LIBOPENCM3_DEPRECATED("use rcc_clock_setup_pll( &rcc_hse_configs[RCC_CLOCK_HSE25_72MHZ])")
void rcc_set_ppre1(uint32_t ppre1)
RCC Set the APB1 Prescale Factor.
void rcc_css_int_clear(void)
RCC Clear the Clock Security System Interrupt Flag.
void rcc_clock_setup_in_hsi_out_64mhz(void) LIBOPENCM3_DEPRECATED("use rcc_clock_setup_pll( &rcc_hsi_configs[RCC_CLOCK_HSI_64MHZ])")
void rcc_clock_setup_in_hse_12mhz_out_72mhz(void) LIBOPENCM3_DEPRECATED("use rcc_clock_setup_pll( &rcc_hse_configs[RCC_CLOCK_HSE12_72MHZ])")
void rcc_enable_rtc_clock(void)
RCC Enable the RTC clock.
void rcc_set_ppre2(uint32_t ppre2)
RCC Set the APB2 Prescale Factor.
void rcc_set_usbpre(uint32_t usbpre)
RCC Set the USB Prescale Factor.
void rcc_css_enable(void)
RCC Enable the Clock Security System.
void rcc_set_hpre(uint32_t hpre)
RCC Set the AHB Prescale Factor.
void rcc_set_pllxtpre(uint32_t pllxtpre)
RCC Set the HSE Frequency Divider used as PLL Clock Source.
void rcc_clock_setup_in_hse_16mhz_out_72mhz(void) LIBOPENCM3_DEPRECATED("use rcc_clock_setup_pll( &rcc_hse_configs[RCC_CLOCK_HSE16_72MHZ])")
uint32_t rcc_rtc_clock_enabled_flag(void)
RCC RTC Clock Enabled Flag.