43#ifndef LIBOPENCM3_RCC_H
44#define LIBOPENCM3_RCC_H
48#define RCC_CR MMIO32(RCC_BASE + 0x00)
49#define RCC_PLLCFGR MMIO32(RCC_BASE + 0x04)
50#define RCC_CFGR MMIO32(RCC_BASE + 0x08)
51#define RCC_CIR MMIO32(RCC_BASE + 0x0c)
52#define RCC_AHB1RSTR MMIO32(RCC_BASE + 0x10)
53#define RCC_AHB2RSTR MMIO32(RCC_BASE + 0x14)
54#define RCC_AHB3RSTR MMIO32(RCC_BASE + 0x18)
56#define RCC_APB1RSTR MMIO32(RCC_BASE + 0x20)
57#define RCC_APB2RSTR MMIO32(RCC_BASE + 0x24)
60#define RCC_AHB1ENR MMIO32(RCC_BASE + 0x30)
61#define RCC_AHB2ENR MMIO32(RCC_BASE + 0x34)
62#define RCC_AHB3ENR MMIO32(RCC_BASE + 0x38)
64#define RCC_APB1ENR MMIO32(RCC_BASE + 0x40)
65#define RCC_APB2ENR MMIO32(RCC_BASE + 0x44)
68#define RCC_AHB1LPENR MMIO32(RCC_BASE + 0x50)
69#define RCC_AHB2LPENR MMIO32(RCC_BASE + 0x54)
70#define RCC_AHB3LPENR MMIO32(RCC_BASE + 0x58)
72#define RCC_APB1LPENR MMIO32(RCC_BASE + 0x60)
73#define RCC_APB2LPENR MMIO32(RCC_BASE + 0x64)
76#define RCC_BDCR MMIO32(RCC_BASE + 0x70)
77#define RCC_CSR MMIO32(RCC_BASE + 0x74)
80#define RCC_SSCGR MMIO32(RCC_BASE + 0x80)
81#define RCC_PLLI2SCFGR MMIO32(RCC_BASE + 0x84)
85#define RCC_CR_PLLI2SRDY (1 << 27)
86#define RCC_CR_PLLI2SON (1 << 26)
87#define RCC_CR_PLLRDY (1 << 25)
88#define RCC_CR_PLLON (1 << 24)
89#define RCC_CR_CSSON (1 << 19)
90#define RCC_CR_HSEBYP (1 << 18)
91#define RCC_CR_HSERDY (1 << 17)
92#define RCC_CR_HSEON (1 << 16)
95#define RCC_CR_HSIRDY (1 << 1)
96#define RCC_CR_HSION (1 << 0)
101#define RCC_PLLCFGR_PLLQ_SHIFT 24
102#define RCC_PLLCFGR_PLLSRC (1 << 22)
104#define RCC_PLLCFGR_PLLP_SHIFT 16
106#define RCC_PLLCFGR_PLLN_SHIFT 6
108#define RCC_PLLCFGR_PLLM_SHIFT 0
113#define RCC_CFGR_MCO2_SHIFT 30
114#define RCC_CFGR_MCO2_SYSCLK 0x0
115#define RCC_CFGR_MCO2_PLLI2S 0x1
116#define RCC_CFGR_MCO2_HSE 0x2
117#define RCC_CFGR_MCO2_PLL 0x3
120#define RCC_CFGR_MCO2PRE_SHIFT 27
121#define RCC_CFGR_MCO1PRE_SHIFT 24
122#define RCC_CFGR_MCOPRE_DIV_NONE 0x0
123#define RCC_CFGR_MCOPRE_DIV_2 0x4
124#define RCC_CFGR_MCOPRE_DIV_3 0x5
125#define RCC_CFGR_MCOPRE_DIV_4 0x6
126#define RCC_CFGR_MCOPRE_DIV_5 0x7
129#define RCC_CFGR_I2SSRC (1 << 23)
132#define RCC_CFGR_MCO1_SHIFT 21
133#define RCC_CFGR_MCO1_MASK 0x3
134#define RCC_CFGR_MCO1_HSI 0x0
135#define RCC_CFGR_MCO1_LSE 0x1
136#define RCC_CFGR_MCO1_HSE 0x2
137#define RCC_CFGR_MCO1_PLL 0x3
138#define RCC_CFGR_MCO_SHIFT RCC_CFGR_MCO1_SHIFT
139#define RCC_CFGR_MCO_MASK RCC_CFGR_MCO1_MASK
142#define RCC_CFGR_RTCPRE_SHIFT 16
143#define RCC_CFGR_RTCPRE_MASK 0x1f
145#define RCC_CFGR_PPRE2_SHIFT 13
146#define RCC_CFGR_PPRE2_MASK 0x7
147#define RCC_CFGR_PPRE1_SHIFT 10
148#define RCC_CFGR_PPRE1_MASK 0x7
153#define RCC_CFGR_PPRE_NODIV 0x0
154#define RCC_CFGR_PPRE_DIV2 0x4
155#define RCC_CFGR_PPRE_DIV4 0x5
156#define RCC_CFGR_PPRE_DIV8 0x6
157#define RCC_CFGR_PPRE_DIV16 0x7
160#define RCC_CFGR_HPRE_SHIFT 4
161#define RCC_CFGR_HPRE_MASK 0xf
164#define RCC_CFGR_HPRE_NODIV 0x0
165#define RCC_CFGR_HPRE_DIV2 (0x8 + 0)
166#define RCC_CFGR_HPRE_DIV4 (0x8 + 1)
167#define RCC_CFGR_HPRE_DIV8 (0x8 + 2)
168#define RCC_CFGR_HPRE_DIV16 (0x8 + 3)
169#define RCC_CFGR_HPRE_DIV64 (0x8 + 4)
170#define RCC_CFGR_HPRE_DIV128 (0x8 + 5)
171#define RCC_CFGR_HPRE_DIV256 (0x8 + 6)
172#define RCC_CFGR_HPRE_DIV512 (0x8 + 7)
176#define RCC_CFGR_SWS_SHIFT 2
177#define RCC_CFGR_SWS_MASK 0x3
178#define RCC_CFGR_SWS_HSI 0x0
179#define RCC_CFGR_SWS_HSE 0x1
180#define RCC_CFGR_SWS_PLL 0x2
183#define RCC_CFGR_SW_SHIFT 0
184#define RCC_CFGR_SW_HSI 0x0
185#define RCC_CFGR_SW_HSE 0x1
186#define RCC_CFGR_SW_PLL 0x2
193#define RCC_CFGR_PPRE_DIV_NONE 0x0
194#define RCC_CFGR_PPRE_DIV_2 0x4
195#define RCC_CFGR_PPRE_DIV_4 0x5
196#define RCC_CFGR_PPRE_DIV_8 0x6
197#define RCC_CFGR_PPRE_DIV_16 0x7
199#define RCC_CFGR_HPRE_DIV_NONE 0x0
200#define RCC_CFGR_HPRE_DIV_2 (0x8 + 0)
201#define RCC_CFGR_HPRE_DIV_4 (0x8 + 1)
202#define RCC_CFGR_HPRE_DIV_8 (0x8 + 2)
203#define RCC_CFGR_HPRE_DIV_16 (0x8 + 3)
204#define RCC_CFGR_HPRE_DIV_64 (0x8 + 4)
205#define RCC_CFGR_HPRE_DIV_128 (0x8 + 5)
206#define RCC_CFGR_HPRE_DIV_256 (0x8 + 6)
207#define RCC_CFGR_HPRE_DIV_512 (0x8 + 7)
213#define RCC_CIR_CSSC (1 << 23)
216#define RCC_CIR_PLLI2SRDYC (1 << 21)
217#define RCC_CIR_PLLRDYC (1 << 20)
218#define RCC_CIR_HSERDYC (1 << 19)
219#define RCC_CIR_HSIRDYC (1 << 18)
220#define RCC_CIR_LSERDYC (1 << 17)
221#define RCC_CIR_LSIRDYC (1 << 16)
224#define RCC_CIR_PLLI2SRDYIE (1 << 13)
225#define RCC_CIR_PLLRDYIE (1 << 12)
226#define RCC_CIR_HSERDYIE (1 << 11)
227#define RCC_CIR_HSIRDYIE (1 << 10)
228#define RCC_CIR_LSERDYIE (1 << 9)
229#define RCC_CIR_LSIRDYIE (1 << 8)
232#define RCC_CIR_CSSF (1 << 7)
235#define RCC_CIR_PLLI2SRDYF (1 << 5)
236#define RCC_CIR_PLLRDYF (1 << 4)
237#define RCC_CIR_HSERDYF (1 << 3)
238#define RCC_CIR_HSIRDYF (1 << 2)
239#define RCC_CIR_LSERDYF (1 << 1)
240#define RCC_CIR_LSIRDYF (1 << 0)
246#define RCC_AHB1RSTR_OTGHSRST (1 << 29)
247#define RCC_AHB1RSTR_ETHMACRST (1 << 25)
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_GPIOIRST (1 << 8)
252#define RCC_AHB1RSTR_GPIOHRST (1 << 7)
253#define RCC_AHB1RSTR_GPIOGRST (1 << 6)
254#define RCC_AHB1RSTR_GPIOFRST (1 << 5)
255#define RCC_AHB1RSTR_GPIOERST (1 << 4)
256#define RCC_AHB1RSTR_GPIODRST (1 << 3)
257#define RCC_AHB1RSTR_GPIOCRST (1 << 2)
258#define RCC_AHB1RSTR_GPIOBRST (1 << 1)
259#define RCC_AHB1RSTR_GPIOARST (1 << 0)
266#define RCC_AHB1RSTR_IOPIRST RCC_AHB1RSTR_GPIOIRST
267#define RCC_AHB1RSTR_IOPHRST RCC_AHB1RSTR_GPIOHRST
268#define RCC_AHB1RSTR_IOPGRST RCC_AHB1RSTR_GPIOGRST
269#define RCC_AHB1RSTR_IOPFRST RCC_AHB1RSTR_GPIOFRST
270#define RCC_AHB1RSTR_IOPERST RCC_AHB1RSTR_GPIOERST
271#define RCC_AHB1RSTR_IOPDRST RCC_AHB1RSTR_GPIODRST
272#define RCC_AHB1RSTR_IOPCRST RCC_AHB1RSTR_GPIOCRST
273#define RCC_AHB1RSTR_IOPBRST RCC_AHB1RSTR_GPIOBRST
274#define RCC_AHB1RSTR_IOPARST RCC_AHB1RSTR_GPIOARST
279#define RCC_AHB2RSTR_OTGFSRST (1 << 7)
280#define RCC_AHB2RSTR_RNGRST (1 << 6)
281#define RCC_AHB2RSTR_HASHRST (1 << 5)
282#define RCC_AHB2RSTR_CRYPRST (1 << 4)
283#define RCC_AHB2RSTR_DCMIRST (1 << 0)
288#define RCC_AHB3RSTR_FSMCRST (1 << 0)
294#define RCC_APB1RSTR_DACRST (1 << 29)
295#define RCC_APB1RSTR_PWRRST (1 << 28)
296#define RCC_APB1RSTR_CAN2RST (1 << 26)
297#define RCC_APB1RSTR_CAN1RST (1 << 25)
298#define RCC_APB1RSTR_I2C3RST (1 << 23)
299#define RCC_APB1RSTR_I2C2RST (1 << 22)
300#define RCC_APB1RSTR_I2C1RST (1 << 21)
301#define RCC_APB1RSTR_UART5RST (1 << 20)
302#define RCC_APB1RSTR_UART4RST (1 << 19)
303#define RCC_APB1RSTR_USART3RST (1 << 18)
304#define RCC_APB1RSTR_USART2RST (1 << 17)
305#define RCC_APB1RSTR_SPI3RST (1 << 15)
306#define RCC_APB1RSTR_SPI2RST (1 << 14)
307#define RCC_APB1RSTR_WWDGRST (1 << 11)
308#define RCC_APB1RSTR_TIM14RST (1 << 8)
309#define RCC_APB1RSTR_TIM13RST (1 << 7)
310#define RCC_APB1RSTR_TIM12RST (1 << 6)
311#define RCC_APB1RSTR_TIM7RST (1 << 5)
312#define RCC_APB1RSTR_TIM6RST (1 << 4)
313#define RCC_APB1RSTR_TIM5RST (1 << 3)
314#define RCC_APB1RSTR_TIM4RST (1 << 2)
315#define RCC_APB1RSTR_TIM3RST (1 << 1)
316#define RCC_APB1RSTR_TIM2RST (1 << 0)
321#define RCC_APB2RSTR_TIM11RST (1 << 18)
322#define RCC_APB2RSTR_TIM10RST (1 << 17)
323#define RCC_APB2RSTR_TIM9RST (1 << 16)
324#define RCC_APB2RSTR_SYSCFGRST (1 << 14)
325#define RCC_APB2RSTR_SPI1RST (1 << 12)
326#define RCC_APB2RSTR_SDIORST (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)
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_DMA2EN (1 << 22)
345#define RCC_AHB1ENR_DMA1EN (1 << 21)
346#define RCC_AHB1ENR_BKPSRAMEN (1 << 18)
347#define RCC_AHB1ENR_CRCEN (1 << 12)
348#define RCC_AHB1ENR_GPIOIEN (1 << 8)
349#define RCC_AHB1ENR_GPIOHEN (1 << 7)
350#define RCC_AHB1ENR_GPIOGEN (1 << 6)
351#define RCC_AHB1ENR_GPIOFEN (1 << 5)
352#define RCC_AHB1ENR_GPIOEEN (1 << 4)
353#define RCC_AHB1ENR_GPIODEN (1 << 3)
354#define RCC_AHB1ENR_GPIOCEN (1 << 2)
355#define RCC_AHB1ENR_GPIOBEN (1 << 1)
356#define RCC_AHB1ENR_GPIOAEN (1 << 0)
363#define RCC_AHB1ENR_IOPIEN RCC_AHB1ENR_GPIOIEN
364#define RCC_AHB1ENR_IOPHEN RCC_AHB1ENR_GPIOHEN
365#define RCC_AHB1ENR_IOPGEN RCC_AHB1ENR_GPIOGEN
366#define RCC_AHB1ENR_IOPFEN RCC_AHB1ENR_GPIOFEN
367#define RCC_AHB1ENR_IOPEEN RCC_AHB1ENR_GPIOEEN
368#define RCC_AHB1ENR_IOPDEN RCC_AHB1ENR_GPIODEN
369#define RCC_AHB1ENR_IOPCEN RCC_AHB1ENR_GPIOCEN
370#define RCC_AHB1ENR_IOPBEN RCC_AHB1ENR_GPIOBEN
371#define RCC_AHB1ENR_IOPAEN RCC_AHB1ENR_GPIOAEN
376#define RCC_AHB2ENR_OTGFSEN (1 << 7)
377#define RCC_AHB2ENR_RNGEN (1 << 6)
378#define RCC_AHB2ENR_HASHEN (1 << 5)
379#define RCC_AHB2ENR_CRYPEN (1 << 4)
380#define RCC_AHB2ENR_DCMIEN (1 << 0)
385#define RCC_AHB3ENR_FSMCEN (1 << 0)
391#define RCC_APB1ENR_DACEN (1 << 29)
392#define RCC_APB1ENR_PWREN (1 << 28)
393#define RCC_APB1ENR_CAN2EN (1 << 26)
394#define RCC_APB1ENR_CAN1EN (1 << 25)
395#define RCC_APB1ENR_I2C3EN (1 << 23)
396#define RCC_APB1ENR_I2C2EN (1 << 22)
397#define RCC_APB1ENR_I2C1EN (1 << 21)
398#define RCC_APB1ENR_UART5EN (1 << 20)
399#define RCC_APB1ENR_UART4EN (1 << 19)
400#define RCC_APB1ENR_USART3EN (1 << 18)
401#define RCC_APB1ENR_USART2EN (1 << 17)
402#define RCC_APB1ENR_SPI3EN (1 << 15)
403#define RCC_APB1ENR_SPI2EN (1 << 14)
404#define RCC_APB1ENR_WWDGEN (1 << 11)
405#define RCC_APB1ENR_TIM14EN (1 << 8)
406#define RCC_APB1ENR_TIM13EN (1 << 7)
407#define RCC_APB1ENR_TIM12EN (1 << 6)
408#define RCC_APB1ENR_TIM7EN (1 << 5)
409#define RCC_APB1ENR_TIM6EN (1 << 4)
410#define RCC_APB1ENR_TIM5EN (1 << 3)
411#define RCC_APB1ENR_TIM4EN (1 << 2)
412#define RCC_APB1ENR_TIM3EN (1 << 1)
413#define RCC_APB1ENR_TIM2EN (1 << 0)
418#define RCC_APB2ENR_TIM11EN (1 << 18)
419#define RCC_APB2ENR_TIM10EN (1 << 17)
420#define RCC_APB2ENR_TIM9EN (1 << 16)
421#define RCC_APB2ENR_SYSCFGEN (1 << 14)
422#define RCC_APB2ENR_SPI1EN (1 << 12)
423#define RCC_APB2ENR_SDIOEN (1 << 11)
424#define RCC_APB2ENR_ADC3EN (1 << 10)
425#define RCC_APB2ENR_ADC2EN (1 << 9)
426#define RCC_APB2ENR_ADC1EN (1 << 8)
427#define RCC_APB2ENR_USART6EN (1 << 5)
428#define RCC_APB2ENR_USART1EN (1 << 4)
429#define RCC_APB2ENR_TIM8EN (1 << 1)
430#define RCC_APB2ENR_TIM1EN (1 << 0)
435#define RCC_AHB1LPENR_OTGHSULPILPEN (1 << 30)
436#define RCC_AHB1LPENR_OTGHSLPEN (1 << 29)
437#define RCC_AHB1LPENR_ETHMACPTPLPEN (1 << 28)
438#define RCC_AHB1LPENR_ETHMACRXLPEN (1 << 27)
439#define RCC_AHB1LPENR_ETHMACTXLPEN (1 << 26)
440#define RCC_AHB1LPENR_ETHMACLPEN (1 << 25)
441#define RCC_AHB1LPENR_DMA2LPEN (1 << 22)
442#define RCC_AHB1LPENR_DMA1LPEN (1 << 21)
443#define RCC_AHB1LPENR_BKPSRAMLPEN (1 << 18)
444#define RCC_AHB1LPENR_SRAM2LPEN (1 << 17)
445#define RCC_AHB1LPENR_SRAM1LPEN (1 << 16)
446#define RCC_AHB1LPENR_FLITFLPEN (1 << 15)
447#define RCC_AHB1LPENR_CRCLPEN (1 << 12)
448#define RCC_AHB1LPENR_GPIOILPEN (1 << 8)
449#define RCC_AHB1LPENR_GPIOHLPEN (1 << 7)
450#define RCC_AHB1LPENR_GPIOGLPEN (1 << 6)
451#define RCC_AHB1LPENR_GPIOFLPEN (1 << 5)
452#define RCC_AHB1LPENR_GPIOELPEN (1 << 4)
453#define RCC_AHB1LPENR_GPIODLPEN (1 << 3)
454#define RCC_AHB1LPENR_GPIOCLPEN (1 << 2)
455#define RCC_AHB1LPENR_GPIOBLPEN (1 << 1)
456#define RCC_AHB1LPENR_GPIOALPEN (1 << 0)
462#define RCC_AHB1LPENR_IOPILPEN RCC_AHB1LPENR_GPIOILPEN
463#define RCC_AHB1LPENR_IOPHLPEN RCC_AHB1LPENR_GPIOHLPEN
464#define RCC_AHB1LPENR_IOPGLPEN RCC_AHB1LPENR_GPIOGLPEN
465#define RCC_AHB1LPENR_IOPFLPEN RCC_AHB1LPENR_GPIOFLPEN
466#define RCC_AHB1LPENR_IOPELPEN RCC_AHB1LPENR_GPIOELPEN
467#define RCC_AHB1LPENR_IOPDLPEN RCC_AHB1LPENR_GPIODLPEN
468#define RCC_AHB1LPENR_IOPCLPEN RCC_AHB1LPENR_GPIOCLPEN
469#define RCC_AHB1LPENR_IOPBLPEN RCC_AHB1LPENR_GPIOBLPEN
470#define RCC_AHB1LPENR_IOPALPEN RCC_AHB1LPENR_GPIOALPEN
475#define RCC_AHB2LPENR_OTGFSLPEN (1 << 7)
476#define RCC_AHB2LPENR_RNGLPEN (1 << 6)
477#define RCC_AHB2LPENR_HASHLPEN (1 << 5)
478#define RCC_AHB2LPENR_CRYPLPEN (1 << 4)
479#define RCC_AHB2LPENR_DCMILPEN (1 << 0)
483#define RCC_AHB3LPENR_FSMCLPEN (1 << 0)
487#define RCC_APB1LPENR_DACLPEN (1 << 29)
488#define RCC_APB1LPENR_PWRLPEN (1 << 28)
489#define RCC_APB1LPENR_CAN2LPEN (1 << 26)
490#define RCC_APB1LPENR_CAN1LPEN (1 << 25)
491#define RCC_APB1LPENR_I2C3LPEN (1 << 23)
492#define RCC_APB1LPENR_I2C2LPEN (1 << 22)
493#define RCC_APB1LPENR_I2C1LPEN (1 << 21)
494#define RCC_APB1LPENR_UART5LPEN (1 << 20)
495#define RCC_APB1LPENR_UART4LPEN (1 << 19)
496#define RCC_APB1LPENR_USART3LPEN (1 << 18)
497#define RCC_APB1LPENR_USART2LPEN (1 << 17)
498#define RCC_APB1LPENR_SPI3LPEN (1 << 15)
499#define RCC_APB1LPENR_SPI2LPEN (1 << 14)
500#define RCC_APB1LPENR_WWDGLPEN (1 << 11)
501#define RCC_APB1LPENR_TIM14LPEN (1 << 8)
502#define RCC_APB1LPENR_TIM13LPEN (1 << 7)
503#define RCC_APB1LPENR_TIM12LPEN (1 << 6)
504#define RCC_APB1LPENR_TIM7LPEN (1 << 5)
505#define RCC_APB1LPENR_TIM6LPEN (1 << 4)
506#define RCC_APB1LPENR_TIM5LPEN (1 << 3)
507#define RCC_APB1LPENR_TIM4LPEN (1 << 2)
508#define RCC_APB1LPENR_TIM3LPEN (1 << 1)
509#define RCC_APB1LPENR_TIM2LPEN (1 << 0)
513#define RCC_APB2LPENR_TIM11LPEN (1 << 18)
514#define RCC_APB2LPENR_TIM10LPEN (1 << 17)
515#define RCC_APB2LPENR_TIM9LPEN (1 << 16)
516#define RCC_APB2LPENR_SYSCFGLPEN (1 << 14)
517#define RCC_APB2LPENR_SPI1LPEN (1 << 12)
518#define RCC_APB2LPENR_SDIOLPEN (1 << 11)
519#define RCC_APB2LPENR_ADC3LPEN (1 << 10)
520#define RCC_APB2LPENR_ADC2LPEN (1 << 9)
521#define RCC_APB2LPENR_ADC1LPEN (1 << 8)
522#define RCC_APB2LPENR_USART6LPEN (1 << 5)
523#define RCC_APB2LPENR_USART1LPEN (1 << 4)
524#define RCC_APB2LPENR_TIM8LPEN (1 << 1)
525#define RCC_APB2LPENR_TIM1LPEN (1 << 0)
529#define RCC_BDCR_BDRST (1 << 16)
530#define RCC_BDCR_RTCEN (1 << 15)
532#define RCC_BDCR_LSEBYP (1 << 2)
533#define RCC_BDCR_LSERDY (1 << 1)
534#define RCC_BDCR_LSEON (1 << 0)
538#define RCC_CSR_LPWRRSTF (1 << 31)
539#define RCC_CSR_WWDGRSTF (1 << 30)
540#define RCC_CSR_IWDGRSTF (1 << 29)
541#define RCC_CSR_SFTRSTF (1 << 28)
542#define RCC_CSR_PORRSTF (1 << 27)
543#define RCC_CSR_PINRSTF (1 << 26)
544#define RCC_CSR_BORRSTF (1 << 25)
545#define RCC_CSR_RMVF (1 << 24)
546#define RCC_CSR_RESET_FLAGS (RCC_CSR_LPWRRSTF | RCC_CSR_WWDGRSTF |\
547 RCC_CSR_IWDGRSTF | RCC_CSR_SFTRSTF | RCC_CSR_PORRSTF |\
548 RCC_CSR_PINRSTF | RCC_CSR_BORRSTF)
549#define RCC_CSR_LSIRDY (1 << 1)
550#define RCC_CSR_LSION (1 << 0)
556#define RCC_SSCGR_SSCGEN (1 << 31)
557#define RCC_SSCGR_SPREADSEL (1 << 30)
559#define RCC_SSCGR_INCSTEP_SHIFT 16
561#define RCC_SSCGR_MODPER_SHIFT 15
566#define RCC_PLLI2SCFGR_PLLI2SR_SHIFT 28
568#define RCC_PLLI2SCFGR_PLLI2SN_SHIFT 6
605#define _REG_BIT(base, bit) (((base) << 5) + (bit))
int rcc_osc_ready_int_flag(enum rcc_osc osc)
void rcc_clock_setup_hse_3v3(const struct rcc_clock_scale *clock)
int rcc_css_int_flag(void)
void rcc_osc_ready_int_clear(enum rcc_osc osc)
void rcc_css_disable(void)
uint32_t rcc_get_spi_clk_freq(uint32_t spi)
Get the peripheral clock speed for the SPI device at base specified.
void rcc_set_sysclk_source(uint32_t clk)
uint32_t rcc_apb2_frequency
void rcc_set_pll_source(uint32_t pllsrc)
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)
const struct rcc_clock_scale rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_END]
uint32_t rcc_get_usart_clk_freq(uint32_t usart)
Get the peripheral clock speed for the USART at base specified.
void rcc_set_rtcpre(uint32_t rtcpre)
void rcc_osc_ready_int_enable(enum rcc_osc osc)
void rcc_osc_ready_int_disable(enum rcc_osc osc)
void rcc_osc_on(enum rcc_osc osc)
#define _REG_BIT(base, bit)
uint32_t rcc_ahb_frequency
void rcc_osc_off(enum rcc_osc osc)
uint32_t rcc_get_i2c_clk_freq(uint32_t i2c)
Get the peripheral clock speed for the I2C device at base specified.
void rcc_backupdomain_reset(void)
uint32_t rcc_apb1_frequency
void rcc_wait_for_sysclk_status(enum rcc_osc osc)
void rcc_set_ppre1(uint32_t ppre1)
void rcc_css_int_clear(void)
void rcc_set_ppre2(uint32_t ppre2)
void rcc_set_main_pll_hse(uint32_t pllm, uint32_t plln, uint32_t pllp, uint32_t pllq)
void rcc_set_main_pll_hsi(uint32_t pllm, uint32_t plln, uint32_t pllp, uint32_t pllq)
void rcc_css_enable(void)
void rcc_set_hpre(uint32_t hpre)