19#ifndef CLK_F2F4F7_CFG_CLOCK_DEFAULT_H
20#define CLK_F2F4F7_CFG_CLOCK_DEFAULT_H
25#if defined(CPU_FAM_STM32F2)
27#elif defined(CPU_FAM_STM32F4)
28#if defined(CPU_LINE_STM32F401xC) || defined(CPU_LINE_STM32F401xE)
30#elif defined(CPU_LINE_STM32F410Cx) || defined(CPU_LINE_STM32F410Rx) || \
31 defined(CPU_LINE_STM32F410Tx) || defined(CPU_LINE_STM32F411xE) || \
32 defined(CPU_LINE_STM32F412Cx) || defined(CPU_LINE_STM32F412Rx) || \
33 defined(CPU_LINE_STM32F412Vx) || defined(CPU_LINE_STM32F412Zx) || \
34 defined(CPU_LINE_STM32F413xx) || defined(CPU_LINE_STM32F423xx)
36#elif defined(CPU_LINE_STM32F405xx) || defined(CPU_LINE_STM32F407xx) || \
37 defined(CPU_LINE_STM32F415xx) || defined(CPU_LINE_STM32F417xx) || \
38 defined(CPU_LINE_STM32F427xx) || defined(CPU_LINE_STM32F437xx) || \
39 defined(CPU_LINE_STM32F429xx) || defined(CPU_LINE_STM32F439xx) || \
40 defined(CPU_LINE_STM32F446xx) || defined(CPU_LINE_STM32F469xx) || \
41 defined(CPU_LINE_STM32F479xx)
44#error "No clock configuration available for this F4 line"
46#elif defined(CPU_FAM_STM32F7)
49#error "No clock configuration available for this family"
56#if IS_ACTIVE(CONFIG_BOARD_HAS_HSE)
57#define CLOCK_PLL_SRC (CONFIG_CLOCK_HSE)
59#define CLOCK_PLL_SRC (CONFIG_CLOCK_HSI)
62#if IS_ACTIVE(CONFIG_USE_CLOCK_HSI)
63#define CLOCK_CORECLOCK (CONFIG_CLOCK_HSI)
65#elif IS_ACTIVE(CONFIG_USE_CLOCK_HSE)
66#if !IS_ACTIVE(CONFIG_BOARD_HAS_HSE)
67#error "The board doesn't provide an HSE oscillator"
69#define CLOCK_CORECLOCK (CONFIG_CLOCK_HSE)
71#elif IS_ACTIVE(CONFIG_USE_CLOCK_PLL)
72#define CLOCK_CORECLOCK (((CLOCK_PLL_SRC / CONFIG_CLOCK_PLL_M) * CONFIG_CLOCK_PLL_N) / CONFIG_CLOCK_PLL_P)
75#define CLOCK_PLLQ (((CLOCK_PLL_SRC / CONFIG_CLOCK_PLL_M) * CONFIG_CLOCK_PLL_N) / CONFIG_CLOCK_PLL_Q)
77#define CLOCK_AHB CLOCK_CORECLOCK
78#define CLOCK_APB1 (CLOCK_CORECLOCK / CONFIG_CLOCK_APB1_DIV)
79#define CLOCK_APB2 (CLOCK_CORECLOCK / CONFIG_CLOCK_APB2_DIV)
Base STM32Fx/Gx/MP1/C0 clock configuration.
Default STM32F4 clock configuration for 100MHz boards.
Default STM32F2/4/7 clock configuration for 120MHz boards.
Default STM32F4 clock configuration for 180MHz boards.
Default STM32F7 clock configuration for 216MHz boards.
Default STM32F4 clock configuration for 84MHz boards.
Common macros and compiler attributes/pragmas configuration.