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)
 RCC Clear the Oscillator Ready Interrupt Flag. More...
 
void rcc_osc_ready_int_enable (enum rcc_osc osc)
 RCC Enable the Oscillator Ready Interrupt. More...
 
void rcc_osc_ready_int_disable (enum rcc_osc osc)
 RCC Disable the Oscillator Ready Interrupt. More...
 
int rcc_osc_ready_int_flag (enum rcc_osc osc)
 RCC Read the Oscillator Ready Interrupt Flag. More...
 
void rcc_css_int_clear (void)
 RCC Clear the Clock Security System Interrupt Flag. More...
 
int rcc_css_int_flag (void)
 RCC Read the Clock Security System Interrupt Flag. More...
 
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_osc_on (enum rcc_osc osc)
 RCC Turn on an Oscillator. More...
 
void rcc_osc_off (enum rcc_osc osc)
 RCC Turn off an Oscillator. More...
 
void rcc_css_enable (void)
 RCC Enable the Clock Security System. More...
 
void rcc_css_disable (void)
 RCC Disable the Clock Security System. More...
 
void rcc_set_sysclk_source (enum rcc_osc clk)
 RCC Set the Source for the System Clock. More...
 
void rcc_set_usbclk_source (enum rcc_osc clk)
 RCC Set the Source for the USB Clock. More...
 
void rcc_enable_rtc_clock (void)
 RCC Enable the RTC clock. More...
 
void rcc_disable_rtc_clock (void)
 RCC Disable the RTC clock. More...
 
void rcc_set_rtc_clock_source (enum rcc_osc clk)
 RCC Set the Source for the RTC clock. More...
 
void rcc_set_pll_multiplication_factor (uint32_t mul)
 RCC Set the PLL Multiplication Factor. More...
 
void rcc_set_pll_source (uint32_t pllsrc)
 RCC Set the PLL Clock Source. More...
 
void rcc_set_pllxtpre (uint32_t pllxtpre)
 RCC Set the HSE Frequency Divider used as PLL Clock Source. More...
 
void rcc_set_ppre (uint32_t ppre)
 RCC Set the APB Prescale Factor. More...
 
void rcc_set_hpre (uint32_t hpre)
 RCC Set the AHB Prescale Factor. More...
 
void rcc_set_prediv (uint32_t prediv)
 Set PLL Source pre-divider CAUTION. More...
 
enum rcc_osc rcc_system_clock_source (void)
 RCC Get the System Clock Source. More...
 
void rcc_set_i2c_clock_hsi (uint32_t i2c)
 
void rcc_set_i2c_clock_sysclk (uint32_t i2c)
 
uint32_t rcc_get_i2c_clocks (void)
 
enum rcc_osc rcc_usb_clock_source (void)
 RCC Get the USB Clock Source. More...
 
void rcc_clock_setup_in_hse_8mhz_out_48mhz (void)
 Set System Clock PLL at 48MHz from HSE at 8MHz. More...
 
void rcc_clock_setup_in_hsi_out_48mhz (void)
 Set System Clock PLL at 48MHz from HSI. More...
 
void rcc_clock_setup_in_hsi48_out_48mhz (void)
 Set System Clock HSI48 at 48MHz. More...
 
static uint32_t rcc_get_usart_clksel_freq (uint8_t shift)
 
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 = 8000000
 
uint32_t rcc_apb1_frequency = 8000000