libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.

Defined Constants and Types for the STM32F0xx Reset and Clock Control More...

Collaboration diagram for RCC Defines:

Modules

 PLL source predividers
 

Macros

#define RCC_CR   MMIO32(RCC_BASE + 0x00)
 
#define RCC_CFGR   MMIO32(RCC_BASE + 0x04)
 
#define RCC_CIR   MMIO32(RCC_BASE + 0x08)
 
#define RCC_APB2RSTR   MMIO32(RCC_BASE + 0x0c)
 
#define RCC_APB1RSTR   MMIO32(RCC_BASE + 0x10)
 
#define RCC_AHBENR   MMIO32(RCC_BASE + 0x14)
 
#define RCC_APB2ENR   MMIO32(RCC_BASE + 0x18)
 
#define RCC_APB1ENR   MMIO32(RCC_BASE + 0x1c)
 
#define RCC_BDCR   MMIO32(RCC_BASE + 0x20)
 
#define RCC_CSR   MMIO32(RCC_BASE + 0x24)
 
#define RCC_AHBRSTR   MMIO32(RCC_BASE + 0x28)
 
#define RCC_CFGR2   MMIO32(RCC_BASE + 0x2c)
 
#define RCC_CFGR3   MMIO32(RCC_BASE + 0x30)
 
#define RCC_CR2   MMIO32(RCC_BASE + 0x34)
 
#define RCC_CR_PLLRDY   (1 << 25)
 
#define RCC_CR_PLLON   (1 << 24)
 
#define RCC_CR_CSSON   (1 << 19)
 
#define RCC_CR_HSEBYP   (1 << 18)
 
#define RCC_CR_HSERDY   (1 << 17)
 
#define RCC_CR_HSEON   (1 << 16)
 
#define RCC_CR_HSICAL_SHIFT   8
 
#define RCC_CR_HSICAL   (0xFF << RCC_CR_HSICAL_SHIFT)
 
#define RCC_CR_HSITRIM_SHIFT   3
 
#define RCC_CR_HSITRIM   (0x1F << RCC_CR_HSITRIM_SHIFT)
 
#define RCC_CR_HSIRDY   (1 << 1)
 
#define RCC_CR_HSION   (1 << 0)
 
#define RCC_CFGR_PLLNODIV   (1 << 31)
 
#define RCC_CFGR_MCOPRE_SHIFT   28
 
#define RCC_CFGR_MCOPRE   (7 << RCC_CFGR_MCOPRE_SHIFT)
 
#define RCC_CFGR_MCOPRE_DIV1   (0 << RCC_CFGR_MCOPRE_SHIFT)
 
#define RCC_CFGR_MCOPRE_DIV2   (1 << RCC_CFGR_MCOPRE_SHIFT)
 
#define RCC_CFGR_MCOPRE_DIV4   (2 << RCC_CFGR_MCOPRE_SHIFT)
 
#define RCC_CFGR_MCOPRE_DIV8   (3 << RCC_CFGR_MCOPRE_SHIFT)
 
#define RCC_CFGR_MCOPRE_DIV16   (4 << RCC_CFGR_MCOPRE_SHIFT)
 
#define RCC_CFGR_MCOPRE_DIV32   (5 << RCC_CFGR_MCOPRE_SHIFT)
 
#define RCC_CFGR_MCOPRE_DIV64   (6 << RCC_CFGR_MCOPRE_SHIFT)
 
#define RCC_CFGR_MCOPRE_DIV128   (7 << RCC_CFGR_MCOPRE_SHIFT)
 
#define RCC_CFGR_MCO_SHIFT   24
 
#define RCC_CFGR_MCO_MASK   0xf
 
#define RCC_CFGR_MCO_NOCLK   0
 
#define RCC_CFGR_MCO_HSI14   1
 
#define RCC_CFGR_MCO_LSI   2
 
#define RCC_CFGR_MCO_LSE   3
 
#define RCC_CFGR_MCO_SYSCLK   4
 
#define RCC_CFGR_MCO_HSI   5
 
#define RCC_CFGR_MCO_HSE   6
 
#define RCC_CFGR_MCO_PLL   7
 
#define RCC_CFGR_MCO_HSI48   8
 
#define RCC_CFGR_PLLMUL_SHIFT   18
 
#define RCC_CFGR_PLLMUL   (0x0F << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLMUL_MUL2   (0x00 << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLMUL_MUL3   (0x01 << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLMUL_MUL4   (0x02 << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLMUL_MUL5   (0x03 << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLMUL_MUL6   (0x04 << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLMUL_MUL7   (0x05 << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLMUL_MUL8   (0x06 << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLMUL_MUL9   (0x07 << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLMUL_MUL10   (0x08 << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLMUL_MUL11   (0x09 << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLMUL_MUL12   (0x0A << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLMUL_MUL13   (0x0B << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLMUL_MUL14   (0x0C << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLMUL_MUL15   (0x0D << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLMUL_MUL16   (0x0E << RCC_CFGR_PLLMUL_SHIFT)
 
#define RCC_CFGR_PLLXTPRE   (1<<17)
 
#define RCC_CFGR_PLLXTPRE_HSE_CLK   0x0
 
#define RCC_CFGR_PLLXTPRE_HSE_CLK_DIV2   0x1
 
#define RCC_CFGR_PLLSRC   (1<<16)
 
#define RCC_CFGR_PLLSRC_HSI_CLK_DIV2   0x0
 
#define RCC_CFGR_PLLSRC_HSE_CLK   0x1
 
#define RCC_CFGR_PLLSRC0   (1<<15)
 
#define RCC_CFGR_ADCPRE   (1<<14)
 
#define RCC_CFGR_PPRE_SHIFT   8
 
#define RCC_CFGR_PPRE   (7 << RCC_CFGR_PPRE_SHIFT)
 
#define RCC_CFGR_PPRE_NODIV   (0 << RCC_CFGR_PPRE_SHIFT)
 
#define RCC_CFGR_PPRE_DIV2   (4 << RCC_CFGR_PPRE_SHIFT)
 
#define RCC_CFGR_PPRE_DIV4   (5 << RCC_CFGR_PPRE_SHIFT)
 
#define RCC_CFGR_PPRE_DIV8   (6 << RCC_CFGR_PPRE_SHIFT)
 
#define RCC_CFGR_PPRE_DIV16   (7 << RCC_CFGR_PPRE_SHIFT)
 
#define RCC_CFGR_HPRE_SHIFT   4
 
#define RCC_CFGR_HPRE   (0xf << RCC_CFGR_HPRE_SHIFT)
 
#define RCC_CFGR_HPRE_NODIV   (0x0 << RCC_CFGR_HPRE_SHIFT)
 
#define RCC_CFGR_HPRE_DIV2   (0x8 << RCC_CFGR_HPRE_SHIFT)
 
#define RCC_CFGR_HPRE_DIV4   (0x9 << RCC_CFGR_HPRE_SHIFT)
 
#define RCC_CFGR_HPRE_DIV8   (0xa << RCC_CFGR_HPRE_SHIFT)
 
#define RCC_CFGR_HPRE_DIV16   (0xb << RCC_CFGR_HPRE_SHIFT)
 
#define RCC_CFGR_HPRE_DIV64   (0xc << RCC_CFGR_HPRE_SHIFT)
 
#define RCC_CFGR_HPRE_DIV128   (0xd << RCC_CFGR_HPRE_SHIFT)
 
#define RCC_CFGR_HPRE_DIV256   (0xe << RCC_CFGR_HPRE_SHIFT)
 
#define RCC_CFGR_HPRE_DIV512   (0xf << RCC_CFGR_HPRE_SHIFT)
 
#define RCC_CFGR_SWS_SHIFT   2
 
#define RCC_CFGR_SWS   (3 << RCC_CFGR_SWS_SHIFT)
 
#define RCC_CFGR_SWS_HSI   (0 << RCC_CFGR_SWS_SHIFT)
 
#define RCC_CFGR_SWS_HSE   (1 << RCC_CFGR_SWS_SHIFT)
 
#define RCC_CFGR_SWS_PLL   (2 << RCC_CFGR_SWS_SHIFT)
 
#define RCC_CFGR_SWS_HSI48   (3 << RCC_CFGR_SWS_SHIFT)
 
#define RCC_CFGR_SW_SHIFT   0
 
#define RCC_CFGR_SW   (3 << RCC_CFGR_SW_SHIFT)
 
#define RCC_CFGR_SW_HSI   (0 << RCC_CFGR_SW_SHIFT)
 
#define RCC_CFGR_SW_HSE   (1 << RCC_CFGR_SW_SHIFT)
 
#define RCC_CFGR_SW_PLL   (2 << RCC_CFGR_SW_SHIFT)
 
#define RCC_CFGR_SW_HSI48   (3 << RCC_CFGR_SW_SHIFT)
 
#define RCC_CIR_CSSC   (1 << 23)
 
#define RCC_CIR_HSI48RDYC   (1 << 22)
 
#define RCC_CIR_HSI14RDYC   (1 << 21)
 
#define RCC_CIR_PLLRDYC   (1 << 20)
 
#define RCC_CIR_HSERDYC   (1 << 19)
 
#define RCC_CIR_HSIRDYC   (1 << 18)
 
#define RCC_CIR_LSERDYC   (1 << 17)
 
#define RCC_CIR_LSIRDYC   (1 << 16)
 
#define RCC_CIR_HSI48RDYIE   (1 << 14)
 
#define RCC_CIR_HSI14RDYIE   (1 << 13)
 
#define RCC_CIR_PLLRDYIE   (1 << 12)
 
#define RCC_CIR_HSERDYIE   (1 << 11)
 
#define RCC_CIR_HSIRDYIE   (1 << 10)
 
#define RCC_CIR_LSERDYIE   (1 << 9)
 
#define RCC_CIR_LSIRDYIE   (1 << 8)
 
#define RCC_CIR_CSSF   (1 << 7)
 
#define RCC_CIR_HSI48RDYF   (1 << 6)
 
#define RCC_CIR_HSI14RDYF   (1 << 5)
 
#define RCC_CIR_PLLRDYF   (1 << 4)
 
#define RCC_CIR_HSERDYF   (1 << 3)
 
#define RCC_CIR_HSIRDYF   (1 << 2)
 
#define RCC_CIR_LSERDYF   (1 << 1)
 
#define RCC_CIR_LSIRDYF   (1 << 0)
 
#define RCC_APB2RSTR_DBGMCURST   (1 << 22)
 
#define RCC_APB2RSTR_TIM17RST   (1 << 18)
 
#define RCC_APB2RSTR_TIM16RST   (1 << 17)
 
#define RCC_APB2RSTR_TIM15RST   (1 << 16)
 
#define RCC_APB2RSTR_USART1RST   (1 << 14)
 
#define RCC_APB2RSTR_SPI1RST   (1 << 12)
 
#define RCC_APB2RSTR_TIM1RST   (1 << 11)
 
#define RCC_APB2RSTR_ADCRST   (1 << 9)
 
#define RCC_APB2RSTR_USART8RST   (1 << 7)
 
#define RCC_APB2RSTR_USART7RST   (1 << 6)
 
#define RCC_APB2RSTR_USART6RST   (1 << 5)
 
#define RCC_APB2RSTR_SYSCFGRST   (1 << 0)
 
#define RCC_APB1RSTR_CECRST   (1 << 30)
 
#define RCC_APB1RSTR_DACRST   (1 << 29)
 
#define RCC_APB1RSTR_PWRRST   (1 << 28)
 
#define RCC_APB1RSTR_CRSRST   (1 << 27)
 
#define RCC_APB1RSTR_CANRST   (1 << 25)
 
#define RCC_APB1RSTR_USBRST   (1 << 23)
 
#define RCC_APB1RSTR_I2C2RST   (1 << 22)
 
#define RCC_APB1RSTR_I2C1RST   (1 << 21)
 
#define RCC_APB1RSTR_USART5RST   (1 << 20)
 
#define RCC_APB1RSTR_USART4RST   (1 << 19)
 
#define RCC_APB1RSTR_USART3RST   (1 << 18)
 
#define RCC_APB1RSTR_USART2RST   (1 << 17)
 
#define RCC_APB1RSTR_SPI2RST   (1 << 14)
 
#define RCC_APB1RSTR_WWDGRST   (1 << 11)
 
#define RCC_APB1RSTR_TIM14RST   (1 << 8)
 
#define RCC_APB1RSTR_TIM7RST   (1 << 5)
 
#define RCC_APB1RSTR_TIM6RST   (1 << 4)
 
#define RCC_APB1RSTR_TIM3RST   (1 << 1)
 
#define RCC_APB1RSTR_TIM2RST   (1 << 0)
 
#define RCC_AHBENR_TSCEN   (1 << 24)
 
#define RCC_AHBENR_GPIOFEN   (1 << 22)
 
#define RCC_AHBENR_GPIOEEN   (1 << 21)
 
#define RCC_AHBENR_GPIODEN   (1 << 20)
 
#define RCC_AHBENR_GPIOCEN   (1 << 19)
 
#define RCC_AHBENR_GPIOBEN   (1 << 18)
 
#define RCC_AHBENR_GPIOAEN   (1 << 17)
 
