64 #include "stm32l4xx.h"
66 #if !defined(HSE_VALUE)
68 #define HSE_VALUE 8000000U
71 #if !defined(MSI_VALUE)
73 #define MSI_VALUE 4000000U
76 #if !defined(HSI_VALUE)
78 #define HSI_VALUE 16000000U
93 #if defined(USER_VECT_TAB_ADDRESS)
105 #if defined(VECT_TAB_SRAM)
107 #define VECT_TAB_BASE_ADDRESS SRAM1_BASE
110 #define VECT_TAB_BASE_ADDRESS FLASH_BASE
113 #if !defined(VECT_TAB_OFFSET)
115 #define VECT_TAB_OFFSET 0x00000000U
137 1U, 2U, 3U, 4U, 6U, 7U, 8U, 9U};
144 1000000U, 2000000U, 4000000U, 8000000U,
145 16000000U, 24000000U, 32000000U, 48000000U};
152 #if defined(USER_VECT_TAB_ADDRESS)
154 SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET;
158 #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
160 ((3UL << 20U) | (3UL << 22U));
210 if ((RCC->CR & RCC_CR_MSIRGSEL) == 0U)
213 msirange = (RCC->CSR & RCC_CSR_MSISRANGE) >> 8U;
218 msirange = (RCC->CR & RCC_CR_MSIRANGE) >> 4U;
224 switch (RCC->CFGR & RCC_CFGR_SWS)
245 pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC);
246 pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> 4U) + 1U;
262 pllvco = (msirange / pllm);
265 pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 8U);
266 pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> 25U) + 1U) * 2U;
const uint32_t MSIRangeTable[12]
const uint8_t APBPrescTable[8]
const uint8_t AHBPrescTable[16]
void SystemInit(void)
Initialize the system before calling the main() function.
uint32_t SystemCoreClock
Define to enable user-defined vector table address setting.
void SystemCoreClockUpdate(void)
Update the SystemCoreClock variable according to the clock register values.