53 .ahb_frequency = 32000,
54 .apb_frequency = 32000,
64 .ahb_frequency = 4000000,
65 .apb_frequency = 4000000,
75 .ahb_frequency = 16000000,
76 .apb_frequency = 16000000,
91 .ahb_frequency = 32000000,
92 .apb_frequency = 32000000,
107 .ahb_frequency = 64000000,
108 .apb_frequency = 64000000,
123 .ahb_frequency = 64000000,
124 .apb_frequency = 64000000,
334 uint32_t pllq, uint32_t pllr)
546 uint32_t reg32 =
RCC_CCIPR & ~(mask << shift);
#define cm3_assert_not_reached()
Check if unreachable code is reached.
void flash_prefetch_enable(void)
This buffer is used for instruction fetches and may or may not be enabled by default,...
void flash_prefetch_disable(void)
Note carefully the clock restrictions under which the prefetch buffer may be set to disabled.
void flash_set_ws(uint32_t ws)
Set the Number of Wait States.
#define FLASH_ACR_LATENCY_0WS
#define FLASH_ACR_LATENCY_2WS
#define FLASH_ACR_LATENCY_1WS
void pwr_set_vos_scale(enum pwr_vos_scale scale)
Setup voltage scaling range.
#define RCC_CCIPR_USARTxSEL_LSE
#define RCC_CCIPR_USARTxSEL_PCLK
#define RCC_CCIPR_USARTxSEL_SYSCLK
#define RCC_CCIPR_USARTxSEL_HSI16
#define RCC_CCIPR_USART3SEL_SHIFT
#define RCC_CCIPR_USART1SEL_SHIFT
#define RCC_CCIPR_TIM1SEL_SHIFT
#define RCC_CCIPR_LPUART1SEL_SHIFT
#define RCC_CCIPR_RNGDIV_MASK
#define RCC_CCIPR_RNGSEL_MASK
#define RCC_CCIPR_I2C2SEL_SHIFT
#define RCC_CCIPR_USART2SEL_SHIFT
#define RCC_CCIPR_CECSEL_SHIFT
#define RCC_CCIPR_LPTIM1SEL_MASK
#define RCC_CCIPR_I2C1SEL_SHIFT
#define RCC_CCIPR_USARTxSEL_MASK
#define RCC_CCIPR_LPTIM1SEL_SHIFT
#define RCC_CCIPR_TIM1SEL_MASK
#define RCC_CCIPR_ADCSEL_SHIFT
#define RCC_CCIPR_LPUART2SEL_SHIFT
#define RCC_CCIPR_LPTIM2SEL_MASK
#define RCC_CCIPR_RNGDIV_SHIFT
#define RCC_CCIPR_LPTIM2SEL_SHIFT
#define RCC_CCIPR_ADCSEL_MASK
#define RCC_CCIPR_CECSEL_MASK
#define RCC_CCIPR_RNGSEL_SHIFT
#define RCC_CFGR_HPRE_NODIV
#define RCC_CFGR_PPRE_NODIV
#define RCC_CFGR_SW_PLLRCLK
#define RCC_CFGR_SW_HSISYS
#define RCC_CFGR_SWS_HSISYS
#define RCC_CFGR_SWS_PLLRCLK
#define RCC_CFGR_PPRE_SHIFT
#define RCC_CFGR_HPRE_MASK
#define RCC_CFGR_SWS_MASK
#define RCC_CFGR_MCOPRE_SHIFT
#define RCC_CFGR_MCOPRE_MASK
#define RCC_CFGR_PPRE_MASK
#define RCC_CFGR_SWS_SHIFT
#define RCC_CFGR_HPRE_SHIFT
#define RCC_CFGR_SW_SHIFT
#define RCC_CR_HSIDIV_DIV4
#define RCC_CR_HSIDIV_DIV1
#define RCC_CR_HSIDIV_SHIFT
#define RCC_CR_HSIDIV_MASK
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,...
@ RCC_CLOCK_CONFIG_HSE_12MHZ_PLL_64MHZ
@ RCC_CLOCK_CONFIG_HSI_PLL_32MHZ
@ RCC_CLOCK_CONFIG_HSI_4MHZ
@ RCC_CLOCK_CONFIG_LSI_32KHZ
@ RCC_CLOCK_CONFIG_HSI_PLL_64MHZ
@ RCC_CLOCK_CONFIG_HSI_16MHZ
void rcc_set_ppre(uint32_t ppre)
Configure APB peripheral clock prescaler.
void rcc_enable_pllr(bool enable)
Enable PLL R clock output.
int rcc_css_int_flag(void)
void rcc_enable_pllp(bool enable)
Enable PLL P clock output.
void rcc_wait_for_osc_ready(enum rcc_osc osc)
Wait for Oscillator Ready.
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.
void rcc_css_disable(void)
enum rcc_osc rcc_system_clock_source(void)
Return the clock source which is used as system clock.
bool rcc_is_osc_ready(enum rcc_osc osc)
Is the given oscillator ready?
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)
Configure pll source.
uint32_t rcc_get_timer_clk_freq(uint32_t timer)
Get the peripheral clock speed for the Timer at base specified.
uint32_t rcc_get_usart_clk_freq(uint32_t usart)
Get the peripheral clock speed for the USART at base specified.
void rcc_set_hsisys_div(uint32_t hsidiv)
Configure HSI16 clock division factor to feed SYSCLK.
void rcc_enable_pllq(bool enable)
Enable PLL Q clock output.
void rcc_set_peripheral_clk_sel(uint32_t periph, uint32_t sel)
Set the peripheral clock source.
void rcc_osc_on(enum rcc_osc osc)
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_clock_setup(const struct rcc_clock_scale *clock)
Setup sysclock with desired source (HSE/HSI/PLL/LSE/LSI).
const struct rcc_clock_scale rcc_clock_config[RCC_CLOCK_CONFIG_END]
uint32_t rcc_apb1_frequency
void rcc_wait_for_sysclk_status(enum rcc_osc osc)
Wait until system clock switched to given oscillator.
void rcc_css_int_clear(void)
void rcc_set_rng_clk_div(uint32_t rng_div)
Setup RNG Peripheral Clock Divider.
static uint32_t rcc_get_clksel_freq(uint8_t shift)
void rcc_css_enable(void)
void rcc_set_hpre(uint32_t hpre)
Configure AHB peripheral clock prescaler.
void rcc_set_mcopre(uint32_t mcopre)
Configure mco prescaler.
void rcc_set_sysclk_source(enum rcc_osc osc)
Set the Source for the System Clock.
#define RCC_PLLCFGR_PLLM_DIV(x)
#define RCC_PLLCFGR_PLLN_MUL(x)
#define RCC_PLLCFGR_PLLP_DIV(x)
#define RCC_PLLCFGR_PLLQ_DIV(x)
#define RCC_PLLCFGR_PLLR_DIV(x)
#define RCC_PLLCFGR_PLLSRC_HSI16
#define RCC_PLLCFGR_PLLSRC_HSE
#define RCC_PLLCFGR_PLLN_SHIFT
#define RCC_PLLCFGR_PLLPEN
#define RCC_PLLCFGR_PLLSRC_SHIFT
#define RCC_PLLCFGR_PLLSRC_MASK
#define RCC_PLLCFGR_PLLQEN
#define RCC_PLLCFGR_PLLR_SHIFT
#define RCC_PLLCFGR_PLLQ_SHIFT
#define RCC_PLLCFGR_PLLM_SHIFT
#define RCC_PLLCFGR_PLLREN
#define RCC_PLLCFGR_PLLP_SHIFT
enum pwr_vos_scale voltage_scale
enum rcc_osc sysclock_source