#define RCC_AHBENR_CRCEN   (1 << 6)
 
#define RCC_AHBENR_FLTFEN   (1 << 4)
 
#define RCC_AHBENR_SRAMEN   (1 << 2)
 
#define RCC_AHBENR_DMA2EN   (1 << 1)
 
#define RCC_AHBENR_DMA1EN   (1 << 0)
 
#define RCC_AHBENR_DMAEN   RCC_AHBENR_DMA1EN /* compatibility alias */
 
#define RCC_APB2ENR_DBGMCUEN   (1 << 22)
 
#define RCC_APB2ENR_TIM17EN   (1 << 18)
 
#define RCC_APB2ENR_TIM16EN   (1 << 17)
 
#define RCC_APB2ENR_TIM15EN   (1 << 16)
 
#define RCC_APB2ENR_USART1EN   (1 << 14)
 
#define RCC_APB2ENR_SPI1EN   (1 << 12)
 
#define RCC_APB2ENR_TIM1EN   (1 << 11)
 
#define RCC_APB2ENR_ADCEN   (1 << 9)
 
#define RCC_APB2ENR_USART8EN   (1 << 7)
 
#define RCC_APB2ENR_USART7EN   (1 << 6)
 
#define RCC_APB2ENR_USART6EN   (1 << 5)
 
#define RCC_APB2ENR_SYSCFGCOMPEN   (1 << 0)
 
#define RCC_APB1ENR_CECEN   (1 << 30)
 
#define RCC_APB1ENR_DACEN   (1 << 29)
 
#define RCC_APB1ENR_PWREN   (1 << 28)
 
#define RCC_APB1ENR_CRSEN   (1 << 27)
 
#define RCC_APB1ENR_CANEN   (1 << 25)
 
#define RCC_APB1ENR_USBEN   (1 << 23)
 
#define RCC_APB1ENR_I2C2EN   (1 << 22)
 
#define RCC_APB1ENR_I2C1EN   (1 << 21)
 
#define RCC_APB1ENR_USART5EN   (1 << 20)
 
#define RCC_APB1ENR_USART4EN   (1 << 19)
 
#define RCC_APB1ENR_USART3EN   (1 << 18)
 
#define RCC_APB1ENR_USART2EN   (1 << 17)
 
#define RCC_APB1ENR_SPI2EN   (1 << 14)
 
#define RCC_APB1ENR_WWDGEN   (1 << 11)
 
#define RCC_APB1ENR_TIM14EN   (1 << 8)
 
#define RCC_APB1ENR_TIM7EN   (1 << 5)
 
#define RCC_APB1ENR_TIM6EN   (1 << 4)
 
#define RCC_APB1ENR_TIM3EN   (1 << 1)
 
#define RCC_APB1ENR_TIM2EN   (1 << 0)
 
#define RCC_BDCR_BDRST   (1 << 16)
 
#define RCC_BDCR_RTCEN   (1 << 15)
 
#define RCC_BDCR_RTCSEL_SHIFT   8
 
#define RCC_BDCR_RTCSEL   (3 << RCC_BDCR_RTCSEL_SHIFT)
 
#define RCC_BDCR_RTCSEL_NOCLK   (0 << RCC_BDCR_RTCSEL_SHIFT)
 
#define RCC_BDCR_RTCSEL_LSE   (1 << RCC_BDCR_RTCSEL_SHIFT)
 
#define RCC_BDCR_RTCSEL_LSI   (2 << RCC_BDCR_RTCSEL_SHIFT)
 
#define RCC_BDCR_RTCSEL_HSE   (3 << RCC_BDCR_RTCSEL_SHIFT)
 
#define RCC_BDCR_LSEDRV_SHIFT   3
 
#define RCC_BDCR_LSEDRV   (3 << RCC_BDCR_LSEDRV_SHIFT)
 
#define RCC_BDCR_LSEDRV_LOW   (0 << RCC_BDCR_LSEDRV_SHIFT)
 
#define RCC_BDCR_LSEDRV_MEDLO   (1 << RCC_BDCR_LSEDRV_SHIFT)
 
#define RCC_BDCR_LSEDRV_MEDHI   (2 << RCC_BDCR_LSEDRV_SHIFT)
 
#define RCC_BDCR_LSEDRV_HIGH   (3 << RCC_BDCR_LSEDRV_SHIFT)
 
#define RCC_BDCR_LSEBYP   (1 << 2)
 
#define RCC_BDCR_LSERDY   (1 << 1)
 
#define RCC_BDCR_LSEON   (1 << 0)
 
#define RCC_CSR_LPWRRSTF   (1 << 31)
 
#define RCC_CSR_WWDGRSTF   (1 << 30)
 
#define RCC_CSR_IWDGRSTF   (1 << 29)
 
#define RCC_CSR_SFTRSTF   (1 << 28)
 
#define RCC_CSR_PORRSTF   (1 << 27)
 
#define RCC_CSR_PINRSTF   (1 << 26)
 
#define RCC_CSR_OBLRSTF   (1 << 25)
 
#define RCC_CSR_RMVF   (1 << 24)
 
#define RCC_CSR_RESET_FLAGS
 
#define RCC_CSR_V18PWRRSTF   (1 << 23)
 
#define RCC_CSR_LSIRDY   (1 << 1)
 
#define RCC_CSR_LSION   (1 << 0)
 
#define RCC_AHBRSTR_TSCRST   (1 << 24)
 
#define RCC_AHBRSTR_IOPFRST   (1 << 22)
 
#define RCC_AHBRSTR_IOPERST   (1 << 21)
 
#define RCC_AHBRSTR_IOPDRST   (1 << 20)
 
#define RCC_AHBRSTR_IOPCRST   (1 << 19)
 
#define RCC_AHBRSTR_IOPBRST   (1 << 18)
 
#define RCC_AHBRSTR_IOPARST   (1 << 17)
 
#define RCC_CFGR2_PREDIV   0xf
 
#define RCC_CFGR3_USART2SW_SHIFT   16
 
#define RCC_CFGR3_USART2SW   (3 << RCC_CFGR3_USART2SW_SHIFT)
 
#define RCC_CFGR3_USART2SW_PCLK   (0 << RCC_CFGR3_USART2SW_SHIFT)
 
#define RCC_CFGR3_USART2SW_SYSCLK   (1 << RCC_CFGR3_USART2SW_SHIFT)
 
#define RCC_CFGR3_USART2SW_LSE   (2 << RCC_CFGR3_USART2SW_SHIFT)
 
#define RCC_CFGR3_USART2SW_HSI   (3 << RCC_CFGR3_USART2SW_SHIFT)
 
#define RCC_CFGR3_ADCSW   (1 << 8)
 
#define RCC_CFGR3_USBSW   (1 << 7)
 
#define RCC_CFGR3_CECSW   (1 << 6)
 
#define RCC_CFGR3_I2C1SW   (1 << 4)
 
#define RCC_CFGR3_USART1SW_SHIFT   0
 
#define RCC_CFGR3_USART1SW   (3 << RCC_CFGR3_USART1SW_SHIFT)
 
#define RCC_CFGR3_USART1SW_PCLK   (0 << RCC_CFGR3_USART1SW_SHIFT)
 
#define RCC_CFGR3_USART1SW_SYSCLK   (1 << RCC_CFGR3_USART1SW_SHIFT)
 
#define RCC_CFGR3_USART1SW_LSE   (2 << RCC_CFGR3_USART1SW_SHIFT)
 
#define RCC_CFGR3_USART1SW_HSI   (3 << RCC_CFGR3_USART1SW_SHIFT)
 
#define RCC_CR2_HSI48CAL_SHIFT   24
 
#define RCC_CR2_HSI48CAL   (0xFF << RCC_CR2_HSI48CAL_SHIFT)
 
#define RCC_CR2_HSI48RDY   (1 << 17)
 
#define RCC_CR2_HSI48ON   (1 << 16)
 
#define RCC_CR2_HSI14CAL_SHIFT   8
 
#define RCC_CR2_HSI14CAL   (0xFF << RCC_CR2_HSI14CAL_SHIFT)
 
#define RCC_CR2_HSI14TRIM_SHIFT   3
 
#define RCC_CR2_HSI14TRIM   (31 << RCC_CR2_HSI14TRIM_SHIFT)
 
#define RCC_CR2_HSI14DIS   (1 << 2)
 
#define RCC_CR2_HSI14RDY   (1 << 1)
 
#define RCC_CR2_HSI14ON   (1 << 0)
 
#define rcc_apb2_frequency   rcc_apb1_frequency
 F0 doens't realllly have apb2, but it has a bunch of things enabled via the "APB2" enable register. More...
 
#define _REG_BIT(base, bit)   (((base) << 5) + (bit))
 

Enumerations

enum  rcc_osc {
  RCC_HSI14, RCC_HSI, RCC_HSE, RCC_PLL,
  RCC_LSI, RCC_LSE, RCC_HSI48
}
 
enum  rcc_periph_clken {
  RCC_DMA = _REG_BIT(0x14, 0), RCC_DMA1 = _REG_BIT(0x14, 0), RCC_DMA2 = _REG_BIT(0x14, 1), RCC_SRAM = _REG_BIT(0x14, 2),
  RCC_FLTIF = _REG_BIT(0x14, 4), RCC_CRC = _REG_BIT(0x14, 6), RCC_GPIOA = _REG_BIT(0x14, 17), RCC_GPIOB = _REG_BIT(0x14, 18),
  RCC_GPIOC = _REG_BIT(0x14, 19), RCC_GPIOD = _REG_BIT(0x14, 20), RCC_GPIOE = _REG_BIT(0x14, 21), RCC_GPIOF = _REG_BIT(0x14, 22),
  RCC_TSC = _REG_BIT(0x14, 24), RCC_SYSCFG_COMP = _REG_BIT(0x18, 0), RCC_USART6 = _REG_BIT(0x18, 5), RCC_USART7 = _REG_BIT(0x18, 6),
  RCC_USART8 = _REG_BIT(0x18, 7), RCC_ADC = _REG_BIT(0x18, 9), RCC_ADC1 = _REG_BIT(0x18, 9), RCC_TIM1 = _REG_BIT(0x18, 11),
  RCC_SPI1 = _REG_BIT(0x18, 12), RCC_USART1 = _REG_BIT(0x18, 14), RCC_TIM15 = _REG_BIT(0x18, 16), RCC_TIM16 = _REG_BIT(0x18, 17),
  RCC_TIM17 = _REG_BIT(0x18, 18), RCC_DBGMCU = _REG_BIT(0x18, 22), RCC_TIM2 = _REG_BIT(0x1C, 0), RCC_TIM3 = _REG_BIT(0x1C, 1),
  RCC_TIM6 = _REG_BIT(0x1C, 4), RCC_TIM7 = _REG_BIT(0x1C, 5), RCC_TIM14 = _REG_BIT(0x1C, 8), RCC_WWDG = _REG_BIT(0x1C, 11),
  RCC_SPI2 = _REG_BIT(0x1C, 14), RCC_USART2 = _REG_BIT(0x1C, 17), RCC_USART3 = _REG_BIT(0x1C, 18), RCC_USART4 = _REG_BIT(0x1C, 19),
  RCC_USART5 = _REG_BIT(0x1C, 20), RCC_I2C1 = _REG_BIT(0x1C, 21), RCC_I2C2 = _REG_BIT(0x1C, 22), RCC_USB = _REG_BIT(0x1C, 23),
  RCC_CAN = _REG_BIT(0x1C, 25), RCC_CAN1 = _REG_BIT(0x1C, 25), RCC_CRS = _REG_BIT(0x1C, 27), RCC_PWR = _REG_BIT(0x1C, 28),
  RCC_DAC = _REG_BIT(0x1C, 29), RCC_DAC1 = _REG_BIT(0x1C, 29), RCC_CEC = _REG_BIT(0x1C, 30), RCC_RTC = _REG_BIT(0x20, 15)
}
 
enum  rcc_periph_rst {
  RST_SYSCFG = _REG_BIT(0x0C, 0), RST_ADC = _REG_BIT(0x0C, 9), RST_ADC1 = _REG_BIT(0x0C, 9), RST_TIM1 = _REG_BIT(0x0C, 11),
  RST_SPI1 = _REG_BIT(0x0C, 12), RST_USART1 = _REG_BIT(0x0C, 14), RST_TIM15 = _REG_BIT(0x0C, 16), RST_TIM16 = _REG_BIT(0x0C, 17),
  RST_TIM17 = _REG_BIT(0x0C, 18), RST_DBGMCU = _REG_BIT(0x0C, 22), RST_TIM2 = _REG_BIT(0x10, 0), RST_TIM3 = _REG_BIT(0x10, 1),
  RST_TIM6 = _REG_BIT(0x10, 4), RST_TIM7 = _REG_BIT(0x10, 5), RST_TIM14 = _REG_BIT(0x10, 8), RST_WWDG = _REG_BIT(0x10, 11),
  RST_SPI2 = _REG_BIT(0x10, 14), RST_USART2 = _REG_BIT(0x10, 17), RST_USART3 = _REG_BIT(0x10, 18), RST_USART4 = _REG_BIT(0x10, 19),
  RST_I2C1 = _REG_BIT(0x10, 21), RST_I2C2 = _REG_BIT(0x10, 22), RST_USB = _REG_BIT(0x10, 23), RST_CAN = _REG_BIT(0x10, 25),
  RST_CAN1 = _REG_BIT(0x10, 25), RST_CRS = _REG_BIT(0x10, 27), RST_PWR = _REG_BIT(0x10, 28), RST_DAC = _REG_BIT(0x10, 29),
  RST_DAC1 = _REG_BIT(0x10, 29), RST_CEC = _REG_BIT(0x10, 30), RST_BACKUPDOMAIN = _REG_BIT(0x20, 16), RST_GPIOA = _REG_BIT(0x28, 17),
  RST_GPIOB = _REG_BIT(0x28, 18), RST_GPIOC = _REG_BIT(0x28, 19), RST_GPIOD = _REG_BIT(0x28, 20), RST_GPIOE = _REG_BIT(0x28, 21),
  RST_GPIOF = _REG_BIT(0x28, 22), RST_TSC = _REG_BIT(0x28, 24)
}
 

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_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_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...
 
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_set_rtc_clock_source (enum rcc_osc clk)
 RCC Set the Source for the RTC 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_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...
 
