libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
Go to the source code of this file.
Data Structures | |
struct | rcc_clock_scale |
Enumerations | |
enum | rcc_clock_config_entry { RCC_CLOCK_VRANGE1_80MHZ , RCC_CLOCK_CONFIG_END } |
enum | rcc_osc { RCC_PLL , RCC_HSE , RCC_HSI16 , RCC_MSI , RCC_LSE , RCC_LSI , RCC_HSI48 } |
enum | rcc_periph_clken { RCC_TSC = _REG_BIT(RCC_AHB1ENR_OFFSET, 16) , RCC_CRC = _REG_BIT(RCC_AHB1ENR_OFFSET, 12) , RCC_FLASH = _REG_BIT(RCC_AHB1ENR_OFFSET, 8) , RCC_DMA2 = _REG_BIT(RCC_AHB1ENR_OFFSET, 1) , RCC_DMA1 = _REG_BIT(RCC_AHB1ENR_OFFSET, 0) , RCC_RNG = _REG_BIT(RCC_AHB2ENR_OFFSET, 18) , RCC_AES = _REG_BIT(RCC_AHB2ENR_OFFSET, 16) , RCC_ADC = _REG_BIT(RCC_AHB2ENR_OFFSET, 13) , RCC_ADC1 = _REG_BIT(RCC_AHB2ENR_OFFSET, 13) , RCC_OTGFS = _REG_BIT(RCC_AHB2ENR_OFFSET, 12) , RCC_GPIOH = _REG_BIT(RCC_AHB2ENR_OFFSET, 7) , RCC_GPIOG = _REG_BIT(RCC_AHB2ENR_OFFSET, 6) , RCC_GPIOF = _REG_BIT(RCC_AHB2ENR_OFFSET, 5) , RCC_GPIOE = _REG_BIT(RCC_AHB2ENR_OFFSET, 4) , RCC_GPIOD = _REG_BIT(RCC_AHB2ENR_OFFSET, 3) , RCC_GPIOC = _REG_BIT(RCC_AHB2ENR_OFFSET, 2) , RCC_GPIOB = _REG_BIT(RCC_AHB2ENR_OFFSET, 1) , RCC_GPIOA = _REG_BIT(RCC_AHB2ENR_OFFSET, 0) , RCC_QSPI = _REG_BIT(RCC_AHB3ENR_OFFSET, 8) , RCC_FMC = _REG_BIT(RCC_AHB3ENR_OFFSET, 0) , RCC_LPTIM1 = _REG_BIT(RCC_APB1ENR1_OFFSET, 31) , RCC_OPAMP = _REG_BIT(RCC_APB1ENR1_OFFSET, 30) , RCC_DAC1 = _REG_BIT(RCC_APB1ENR1_OFFSET, 29) , RCC_PWR = _REG_BIT(RCC_APB1ENR1_OFFSET, 28) , RCC_USB = _REG_BIT(RCC_APB1ENR1_OFFSET, 26) , RCC_CAN2 = _REG_BIT(RCC_APB1ENR1_OFFSET, 26) , RCC_CAN1 = _REG_BIT(RCC_APB1ENR1_OFFSET, 25) , RCC_CRS = _REG_BIT(RCC_APB1ENR1_OFFSET, 24) , RCC_I2C3 = _REG_BIT(RCC_APB1ENR1_OFFSET, 23) , RCC_I2C2 = _REG_BIT(RCC_APB1ENR1_OFFSET, 22) , RCC_I2C1 = _REG_BIT(RCC_APB1ENR1_OFFSET, 21) , RCC_UART5 = _REG_BIT(RCC_APB1ENR1_OFFSET, 20) , RCC_UART4 = _REG_BIT(RCC_APB1ENR1_OFFSET, 19) , RCC_USART3 = _REG_BIT(RCC_APB1ENR1_OFFSET, 18) , RCC_USART2 = _REG_BIT(RCC_APB1ENR1_OFFSET, 17) , RCC_SPI3 = _REG_BIT(RCC_APB1ENR1_OFFSET, 15) , RCC_SPI2 = _REG_BIT(RCC_APB1ENR1_OFFSET, 14) , RCC_LCD = _REG_BIT(RCC_APB1ENR1_OFFSET, 9) , RCC_TIM7 = _REG_BIT(RCC_APB1ENR1_OFFSET, 5) , RCC_TIM6 = _REG_BIT(RCC_APB1ENR1_OFFSET, 4) , RCC_TIM5 = _REG_BIT(RCC_APB1ENR1_OFFSET, 3) , RCC_TIM4 = _REG_BIT(RCC_APB1ENR1_OFFSET, 2) , RCC_TIM3 = _REG_BIT(RCC_APB1ENR1_OFFSET, 1) , RCC_TIM2 = _REG_BIT(RCC_APB1ENR1_OFFSET, 0) , RCC_LPTIM2 = _REG_BIT(RCC_APB1ENR2_OFFSET, 5) , RCC_SWPMI1 = _REG_BIT(RCC_APB1ENR2_OFFSET, 2) , RCC_LPUART1 = _REG_BIT(RCC_APB1ENR2_OFFSET, 0) , RCC_DFSDM = _REG_BIT(RCC_APB2ENR_OFFSET, 24) , RCC_SAI2 = _REG_BIT(RCC_APB2ENR_OFFSET, 22) , RCC_SAI1 = _REG_BIT(RCC_APB2ENR_OFFSET, 21) , RCC_TIM17 = _REG_BIT(RCC_APB2ENR_OFFSET, 18) , RCC_TIM16 = _REG_BIT(RCC_APB2ENR_OFFSET, 17) , RCC_TIM15 = _REG_BIT(RCC_APB2ENR_OFFSET, 16) , RCC_USART1 = _REG_BIT(RCC_APB2ENR_OFFSET, 14) , RCC_TIM8 = _REG_BIT(RCC_APB2ENR_OFFSET, 13) , RCC_SPI1 = _REG_BIT(RCC_APB2ENR_OFFSET, 12) , RCC_TIM1 = _REG_BIT(RCC_APB2ENR_OFFSET, 11) , RCC_SDMMC1 = _REG_BIT(RCC_APB2ENR_OFFSET, 10) , RCC_FW = _REG_BIT(RCC_APB2ENR_OFFSET, 7) , RCC_SYSCFG = _REG_BIT(RCC_APB2ENR_OFFSET, 0) , SCC_TSC = _REG_BIT(RCC_AHB1SMENR_OFFSET, 16) , SCC_CRC = _REG_BIT(RCC_AHB1SMENR_OFFSET, 12) , SCC_SRAM1 = _REG_BIT(RCC_AHB1SMENR_OFFSET, 9) , SCC_FLASH = _REG_BIT(RCC_AHB1SMENR_OFFSET, 8) , SCC_DMA2 = _REG_BIT(RCC_AHB1SMENR_OFFSET, 1) , SCC_DMA1 = _REG_BIT(RCC_AHB1SMENR_OFFSET, 0) , SCC_RNG = _REG_BIT(RCC_AHB2SMENR_OFFSET, 18) , SCC_AES = _REG_BIT(RCC_AHB2SMENR_OFFSET, 16) , SCC_ADC = _REG_BIT(RCC_AHB2SMENR_OFFSET, 13) , SCC_ADC1 = _REG_BIT(RCC_AHB2SMENR_OFFSET, 13) , SCC_OTGFS = _REG_BIT(RCC_AHB2SMENR_OFFSET, 12) , SCC_SRAM2 = _REG_BIT(RCC_AHB2SMENR_OFFSET, 9) , SCC_GPIOH = _REG_BIT(RCC_AHB2SMENR_OFFSET, 7) , SCC_GPIOG = _REG_BIT(RCC_AHB2SMENR_OFFSET, 6) , SCC_GPIOF = _REG_BIT(RCC_AHB2SMENR_OFFSET, 5) , SCC_GPIOE = _REG_BIT(RCC_AHB2SMENR_OFFSET, 4) , SCC_GPIOD = _REG_BIT(RCC_AHB2SMENR_OFFSET, 3) , SCC_GPIOC = _REG_BIT(RCC_AHB2SMENR_OFFSET, 2) , SCC_GPIOB = _REG_BIT(RCC_AHB2SMENR_OFFSET, 1) , SCC_GPIOA = _REG_BIT(RCC_AHB2SMENR_OFFSET, 0) , SCC_QSPI = _REG_BIT(RCC_AHB3SMENR_OFFSET, 8) , SCC_FMC = _REG_BIT(RCC_AHB3SMENR_OFFSET, 0) , SCC_LPTIM1 = _REG_BIT(RCC_APB1ENR1_OFFSET, 31) , SCC_OPAMP = _REG_BIT(RCC_APB1ENR1_OFFSET, 30) , SCC_DAC1 = _REG_BIT(RCC_APB1ENR1_OFFSET, 29) , SCC_PWR = _REG_BIT(RCC_APB1ENR1_OFFSET, 28) , SCC_CAN2 = _REG_BIT(RCC_APB1ENR1_OFFSET, 26) , SCC_CAN1 = _REG_BIT(RCC_APB1ENR1_OFFSET, 25) , SCC_I2C3 = _REG_BIT(RCC_APB1ENR1_OFFSET, 23) , SCC_I2C2 = _REG_BIT(RCC_APB1ENR1_OFFSET, 22) , SCC_I2C1 = _REG_BIT(RCC_APB1ENR1_OFFSET, 21) , SCC_UART5 = _REG_BIT(RCC_APB1ENR1_OFFSET, 20) , SCC_UART4 = _REG_BIT(RCC_APB1ENR1_OFFSET, 19) , SCC_USART3 = _REG_BIT(RCC_APB1ENR1_OFFSET, 18) , SCC_USART2 = _REG_BIT(RCC_APB1ENR1_OFFSET, 17) , SCC_SPI3 = _REG_BIT(RCC_APB1ENR1_OFFSET, 15) , SCC_SPI2 = _REG_BIT(RCC_APB1ENR1_OFFSET, 14) , SCC_WWDG = _REG_BIT(RCC_APB1ENR1_OFFSET, 11) , SCC_LCD = _REG_BIT(RCC_APB1ENR1_OFFSET, 9) , SCC_TIM7 = _REG_BIT(RCC_APB1ENR1_OFFSET, 5) , SCC_TIM6 = _REG_BIT(RCC_APB1ENR1_OFFSET, 4) , SCC_TIM5 = _REG_BIT(RCC_APB1ENR1_OFFSET, 3) , SCC_TIM4 = _REG_BIT(RCC_APB1ENR1_OFFSET, 2) , SCC_TIM3 = _REG_BIT(RCC_APB1ENR1_OFFSET, 1) , SCC_TIM2 = _REG_BIT(RCC_APB1ENR1_OFFSET, 0) , SCC_LPTIM2 = _REG_BIT(RCC_APB1ENR2_OFFSET, 5) , SCC_SWPMI1 = _REG_BIT(RCC_APB1ENR2_OFFSET, 2) , SCC_LPUART1 = _REG_BIT(RCC_APB1ENR2_OFFSET, 0) , SCC_DFSDM = _REG_BIT(RCC_APB2ENR_OFFSET, 24) , SCC_SAI2 = _REG_BIT(RCC_APB2ENR_OFFSET, 22) , SCC_SAI1 = _REG_BIT(RCC_APB2ENR_OFFSET, 21) , SCC_TIM17 = _REG_BIT(RCC_APB2ENR_OFFSET, 18) , SCC_TIM16 = _REG_BIT(RCC_APB2ENR_OFFSET, 17) , SCC_TIM15 = _REG_BIT(RCC_APB2ENR_OFFSET, 16) , SCC_USART1 = _REG_BIT(RCC_APB2ENR_OFFSET, 14) , SCC_TIM8 = _REG_BIT(RCC_APB2ENR_OFFSET, 13) , SCC_SPI1 = _REG_BIT(RCC_APB2ENR_OFFSET, 12) , SCC_TIM1 = _REG_BIT(RCC_APB2ENR_OFFSET, 11) , SCC_SDMMC1 = _REG_BIT(RCC_APB2ENR_OFFSET, 10) , SCC_SYSCFG = _REG_BIT(RCC_APB2ENR_OFFSET, 0) } |
enum | rcc_periph_rst { RST_TSC = _REG_BIT(RCC_AHB1RSTR_OFFSET, 16) , RST_CRC = _REG_BIT(RCC_AHB1RSTR_OFFSET, 12) , RST_FLASH = _REG_BIT(RCC_AHB1RSTR_OFFSET, 8) , RST_DMA2 = _REG_BIT(RCC_AHB1RSTR_OFFSET, 1) , RST_DMA1 = _REG_BIT(RCC_AHB1RSTR_OFFSET, 0) , RST_RNG = _REG_BIT(RCC_AHB2RSTR_OFFSET, 18) , RST_AES = _REG_BIT(RCC_AHB2RSTR_OFFSET, 16) , RST_ADC = _REG_BIT(RCC_AHB2RSTR_OFFSET, 13) , RST_ADC1 = _REG_BIT(RCC_AHB2RSTR_OFFSET, 13) , RST_OTGFS = _REG_BIT(RCC_AHB2RSTR_OFFSET, 12) , RST_GPIOH = _REG_BIT(RCC_AHB2RSTR_OFFSET, 7) , RST_GPIOG = _REG_BIT(RCC_AHB2RSTR_OFFSET, 6) , RST_GPIOF = _REG_BIT(RCC_AHB2RSTR_OFFSET, 5) , RST_GPIOE = _REG_BIT(RCC_AHB2RSTR_OFFSET, 4) , RST_GPIOD = _REG_BIT(RCC_AHB2RSTR_OFFSET, 3) , RST_GPIOC = _REG_BIT(RCC_AHB2RSTR_OFFSET, 2) , RST_GPIOB = _REG_BIT(RCC_AHB2RSTR_OFFSET, 1) , RST_GPIOA = _REG_BIT(RCC_AHB2RSTR_OFFSET, 0) , RST_QSPI = _REG_BIT(RCC_AHB3RSTR_OFFSET, 8) , RST_FMC = _REG_BIT(RCC_AHB3RSTR_OFFSET, 0) , RST_LPTIM1 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 31) , RST_OPAMP = _REG_BIT(RCC_APB1RSTR1_OFFSET, 30) , RST_DAC1 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 29) , RST_PWR = _REG_BIT(RCC_APB1RSTR1_OFFSET, 28) , RST_USB = _REG_BIT(RCC_APB1RSTR1_OFFSET, 26) , RST_CAN2 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 26) , RST_CAN1 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 25) , RST_CRS = _REG_BIT(RCC_APB1RSTR1_OFFSET, 24) , RST_I2C3 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 23) , RST_I2C2 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 22) , RST_I2C1 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 21) , RST_UART5 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 20) , RST_UART4 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 19) , RST_USART3 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 18) , RST_USART2 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 17) , RST_SPI3 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 15) , RST_SPI2 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 14) , RST_LCD = _REG_BIT(RCC_APB1RSTR1_OFFSET, 9) , RST_TIM7 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 5) , RST_TIM6 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 4) , RST_TIM5 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 3) , RST_TIM4 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 2) , RST_TIM3 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 1) , RST_TIM2 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 0) , RST_LPTIM2 = _REG_BIT(RCC_APB1RSTR2_OFFSET, 5) , RST_SWPMI1 = _REG_BIT(RCC_APB1RSTR2_OFFSET, 2) , RST_LPUART1 = _REG_BIT(RCC_APB1RSTR2_OFFSET, 0) , RST_DFSDM = _REG_BIT(RCC_APB2RSTR_OFFSET, 24) , RST_SAI2 = _REG_BIT(RCC_APB2RSTR_OFFSET, 22) , RST_SAI1 = _REG_BIT(RCC_APB2RSTR_OFFSET, 21) , RST_TIM17 = _REG_BIT(RCC_APB2RSTR_OFFSET, 18) , RST_TIM16 = _REG_BIT(RCC_APB2RSTR_OFFSET, 17) , RST_TIM15 = _REG_BIT(RCC_APB2RSTR_OFFSET, 16) , RST_USART1 = _REG_BIT(RCC_APB2RSTR_OFFSET, 14) , RST_TIM8 = _REG_BIT(RCC_APB2RSTR_OFFSET, 13) , RST_SPI1 = _REG_BIT(RCC_APB2RSTR_OFFSET, 12) , RST_TIM1 = _REG_BIT(RCC_APB2RSTR_OFFSET, 11) , RST_SDMMC1 = _REG_BIT(RCC_APB2RSTR_OFFSET, 10) , RST_SYSCFG = _REG_BIT(RCC_APB2RSTR_OFFSET, 0) } |
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) |
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_sysclk_source (uint32_t clk) |
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_main_pll (uint32_t source, uint32_t pllm, uint32_t plln, uint32_t pllp, uint32_t pllq, uint32_t pllr) |
uint32_t | rcc_system_clock_source (void) |
void | rcc_clock_setup_pll (const struct rcc_clock_scale *clock) |
Setup clocks to run from PLL. More... | |
void | rcc_set_msi_range (uint32_t msi_range) |
Set the msi run time range. More... | |
void | rcc_set_msi_range_standby (uint32_t msi_range) |
Set the msi range after reset/standby. More... | |
void | rcc_pll_output_enable (uint32_t pllout) |
Enable PLL Output. More... | |
void | rcc_set_clock48_source (uint32_t clksel) |
Set clock source for 48MHz clock. More... | |
void | rcc_enable_rtc_clock (void) |
Enable the RTC clock. More... | |
void | rcc_disable_rtc_clock (void) |
Disable the RTC clock. More... | |
void | rcc_set_rtc_clock_source (enum rcc_osc clk) |
Set the source for the RTC clock. More... | |
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 | |
const struct rcc_clock_scale | rcc_hsi16_configs [RCC_CLOCK_CONFIG_END] |
uint32_t | rcc_ahb_frequency |
uint32_t | rcc_apb1_frequency |
uint32_t | rcc_apb2_frequency |