73 .flash_waitstates = 1,
74 .ahb_frequency = 24e6,
75 .apb1_frequency = 24e6,
76 .apb2_frequency = 24e6,
91 .flash_waitstates = 1,
92 .ahb_frequency = 48e6,
93 .apb1_frequency = 48e6,
94 .apb2_frequency = 48e6,
109 .flash_waitstates = 3,
110 .ahb_frequency = 96e6,
111 .apb1_frequency = 96e6,
112 .apb2_frequency = 96e6,
127 .flash_waitstates = 4,
128 .ahb_frequency = 170e6,
129 .apb1_frequency = 170e6,
130 .apb2_frequency = 170e6,
148 .flash_waitstates = 1,
149 .ahb_frequency = 24e6,
150 .apb1_frequency = 24e6,
151 .apb2_frequency = 24e6,
166 .flash_waitstates = 1,
167 .ahb_frequency = 48e6,
168 .apb1_frequency = 48e6,
169 .apb2_frequency = 48e6,
184 .flash_waitstates = 3,
185 .ahb_frequency = 96e6,
186 .apb1_frequency = 96e6,
187 .apb2_frequency = 96e6,
202 .flash_waitstates = 4,
203 .ahb_frequency = 170e6,
204 .apb1_frequency = 170e6,
205 .apb2_frequency = 170e6,
224 .flash_waitstates = 1,
225 .ahb_frequency = 24e6,
226 .apb1_frequency = 24e6,
227 .apb2_frequency = 24e6,
242 .flash_waitstates = 1,
243 .ahb_frequency = 48e6,
244 .apb1_frequency = 48e6,
245 .apb2_frequency = 48e6,
260 .flash_waitstates = 3,
261 .ahb_frequency = 96e6,
262 .apb1_frequency = 96e6,
263 .apb2_frequency = 96e6,
278 .flash_waitstates = 4,
279 .ahb_frequency = 170e6,
280 .apb1_frequency = 170e6,
281 .apb2_frequency = 170e6,
299 .flash_waitstates = 1,
300 .ahb_frequency = 24e6,
301 .apb1_frequency = 24e6,
302 .apb2_frequency = 24e6,
317 .flash_waitstates = 1,
318 .ahb_frequency = 48e6,
319 .apb1_frequency = 48e6,
320 .apb2_frequency = 48e6,
335 .flash_waitstates = 3,
336 .ahb_frequency = 96e6,
337 .apb1_frequency = 96e6,
338 .apb2_frequency = 96e6,
353 .flash_waitstates = 4,
354 .ahb_frequency = 170e6,
355 .apb1_frequency = 170e6,
356 .apb2_frequency = 170e6,
624 bool pllpen = (
pllp != 0);
625 bool pllqen = (
pllq != 0);
626 bool pllren = (
pllr != 0);
630 uint32_t pllpdiv =
pllp;
631 pllp = (pllpdiv == 17);
632 if ((pllpdiv == 7) || (pllpdiv == 17)) {
#define cm3_assert_not_reached()
Check if unreachable code is reached.
void flash_icache_disable(void)
Disable the Instruction Cache.
void flash_icache_enable(void)
Enable the Instruction Cache.
void flash_dcache_disable(void)
Disable the data cache.
void flash_dcache_enable(void)
Enable the data cache.
void flash_set_ws(uint32_t ws)
Set the Number of Wait States.
void pwr_enable_boost(void)
Enable Boost Mode.
void pwr_set_vos_scale(enum pwr_vos_scale scale)
void pwr_disable_boost(void)
Disable Boost Mode.
#define RCC_CCIPR_USARTxSEL_LSE
#define RCC_CCIPR_USARTxSEL_PCLK
#define RCC_CCIPR_USART3SEL_SHIFT
#define RCC_CCIPR_UART4SEL_SHIFT
#define RCC_CCIPR_USART1SEL_SHIFT
#define RCC_CCIPR_SEL_MASK
#define RCC_CCIPR_LPUART1SEL_SHIFT
#define RCC_CCIPR_USARTxSEL_SYSCLK
#define RCC_CCIPR_USART2SEL_SHIFT
#define RCC_CCIPR_USARTxSEL_HSI16
#define RCC_CCIPR_UART5SEL_SHIFT
#define RCC_CCIPR_CLK48SEL_SHIFT
#define RCC_CFGR_HPRE_NODIV
#define RCC_CFGR_PPREx_NODIV
#define RCC_CFGR_SWx_HSI16
#define RCC_CFGR_PPRE1_MASK
#define RCC_CFGR_PPRE2_SHIFT
#define RCC_CFGR_PPRE2_MASK
#define RCC_CFGR_HPRE_MASK
#define RCC_CFGR_SWS_MASK
#define RCC_CFGR_SWS_SHIFT
#define RCC_CFGR_HPRE_SHIFT
#define RCC_CFGR_SW_SHIFT
#define RCC_CFGR_PPRE1_SHIFT
#define RCC_CICR_HSI48RDYC
#define RCC_CIER_HSI48RDYIE
#define RCC_CIER_LSERDYIE
#define RCC_CIER_HSIRDYIE
#define RCC_CIER_LSIRDYIE
#define RCC_CIER_PLLRDYIE
#define RCC_CIER_HSERDYIE
#define RCC_CIFR_HSI48RDYF
#define RCC_CRRCR_HSI48ON
#define RCC_CRRCR_HSI48RDY
void rcc_periph_clock_enable(enum rcc_periph_clken clken)
Enable Peripheral Clock in running mode.
uint16_t rcc_get_div_from_hpre(uint8_t div_val)
This will return the divisor 1/2/4/8/16/64/128/256/512 which is set as a 4-bit value,...
int rcc_osc_ready_int_flag(enum rcc_osc osc)
void rcc_clock_setup_hse_3v3(const struct rcc_clock_scale *clock)
Setup clocks with the HSE.
int rcc_css_int_flag(void)
void rcc_set_clock48_source(uint32_t clksel)
Set clock source for 48MHz clock.
void rcc_osc_ready_int_clear(enum rcc_osc osc)
void rcc_wait_for_osc_ready(enum rcc_osc osc)
Wait for Oscillator Ready.
void rcc_css_disable(void)
bool rcc_is_osc_ready(enum rcc_osc osc)
Is the given oscillator ready?
void rcc_set_sysclk_source(uint32_t clk)
uint32_t rcc_apb2_frequency
void rcc_set_pll_source(uint32_t pllsrc)
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 specified (LP)UxART.
const struct rcc_clock_scale rcc_hsi_configs[RCC_CLOCK_3V3_END]
void rcc_clock_setup_pll(const struct rcc_clock_scale *clock)
Setup clocks to run from PLL.
const struct rcc_clock_scale rcc_hse_12mhz_3v3[RCC_CLOCK_3V3_END]
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)
uint32_t rcc_ahb_frequency
void rcc_osc_off(enum rcc_osc osc)
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_main_pll(uint32_t pllsrc, uint32_t pllm, uint32_t plln, uint32_t pllp, uint32_t pllq, uint32_t pllr)
Reconfigures the main PLL for a HSE source.
void rcc_set_ppre2(uint32_t ppre2)
static uint32_t rcc_get_clksel_freq(uint8_t shift)
void rcc_css_enable(void)
void rcc_set_hpre(uint32_t hpre)
const struct rcc_clock_scale rcc_hse_16mhz_3v3[RCC_CLOCK_3V3_END]
#define RCC_PLLCFGR_PLLM_SHIFT
#define RCC_PLLCFGR_PLLM_MASK
#define RCC_PLLCFGR_PLLN_SHIFT
#define RCC_PLLCFGR_PLLN_MASK
#define RCC_PLLCFGR_PLLPEN
#define RCC_PLLCFGR_PLLSRC_SHIFT
#define RCC_PLLCFGR_PLLR_MASK
#define RCC_PLLCFGR_PLLP_DIV7
#define RCC_PLLCFGR_PLLSRC_MASK
#define RCC_PLLCFGR_PLLP_DIV17
#define RCC_PLLCFGR_PLLSRC_HSI16
#define RCC_PLLCFGR_PLLQEN
#define RCC_PLLCFGR_PLLPDIV_MASK
#define RCC_PLLCFGR_PLLR_SHIFT
#define RCC_PLLCFGR_PLLQ_SHIFT
#define RCC_PLLCFGR_PLLPDIV_SHIFT
#define RCC_PLLCFGR_PLLQ_MASK
#define RCC_PLLCFGR_PLLREN
#define RCC_PLLCFGR_PLLSRC_HSE
enum pwr_vos_scale vos_scale