void rcc_peripheral_enable_clock (volatile uint32_t *reg, uint32_t en)
 RCC Enable Peripheral Clocks. More...
 
void rcc_peripheral_disable_clock (volatile uint32_t *reg, uint32_t en)
 RCC Disable Peripheral Clocks. More...
 
void rcc_peripheral_reset (volatile uint32_t *reg, uint32_t reset)
 RCC Reset Peripherals. More...
 
void rcc_peripheral_clear_reset (volatile uint32_t *reg, uint32_t clear_reset)
 RCC Remove Reset on Peripherals. More...
 
void rcc_periph_clock_enable (enum rcc_periph_clken clken)
 Enable Peripheral Clock in running mode. More...
 
void rcc_periph_clock_disable (enum rcc_periph_clken clken)
 Disable Peripheral Clock in running mode. More...
 
void rcc_periph_reset_pulse (enum rcc_periph_rst rst)
 Reset Peripheral, pulsed. More...
 
void rcc_periph_reset_hold (enum rcc_periph_rst rst)
 Reset Peripheral, hold. More...
 
void rcc_periph_reset_release (enum rcc_periph_rst rst)
 Reset Peripheral, release. More...
 
void rcc_set_mco (uint32_t mcosrc)
 Select the source of Microcontroller Clock Output. More...
 
void rcc_osc_bypass_enable (enum rcc_osc osc)
 RCC Enable Bypass. More...
 
void rcc_osc_bypass_disable (enum rcc_osc osc)
 RCC Disable Bypass. 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...
 

Variables

uint32_t rcc_ahb_frequency
 
uint32_t rcc_apb1_frequency
 

Detailed Description

Defined Constants and Types for the STM32F0xx Reset and Clock Control

Author
© 2013 Frantisek Burian BuFra.nosp@m.n@se.nosp@m.znam..nosp@m.cz
Version
1.0.0
Date
29 Jun 2013

LGPL License Terms libopencm3 License

Author
© 2013 Frantisek Burian BuFra.nosp@m.n@se.nosp@m.znam..nosp@m.cz

Macro Definition Documentation

◆ _REG_BIT

#define _REG_BIT (   base,
  bit 
)    (((base) << 5) + (bit))

Definition at line 411 of file f0/rcc.h.

◆ RCC_AHBENR

#define RCC_AHBENR   MMIO32(RCC_BASE + 0x14)

Definition at line 53 of file f0/rcc.h.

◆ RCC_AHBENR_CRCEN

#define RCC_AHBENR_CRCEN   (1 << 6)

Definition at line 244 of file f0/rcc.h.

◆ RCC_AHBENR_DMA1EN

#define RCC_AHBENR_DMA1EN   (1 << 0)

Definition at line 248 of file f0/rcc.h.

◆ RCC_AHBENR_DMA2EN

#define RCC_AHBENR_DMA2EN   (1 << 1)

Definition at line 247 of file f0/rcc.h.

◆ RCC_AHBENR_DMAEN

#define RCC_AHBENR_DMAEN   RCC_AHBENR_DMA1EN /* compatibility alias */

Definition at line 249 of file f0/rcc.h.

◆ RCC_AHBENR_FLTFEN

#define RCC_AHBENR_FLTFEN   (1 << 4)

Definition at line 245 of file f0/rcc.h.

◆ RCC_AHBENR_GPIOAEN

#define RCC_AHBENR_GPIOAEN   (1 << 17)

Definition at line 243 of file f0/rcc.h.

◆ RCC_AHBENR_GPIOBEN

#define RCC_AHBENR_GPIOBEN   (1 << 18)

Definition at line 242 of file f0/rcc.h.

◆ RCC_AHBENR_GPIOCEN

#define RCC_AHBENR_GPIOCEN   (1 << 19)

Definition at line 241 of file f0/rcc.h.

◆ RCC_AHBENR_GPIODEN

#define RCC_AHBENR_GPIODEN   (1 << 20)

Definition at line 240 of file f0/rcc.h.

◆ RCC_AHBENR_GPIOEEN

#define RCC_AHBENR_GPIOEEN   (1 << 21)

Definition at line 239 of file f0/rcc.h.

◆ RCC_AHBENR_GPIOFEN

#define RCC_AHBENR_GPIOFEN   (1 << 22)

Definition at line 238 of file f0/rcc.h.

◆ RCC_AHBENR_SRAMEN

#define RCC_AHBENR_SRAMEN   (1 << 2)

Definition at line 246 of file f0/rcc.h.

◆ RCC_AHBENR_TSCEN

#define RCC_AHBENR_TSCEN   (1 << 24)

Definition at line 237 of file f0/rcc.h.

◆ RCC_AHBRSTR

#define RCC_AHBRSTR   MMIO32(RCC_BASE + 0x28)

Definition at line 58 of file f0/rcc.h.

◆ RCC_AHBRSTR_IOPARST

#define RCC_AHBRSTR_IOPARST   (1 << 17)

Definition at line 333 of file f0/rcc.h.

◆ RCC_AHBRSTR_IOPBRST

#define RCC_AHBRSTR_IOPBRST   (1 << 18)

Definition at line 332 of file f0/rcc.h.

◆ RCC_AHBRSTR_IOPCRST

#define RCC_AHBRSTR_IOPCRST   (1 << 19)

Definition at line 331 of file f0/rcc.h.

◆ RCC_AHBRSTR_IOPDRST

#define RCC_AHBRSTR_IOPDRST   (1 << 20)

Definition at line 330 of file f0/rcc.h.

◆ RCC_AHBRSTR_IOPERST

#define RCC_AHBRSTR_IOPERST   (1 << 21)

Definition at line 329 of file f0/rcc.h.

◆ RCC_AHBRSTR_IOPFRST

#define RCC_AHBRSTR_IOPFRST   (1 << 22)

Definition at line 328 of file f0/rcc.h.

◆ RCC_AHBRSTR_TSCRST

#define RCC_AHBRSTR_TSCRST   (1 << 24)

Definition at line 327 of file f0/rcc.h.

◆ RCC_APB1ENR

#define RCC_APB1ENR   MMIO32(RCC_BASE + 0x1c)

Definition at line 55 of file f0/rcc.h.

◆ RCC_APB1ENR_CANEN

#define RCC_APB1ENR_CANEN   (1 << 25)

Definition at line 272 of file f0/rcc.h.

◆ RCC_APB1ENR_CECEN

#define RCC_APB1ENR_CECEN   (1 << 30)

Definition at line 268 of file f0/rcc.h.

◆ RCC_APB1ENR_CRSEN

#define RCC_APB1ENR_CRSEN   (1 << 27)

Definition at line 271 of file f0/rcc.h.

◆ RCC_APB1ENR_DACEN

#define RCC_APB1ENR_DACEN   (1 << 29)

Definition at line 269 of file f0/rcc.h.

◆ RCC_APB1ENR_I2C1EN

#define RCC_APB1ENR_I2C1EN   (1 << 21)

Definition at line 275 of file f0/rcc.h.

◆ RCC_APB1ENR_I2C2EN

#define RCC_APB1ENR_I2C2EN   (1 << 22)

Definition at line 274 of file f0/rcc.h.

◆ RCC_APB1ENR_PWREN

#define RCC_APB1ENR_PWREN   (1 << 28)

Definition at line 270 of file f0/rcc.h.

◆ RCC_APB1ENR_SPI2EN

#define RCC_APB1ENR_SPI2EN   (1 << 14)

Definition at line 280 of file f0/rcc.h.

◆ RCC_APB1ENR_TIM14EN

#define RCC_APB1ENR_TIM14EN   (1 << 8)

Definition at line 282 of file f0/rcc.h.

◆ RCC_APB1ENR_TIM2EN

#define RCC_APB1ENR_TIM2EN   (1 << 0)

Definition at line 286 of file f0/rcc.h.

◆ RCC_APB1ENR_TIM3EN

#define RCC_APB1ENR_TIM3EN   (1 << 1)

Definition at line 285 of file f0/rcc.h.

◆ RCC_APB1ENR_TIM6EN

#define RCC_APB1ENR_TIM6EN   (1 << 4)

Definition at line 284 of file f0/rcc.h.

◆ RCC_APB1ENR_TIM7EN

#define RCC_APB1ENR_TIM7EN   (1 << 5)

Definition at line 283 of file f0/rcc.h.

◆ RCC_APB1ENR_USART2EN

#define RCC_APB1ENR_USART2EN   (1 << 17)

Definition at line 279 of file f0/rcc.h.

◆ RCC_APB1ENR_USART3EN

#define RCC_APB1ENR_USART3EN   (1 << 18)

Definition at line 278 of file f0/rcc.h.

◆ RCC_APB1ENR_USART4EN

#define RCC_APB1ENR_USART4EN   (1 << 19)

Definition at line 277 of file f0/rcc.h.

◆ RCC_APB1ENR_USART5EN

#define RCC_APB1ENR_USART5EN   (1 << 20)

Definition at line 276 of file f0/rcc.h.

◆ RCC_APB1ENR_USBEN

#define RCC_APB1ENR_USBEN   (1 << 23)

Definition at line 273 of file f0/rcc.h.

◆ RCC_APB1ENR_WWDGEN

#define RCC_APB1ENR_WWDGEN   (1 << 11)

Definition at line 281 of file f0/rcc.h.

◆ RCC_APB1RSTR

#define RCC_APB1RSTR   MMIO32(RCC_BASE + 0x10)

Definition at line 52 of file f0/rcc.h.

◆ RCC_APB1RSTR_CANRST

#define RCC_APB1RSTR_CANRST   (1 << 25)

Definition at line 219 of file f0/rcc.h.

◆ RCC_APB1RSTR_CECRST

#define RCC_APB1RSTR_CECRST   (1 << 30)

Definition at line 215 of file f0/rcc.h.

◆ RCC_APB1RSTR_CRSRST

#define RCC_APB1RSTR_CRSRST   (1 << 27)

Definition at line 218 of file f0/rcc.h.

◆ RCC_APB1RSTR_DACRST

#define RCC_APB1RSTR_DACRST   (1 << 29)

Definition at line 216 of file f0/rcc.h.

◆ RCC_APB1RSTR_I2C1RST

#define RCC_APB1RSTR_I2C1RST   (1 << 21)

Definition at line 222 of file f0/rcc.h.

◆ RCC_APB1RSTR_I2C2RST

#define RCC_APB1RSTR_I2C2RST   (1 << 22)

Definition at line 221 of file f0/rcc.h.

◆ RCC_APB1RSTR_PWRRST

#define RCC_APB1RSTR_PWRRST   (1 << 28)

Definition at line 217 of file f0/rcc.h.

◆ RCC_APB1RSTR_SPI2RST

#define RCC_APB1RSTR_SPI2RST   (1 << 14)

Definition at line 227 of file f0/rcc.h.

◆ RCC_APB1RSTR_TIM14RST

#define RCC_APB1RSTR_TIM14RST   (1 << 8)

Definition at line 229 of file f0/rcc.h.

◆ RCC_APB1RSTR_TIM2RST

#define RCC_APB1RSTR_TIM2RST   (1 << 0)

Definition at line 233 of file f0/rcc.h.

◆ RCC_APB1RSTR_TIM3RST

#define RCC_APB1RSTR_TIM3RST   (1 << 1)

Definition at line 232 of file f0/rcc.h.

◆ RCC_APB1RSTR_TIM6RST

#define RCC_APB1RSTR_TIM6RST   (1 << 4)

Definition at line 231 of file f0/rcc.h.

◆ RCC_APB1RSTR_TIM7RST

#define RCC_APB1RSTR_TIM7RST   (1 << 5)

Definition at line 230 of file f0/rcc.h.

◆ RCC_APB1RSTR_USART2RST

#define RCC_APB1RSTR_USART2RST   (1 << 17)

Definition at line 226 of file f0/rcc.h.

◆ RCC_APB1RSTR_USART3RST

#define RCC_APB1RSTR_USART3RST   (1 << 18)

Definition at line 225 of file f0/rcc.h.

