Go to the source code of this file.
Classes | |
struct | RCC_Typedef |
RCC register map structure. More... |
Enumerations | |
enum | rcc_cfgr_hpre_div_t { RCC_CFGR_HPRE_DIV1 = 0x0 , RCC_CFGR_HPRE_DIV2 = 0x8 , RCC_CFGR_HPRE_DIV4 = 0x9 , RCC_CFGR_HPRE_DIV8 = 0xA , RCC_CFGR_HPRE_DIV16 = 0xB , RCC_CFGR_HPRE_DIV64 = 0xC , RCC_CFGR_HPRE_DIV128 = 0xD , RCC_CFGR_HPRE_DIV256 = 0xE , RCC_CFGR_HPRE_DIV512 = 0xF } |
AHB prescaler division factors. More... | |
enum | rcc_cfgr_ppre_div_t { RCC_CFGR_PPRE_DIV1 = 0x0 , RCC_CFGR_PPRE_DIV2 = 0x4 , RCC_CFGR_PPRE_DIV4 = 0x5 , RCC_CFGR_PPRE_DIV8 = 0x6 , RCC_CFGR_PPRE_DIV16 = 0x7 } |
APB prescaler division factors. More... |
#define RCC ((RCC_Typedef *)RCC_BASE_ADDR) |
Pointer to RCC peripheral registers.
#define RCC_BASE_ADDR 0x40023800 |
RCC base address.
#define RCC_CFGR_HPRE_BIT 4 |
AHB prescaler bits
#define RCC_CFGR_HPRE_DIV | ( | n | ) |
Set AHB prescaler
#define RCC_CFGR_HPRE_DIV1 0x0 |
AHB clock not divided
#define RCC_CFGR_HPRE_MASK (0xF << RCC_CFGR_HPRE_BIT) |
Mask for AHB prescaler
#define RCC_CFGR_PPRE1_BIT 10 |
APB1 prescaler bits
#define RCC_CFGR_PPRE1_DIV | ( | n | ) |
Set APB1 prescaler
#define RCC_CFGR_PPRE1_DIV4 0x5 |
APB1 clock = HCLK / 4
#define RCC_CFGR_PPRE1_MASK (0x7 << RCC_CFGR_PPRE1_BIT) |
Mask for APB1 prescaler
#define RCC_CFGR_PPRE2_BIT 13 |
APB2 prescaler bits
#define RCC_CFGR_PPRE2_DIV | ( | n | ) |
Set APB2 prescaler
#define RCC_CFGR_PPRE2_DIV2 0x4 |
APB2 clock = HCLK / 2
#define RCC_CFGR_PPRE2_MASK (0x7 << RCC_CFGR_PPRE2_BIT) |
Mask for APB2 prescaler
#define RCC_CFGR_SW_BIT 0 |
System clock switch bits
#define RCC_CFGR_SWS_BIT 2 |
System clock switch status bits
#define RCC_CR_HSE_ON_BIT 16 |
HSE clock enable bit
#define RCC_CR_HSE_READY_BIT 17 |
HSE clock ready flag
#define RCC_CR_HSEON (1 << RCC_CR_HSE_ON_BIT) |
Enable external HSE clock
#define RCC_CR_HSERDY (1 << RCC_CR_HSE_READY_BIT) |
External HSE clock ready flag
#define RCC_CR_HSI_ON_BIT 0 |
HSI clock enable bit
#define RCC_CR_HSI_READY_BIT 1 |
HSI clock ready flag
#define RCC_CR_HSION (1 << RCC_CR_HSI_ON_BIT) |
Enable internal HSI clock
#define RCC_CR_HSIRDY (1 << RCC_CR_HSI_READY_BIT) |
Internal HSI clock ready flag
#define RCC_CR_PLL_ON_BIT 24 |
PLL enable bit
#define RCC_CR_PLL_READY_BIT 25 |
PLL ready flag
#define RCC_CR_PLLON (1 << RCC_CR_PLL_ON_BIT) |
Enable PLL
#define RCC_CR_PLLRDY (1 << RCC_CR_PLL_READY_BIT) |
PLL ready flag
#define RCC_OFF 0x0 |
Disable flag.
#define RCC_ON 0x1 |
Enable flag.
#define RCC_PLLCFGR_PLLM | ( | m | ) |
Set PLLM
#define RCC_PLLCFGR_PLLM_BIT 0 |
PLLM bits
#define RCC_PLLCFGR_PLLN | ( | n | ) |
Set PLLN
#define RCC_PLLCFGR_PLLN_BIT 6 |
PLLN bits
#define RCC_PLLCFGR_PLLP | ( | p | ) |
Set PLLP
#define RCC_PLLCFGR_PLLP_BIT 16 |
PLLP bits
#define RCC_PLLCFGR_PLLQ | ( | q | ) |
Set PLLQ
#define RCC_PLLCFGR_PLLQ_BIT 24 |
PLLQ bits
#define RCC_PLLCFGR_SRC (1 << RCC_PLLCFGR_SRC_BIT) |
0: HSI, 1: HSE
#define RCC_PLLCFGR_SRC_BIT 22 |
PLL source selection bit
enum rcc_cfgr_hpre_div_t |
AHB prescaler division factors.
enum rcc_cfgr_ppre_div_t |