libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
rcc.c File Reference
Include dependency graph for rcc.c:

Go to the source code of this file.

Functions

void rcc_osc_ready_int_clear (enum rcc_osc osc)
 
void rcc_osc_ready_int_enable (enum rcc_osc osc)
 
void rcc_osc_ready_int_disable (enum rcc_osc osc)
 
int rcc_osc_ready_int_flag (enum rcc_osc osc)
 
void rcc_css_int_clear (void)
 
int rcc_css_int_flag (void)
 
bool rcc_is_osc_ready (enum rcc_osc osc)
 Is the given oscillator ready? More...
 
void rcc_wait_for_osc_ready (enum rcc_osc osc)
 Wait for Oscillator Ready. More...
 
void rcc_wait_for_sysclk_status (enum rcc_osc osc)
 
void rcc_osc_on (enum rcc_osc osc)
 
void rcc_osc_off (enum rcc_osc osc)
 
void rcc_css_enable (void)
 
void rcc_css_disable (void)
 
void rcc_set_msi_range (uint32_t range)
 Set the range of the MSI oscillator. More...
 
void rcc_set_sysclk_source (uint32_t clk)
 
void rcc_set_pll_configuration (uint32_t source, uint32_t multiplier, uint32_t divisor)
 
void rcc_set_pll_source (uint32_t pllsrc)
 
void rcc_set_ppre2 (uint32_t ppre2)
 
void rcc_set_ppre1 (uint32_t ppre1)
 
void rcc_set_hpre (uint32_t hpre)
 
void rcc_set_rtcpre (uint32_t rtcpre)
 
uint32_t rcc_system_clock_source (void)
 
void rcc_rtc_select_clock (uint32_t clock)
 
void rcc_clock_setup_msi (const struct rcc_clock_scale *clock)
 
void rcc_clock_setup_hsi (const struct rcc_clock_scale *clock)
 Switch sysclock to HSI with the given parameters. More...
 
void rcc_clock_setup_pll (const struct rcc_clock_scale *clock)
 
uint32_t rcc_get_usart_clk_freq (uint32_t usart)
 Get the peripheral clock speed for the USART at base specified. More...
 
uint32_t rcc_get_timer_clk_freq (uint32_t timer)
 Get the peripheral clock speed for the Timer at base specified. More...
 
uint32_t rcc_get_i2c_clk_freq (uint32_t i2c)
 Get the peripheral clock speed for the I2C device at base specified. More...
 
uint32_t rcc_get_spi_clk_freq (uint32_t spi)
 Get the peripheral clock speed for the SPI device at base specified. More...
 

Variables

uint32_t rcc_ahb_frequency = 2097000
 
uint32_t rcc_apb1_frequency = 2097000
 
uint32_t rcc_apb2_frequency = 2097000
 
const struct rcc_clock_scale rcc_clock_config [RCC_CLOCK_CONFIG_END]