◆ RCC_APB1RSTR_USART4RST

#define RCC_APB1RSTR_USART4RST   (1 << 19)

Definition at line 224 of file f0/rcc.h.

◆ RCC_APB1RSTR_USART5RST

#define RCC_APB1RSTR_USART5RST   (1 << 20)

Definition at line 223 of file f0/rcc.h.

◆ RCC_APB1RSTR_USBRST

#define RCC_APB1RSTR_USBRST   (1 << 23)

Definition at line 220 of file f0/rcc.h.

◆ RCC_APB1RSTR_WWDGRST

#define RCC_APB1RSTR_WWDGRST   (1 << 11)

Definition at line 228 of file f0/rcc.h.

◆ rcc_apb2_frequency

#define rcc_apb2_frequency   rcc_apb1_frequency

F0 doens't realllly have apb2, but it has a bunch of things enabled via the "APB2" enable register.

Fake it out.

Definition at line 405 of file f0/rcc.h.

Referenced by usart_set_baudrate().

◆ RCC_APB2ENR

#define RCC_APB2ENR   MMIO32(RCC_BASE + 0x18)

Definition at line 54 of file f0/rcc.h.

◆ RCC_APB2ENR_ADCEN

#define RCC_APB2ENR_ADCEN   (1 << 9)

Definition at line 260 of file f0/rcc.h.

◆ RCC_APB2ENR_DBGMCUEN

#define RCC_APB2ENR_DBGMCUEN   (1 << 22)

Definition at line 253 of file f0/rcc.h.

◆ RCC_APB2ENR_SPI1EN

#define RCC_APB2ENR_SPI1EN   (1 << 12)

Definition at line 258 of file f0/rcc.h.

◆ RCC_APB2ENR_SYSCFGCOMPEN

#define RCC_APB2ENR_SYSCFGCOMPEN   (1 << 0)

Definition at line 264 of file f0/rcc.h.

◆ RCC_APB2ENR_TIM15EN

#define RCC_APB2ENR_TIM15EN   (1 << 16)

Definition at line 256 of file f0/rcc.h.

◆ RCC_APB2ENR_TIM16EN

#define RCC_APB2ENR_TIM16EN   (1 << 17)

Definition at line 255 of file f0/rcc.h.

◆ RCC_APB2ENR_TIM17EN

#define RCC_APB2ENR_TIM17EN   (1 << 18)

Definition at line 254 of file f0/rcc.h.

◆ RCC_APB2ENR_TIM1EN

#define RCC_APB2ENR_TIM1EN   (1 << 11)

Definition at line 259 of file f0/rcc.h.

◆ RCC_APB2ENR_USART1EN

#define RCC_APB2ENR_USART1EN   (1 << 14)

Definition at line 257 of file f0/rcc.h.

◆ RCC_APB2ENR_USART6EN

#define RCC_APB2ENR_USART6EN   (1 << 5)

Definition at line 263 of file f0/rcc.h.

◆ RCC_APB2ENR_USART7EN

#define RCC_APB2ENR_USART7EN   (1 << 6)

Definition at line 262 of file f0/rcc.h.

◆ RCC_APB2ENR_USART8EN

#define RCC_APB2ENR_USART8EN   (1 << 7)

Definition at line 261 of file f0/rcc.h.

◆ RCC_APB2RSTR

#define RCC_APB2RSTR   MMIO32(RCC_BASE + 0x0c)

Definition at line 51 of file f0/rcc.h.

◆ RCC_APB2RSTR_ADCRST

#define RCC_APB2RSTR_ADCRST   (1 << 9)

Definition at line 207 of file f0/rcc.h.

◆ RCC_APB2RSTR_DBGMCURST

#define RCC_APB2RSTR_DBGMCURST   (1 << 22)

Definition at line 200 of file f0/rcc.h.

◆ RCC_APB2RSTR_SPI1RST

#define RCC_APB2RSTR_SPI1RST   (1 << 12)

Definition at line 205 of file f0/rcc.h.

◆ RCC_APB2RSTR_SYSCFGRST

#define RCC_APB2RSTR_SYSCFGRST   (1 << 0)

Definition at line 211 of file f0/rcc.h.

◆ RCC_APB2RSTR_TIM15RST

#define RCC_APB2RSTR_TIM15RST   (1 << 16)

Definition at line 203 of file f0/rcc.h.

◆ RCC_APB2RSTR_TIM16RST

#define RCC_APB2RSTR_TIM16RST   (1 << 17)

Definition at line 202 of file f0/rcc.h.

◆ RCC_APB2RSTR_TIM17RST

#define RCC_APB2RSTR_TIM17RST   (1 << 18)

Definition at line 201 of file f0/rcc.h.

◆ RCC_APB2RSTR_TIM1RST

#define RCC_APB2RSTR_TIM1RST   (1 << 11)

Definition at line 206 of file f0/rcc.h.

◆ RCC_APB2RSTR_USART1RST

#define RCC_APB2RSTR_USART1RST   (1 << 14)

Definition at line 204 of file f0/rcc.h.

◆ RCC_APB2RSTR_USART6RST

#define RCC_APB2RSTR_USART6RST   (1 << 5)

Definition at line 210 of file f0/rcc.h.

◆ RCC_APB2RSTR_USART7RST

#define RCC_APB2RSTR_USART7RST   (1 << 6)

Definition at line 209 of file f0/rcc.h.

◆ RCC_APB2RSTR_USART8RST

#define RCC_APB2RSTR_USART8RST   (1 << 7)

Definition at line 208 of file f0/rcc.h.

◆ RCC_BDCR

◆ RCC_BDCR_BDRST

#define RCC_BDCR_BDRST   (1 << 16)

Definition at line 290 of file f0/rcc.h.

◆ RCC_BDCR_LSEBYP

#define RCC_BDCR_LSEBYP   (1 << 2)

Definition at line 304 of file f0/rcc.h.

Referenced by rcc_osc_bypass_disable(), and rcc_osc_bypass_enable().

◆ RCC_BDCR_LSEDRV

#define RCC_BDCR_LSEDRV   (3 << RCC_BDCR_LSEDRV_SHIFT)

Definition at line 299 of file f0/rcc.h.

◆ RCC_BDCR_LSEDRV_HIGH

#define RCC_BDCR_LSEDRV_HIGH   (3 << RCC_BDCR_LSEDRV_SHIFT)

Definition at line 303 of file f0/rcc.h.

◆ RCC_BDCR_LSEDRV_LOW

#define RCC_BDCR_LSEDRV_LOW   (0 << RCC_BDCR_LSEDRV_SHIFT)

Definition at line 300 of file f0/rcc.h.

◆ RCC_BDCR_LSEDRV_MEDHI

#define RCC_BDCR_LSEDRV_MEDHI   (2 << RCC_BDCR_LSEDRV_SHIFT)

Definition at line 302 of file f0/rcc.h.

◆ RCC_BDCR_LSEDRV_MEDLO

#define RCC_BDCR_LSEDRV_MEDLO   (1 << RCC_BDCR_LSEDRV_SHIFT)

Definition at line 301 of file f0/rcc.h.

◆ RCC_BDCR_LSEDRV_SHIFT

#define RCC_BDCR_LSEDRV_SHIFT   3

Definition at line 298 of file f0/rcc.h.

◆ RCC_BDCR_LSEON

#define RCC_BDCR_LSEON   (1 << 0)

Definition at line 306 of file f0/rcc.h.

Referenced by rcc_osc_off(), and rcc_osc_on().

◆ RCC_BDCR_LSERDY

#define RCC_BDCR_LSERDY   (1 << 1)

Definition at line 305 of file f0/rcc.h.

Referenced by rcc_is_osc_ready().

◆ RCC_BDCR_RTCEN

#define RCC_BDCR_RTCEN   (1 << 15)

Definition at line 291 of file f0/rcc.h.

Referenced by rcc_disable_rtc_clock(), and rcc_enable_rtc_clock().

◆ RCC_BDCR_RTCSEL

#define RCC_BDCR_RTCSEL   (3 << RCC_BDCR_RTCSEL_SHIFT)

Definition at line 293 of file f0/rcc.h.

Referenced by rcc_set_rtc_clock_source().

◆ RCC_BDCR_RTCSEL_HSE

#define RCC_BDCR_RTCSEL_HSE   (3 << RCC_BDCR_RTCSEL_SHIFT)

Definition at line 297 of file f0/rcc.h.

Referenced by rcc_set_rtc_clock_source().

◆ RCC_BDCR_RTCSEL_LSE

#define RCC_BDCR_RTCSEL_LSE   (1 << RCC_BDCR_RTCSEL_SHIFT)

Definition at line 295 of file f0/rcc.h.

Referenced by rcc_set_rtc_clock_source().

◆ RCC_BDCR_RTCSEL_LSI

#define RCC_BDCR_RTCSEL_LSI   (2 << RCC_BDCR_RTCSEL_SHIFT)

Definition at line 296 of file f0/rcc.h.

Referenced by rcc_set_rtc_clock_source().

◆ RCC_BDCR_RTCSEL_NOCLK

#define RCC_BDCR_RTCSEL_NOCLK   (0 << RCC_BDCR_RTCSEL_SHIFT)

Definition at line 294 of file f0/rcc.h.

◆ RCC_BDCR_RTCSEL_SHIFT

#define RCC_BDCR_RTCSEL_SHIFT   8

Definition at line 292 of file f0/rcc.h.

◆ RCC_CFGR

◆ RCC_CFGR2

#define RCC_CFGR2   MMIO32(RCC_BASE + 0x2c)

Definition at line 59 of file f0/rcc.h.

Referenced by rcc_set_prediv().

◆ RCC_CFGR2_PREDIV

#define RCC_CFGR2_PREDIV   0xf

Definition at line 338 of file f0/rcc.h.

Referenced by rcc_set_prediv().

◆ RCC_CFGR3

#define RCC_CFGR3   MMIO32(RCC_BASE + 0x30)

◆ RCC_CFGR3_ADCSW

#define RCC_CFGR3_ADCSW   (1 << 8)

Definition at line 369 of file f0/rcc.h.

◆ RCC_CFGR3_CECSW

#define RCC_CFGR3_CECSW   (1 << 6)

Definition at line 371 of file f0/rcc.h.

◆ RCC_CFGR3_I2C1SW

#define RCC_CFGR3_I2C1SW   (1 << 4)

Definition at line 372 of file f0/rcc.h.

Referenced by rcc_get_i2c_clocks(), rcc_set_i2c_clock_hsi(), and rcc_set_i2c_clock_sysclk().

◆ RCC_CFGR3_USART1SW

#define RCC_CFGR3_USART1SW   (3 << RCC_CFGR3_USART1SW_SHIFT)

Definition at line 375 of file f0/rcc.h.

◆ RCC_CFGR3_USART1SW_HSI

#define RCC_CFGR3_USART1SW_HSI   (3 << RCC_CFGR3_USART1SW_SHIFT)

Definition at line 379 of file f0/rcc.h.

◆ RCC_CFGR3_USART1SW_LSE

#define RCC_CFGR3_USART1SW_LSE   (2 << RCC_CFGR3_USART1SW_SHIFT)

Definition at line 378 of file f0/rcc.h.

◆ RCC_CFGR3_USART1SW_PCLK

#define RCC_CFGR3_USART1SW_PCLK   (0 << RCC_CFGR3_USART1SW_SHIFT)

Definition at line 376 of file f0/rcc.h.

◆ RCC_CFGR3_USART1SW_SHIFT

#define RCC_CFGR3_USART1SW_SHIFT   0

Definition at line 374 of file f0/rcc.h.

◆ RCC_CFGR3_USART1SW_SYSCLK

#define RCC_CFGR3_USART1SW_SYSCLK   (1 << RCC_CFGR3_USART1SW_SHIFT)

Definition at line 377 of file f0/rcc.h.

◆ RCC_CFGR3_USART2SW

#define RCC_CFGR3_USART2SW   (3 << RCC_CFGR3_USART2SW_SHIFT)

Definition at line 363 of file f0/rcc.h.

◆ RCC_CFGR3_USART2SW_HSI

#define RCC_CFGR3_USART2SW_HSI   (3 << RCC_CFGR3_USART2SW_SHIFT)

Definition at line 367 of file f0/rcc.h.

◆ RCC_CFGR3_USART2SW_LSE

#define RCC_CFGR3_USART2SW_LSE   (2 << RCC_CFGR3_USART2SW_SHIFT)

Definition at line 366 of file f0/rcc.h.

◆ RCC_CFGR3_USART2SW_PCLK

#define RCC_CFGR3_USART2SW_PCLK   (0 << RCC_CFGR3_USART2SW_SHIFT)

Definition at line 364 of file f0/rcc.h.

◆ RCC_CFGR3_USART2SW_SHIFT

#define RCC_CFGR3_USART2SW_SHIFT   16

Definition at line 362 of file f0/rcc.h.

◆ RCC_CFGR3_USART2SW_SYSCLK

#define RCC_CFGR3_USART2SW_SYSCLK   (1 << RCC_CFGR3_USART2SW_SHIFT)

Definition at line 365 of file f0/rcc.h.

◆ RCC_CFGR3_USBSW

