37#ifndef LIBOPENCM3_RCC_H
38#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)
60#define RCC_CFGR3 MMIO32(RCC_BASE + 0x30)
61#define RCC_CR2 MMIO32(RCC_BASE + 0x34)
69#define RCC_CR_PLLRDY (1 << 25)
70#define RCC_CR_PLLON (1 << 24)
71#define RCC_CR_CSSON (1 << 19)
72#define RCC_CR_HSEBYP (1 << 18)
73#define RCC_CR_HSERDY (1 << 17)
74#define RCC_CR_HSEON (1 << 16)
75#define RCC_CR_HSICAL_SHIFT 8
76#define RCC_CR_HSICAL (0xFF << RCC_CR_HSICAL_SHIFT)
77#define RCC_CR_HSITRIM_SHIFT 3
78#define RCC_CR_HSITRIM (0x1F << RCC_CR_HSITRIM_SHIFT)
79#define RCC_CR_HSIRDY (1 << 1)
80#define RCC_CR_HSION (1 << 0)
84#define RCC_CFGR_PLLNODIV (1 << 31)
86#define RCC_CFGR_MCOPRE_SHIFT 28
87#define RCC_CFGR_MCOPRE (7 << RCC_CFGR_MCOPRE_SHIFT)
88#define RCC_CFGR_MCOPRE_DIV1 (0 << RCC_CFGR_MCOPRE_SHIFT)
89#define RCC_CFGR_MCOPRE_DIV2 (1 << RCC_CFGR_MCOPRE_SHIFT)
90#define RCC_CFGR_MCOPRE_DIV4 (2 << RCC_CFGR_MCOPRE_SHIFT)
91#define RCC_CFGR_MCOPRE_DIV8 (3 << RCC_CFGR_MCOPRE_SHIFT)
92#define RCC_CFGR_MCOPRE_DIV16 (4 << RCC_CFGR_MCOPRE_SHIFT)
93#define RCC_CFGR_MCOPRE_DIV32 (5 << RCC_CFGR_MCOPRE_SHIFT)
94#define RCC_CFGR_MCOPRE_DIV64 (6 << RCC_CFGR_MCOPRE_SHIFT)
95#define RCC_CFGR_MCOPRE_DIV128 (7 << RCC_CFGR_MCOPRE_SHIFT)
97#define RCC_CFGR_MCO_SHIFT 24
98#define RCC_CFGR_MCO_MASK 0xf
99#define RCC_CFGR_MCO_NOCLK 0
100#define RCC_CFGR_MCO_HSI14 1
101#define RCC_CFGR_MCO_LSI 2
102#define RCC_CFGR_MCO_LSE 3
103#define RCC_CFGR_MCO_SYSCLK 4
104#define RCC_CFGR_MCO_HSI 5
105#define RCC_CFGR_MCO_HSE 6
106#define RCC_CFGR_MCO_PLL 7
107#define RCC_CFGR_MCO_HSI48 8
109#define RCC_CFGR_PLLMUL_SHIFT 18
110#define RCC_CFGR_PLLMUL (0x0F << RCC_CFGR_PLLMUL_SHIFT)
114#define RCC_CFGR_PLLMUL_MUL2 (0x00 << RCC_CFGR_PLLMUL_SHIFT)
115#define RCC_CFGR_PLLMUL_MUL3 (0x01 << RCC_CFGR_PLLMUL_SHIFT)
116#define RCC_CFGR_PLLMUL_MUL4 (0x02 << RCC_CFGR_PLLMUL_SHIFT)
117#define RCC_CFGR_PLLMUL_MUL5 (0x03 << RCC_CFGR_PLLMUL_SHIFT)
118#define RCC_CFGR_PLLMUL_MUL6 (0x04 << RCC_CFGR_PLLMUL_SHIFT)
119#define RCC_CFGR_PLLMUL_MUL7 (0x05 << RCC_CFGR_PLLMUL_SHIFT)
120#define RCC_CFGR_PLLMUL_MUL8 (0x06 << RCC_CFGR_PLLMUL_SHIFT)
121#define RCC_CFGR_PLLMUL_MUL9 (0x07 << RCC_CFGR_PLLMUL_SHIFT)
122#define RCC_CFGR_PLLMUL_MUL10 (0x08 << RCC_CFGR_PLLMUL_SHIFT)
123#define RCC_CFGR_PLLMUL_MUL11 (0x09 << RCC_CFGR_PLLMUL_SHIFT)
124#define RCC_CFGR_PLLMUL_MUL12 (0x0A << RCC_CFGR_PLLMUL_SHIFT)
125#define RCC_CFGR_PLLMUL_MUL13 (0x0B << RCC_CFGR_PLLMUL_SHIFT)
126#define RCC_CFGR_PLLMUL_MUL14 (0x0C << RCC_CFGR_PLLMUL_SHIFT)
127#define RCC_CFGR_PLLMUL_MUL15 (0x0D << RCC_CFGR_PLLMUL_SHIFT)
128#define RCC_CFGR_PLLMUL_MUL16 (0x0E << RCC_CFGR_PLLMUL_SHIFT)
131#define RCC_CFGR_PLLXTPRE (1<<17)
135#define RCC_CFGR_PLLXTPRE_HSE_CLK 0x0
136#define RCC_CFGR_PLLXTPRE_HSE_CLK_DIV2 0x1
139#define RCC_CFGR_PLLSRC (1<<16)
143#define RCC_CFGR_PLLSRC_HSI_CLK_DIV2 0x0
144#define RCC_CFGR_PLLSRC_HSE_CLK 0x1
147#define RCC_CFGR_PLLSRC0 (1<<15)
148#define RCC_CFGR_ADCPRE (1<<14)
150#define RCC_CFGR_PPRE_SHIFT 8
151#define RCC_CFGR_PPRE (7 << RCC_CFGR_PPRE_SHIFT)
152#define RCC_CFGR_PPRE_MASK 0x7
155#define RCC_CFGR_PPRE_NODIV (0 << RCC_CFGR_PPRE_SHIFT)
156#define RCC_CFGR_PPRE_DIV2 (4 << RCC_CFGR_PPRE_SHIFT)
157#define RCC_CFGR_PPRE_DIV4 (5 << RCC_CFGR_PPRE_SHIFT)
158#define RCC_CFGR_PPRE_DIV8 (6 << RCC_CFGR_PPRE_SHIFT)
159#define RCC_CFGR_PPRE_DIV16 (7 << RCC_CFGR_PPRE_SHIFT)
162#define RCC_CFGR_HPRE_SHIFT 4
163#define RCC_CFGR_HPRE (0xf << RCC_CFGR_HPRE_SHIFT)
164#define RCC_CFGR_HPRE_MASK 0xf
167#define RCC_CFGR_HPRE_NODIV (0x0 << RCC_CFGR_HPRE_SHIFT)
168#define RCC_CFGR_HPRE_DIV2 (0x8 << RCC_CFGR_HPRE_SHIFT)
169#define RCC_CFGR_HPRE_DIV4 (0x9 << RCC_CFGR_HPRE_SHIFT)
170#define RCC_CFGR_HPRE_DIV8 (0xa << RCC_CFGR_HPRE_SHIFT)
171#define RCC_CFGR_HPRE_DIV16 (0xb << RCC_CFGR_HPRE_SHIFT)
172#define RCC_CFGR_HPRE_DIV64 (0xc << RCC_CFGR_HPRE_SHIFT)
173#define RCC_CFGR_HPRE_DIV128 (0xd << RCC_CFGR_HPRE_SHIFT)
174#define RCC_CFGR_HPRE_DIV256 (0xe << RCC_CFGR_HPRE_SHIFT)
175#define RCC_CFGR_HPRE_DIV512 (0xf << RCC_CFGR_HPRE_SHIFT)
178#define RCC_CFGR_SWS_SHIFT 2
179#define RCC_CFGR_SWS (3 << RCC_CFGR_SWS_SHIFT)
180#define RCC_CFGR_SWS_HSI (0 << RCC_CFGR_SWS_SHIFT)
181#define RCC_CFGR_SWS_HSE (1 << RCC_CFGR_SWS_SHIFT)
182#define RCC_CFGR_SWS_PLL (2 << RCC_CFGR_SWS_SHIFT)
183#define RCC_CFGR_SWS_HSI48 (3 << RCC_CFGR_SWS_SHIFT)
185#define RCC_CFGR_SW_SHIFT 0
186#define RCC_CFGR_SW (3 << RCC_CFGR_SW_SHIFT)
187#define RCC_CFGR_SW_HSI (0 << RCC_CFGR_SW_SHIFT)
188#define RCC_CFGR_SW_HSE (1 << RCC_CFGR_SW_SHIFT)
189#define RCC_CFGR_SW_PLL (2 << RCC_CFGR_SW_SHIFT)
190#define RCC_CFGR_SW_HSI48 (3 << RCC_CFGR_SW_SHIFT)
194#define RCC_CIR_CSSC (1 << 23)
195#define RCC_CIR_HSI48RDYC (1 << 22)
196#define RCC_CIR_HSI14RDYC (1 << 21)
197#define RCC_CIR_PLLRDYC (1 << 20)
198#define RCC_CIR_HSERDYC (1 << 19)
199#define RCC_CIR_HSIRDYC (1 << 18)
200#define RCC_CIR_LSERDYC (1 << 17)
201#define RCC_CIR_LSIRDYC (1 << 16)
202#define RCC_CIR_HSI48RDYIE (1 << 14)
203#define RCC_CIR_HSI14RDYIE (1 << 13)
204#define RCC_CIR_PLLRDYIE (1 << 12)
205#define RCC_CIR_HSERDYIE (1 << 11)
206#define RCC_CIR_HSIRDYIE (1 << 10)
207#define RCC_CIR_LSERDYIE (1 << 9)
208#define RCC_CIR_LSIRDYIE (1 << 8)
209#define RCC_CIR_CSSF (1 << 7)
210#define RCC_CIR_HSI48RDYF (1 << 6)
211#define RCC_CIR_HSI14RDYF (1 << 5)
212#define RCC_CIR_PLLRDYF (1 << 4)
213#define RCC_CIR_HSERDYF (1 << 3)
214#define RCC_CIR_HSIRDYF (1 << 2)
215#define RCC_CIR_LSERDYF (1 << 1)
216#define RCC_CIR_LSIRDYF (1 << 0)
220#define RCC_APB2RSTR_DBGMCURST (1 << 22)
221#define RCC_APB2RSTR_TIM17RST (1 << 18)
222#define RCC_APB2RSTR_TIM16RST (1 << 17)
223#define RCC_APB2RSTR_TIM15RST (1 << 16)
224#define RCC_APB2RSTR_USART1RST (1 << 14)
225#define RCC_APB2RSTR_SPI1RST (1 << 12)
226#define RCC_APB2RSTR_TIM1RST (1 << 11)
227#define RCC_APB2RSTR_ADCRST (1 << 9)
228#define RCC_APB2RSTR_USART8RST (1 << 7)
229#define RCC_APB2RSTR_USART7RST (1 << 6)
230#define RCC_APB2RSTR_USART6RST (1 << 5)
231#define RCC_APB2RSTR_SYSCFGRST (1 << 0)
237#define RCC_APB1RSTR_CECRST (1 << 30)
238#define RCC_APB1RSTR_DACRST (1 << 29)
239#define RCC_APB1RSTR_PWRRST (1 << 28)
240#define RCC_APB1RSTR_CRSRST (1 << 27)
241#define RCC_APB1RSTR_CANRST (1 << 25)
242#define RCC_APB1RSTR_USBRST (1 << 23)
243#define RCC_APB1RSTR_I2C2RST (1 << 22)
244#define RCC_APB1RSTR_I2C1RST (1 << 21)
245#define RCC_APB1RSTR_USART5RST (1 << 20)
246#define RCC_APB1RSTR_USART4RST (1 << 19)
247#define RCC_APB1RSTR_USART3RST (1 << 18)
248#define RCC_APB1RSTR_USART2RST (1 << 17)
249#define RCC_APB1RSTR_SPI2RST (1 << 14)
250#define RCC_APB1RSTR_WWDGRST (1 << 11)
251#define RCC_APB1RSTR_TIM14RST (1 << 8)
252#define RCC_APB1RSTR_TIM7RST (1 << 5)
253#define RCC_APB1RSTR_TIM6RST (1 << 4)
254#define RCC_APB1RSTR_TIM3RST (1 << 1)
255#define RCC_APB1RSTR_TIM2RST (1 << 0)
260#define RCC_AHBENR_TSCEN (1 << 24)
261#define RCC_AHBENR_GPIOFEN (1 << 22)
262#define RCC_AHBENR_GPIOEEN (1 << 21)
263#define RCC_AHBENR_GPIODEN (1 << 20)
264#define RCC_AHBENR_GPIOCEN (1 << 19)
265#define RCC_AHBENR_GPIOBEN (1 << 18)
266#define RCC_AHBENR_GPIOAEN (1 << 17)
267#define RCC_AHBENR_CRCEN (1 << 6)
268#define RCC_AHBENR_FLTFEN (1 << 4)
269#define RCC_AHBENR_SRAMEN (1 << 2)
270#define RCC_AHBENR_DMA2EN (1 << 1)
271#define RCC_AHBENR_DMA1EN (1 << 0)
272#define RCC_AHBENR_DMAEN RCC_AHBENR_DMA1EN
277#define RCC_APB2ENR_DBGMCUEN (1 << 22)
278#define RCC_APB2ENR_TIM17EN (1 << 18)
279#define RCC_APB2ENR_TIM16EN (1 << 17)
280#define RCC_APB2ENR_TIM15EN (1 << 16)
281#define RCC_APB2ENR_USART1EN (1 << 14)
282#define RCC_APB2ENR_SPI1EN (1 << 12)
283#define RCC_APB2ENR_TIM1EN (1 << 11)
284#define RCC_APB2ENR_ADCEN (1 << 9)
285#define RCC_APB2ENR_USART8EN (1 << 7)
286#define RCC_APB2ENR_USART7EN (1 << 6)
287#define RCC_APB2ENR_USART6EN (1 << 5)
288#define RCC_APB2ENR_SYSCFGCOMPEN (1 << 0)
293#define RCC_APB1ENR_CECEN (1 << 30)
294#define RCC_APB1ENR_DACEN (1 << 29)
295#define RCC_APB1ENR_PWREN (1 << 28)
296#define RCC_APB1ENR_CRSEN (1 << 27)
297#define RCC_APB1ENR_CANEN (1 << 25)
298#define RCC_APB1ENR_USBEN (1 << 23)
299#define RCC_APB1ENR_I2C2EN (1 << 22)
300#define RCC_APB1ENR_I2C1EN (1 << 21)
301#define RCC_APB1ENR_USART5EN (1 << 20)
302#define RCC_APB1ENR_USART4EN (1 << 19)
303#define RCC_APB1ENR_USART3EN (1 << 18)
304#define RCC_APB1ENR_USART2EN (1 << 17)
305#define RCC_APB1ENR_SPI2EN (1 << 14)
306#define RCC_APB1ENR_WWDGEN (1 << 11)
307#define RCC_APB1ENR_TIM14EN (1 << 8)
308#define RCC_APB1ENR_TIM7EN (1 << 5)
309#define RCC_APB1ENR_TIM6EN (1 << 4)
310#define RCC_APB1ENR_TIM3EN (1 << 1)
311#define RCC_APB1ENR_TIM2EN (1 << 0)
316#define RCC_BDCR_BDRST (1 << 16)
317#define RCC_BDCR_RTCEN (1 << 15)
318#define RCC_BDCR_RTCSEL_SHIFT 8
319#define RCC_BDCR_RTCSEL (3 << RCC_BDCR_RTCSEL_SHIFT)
320#define RCC_BDCR_RTCSEL_NOCLK (0 << RCC_BDCR_RTCSEL_SHIFT)
321#define RCC_BDCR_RTCSEL_LSE (1 << RCC_BDCR_RTCSEL_SHIFT)
322#define RCC_BDCR_RTCSEL_LSI (2 << RCC_BDCR_RTCSEL_SHIFT)
323#define RCC_BDCR_RTCSEL_HSE (3 << RCC_BDCR_RTCSEL_SHIFT)
324#define RCC_BDCR_LSEDRV_SHIFT 3
325#define RCC_BDCR_LSEDRV (3 << RCC_BDCR_LSEDRV_SHIFT)
326#define RCC_BDCR_LSEDRV_LOW (0 << RCC_BDCR_LSEDRV_SHIFT)
327#define RCC_BDCR_LSEDRV_MEDLO (1 << RCC_BDCR_LSEDRV_SHIFT)
328#define RCC_BDCR_LSEDRV_MEDHI (2 << RCC_BDCR_LSEDRV_SHIFT)
329#define RCC_BDCR_LSEDRV_HIGH (3 << RCC_BDCR_LSEDRV_SHIFT)
330#define RCC_BDCR_LSEBYP (1 << 2)
331#define RCC_BDCR_LSERDY (1 << 1)
332#define RCC_BDCR_LSEON (1 << 0)
336#define RCC_CSR_LPWRRSTF (1 << 31)
337#define RCC_CSR_WWDGRSTF (1 << 30)
338#define RCC_CSR_IWDGRSTF (1 << 29)
339#define RCC_CSR_SFTRSTF (1 << 28)
340#define RCC_CSR_PORRSTF (1 << 27)
341#define RCC_CSR_PINRSTF (1 << 26)
342#define RCC_CSR_OBLRSTF (1 << 25)
343#define RCC_CSR_RMVF (1 << 24)
344#define RCC_CSR_RESET_FLAGS (RCC_CSR_LPWRRSTF | RCC_CSR_WWDGRSTF |\
345 RCC_CSR_IWDGRSTF | RCC_CSR_SFTRSTF | RCC_CSR_PORRSTF |\
346 RCC_CSR_PINRSTF | RCC_CSR_OBLRSTF)
347#define RCC_CSR_V18PWRRSTF (1 << 23)
348#define RCC_CSR_LSIRDY (1 << 1)
349#define RCC_CSR_LSION (1 << 0)
353#define RCC_AHBRSTR_TSCRST (1 << 24)
354#define RCC_AHBRSTR_IOPFRST (1 << 22)
355#define RCC_AHBRSTR_IOPERST (1 << 21)
356#define RCC_AHBRSTR_IOPDRST (1 << 20)
357#define RCC_AHBRSTR_IOPCRST (1 << 19)
358#define RCC_AHBRSTR_IOPBRST (1 << 18)
359#define RCC_AHBRSTR_IOPARST (1 << 17)
365#define RCC_CFGR2_PREDIV 0xf
369#define RCC_CFGR2_PREDIV_NODIV 0x0
370#define RCC_CFGR2_PREDIV_DIV2 0x1
371#define RCC_CFGR2_PREDIV_DIV3 0x2
372#define RCC_CFGR2_PREDIV_DIV4 0x3
373#define RCC_CFGR2_PREDIV_DIV5 0x4
374#define RCC_CFGR2_PREDIV_DIV6 0x5
375#define RCC_CFGR2_PREDIV_DIV7 0x6
376#define RCC_CFGR2_PREDIV_DIV8 0x7
377#define RCC_CFGR2_PREDIV_DIV9 0x8
378#define RCC_CFGR2_PREDIV_DIV10 0x9
379#define RCC_CFGR2_PREDIV_DIV11 0xa
380#define RCC_CFGR2_PREDIV_DIV12 0xb
381#define RCC_CFGR2_PREDIV_DIV13 0xc
382#define RCC_CFGR2_PREDIV_DIV14 0xd
383#define RCC_CFGR2_PREDIV_DIV15 0xe
384#define RCC_CFGR2_PREDIV_DIV16 0xf
392#define RCC_CFGR3_USART3SW_SHIFT 18
393#define RCC_CFGR3_USART2SW_SHIFT 16
394#define RCC_CFGR3_USART1SW_SHIFT 0
400#define RCC_CFGR3_USARTxSW_PCLK 0x0
401#define RCC_CFGR3_USARTxSW_SYSCLK 0x1
402#define RCC_CFGR3_USARTxSW_LSE 0x2
403#define RCC_CFGR3_USARTxSW_HSI 0x3
405#define RCC_CFGR3_USARTxSW_MASK 0x3
407#define RCC_CFGR3_ADCSW (1 << 8)
408#define RCC_CFGR3_USBSW (1 << 7)
409#define RCC_CFGR3_CECSW (1 << 6)
410#define RCC_CFGR3_I2C1SW (1 << 4)
412#define RCC_CR2_HSI48CAL_SHIFT 24
413#define RCC_CR2_HSI48CAL (0xFF << RCC_CR2_HSI48CAL_SHIFT)
414#define RCC_CR2_HSI48RDY (1 << 17)
415#define RCC_CR2_HSI48ON (1 << 16)
416#define RCC_CR2_HSI14CAL_SHIFT 8
417#define RCC_CR2_HSI14CAL (0xFF << RCC_CR2_HSI14CAL_SHIFT)
418#define RCC_CR2_HSI14TRIM_SHIFT 3
419#define RCC_CR2_HSI14TRIM (31 << RCC_CR2_HSI14TRIM_SHIFT)
420#define RCC_CR2_HSI14DIS (1 << 2)
421#define RCC_CR2_HSI14RDY (1 << 1)
422#define RCC_CR2_HSI14ON (1 << 0)
434#define rcc_apb2_frequency rcc_apb1_frequency
440#define _REG_BIT(base, bit) (((base) << 5) + (bit))
int rcc_osc_ready_int_flag(enum rcc_osc osc)
RCC Read the Oscillator Ready Interrupt Flag.
void rcc_set_ppre(uint32_t ppre)
RCC Set the APB Prescale Factor.
void rcc_set_sysclk_source(enum rcc_osc clk)
RCC Set the Source for the System Clock.
int rcc_css_int_flag(void)
RCC Read the Clock Security System Interrupt Flag.
void rcc_set_i2c_clock_sysclk(uint32_t i2c)
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.
enum rcc_osc rcc_system_clock_source(void)
RCC Get the System Clock Source.
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_pll_source(uint32_t pllsrc)
RCC Set the PLL Clock Source.
uint32_t rcc_get_timer_clk_freq(uint32_t timer)
Get the peripheral clock speed for the Timer at base specified.
enum rcc_osc rcc_usb_clock_source(void)
RCC Get the USB Clock Source.
uint32_t rcc_get_usart_clk_freq(uint32_t usart)
Get the peripheral clock speed for the USART at base specified.
void rcc_set_usbclk_source(enum rcc_osc clk)
RCC Set the Source for the USB Clock.
void rcc_set_prediv(uint32_t prediv)
Set PLL Source pre-divider CAUTION.
void rcc_osc_ready_int_enable(enum rcc_osc osc)
RCC Enable the Oscillator Ready Interrupt.
void rcc_set_rtc_clock_source(enum rcc_osc clk)
RCC Set the Source for the RTC clock.
void rcc_clock_setup_in_hse_8mhz_out_48mhz(void)
Set System Clock PLL at 48MHz from HSE at 8MHz.
void rcc_disable_rtc_clock(void)
RCC Disable the RTC clock.
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_hsi48_out_48mhz(void)
Set System Clock HSI48 at 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.
uint32_t rcc_apb1_frequency
uint32_t rcc_get_i2c_clocks(void)
void rcc_css_int_clear(void)
RCC Clear the Clock Security System Interrupt Flag.
void rcc_enable_rtc_clock(void)
RCC Enable the RTC clock.
void rcc_set_i2c_clock_hsi(uint32_t i2c)
void rcc_clock_setup_in_hsi_out_48mhz(void)
Set System Clock PLL at 48MHz from HSI.
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.