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_source { RCC_CPUCLK , RCC_SYSCLK , RCC_PERCLK , RCC_SYSTICKCLK , RCC_HCLK3 , RCC_AHBCLK , RCC_APB1CLK , RCC_APB2CLK } |
Enumerations for core system/bus clocks for user/driver/system access to base bus clocks not directly associated with a peripheral. More... | |
enum | rcc_clock_3v3 { RCC_CLOCK_3V3_24MHZ , RCC_CLOCK_3V3_48MHZ , RCC_CLOCK_3V3_96MHZ , RCC_CLOCK_3V3_170MHZ , RCC_CLOCK_3V3_END } |
enum | rcc_osc { RCC_HSI48 , RCC_PLL , RCC_HSE , RCC_HSI16 , RCC_LSE , RCC_LSI } |
enum | rcc_periph_clken { RCC_CRC = _REG_BIT(RCC_AHB1ENR_OFFSET, 12) , RCC_FLASH = _REG_BIT(RCC_AHB1ENR_OFFSET, 8) , RCC_FMAC = _REG_BIT(RCC_AHB1ENR_OFFSET, 4) , RCC_CORDIC = _REG_BIT(RCC_AHB1ENR_OFFSET, 3) , RCC_DMAMUX1 = _REG_BIT(RCC_AHB1ENR_OFFSET, 2) , RCC_DMA2 = _REG_BIT(RCC_AHB1ENR_OFFSET, 1) , RCC_DMA1 = _REG_BIT(RCC_AHB1ENR_OFFSET, 0) , RCC_RNG = _REG_BIT(RCC_AHB2ENR_OFFSET, 26) , RCC_AES = _REG_BIT(RCC_AHB2ENR_OFFSET, 24) , RCC_DAC4 = _REG_BIT(RCC_AHB2ENR_OFFSET, 19) , RCC_DAC3 = _REG_BIT(RCC_AHB2ENR_OFFSET, 18) , RCC_DAC2 = _REG_BIT(RCC_AHB2ENR_OFFSET, 17) , RCC_DAC1 = _REG_BIT(RCC_AHB2ENR_OFFSET, 16) , RCC_ADC345 = _REG_BIT(RCC_AHB2ENR_OFFSET, 14) , RCC_ADC12 = _REG_BIT(RCC_AHB2ENR_OFFSET, 13) , RCC_ADC1 = _REG_BIT(RCC_AHB2ENR_OFFSET, 13) , 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_I2C3 = _REG_BIT(RCC_APB1ENR1_OFFSET, 30) , RCC_PWR = _REG_BIT(RCC_APB1ENR1_OFFSET, 28) , RCC_FDCAN = _REG_BIT(RCC_APB1ENR1_OFFSET, 25) , RCC_USB = _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_WWDG = _REG_BIT(RCC_APB1ENR1_OFFSET, 11) , RCC_RTCAPB = _REG_BIT(RCC_APB1ENR1_OFFSET, 10) , RCC_CRS = _REG_BIT(RCC_APB1ENR1_OFFSET, 8) , 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_UCPD1 = _REG_BIT(RCC_APB1ENR2_OFFSET, 8) , RCC_I2C4 = _REG_BIT(RCC_APB1ENR2_OFFSET, 1) , RCC_LPUART1 = _REG_BIT(RCC_APB1ENR2_OFFSET, 0) , RCC_HRTIM1 = _REG_BIT(RCC_APB2ENR_OFFSET, 26) , RCC_SAI1 = _REG_BIT(RCC_APB2ENR_OFFSET, 21) , RCC_TIM20 = _REG_BIT(RCC_APB2ENR_OFFSET, 20) , 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_SPI4 = _REG_BIT(RCC_APB2ENR_OFFSET, 15) , 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_SYSCFG = _REG_BIT(RCC_APB2ENR_OFFSET, 0) , 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_FMAC = _REG_BIT(RCC_AHB1SMENR_OFFSET, 4) , SCC_CORDIC = _REG_BIT(RCC_AHB1SMENR_OFFSET, 3) , SCC_DMAMUX1 = _REG_BIT(RCC_AHB1SMENR_OFFSET, 2) , SCC_DMA2 = _REG_BIT(RCC_AHB1SMENR_OFFSET, 1) , SCC_DMA1 = _REG_BIT(RCC_AHB1SMENR_OFFSET, 0) , SCC_RNG = _REG_BIT(RCC_AHB2SMENR_OFFSET, 26) , SCC_AES = _REG_BIT(RCC_AHB2SMENR_OFFSET, 24) , SCC_DAC4 = _REG_BIT(RCC_AHB2SMENR_OFFSET, 19) , SCC_DAC3 = _REG_BIT(RCC_AHB2SMENR_OFFSET, 18) , SCC_DAC2 = _REG_BIT(RCC_AHB2SMENR_OFFSET, 17) , SCC_DAC1 = _REG_BIT(RCC_AHB2SMENR_OFFSET, 16) , SCC_ADC345 = _REG_BIT(RCC_AHB2SMENR_OFFSET, 14) , SCC_ADC12 = _REG_BIT(RCC_AHB2SMENR_OFFSET, 13) , SCC_ADC1 = _REG_BIT(RCC_AHB2SMENR_OFFSET, 13) , SCC_CCMSRAM = _REG_BIT(RCC_AHB2SMENR_OFFSET, 10) , SCC_SRAM2 = _REG_BIT(RCC_AHB2SMENR_OFFSET, 9) , 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_APB1SMENR1_OFFSET, 31) , SCC_I2C3 = _REG_BIT(RCC_APB1SMENR1_OFFSET, 30) , SCC_PWR = _REG_BIT(RCC_APB1SMENR1_OFFSET, 28) , SCC_FDCAN = _REG_BIT(RCC_APB1SMENR1_OFFSET, 25) , SCC_USB = _REG_BIT(RCC_APB1SMENR1_OFFSET, 23) , SCC_I2C2 = _REG_BIT(RCC_APB1SMENR1_OFFSET, 22) , SCC_I2C1 = _REG_BIT(RCC_APB1SMENR1_OFFSET, 21) , SCC_UART5 = _REG_BIT(RCC_APB1SMENR1_OFFSET, 20) , SCC_UART4 = _REG_BIT(RCC_APB1SMENR1_OFFSET, 19) , SCC_USART3 = _REG_BIT(RCC_APB1SMENR1_OFFSET, 18) , SCC_USART2 = _REG_BIT(RCC_APB1SMENR1_OFFSET, 17) , SCC_SPI3 = _REG_BIT(RCC_APB1SMENR1_OFFSET, 15) , SCC_SPI2 = _REG_BIT(RCC_APB1SMENR1_OFFSET, 14) , SCC_WWDG = _REG_BIT(RCC_APB1SMENR1_OFFSET, 11) , SCC_RTCAPB = _REG_BIT(RCC_APB1SMENR1_OFFSET, 10) , SCC_CRS = _REG_BIT(RCC_APB1SMENR1_OFFSET, 8) , SCC_TIM7 = _REG_BIT(RCC_APB1SMENR1_OFFSET, 5) , SCC_TIM6 = _REG_BIT(RCC_APB1SMENR1_OFFSET, 4) , SCC_TIM5 = _REG_BIT(RCC_APB1SMENR1_OFFSET, 3) , SCC_TIM4 = _REG_BIT(RCC_APB1SMENR1_OFFSET, 2) , SCC_TIM3 = _REG_BIT(RCC_APB1SMENR1_OFFSET, 1) , SCC_TIM2 = _REG_BIT(RCC_APB1SMENR1_OFFSET, 0) , SCC_UCPD1 = _REG_BIT(RCC_APB1SMENR2_OFFSET, 8) , SCC_I2C4 = _REG_BIT(RCC_APB1SMENR2_OFFSET, 1) , SCC_LPUART1 = _REG_BIT(RCC_APB1SMENR2_OFFSET, 0) , SCC_HRTIM1 = _REG_BIT(RCC_APB2SMENR_OFFSET, 26) , SCC_SAI1 = _REG_BIT(RCC_APB2SMENR_OFFSET, 21) , SCC_TIM20 = _REG_BIT(RCC_APB2SMENR_OFFSET, 20) , SCC_TIM17 = _REG_BIT(RCC_APB2SMENR_OFFSET, 18) , SCC_TIM16 = _REG_BIT(RCC_APB2SMENR_OFFSET, 17) , SCC_TIM15 = _REG_BIT(RCC_APB2SMENR_OFFSET, 16) , SCC_SPI4 = _REG_BIT(RCC_APB2SMENR_OFFSET, 15) , SCC_USART1 = _REG_BIT(RCC_APB2SMENR_OFFSET, 14) , SCC_TIM8 = _REG_BIT(RCC_APB2SMENR_OFFSET, 13) , SCC_SPI1 = _REG_BIT(RCC_APB2SMENR_OFFSET, 12) , SCC_TIM1 = _REG_BIT(RCC_APB2SMENR_OFFSET, 11) , SCC_SYSCFG = _REG_BIT(RCC_APB2SMENR_OFFSET, 0) } |
enum | rcc_periph_rst { RST_CRC = _REG_BIT(RCC_AHB1RSTR_OFFSET, 12) , RST_FLASH = _REG_BIT(RCC_AHB1RSTR_OFFSET, 8) , RST_FMAC = _REG_BIT(RCC_AHB1RSTR_OFFSET, 4) , RST_CORDIC = _REG_BIT(RCC_AHB1RSTR_OFFSET, 3) , RST_DMAMUX1 = _REG_BIT(RCC_AHB1RSTR_OFFSET, 2) , RST_DMA2 = _REG_BIT(RCC_AHB1RSTR_OFFSET, 1) , RST_DMA1 = _REG_BIT(RCC_AHB1RSTR_OFFSET, 0) , RST_RNG = _REG_BIT(RCC_AHB2RSTR_OFFSET, 26) , RST_AES = _REG_BIT(RCC_AHB2RSTR_OFFSET, 24) , RST_DAC4 = _REG_BIT(RCC_AHB2RSTR_OFFSET, 19) , RST_DAC3 = _REG_BIT(RCC_AHB2RSTR_OFFSET, 18) , RST_DAC2 = _REG_BIT(RCC_AHB2RSTR_OFFSET, 17) , RST_DAC1 = _REG_BIT(RCC_AHB2RSTR_OFFSET, 16) , RST_ADC345 = _REG_BIT(RCC_AHB2RSTR_OFFSET, 14) , RST_ADC12 = _REG_BIT(RCC_AHB2RSTR_OFFSET, 13) , RST_ADC1 = _REG_BIT(RCC_AHB2RSTR_OFFSET, 13) , 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_I2C3 = _REG_BIT(RCC_APB1RSTR1_OFFSET, 30) , RST_PWR = _REG_BIT(RCC_APB1RSTR1_OFFSET, 28) , RST_FDCAN = _REG_BIT(RCC_APB1RSTR1_OFFSET, 25) , RST_USB = _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_CRS = _REG_BIT(RCC_APB1RSTR1_OFFSET, 8) , 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_UCPD1 = _REG_BIT(RCC_APB1RSTR2_OFFSET, 8) , RST_I2C4 = _REG_BIT(RCC_APB1RSTR2_OFFSET, 1) , RST_LPUART1 = _REG_BIT(RCC_APB1RSTR2_OFFSET, 0) , RST_HRTIM1 = _REG_BIT(RCC_APB2RSTR_OFFSET, 26) , RST_SAI1 = _REG_BIT(RCC_APB2RSTR_OFFSET, 21) , RST_TIM20 = _REG_BIT(RCC_APB2RSTR_OFFSET, 20) , 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_SPI4 = _REG_BIT(RCC_APB2RSTR_OFFSET, 15) , 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_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 pllsrc, uint32_t pllm, uint32_t plln, uint32_t pllp, uint32_t pllq, uint32_t pllr) |
Reconfigures the main PLL for a HSE source. More... | |
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_clock_setup_hse_3v3 (const struct rcc_clock_scale *clock) |
Setup clocks with the HSE. More... | |
void | rcc_set_clock48_source (uint32_t clksel) |
Set clock source for 48MHz clock. More... | |
uint32_t | rcc_get_usart_clk_freq (uint32_t usart) |
Get the peripheral clock speed for the specified (LP)UxART. More... | |
Variables | |
uint32_t | rcc_ahb_frequency |
uint32_t | rcc_apb1_frequency |
uint32_t | rcc_apb2_frequency |
const struct rcc_clock_scale | rcc_hsi_configs [RCC_CLOCK_3V3_END] |
const struct rcc_clock_scale | rcc_hse_8mhz_3v3 [RCC_CLOCK_3V3_END] |
const struct rcc_clock_scale | rcc_hse_12mhz_3v3 [RCC_CLOCK_3V3_END] |
const struct rcc_clock_scale | rcc_hse_16mhz_3v3 [RCC_CLOCK_3V3_END] |