#define RCC_CFGR3_USBSW   (1 << 7)

Definition at line 370 of file f0/rcc.h.

Referenced by rcc_set_usbclk_source(), and rcc_usb_clock_source().

◆ RCC_CFGR_ADCPRE

#define RCC_CFGR_ADCPRE   (1<<14)

Definition at line 136 of file f0/rcc.h.

◆ RCC_CFGR_HPRE

#define RCC_CFGR_HPRE   (0xf << RCC_CFGR_HPRE_SHIFT)

Definition at line 147 of file f0/rcc.h.

Referenced by rcc_set_hpre().

◆ RCC_CFGR_HPRE_DIV128

#define RCC_CFGR_HPRE_DIV128   (0xd << RCC_CFGR_HPRE_SHIFT)

Definition at line 154 of file f0/rcc.h.

◆ RCC_CFGR_HPRE_DIV16

#define RCC_CFGR_HPRE_DIV16   (0xb << RCC_CFGR_HPRE_SHIFT)

Definition at line 152 of file f0/rcc.h.

◆ RCC_CFGR_HPRE_DIV2

#define RCC_CFGR_HPRE_DIV2   (0x8 << RCC_CFGR_HPRE_SHIFT)

Definition at line 149 of file f0/rcc.h.

◆ RCC_CFGR_HPRE_DIV256

#define RCC_CFGR_HPRE_DIV256   (0xe << RCC_CFGR_HPRE_SHIFT)

Definition at line 155 of file f0/rcc.h.

◆ RCC_CFGR_HPRE_DIV4

#define RCC_CFGR_HPRE_DIV4   (0x9 << RCC_CFGR_HPRE_SHIFT)

Definition at line 150 of file f0/rcc.h.

◆ RCC_CFGR_HPRE_DIV512

#define RCC_CFGR_HPRE_DIV512   (0xf << RCC_CFGR_HPRE_SHIFT)

Definition at line 156 of file f0/rcc.h.

◆ RCC_CFGR_HPRE_DIV64

#define RCC_CFGR_HPRE_DIV64   (0xc << RCC_CFGR_HPRE_SHIFT)

Definition at line 153 of file f0/rcc.h.

◆ RCC_CFGR_HPRE_DIV8

#define RCC_CFGR_HPRE_DIV8   (0xa << RCC_CFGR_HPRE_SHIFT)

Definition at line 151 of file f0/rcc.h.

◆ RCC_CFGR_HPRE_NODIV

#define RCC_CFGR_HPRE_NODIV   (0x0 << RCC_CFGR_HPRE_SHIFT)

◆ RCC_CFGR_HPRE_SHIFT

#define RCC_CFGR_HPRE_SHIFT   4

Definition at line 146 of file f0/rcc.h.

◆ RCC_CFGR_MCO_HSE

#define RCC_CFGR_MCO_HSE   6

Definition at line 105 of file f0/rcc.h.

◆ RCC_CFGR_MCO_HSI

#define RCC_CFGR_MCO_HSI   5

Definition at line 104 of file f0/rcc.h.

◆ RCC_CFGR_MCO_HSI14

#define RCC_CFGR_MCO_HSI14   1

Definition at line 100 of file f0/rcc.h.

◆ RCC_CFGR_MCO_HSI48

#define RCC_CFGR_MCO_HSI48   8

Definition at line 107 of file f0/rcc.h.

◆ RCC_CFGR_MCO_LSE

#define RCC_CFGR_MCO_LSE   3

Definition at line 102 of file f0/rcc.h.

◆ RCC_CFGR_MCO_LSI

#define RCC_CFGR_MCO_LSI   2

Definition at line 101 of file f0/rcc.h.

◆ RCC_CFGR_MCO_MASK

#define RCC_CFGR_MCO_MASK   0xf

Definition at line 98 of file f0/rcc.h.

Referenced by rcc_set_mco().

◆ RCC_CFGR_MCO_NOCLK

#define RCC_CFGR_MCO_NOCLK   0

Definition at line 99 of file f0/rcc.h.

◆ RCC_CFGR_MCO_PLL

#define RCC_CFGR_MCO_PLL   7

Definition at line 106 of file f0/rcc.h.

◆ RCC_CFGR_MCO_SHIFT

#define RCC_CFGR_MCO_SHIFT   24

Definition at line 97 of file f0/rcc.h.

Referenced by rcc_set_mco().

◆ RCC_CFGR_MCO_SYSCLK

#define RCC_CFGR_MCO_SYSCLK   4

Definition at line 103 of file f0/rcc.h.

◆ RCC_CFGR_MCOPRE

#define RCC_CFGR_MCOPRE   (7 << RCC_CFGR_MCOPRE_SHIFT)

Definition at line 87 of file f0/rcc.h.

◆ RCC_CFGR_MCOPRE_DIV1

#define RCC_CFGR_MCOPRE_DIV1   (0 << RCC_CFGR_MCOPRE_SHIFT)

Definition at line 88 of file f0/rcc.h.

◆ RCC_CFGR_MCOPRE_DIV128

#define RCC_CFGR_MCOPRE_DIV128   (7 << RCC_CFGR_MCOPRE_SHIFT)

Definition at line 95 of file f0/rcc.h.

◆ RCC_CFGR_MCOPRE_DIV16

#define RCC_CFGR_MCOPRE_DIV16   (4 << RCC_CFGR_MCOPRE_SHIFT)

Definition at line 92 of file f0/rcc.h.

◆ RCC_CFGR_MCOPRE_DIV2

#define RCC_CFGR_MCOPRE_DIV2   (1 << RCC_CFGR_MCOPRE_SHIFT)

Definition at line 89 of file f0/rcc.h.

◆ RCC_CFGR_MCOPRE_DIV32

#define RCC_CFGR_MCOPRE_DIV32   (5 << RCC_CFGR_MCOPRE_SHIFT)

Definition at line 93 of file f0/rcc.h.

◆ RCC_CFGR_MCOPRE_DIV4

#define RCC_CFGR_MCOPRE_DIV4   (2 << RCC_CFGR_MCOPRE_SHIFT)

Definition at line 90 of file f0/rcc.h.

◆ RCC_CFGR_MCOPRE_DIV64

#define RCC_CFGR_MCOPRE_DIV64   (6 << RCC_CFGR_MCOPRE_SHIFT)

Definition at line 94 of file f0/rcc.h.

◆ RCC_CFGR_MCOPRE_DIV8

#define RCC_CFGR_MCOPRE_DIV8   (3 << RCC_CFGR_MCOPRE_SHIFT)

Definition at line 91 of file f0/rcc.h.

◆ RCC_CFGR_MCOPRE_SHIFT

#define RCC_CFGR_MCOPRE_SHIFT   28

Definition at line 86 of file f0/rcc.h.

◆ RCC_CFGR_PLLMUL

#define RCC_CFGR_PLLMUL   (0x0F << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 110 of file f0/rcc.h.

Referenced by rcc_set_pll_multiplication_factor().

◆ RCC_CFGR_PLLMUL_MUL10

#define RCC_CFGR_PLLMUL_MUL10   (0x08 << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 119 of file f0/rcc.h.

◆ RCC_CFGR_PLLMUL_MUL11

#define RCC_CFGR_PLLMUL_MUL11   (0x09 << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 120 of file f0/rcc.h.

◆ RCC_CFGR_PLLMUL_MUL12

#define RCC_CFGR_PLLMUL_MUL12   (0x0A << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 121 of file f0/rcc.h.

Referenced by rcc_clock_setup_in_hsi_out_48mhz().

◆ RCC_CFGR_PLLMUL_MUL13

#define RCC_CFGR_PLLMUL_MUL13   (0x0B << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 122 of file f0/rcc.h.

◆ RCC_CFGR_PLLMUL_MUL14

#define RCC_CFGR_PLLMUL_MUL14   (0x0C << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 123 of file f0/rcc.h.

◆ RCC_CFGR_PLLMUL_MUL15

#define RCC_CFGR_PLLMUL_MUL15   (0x0D << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 124 of file f0/rcc.h.

◆ RCC_CFGR_PLLMUL_MUL16

#define RCC_CFGR_PLLMUL_MUL16   (0x0E << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 125 of file f0/rcc.h.

◆ RCC_CFGR_PLLMUL_MUL2

#define RCC_CFGR_PLLMUL_MUL2   (0x00 << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 111 of file f0/rcc.h.

◆ RCC_CFGR_PLLMUL_MUL3

#define RCC_CFGR_PLLMUL_MUL3   (0x01 << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 112 of file f0/rcc.h.

◆ RCC_CFGR_PLLMUL_MUL4

#define RCC_CFGR_PLLMUL_MUL4   (0x02 << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 113 of file f0/rcc.h.

◆ RCC_CFGR_PLLMUL_MUL5

#define RCC_CFGR_PLLMUL_MUL5   (0x03 << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 114 of file f0/rcc.h.

◆ RCC_CFGR_PLLMUL_MUL6

#define RCC_CFGR_PLLMUL_MUL6   (0x04 << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 115 of file f0/rcc.h.

Referenced by rcc_clock_setup_in_hse_8mhz_out_48mhz().

◆ RCC_CFGR_PLLMUL_MUL7

#define RCC_CFGR_PLLMUL_MUL7   (0x05 << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 116 of file f0/rcc.h.

◆ RCC_CFGR_PLLMUL_MUL8

#define RCC_CFGR_PLLMUL_MUL8   (0x06 << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 117 of file f0/rcc.h.

◆ RCC_CFGR_PLLMUL_MUL9

#define RCC_CFGR_PLLMUL_MUL9   (0x07 << RCC_CFGR_PLLMUL_SHIFT)

Definition at line 118 of file f0/rcc.h.

◆ RCC_CFGR_PLLMUL_SHIFT

#define RCC_CFGR_PLLMUL_SHIFT   18

Definition at line 109 of file f0/rcc.h.

◆ RCC_CFGR_PLLNODIV

#define RCC_CFGR_PLLNODIV   (1 << 31)

Definition at line 84 of file f0/rcc.h.

◆ RCC_CFGR_PLLSRC

#define RCC_CFGR_PLLSRC   (1<<16)

Definition at line 131 of file f0/rcc.h.

Referenced by rcc_set_pll_source().

◆ RCC_CFGR_PLLSRC0

#define RCC_CFGR_PLLSRC0   (1<<15)

Definition at line 135 of file f0/rcc.h.

◆ RCC_CFGR_PLLSRC_HSE_CLK

#define RCC_CFGR_PLLSRC_HSE_CLK   0x1

Definition at line 133 of file f0/rcc.h.

Referenced by rcc_clock_setup_in_hse_8mhz_out_48mhz().

◆ RCC_CFGR_PLLSRC_HSI_CLK_DIV2

#define RCC_CFGR_PLLSRC_HSI_CLK_DIV2   0x0

Definition at line 132 of file f0/rcc.h.

Referenced by rcc_clock_setup_in_hsi_out_48mhz().

◆ RCC_CFGR_PLLXTPRE

#define RCC_CFGR_PLLXTPRE   (1<<17)

Definition at line 127 of file f0/rcc.h.

Referenced by rcc_set_pllxtpre().

◆ RCC_CFGR_PLLXTPRE_HSE_CLK

#define RCC_CFGR_PLLXTPRE_HSE_CLK   0x0

Definition at line 128 of file f0/rcc.h.

Referenced by rcc_clock_setup_in_hse_8mhz_out_48mhz().

◆ RCC_CFGR_PLLXTPRE_HSE_CLK_DIV2

#define RCC_CFGR_PLLXTPRE_HSE_CLK_DIV2   0x1

Definition at line 129 of file f0/rcc.h.

◆ RCC_CFGR_PPRE

#define RCC_CFGR_PPRE   (7 << RCC_CFGR_PPRE_SHIFT)

Definition at line 139 of file f0/rcc.h.

Referenced by rcc_set_ppre().

◆ RCC_CFGR_PPRE_DIV16

#define RCC_CFGR_PPRE_DIV16   (7 << RCC_CFGR_PPRE_SHIFT)

Definition at line 144 of file f0/rcc.h.

◆ RCC_CFGR_PPRE_DIV2

#define RCC_CFGR_PPRE_DIV2   (4 << RCC_CFGR_PPRE_SHIFT)

Definition at line 141 of file f0/rcc.h.

◆ RCC_CFGR_PPRE_DIV4

#define RCC_CFGR_PPRE_DIV4   (5 << RCC_CFGR_PPRE_SHIFT)

Definition at line 142 of file f0/rcc.h.

◆ RCC_CFGR_PPRE_DIV8

#define RCC_CFGR_PPRE_DIV8   (6 << RCC_CFGR_PPRE_SHIFT)

Definition at line 143 of file f0/rcc.h.

◆ RCC_CFGR_PPRE_NODIV

#define RCC_CFGR_PPRE_NODIV   (0 << RCC_CFGR_PPRE_SHIFT)

◆ RCC_CFGR_PPRE_SHIFT

#define RCC_CFGR_PPRE_SHIFT   8

Definition at line 138 of file f0/rcc.h.

◆ RCC_CFGR_SW

#define RCC_CFGR_SW   (3 << RCC_CFGR_SW_SHIFT)

Definition at line 166 of file f0/rcc.h.

Referenced by rcc_set_sysclk_source().

◆ RCC_CFGR_SW_HSE

#define RCC_CFGR_SW_HSE   (1 << RCC_CFGR_SW_SHIFT)

Definition at line 168 of file f0/rcc.h.

Referenced by rcc_set_sysclk_source().

◆ RCC_CFGR_SW_HSI

#define RCC_CFGR_SW_HSI   (0 << RCC_CFGR_SW_SHIFT)

Definition at line 167 of file f0/rcc.h.

Referenced by rcc_set_sysclk_source().

◆ RCC_CFGR_SW_HSI48

#define RCC_CFGR_SW_HSI48   (3 << RCC_CFGR_SW_SHIFT)

Definition at line 170 of file f0/rcc.h.

Referenced by rcc_set_sysclk_source().

◆ RCC_CFGR_SW_PLL

#define RCC_CFGR_SW_PLL   (2 << RCC_CFGR_SW_SHIFT)

Definition at line 169 of file f0/rcc.h.

Referenced by rcc_set_sysclk_source().

◆ RCC_CFGR_SW_SHIFT

#define RCC_CFGR_SW_SHIFT   0

Definition at line 165 of file f0/rcc.h.

◆ RCC_CFGR_SWS

#define RCC_CFGR_SWS   (3 << RCC_CFGR_SWS_SHIFT)

Definition at line 159 of file f0/rcc.h.

Referenced by rcc_system_clock_source().

◆ RCC_CFGR_SWS_HSE

#define RCC_CFGR_SWS_HSE   (1 << RCC_CFGR_SWS_SHIFT)

Definition at line 161 of file f0/rcc.h.

Referenced by rcc_system_clock_source().

◆ RCC_CFGR_SWS_HSI

#define RCC_CFGR_SWS_HSI   (0 << RCC_CFGR_SWS_SHIFT)

Definition at line 160 of file f0/rcc.h.

Referenced by rcc_system_clock_source().

◆ RCC_CFGR_SWS_HSI48

#define RCC_CFGR_SWS_HSI48   (3 << RCC_CFGR_SWS_SHIFT)

Definition at line 163 of file f0/rcc.h.

Referenced by rcc_system_clock_source().

◆ RCC_CFGR_SWS_PLL

#define RCC_CFGR_SWS_PLL   (2 << RCC_CFGR_SWS_SHIFT)

Definition at line 162 of file f0/rcc.h.

Referenced by rcc_system_clock_source().

◆ RCC_CFGR_SWS_SHIFT

#define RCC_CFGR_SWS_SHIFT   2

Definition at line 158 of file f0/rcc.h.

◆ RCC_CIR

◆ RCC_CIR_CSSC

#define RCC_CIR_CSSC   (1 << 23)

Definition at line 174 of file f0/rcc.h.

Referenced by rcc_css_int_clear().

◆ RCC_CIR_CSSF

#define RCC_CIR_CSSF   (1 << 7)

Definition at line 189 of file f0/rcc.h.

Referenced by rcc_css_int_flag().

◆ RCC_CIR_HSERDYC

#define RCC_CIR_HSERDYC   (1 << 19)

Definition at line 178 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_clear(), and rcc_osc_ready_int_disable().

◆ RCC_CIR_HSERDYF

#define RCC_CIR_HSERDYF   (1 << 3)

Definition at line 193 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_flag().

◆ RCC_CIR_HSERDYIE

#define RCC_CIR_HSERDYIE   (1 << 11)

Definition at line 185 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_enable().

◆ RCC_CIR_HSI14RDYC

#define RCC_CIR_HSI14RDYC   (1 << 21)

Definition at line 176 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_clear(), and rcc_osc_ready_int_disable().

◆ RCC_CIR_HSI14RDYF

#define RCC_CIR_HSI14RDYF   (1 << 5)

Definition at line 191 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_flag().

◆ RCC_CIR_HSI14RDYIE

#define RCC_CIR_HSI14RDYIE   (1 << 13)

Definition at line 183 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_enable().

◆ RCC_CIR_HSI48RDYC

#define RCC_CIR_HSI48RDYC   (1 << 22)

Definition at line 175 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_clear(), and rcc_osc_ready_int_disable().

◆ RCC_CIR_HSI48RDYF

#define RCC_CIR_HSI48RDYF   (1 << 6)

Definition at line 190 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_flag().

◆ RCC_CIR_HSI48RDYIE

#define RCC_CIR_HSI48RDYIE   (1 << 14)

Definition at line 182 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_enable().

◆ RCC_CIR_HSIRDYC

#define RCC_CIR_HSIRDYC   (1 << 18)

Definition at line 179 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_clear(), and rcc_osc_ready_int_disable().

◆ RCC_CIR_HSIRDYF

#define RCC_CIR_HSIRDYF   (1 << 2)

Definition at line 194 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_flag().

◆ RCC_CIR_HSIRDYIE

#define RCC_CIR_HSIRDYIE   (1 << 10)

Definition at line 186 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_enable().

◆ RCC_CIR_LSERDYC

#define RCC_CIR_LSERDYC   (1 << 17)

Definition at line 180 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_clear(), and rcc_osc_ready_int_disable().

◆ RCC_CIR_LSERDYF

#define RCC_CIR_LSERDYF   (1 << 1)

Definition at line 195 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_flag().

◆ RCC_CIR_LSERDYIE

#define RCC_CIR_LSERDYIE   (1 << 9)

Definition at line 187 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_enable().

◆ RCC_CIR_LSIRDYC

#define RCC_CIR_LSIRDYC   (1 << 16)

Definition at line 181 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_clear(), and rcc_osc_ready_int_disable().

◆ RCC_CIR_LSIRDYF

#define RCC_CIR_LSIRDYF   (1 << 0)

Definition at line 196 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_flag().

◆ RCC_CIR_LSIRDYIE

#define RCC_CIR_LSIRDYIE   (1 << 8)

Definition at line 188 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_enable().

◆ RCC_CIR_PLLRDYC

#define RCC_CIR_PLLRDYC   (1 << 20)

Definition at line 177 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_clear(), and rcc_osc_ready_int_disable().

◆ RCC_CIR_PLLRDYF

#define RCC_CIR_PLLRDYF   (1 << 4)

Definition at line 192 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_flag().

◆ RCC_CIR_PLLRDYIE

#define RCC_CIR_PLLRDYIE   (1 << 12)

Definition at line 184 of file f0/rcc.h.

Referenced by rcc_osc_ready_int_enable().

◆ RCC_CR

◆ RCC_CR2

#define RCC_CR2   MMIO32(RCC_BASE + 0x34)

Definition at line 61 of file f0/rcc.h.

Referenced by rcc_is_osc_ready(), rcc_osc_off(), and rcc_osc_on().

◆ RCC_CR2_HSI14CAL

#define RCC_CR2_HSI14CAL   (0xFF << RCC_CR2_HSI14CAL_SHIFT)

Definition at line 388 of file f0/rcc.h.

◆ RCC_CR2_HSI14CAL_SHIFT

#define RCC_CR2_HSI14CAL_SHIFT   8

Definition at line 387 of file f0/rcc.h.

◆ RCC_CR2_HSI14DIS

#define RCC_CR2_HSI14DIS   (1 << 2)

Definition at line 391 of file f0/rcc.h.

◆ RCC_CR2_HSI14ON

#define RCC_CR2_HSI14ON   (1 << 0)

Definition at line 393 of file f0/rcc.h.

Referenced by rcc_osc_off(), and rcc_osc_on().

◆ RCC_CR2_HSI14RDY

#define RCC_CR2_HSI14RDY   (1 << 1)

Definition at line 392 of file f0/rcc.h.

Referenced by rcc_is_osc_ready().

◆ RCC_CR2_HSI14TRIM

#define RCC_CR2_HSI14TRIM   (31 << RCC_CR2_HSI14TRIM_SHIFT)

Definition at line 390 of file f0/rcc.h.

◆ RCC_CR2_HSI14TRIM_SHIFT

#define RCC_CR2_HSI14TRIM_SHIFT   3

Definition at line 389 of file f0/rcc.h.

◆ RCC_CR2_HSI48CAL

#define RCC_CR2_HSI48CAL   (0xFF << RCC_CR2_HSI48CAL_SHIFT)

Definition at line 384 of file f0/rcc.h.

◆ RCC_CR2_HSI48CAL_SHIFT

#define RCC_CR2_HSI48CAL_SHIFT   24

Definition at line 383 of file f0/rcc.h.

◆ RCC_CR2_HSI48ON

#define RCC_CR2_HSI48ON   (1 << 16)

Definition at line 386 of file f0/rcc.h.

Referenced by rcc_osc_off(), and rcc_osc_on().

◆ RCC_CR2_HSI48RDY

#define RCC_CR2_HSI48RDY   (1 << 17)

Definition at line 385 of file f0/rcc.h.

Referenced by rcc_is_osc_ready().

◆ RCC_CR_CSSON

#define RCC_CR_CSSON   (1 << 19)

Definition at line 71 of file f0/rcc.h.

Referenced by rcc_css_disable(), and rcc_css_enable().

◆ RCC_CR_HSEBYP

#define RCC_CR_HSEBYP   (1 << 18)

Definition at line 72 of file f0/rcc.h.

Referenced by rcc_osc_bypass_disable(), and rcc_osc_bypass_enable().

◆ RCC_CR_HSEON

#define RCC_CR_HSEON   (1 << 16)

Definition at line 74 of file f0/rcc.h.

Referenced by rcc_osc_off(), and rcc_osc_on().

◆ RCC_CR_HSERDY

#define RCC_CR_HSERDY   (1 << 17)

Definition at line 73 of file f0/rcc.h.

Referenced by rcc_is_osc_ready().

◆ RCC_CR_HSICAL

#define RCC_CR_HSICAL   (0xFF << RCC_CR_HSICAL_SHIFT)

Definition at line 76 of file f0/rcc.h.

◆ RCC_CR_HSICAL_SHIFT

#define RCC_CR_HSICAL_SHIFT   8

Definition at line 75 of file f0/rcc.h.

◆ RCC_CR_HSION

#define RCC_CR_HSION   (1 << 0)

Definition at line 80 of file f0/rcc.h.

Referenced by rcc_osc_off(), and rcc_osc_on().

◆ RCC_CR_HSIRDY

#define RCC_CR_HSIRDY   (1 << 1)

Definition at line 79 of file f0/rcc.h.

Referenced by rcc_is_osc_ready().

◆ RCC_CR_HSITRIM

#define RCC_CR_HSITRIM   (0x1F << RCC_CR_HSITRIM_SHIFT)

Definition at line 78 of file f0/rcc.h.

◆ RCC_CR_HSITRIM_SHIFT

#define RCC_CR_HSITRIM_SHIFT   3

Definition at line 77 of file f0/rcc.h.

◆ RCC_CR_PLLON

#define RCC_CR_PLLON   (1 << 24)

Definition at line 70 of file f0/rcc.h.

Referenced by rcc_osc_on().

◆ RCC_CR_PLLRDY

#define RCC_CR_PLLRDY   (1 << 25)

Definition at line 69 of file f0/rcc.h.

Referenced by rcc_is_osc_ready().

◆ RCC_CSR

#define RCC_CSR   MMIO32(RCC_BASE + 0x24)

◆ RCC_CSR_IWDGRSTF

#define RCC_CSR_IWDGRSTF   (1 << 29)

Definition at line 312 of file f0/rcc.h.

◆ RCC_CSR_LPWRRSTF

#define RCC_CSR_LPWRRSTF   (1 << 31)

Definition at line 310 of file f0/rcc.h.

◆ RCC_CSR_LSION

#define RCC_CSR_LSION   (1 << 0)

Definition at line 323 of file f0/rcc.h.

Referenced by rcc_osc_off(), and rcc_osc_on().

◆ RCC_CSR_LSIRDY

#define RCC_CSR_LSIRDY   (1 << 1)

Definition at line 322 of file f0/rcc.h.

Referenced by rcc_is_osc_ready().

◆ RCC_CSR_OBLRSTF

#define RCC_CSR_OBLRSTF   (1 << 25)

Definition at line 316 of file f0/rcc.h.

◆ RCC_CSR_PINRSTF

#define RCC_CSR_PINRSTF   (1 << 26)

Definition at line 315 of file f0/rcc.h.

◆ RCC_CSR_PORRSTF

#define RCC_CSR_PORRSTF   (1 << 27)

Definition at line 314 of file f0/rcc.h.

◆ RCC_CSR_RESET_FLAGS

#define RCC_CSR_RESET_FLAGS
Value:
RCC_CSR_IWDGRSTF | RCC_CSR_SFTRSTF | RCC_CSR_PORRSTF |\
RCC_CSR_PINRSTF | RCC_CSR_OBLRSTF)
#define RCC_CSR_PORRSTF
Definition: f0/rcc.h:314
#define RCC_CSR_SFTRSTF
Definition: f0/rcc.h:313
#define RCC_CSR_WWDGRSTF
Definition: f0/rcc.h:311
#define RCC_CSR_LPWRRSTF
Definition: f0/rcc.h:310
#define RCC_CSR_OBLRSTF
Definition: f0/rcc.h:316

Definition at line 318 of file f0/rcc.h.

◆ RCC_CSR_RMVF

#define RCC_CSR_RMVF   (1 << 24)

Definition at line 317 of file f0/rcc.h.

◆ RCC_CSR_SFTRSTF

#define RCC_CSR_SFTRSTF   (1 << 28)

Definition at line 313 of file f0/rcc.h.

◆ RCC_CSR_V18PWRRSTF

#define RCC_CSR_V18PWRRSTF   (1 << 23)

Definition at line 321 of file f0/rcc.h.

◆ RCC_CSR_WWDGRSTF

#define RCC_CSR_WWDGRSTF   (1 << 30)

Definition at line 311 of file f0/rcc.h.

Enumeration Type Documentation

◆ rcc_osc

enum rcc_osc
Enumerator
RCC_HSI14 
RCC_HSI 
RCC_HSE 
RCC_PLL 
RCC_LSI 
RCC_LSE 
RCC_HSI48 

Definition at line 407 of file f0/rcc.h.

◆ rcc_periph_clken

Enumerator
RCC_DMA 
RCC_DMA1 
RCC_DMA2 
RCC_SRAM 
RCC_FLTIF 
RCC_CRC 
RCC_GPIOA 
RCC_GPIOB 
RCC_GPIOC 
RCC_GPIOD 
RCC_GPIOE 
RCC_GPIOF 
RCC_TSC 
RCC_SYSCFG_COMP 
RCC_USART6 
RCC_USART7 
RCC_USART8 
RCC_ADC 
RCC_ADC1 
RCC_TIM1 
RCC_SPI1 
RCC_USART1 
RCC_TIM15 
RCC_TIM16 
RCC_TIM17 
RCC_DBGMCU 
RCC_TIM2 
RCC_TIM3 
RCC_TIM6 
RCC_TIM7 
RCC_TIM14 
RCC_WWDG 
RCC_SPI2 
RCC_USART2 
RCC_USART3 
RCC_USART4 
RCC_USART5 
RCC_I2C1 
RCC_I2C2 
RCC_USB 
RCC_CAN 
RCC_CAN1 
RCC_CRS 
RCC_PWR 
RCC_DAC 
RCC_DAC1 
RCC_CEC 
RCC_RTC 

Definition at line 413 of file f0/rcc.h.

◆ rcc_periph_rst

Enumerator
RST_SYSCFG 
RST_ADC 
RST_ADC1 
RST_TIM1 
RST_SPI1 
RST_USART1 
RST_TIM15 
RST_TIM16 
RST_TIM17 
RST_DBGMCU 
RST_TIM2 
RST_TIM3 
RST_TIM6 
RST_TIM7 
RST_TIM14 
RST_WWDG 
RST_SPI2 
RST_USART2 
RST_USART3 
RST_USART4 
RST_I2C1 
RST_I2C2 
RST_USB 
RST_CAN 
RST_CAN1 
RST_CRS 
RST_PWR 
RST_DAC 
RST_DAC1 
RST_CEC 
RST_BACKUPDOMAIN 
RST_GPIOA 
RST_GPIOB 
RST_GPIOC 
RST_GPIOD 
RST_GPIOE 
RST_GPIOF 
RST_TSC 

Definition at line 471 of file f0/rcc.h.

Function Documentation

◆ rcc_clock_setup_in_hse_8mhz_out_48mhz()

◆ rcc_clock_setup_in_hsi48_out_48mhz()

void rcc_clock_setup_in_hsi48_out_48mhz ( void  )

◆ rcc_clock_setup_in_hsi_out_48mhz()

◆ rcc_css_disable()

void rcc_css_disable ( void  )

RCC Disable the Clock Security System.

Definition at line 322 of file rcc.c.

References RCC_CR, and RCC_CR_CSSON.

◆ rcc_css_enable()

void rcc_css_enable ( void  )

RCC Enable the Clock Security System.

Definition at line 313 of file rcc.c.

References RCC_CR, and RCC_CR_CSSON.

◆ rcc_css_int_clear()

void rcc_css_int_clear ( void  )

RCC Clear the Clock Security System Interrupt Flag.

Definition at line 190 of file rcc.c.

References RCC_CIR, and RCC_CIR_CSSC.

◆ rcc_css_int_flag()

int rcc_css_int_flag ( void  )

RCC Read the Clock Security System Interrupt Flag.

Returns
int. Boolean value for flag set.

Definition at line 201 of file rcc.c.

References RCC_CIR, and RCC_CIR_CSSF.

◆ rcc_disable_rtc_clock()

void rcc_disable_rtc_clock ( void  )

RCC Disable the RTC clock.

Definition at line 397 of file rcc.c.

References RCC_BDCR, and RCC_BDCR_RTCEN.

◆ rcc_enable_rtc_clock()

void rcc_enable_rtc_clock ( void  )

RCC Enable the RTC clock.

Definition at line 387 of file rcc.c.

References RCC_BDCR, and RCC_BDCR_RTCEN.

◆ rcc_get_i2c_clocks()

uint32_t rcc_get_i2c_clocks ( void  )

Definition at line 538 of file rcc.c.

References RCC_CFGR3, and RCC_CFGR3_I2C1SW.

◆ rcc_is_osc_ready()

bool rcc_is_osc_ready ( enum rcc_osc  osc)

Is the given oscillator ready?

Parameters
oscOscillator ID
Returns
true if the hardware indicates the oscillator is ready.

Definition at line 206 of file rcc.c.

References RCC_BDCR, RCC_BDCR_LSERDY, RCC_CR, RCC_CR2, RCC_CR2_HSI14RDY, RCC_CR2_HSI48RDY, RCC_CR_HSERDY, RCC_CR_HSIRDY, RCC_CR_PLLRDY, RCC_CSR, RCC_CSR_LSIRDY, RCC_HSE, RCC_HSI, RCC_HSI14, RCC_HSI48, RCC_LSE, RCC_LSI, and RCC_PLL.

Referenced by rcc_wait_for_osc_ready().

Here is the caller graph for this function:

◆ rcc_osc_bypass_disable()

void rcc_osc_bypass_disable ( enum rcc_osc  osc)

RCC Disable Bypass.

Re-enable the internal clock (high speed and low speed clocks only). The internal clock must be disabled (see rcc_osc_off) for this to have effect.

Note
The LSE clock is in the backup domain and cannot have bypass removed until the backup domain write protection has been removed (see pwr_disable_backup_domain_write_protect) or the backup domain has been reset (see rcc_backupdomain_reset).
Parameters
[in]oscOscillator ID. Only HSE and LSE have effect.

Definition at line 241 of file rcc_common_all.c.

References RCC_BDCR, RCC_BDCR_LSEBYP, RCC_CR, RCC_CR_HSEBYP, RCC_CSR, RCC_HSE, and RCC_LSE.

◆ rcc_osc_bypass_enable()

void rcc_osc_bypass_enable ( enum rcc_osc  osc)

RCC Enable Bypass.

Enable an external clock to bypass the internal clock (high speed and low speed clocks only). The external clock must be enabled (see rcc_osc_on) and the internal clock must be disabled (see rcc_osc_off) for this to have effect.

Note
The LSE clock is in the backup domain and cannot be bypassed until the backup domain write protection has been removed (see pwr_disable_backup_domain_write_protect).
Parameters
[in]oscOscillator ID. Only HSE and LSE have effect.

Definition at line 211 of file rcc_common_all.c.

References RCC_BDCR, RCC_BDCR_LSEBYP, RCC_CR, RCC_CR_HSEBYP, RCC_CSR, RCC_HSE, and RCC_LSE.

◆ rcc_osc_off()

void rcc_osc_off ( enum rcc_osc  osc)

RCC Turn off an Oscillator.

Disable an oscillator and power off.

Note
An oscillator cannot be turned off if it is selected as the system clock.
Parameters
[in]oscenum ::osc_t. Oscillator ID

Definition at line 282 of file rcc.c.

References RCC_BDCR, RCC_BDCR_LSEON, RCC_CR, RCC_CR2, RCC_CR2_HSI14ON, RCC_CR2_HSI48ON, RCC_CR_HSEON, RCC_CR_HSION, RCC_CSR, RCC_CSR_LSION, RCC_HSE, RCC_HSI, RCC_HSI14, RCC_HSI48, RCC_LSE, RCC_LSI, and RCC_PLL.

◆ rcc_osc_on()

void rcc_osc_on ( enum rcc_osc  osc)

RCC Turn on an Oscillator.

Enable an oscillator and power on. Each oscillator requires an amount of time to settle to a usable state. Refer to datasheets for time delay information. A status flag is available to indicate when the oscillator becomes ready (see rcc_osc_ready_int_flag and rcc_wait_for_osc_ready).

Parameters
[in]oscenum ::osc_t. Oscillator ID

Definition at line 244 of file rcc.c.

References RCC_BDCR, RCC_BDCR_LSEON, RCC_CR, RCC_CR2, RCC_CR2_HSI14ON, RCC_CR2_HSI48ON, RCC_CR_HSEON, RCC_CR_HSION, RCC_CR_PLLON, RCC_CSR, RCC_CSR_LSION, RCC_HSE, RCC_HSI, RCC_HSI14, RCC_HSI48, RCC_LSE, RCC_LSI, and RCC_PLL.

Referenced by rcc_clock_setup_in_hse_8mhz_out_48mhz(), rcc_clock_setup_in_hsi48_out_48mhz(), and rcc_clock_setup_in_hsi_out_48mhz().

Here is the caller graph for this function:

◆ rcc_osc_ready_int_clear()

void rcc_osc_ready_int_clear ( enum rcc_osc  osc)

RCC Clear the Oscillator Ready Interrupt Flag.

Clear the interrupt flag that was set when a clock oscillator became ready to use.

Parameters
[in]oscenum ::osc_t. Oscillator ID

Definition at line 57 of file rcc.c.

References RCC_CIR, RCC_CIR_HSERDYC, RCC_CIR_HSI14RDYC, RCC_CIR_HSI48RDYC, RCC_CIR_HSIRDYC, RCC_CIR_LSERDYC, RCC_CIR_LSIRDYC, RCC_CIR_PLLRDYC, RCC_HSE, RCC_HSI, RCC_HSI14, RCC_HSI48, RCC_LSE, RCC_LSI, and RCC_PLL.

◆ rcc_osc_ready_int_disable()

void rcc_osc_ready_int_disable ( enum rcc_osc  osc)

RCC Disable the Oscillator Ready Interrupt.

Parameters
[in]oscenum ::osc_t. Oscillator ID

Definition at line 123 of file rcc.c.

References RCC_CIR, RCC_CIR_HSERDYC, RCC_CIR_HSI14RDYC, RCC_CIR_HSI48RDYC, RCC_CIR_HSIRDYC, RCC_CIR_LSERDYC, RCC_CIR_LSIRDYC, RCC_CIR_PLLRDYC, RCC_HSE, RCC_HSI, RCC_HSI14, RCC_HSI48, RCC_LSE, RCC_LSI, and RCC_PLL.

◆ rcc_osc_ready_int_enable()

void rcc_osc_ready_int_enable ( enum rcc_osc  osc)

RCC Enable the Oscillator Ready Interrupt.

Parameters
[in]oscenum ::osc_t. Oscillator ID

Definition at line 90 of file rcc.c.

References RCC_CIR, RCC_CIR_HSERDYIE, RCC_CIR_HSI14RDYIE, RCC_CIR_HSI48RDYIE, RCC_CIR_HSIRDYIE, RCC_CIR_LSERDYIE, RCC_CIR_LSIRDYIE, RCC_CIR_PLLRDYIE, RCC_HSE, RCC_HSI, RCC_HSI14, RCC_HSI48, RCC_LSE, RCC_LSI, and RCC_PLL.

◆ rcc_osc_ready_int_flag()

int rcc_osc_ready_int_flag ( enum rcc_osc  osc)

RCC Read the Oscillator Ready Interrupt Flag.

Parameters
[in]oscenum ::osc_t. Oscillator ID
Returns
int. Boolean value for flag set.

Definition at line 157 of file rcc.c.

References cm3_assert_not_reached, RCC_CIR, RCC_CIR_HSERDYF, RCC_CIR_HSI14RDYF, RCC_CIR_HSI48RDYF, RCC_CIR_HSIRDYF, RCC_CIR_LSERDYF, RCC_CIR_LSIRDYF, RCC_CIR_PLLRDYF, RCC_HSE, RCC_HSI, RCC_HSI14, RCC_HSI48, RCC_LSE, RCC_LSI, and RCC_PLL.

◆ rcc_periph_clock_disable()

void rcc_periph_clock_disable ( enum rcc_periph_clken  clken)

Disable Peripheral Clock in running mode.

Disable the clock on particular peripheral.

Parameters
[in]clkenrcc_periph_clken Peripheral RCC

For available constants, see rcc_periph_clken (RCC_UART1 for example)

Definition at line 135 of file rcc_common_all.c.

References _RCC_BIT, and _RCC_REG.

◆ rcc_periph_clock_enable()

void rcc_periph_clock_enable ( enum rcc_periph_clken  clken)

Enable Peripheral Clock in running mode.

Enable the clock on particular peripheral.

Parameters
[in]clkenrcc_periph_clken Peripheral RCC

For available constants, see rcc_periph_clken (RCC_UART1 for example)

Definition at line 121 of file rcc_common_all.c.

References _RCC_BIT, and _RCC_REG.

Referenced by crs_autotrim_usb_enable(), and st_usbfs_v2_usbd_init().

Here is the caller graph for this function:

◆ rcc_periph_reset_hold()

void rcc_periph_reset_hold ( enum rcc_periph_rst  rst)

Reset Peripheral, hold.

Reset particular peripheral, and hold in reset state.

Parameters
[in]rstrcc_periph_rst Peripheral reset

For available constants, see rcc_periph_rst (RST_UART1 for example)

Definition at line 166 of file rcc_common_all.c.

References _RCC_BIT, and _RCC_REG.

◆ rcc_periph_reset_pulse()

void rcc_periph_reset_pulse ( enum rcc_periph_rst  rst)

Reset Peripheral, pulsed.

Reset particular peripheral, and restore to working state.

Parameters
[in]rstrcc_periph_rst Peripheral reset

For available constants, see rcc_periph_rst (RST_UART1 for example)

Definition at line 150 of file rcc_common_all.c.

References _RCC_BIT, and _RCC_REG.

Referenced by can_reset(), i2c_reset(), and spi_reset().

Here is the caller graph for this function:

◆ rcc_periph_reset_release()

void rcc_periph_reset_release ( enum rcc_periph_rst  rst)

Reset Peripheral, release.

Restore peripheral from reset state to working state.

Parameters
[in]rstrcc_periph_rst Peripheral reset

For available constants, see rcc_periph_rst (RST_UART1 for example)

Definition at line 181 of file rcc_common_all.c.

References _RCC_BIT, and _RCC_REG.

◆ rcc_peripheral_clear_reset()

void rcc_peripheral_clear_reset ( volatile uint32_t *  reg,
uint32_t  clear_reset 
)

RCC Remove Reset on Peripherals.

Remove the reset on particular peripherals. There are three registers involved, each one controlling reset of peripherals associated with the AHB, APB1 and APB2 respectively. Several peripherals could have the reset removed simultaneously only if they are controlled by the same register.

Parameters
[in]*regUnsigned int32. Pointer to a Reset Register (either RCC_AHBENR, RCC_APB1ENR or RCC_APB2ENR)
[in]clear_resetUnsigned int32. Logical OR of all resets to be removed:
  • If register is RCC_AHBRSTR, from rcc_ahbrstr_rst
  • If register is RCC_APB1RSTR, from rcc_apb1rstr_rst
  • If register is RCC_APB2RSTR, from rcc_apb2rstr_rst

Definition at line 103 of file rcc_common_all.c.

◆ rcc_peripheral_disable_clock()

void rcc_peripheral_disable_clock ( volatile uint32_t *  reg,
uint32_t  en 
)

RCC Disable Peripheral Clocks.

Enable the clock on particular peripherals. There are three registers involved, each one controlling the enabling of clocks associated with the AHB, APB1 and APB2 respectively. Several peripherals could be disabled simultaneously only if they are controlled by the same register.

Parameters
[in]*regUnsigned int32. Pointer to a Clock Enable Register (either RCC_AHBENR, RCC_APB1ENR or RCC_APB2ENR)
[in]enUnsigned int32. Logical OR of all enables to be used for disabling.
  • If register is RCC_AHBER, from rcc_ahbenr_en
  • If register is RCC_APB1ENR, from rcc_apb1enr_en
  • If register is RCC_APB2ENR, from rcc_apb2enr_en

Definition at line 62 of file rcc_common_all.c.

◆ rcc_peripheral_enable_clock()

void rcc_peripheral_enable_clock ( volatile uint32_t *  reg,
uint32_t  en 
)

RCC Enable Peripheral Clocks.

Enable the clock on particular peripherals. There are three registers involved, each one controlling the enabling of clocks associated with the AHB, APB1 and APB2 respectively. Several peripherals could be enabled simultaneously only if they are controlled by the same register.

Parameters
[in]*regUnsigned int32. Pointer to a Clock Enable Register (either RCC_AHBENR, RCC_APB1ENR or RCC_APB2ENR)
[in]enUnsigned int32. Logical OR of all enables to be set
  • If register is RCC_AHBER, from rcc_ahbenr_en
  • If register is RCC_APB1ENR, from rcc_apb1enr_en
  • If register is RCC_APB2ENR, from rcc_apb2enr_en

Definition at line 41 of file rcc_common_all.c.

◆ rcc_peripheral_reset()

void rcc_peripheral_reset ( volatile uint32_t *  reg,
uint32_t  reset 
)

RCC Reset Peripherals.

Reset particular peripherals. There are three registers involved, each one controlling reset of peripherals associated with the AHB, APB1 and APB2 respectively. Several peripherals could be reset simultaneously only if they are controlled by the same register.

Parameters
[in]*regUnsigned int32. Pointer to a Reset Register (either RCC_AHBENR, RCC_APB1ENR or RCC_APB2ENR)
[in]resetUnsigned int32. Logical OR of all resets.
  • If register is RCC_AHBRSTR, from rcc_ahbrstr_rst
  • If register is RCC_APB1RSTR, from rcc_apb1rstr_rst
  • If register is RCC_APB2RSTR, from rcc_apb2rstr_rst

Definition at line 82 of file rcc_common_all.c.

◆ rcc_set_hpre()

void rcc_set_hpre ( uint32_t  hpre)

RCC Set the AHB Prescale Factor.

Parameters
[in]hpreUnsigned int32. AHB prescale factor rcc_cfgr_ahbpre

Definition at line 484 of file rcc.c.

References RCC_CFGR, and RCC_CFGR_HPRE.

Referenced by rcc_clock_setup_in_hse_8mhz_out_48mhz(), rcc_clock_setup_in_hsi48_out_48mhz(), and rcc_clock_setup_in_hsi_out_48mhz().

Here is the caller graph for this function:

◆ rcc_set_i2c_clock_hsi()

void rcc_set_i2c_clock_hsi ( uint32_t  i2c)

Definition at line 524 of file rcc.c.

References I2C1, RCC_CFGR3, and RCC_CFGR3_I2C1SW.

◆ rcc_set_i2c_clock_sysclk()

void rcc_set_i2c_clock_sysclk ( uint32_t  i2c)

Definition at line 531 of file rcc.c.

References I2C1, RCC_CFGR3, and RCC_CFGR3_I2C1SW.

◆ rcc_set_mco()

void rcc_set_mco ( uint32_t  mcosrc)

Select the source of Microcontroller Clock Output.

Exact sources available depend on your target. On devices with multiple MCO pins, this function controls MCO1

Parameters
[in]mcosrcthe unshifted source bits

Definition at line 194 of file rcc_common_all.c.

References RCC_CFGR, RCC_CFGR_MCO_MASK, and RCC_CFGR_MCO_SHIFT.

◆ rcc_set_pll_multiplication_factor()

void rcc_set_pll_multiplication_factor ( uint32_t  mul)

RCC Set the PLL Multiplication Factor.

Note
This only has effect when the PLL is disabled.
Parameters
[in]mulUnsigned int32. PLL multiplication factor rcc_cfgr_pmf

Definition at line 434 of file rcc.c.

References RCC_CFGR, and RCC_CFGR_PLLMUL.

Referenced by rcc_clock_setup_in_hse_8mhz_out_48mhz(), and rcc_clock_setup_in_hsi_out_48mhz().

Here is the caller graph for this function:

◆ rcc_set_pll_source()

void rcc_set_pll_source ( uint32_t  pllsrc)

RCC Set the PLL Clock Source.

Note
This only has effect when the PLL is disabled.
Parameters
[in]pllsrcUnsigned int32. PLL clock source rcc_cfgr_pcs

Definition at line 447 of file rcc.c.

References RCC_CFGR, and RCC_CFGR_PLLSRC.

Referenced by rcc_clock_setup_in_hse_8mhz_out_48mhz(), and rcc_clock_setup_in_hsi_out_48mhz().

Here is the caller graph for this function:

◆ rcc_set_pllxtpre()

void rcc_set_pllxtpre ( uint32_t  pllxtpre)

RCC Set the HSE Frequency Divider used as PLL Clock Source.

Note
This only has effect when the PLL is disabled.
Parameters
[in]pllxtpreUnsigned int32. HSE division factor rcc_cfgr_hsepre

Definition at line 461 of file rcc.c.

References RCC_CFGR, and RCC_CFGR_PLLXTPRE.

Referenced by rcc_clock_setup_in_hse_8mhz_out_48mhz().

Here is the caller graph for this function:

◆ rcc_set_ppre()

void rcc_set_ppre ( uint32_t  ppre)

RCC Set the APB Prescale Factor.

Parameters
[in]ppre1Unsigned int32. APB prescale factor rcc_cfgr_apb1pre

Definition at line 473 of file rcc.c.

References RCC_CFGR, and RCC_CFGR_PPRE.

Referenced by rcc_clock_setup_in_hse_8mhz_out_48mhz(), rcc_clock_setup_in_hsi48_out_48mhz(), and rcc_clock_setup_in_hsi_out_48mhz().

Here is the caller graph for this function:

◆ rcc_set_prediv()

void rcc_set_prediv ( uint32_t  prediv)

Set PLL Source pre-divider CAUTION.

On F03x and F05, prediv only applies to HSE source. On others, this is after source selection. See also f3.

Parameters
[in]predivdivision by prediv+1 PLL source predividers

Definition at line 495 of file rcc.c.

References RCC_CFGR2, and RCC_CFGR2_PREDIV.

◆ rcc_set_rtc_clock_source()

void rcc_set_rtc_clock_source ( enum rcc_osc  clk)

RCC Set the Source for the RTC clock.

Parameters
[in]clock_sourcercc_osc. RTC clock source. Only HSE/32, LSE and LSI.

Definition at line 408 of file rcc.c.

References RCC_BDCR, RCC_BDCR_RTCSEL, RCC_BDCR_RTCSEL_HSE, RCC_BDCR_RTCSEL_LSE, RCC_BDCR_RTCSEL_LSI, RCC_HSE, RCC_LSE, and RCC_LSI.

◆ rcc_set_sysclk_source()

void rcc_set_sysclk_source ( enum rcc_osc  clk)

RCC Set the Source for the System Clock.

Parameters
[in]oscenum ::osc_t. Oscillator ID. Only HSE, LSE and PLL have effect.

Definition at line 334 of file rcc.c.

References RCC_CFGR, RCC_CFGR_SW, RCC_CFGR_SW_HSE, RCC_CFGR_SW_HSI, RCC_CFGR_SW_HSI48, RCC_CFGR_SW_PLL, RCC_HSE, RCC_HSI, RCC_HSI14, RCC_HSI48, RCC_LSE, RCC_LSI, and RCC_PLL.

Referenced by rcc_clock_setup_in_hse_8mhz_out_48mhz(), rcc_clock_setup_in_hsi48_out_48mhz(), and rcc_clock_setup_in_hsi_out_48mhz().

Here is the caller graph for this function:

◆ rcc_set_usbclk_source()

void rcc_set_usbclk_source ( enum rcc_osc  clk)

RCC Set the Source for the USB Clock.

Parameters
[in]oscenum ::osc_t. Oscillator ID. Only HSI48 or PLL have effect.

Definition at line 363 of file rcc.c.

References RCC_CFGR3, RCC_CFGR3_USBSW, RCC_HSE, RCC_HSI, RCC_HSI14, RCC_HSI48, RCC_LSE, RCC_LSI, and RCC_PLL.

◆ rcc_system_clock_source()

enum rcc_osc rcc_system_clock_source ( void  )

RCC Get the System Clock Source.

Returns
::osc_t System clock source:

Definition at line 507 of file rcc.c.

References cm3_assert_not_reached, RCC_CFGR, RCC_CFGR_SWS, RCC_CFGR_SWS_HSE, RCC_CFGR_SWS_HSI, RCC_CFGR_SWS_HSI48, RCC_CFGR_SWS_PLL, RCC_HSE, RCC_HSI, RCC_HSI48, and RCC_PLL.

◆ rcc_usb_clock_source()

enum rcc_osc rcc_usb_clock_source ( void  )

RCC Get the USB Clock Source.

Returns
::osc_t USB clock source:

Definition at line 549 of file rcc.c.

References RCC_CFGR3, RCC_CFGR3_USBSW, RCC_HSI48, and RCC_PLL.

◆ rcc_wait_for_osc_ready()

void rcc_wait_for_osc_ready ( enum rcc_osc  osc)

Wait for Oscillator Ready.

Block until the hardware indicates that the Oscillator is ready.

Parameters
oscOscillator ID

Definition at line 227 of file rcc.c.

References rcc_is_osc_ready().

Referenced by rcc_clock_setup_in_hse_8mhz_out_48mhz(), rcc_clock_setup_in_hsi48_out_48mhz(), and rcc_clock_setup_in_hsi_out_48mhz().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ rcc_ahb_frequency

uint32_t rcc_ahb_frequency

◆ rcc_apb1_frequency