cfg_clock_default_120.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Freie Universität Berlin
3  * 2017 OTA keys S.A.
4  * 2018-2020 Inria
5  *
6  * This file is subject to the terms and conditions of the GNU Lesser
7  * General Public License v2.1. See the file LICENSE in the top level
8  * directory for more details.
9  */
10 
23 #ifndef CLK_F2F4F7_CFG_CLOCK_DEFAULT_120_H
24 #define CLK_F2F4F7_CFG_CLOCK_DEFAULT_120_H
25 
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
36 /* The following parameters configure a 120MHz system clock with HSE (8MHz or
37  16MHz) or HSI (16MHz) as PLL input clock */
38 #ifndef CONFIG_CLOCK_PLL_M
39 #define CONFIG_CLOCK_PLL_M (4)
40 #endif
41 #ifndef CONFIG_CLOCK_PLL_N
42 #if IS_ACTIVE(CONFIG_BOARD_HAS_HSE) && (CLOCK_HSE == MHZ(8))
43 #define CONFIG_CLOCK_PLL_N (120)
44 #else
45 #define CONFIG_CLOCK_PLL_N (60)
46 #endif
47 #endif
48 #ifndef CONFIG_CLOCK_PLL_P
49 #define CONFIG_CLOCK_PLL_P (2)
50 #endif
51 #ifndef CONFIG_CLOCK_PLL_Q
52 #define CONFIG_CLOCK_PLL_Q (5)
53 #endif
54 
59 #ifndef CONFIG_CLOCK_APB1_DIV
60 #define CONFIG_CLOCK_APB1_DIV (4) /* max 30MHz */
61 #endif
62 #ifndef CONFIG_CLOCK_APB2_DIV
63 #define CONFIG_CLOCK_APB2_DIV (2) /* max 60MHz */
64 #endif
65 
67 #ifdef __cplusplus
68 }
69 #endif
70 
72 
73 #if CLOCK_CORECLOCK > MHZ(120)
74 #error "SYSCLK cannot exceed 120MHz"
75 #endif
76 
77 #endif /* CLK_F2F4F7_CFG_CLOCK_DEFAULT_120_H */
78 
cfg_clock_common.h
Base STM32F4 clock configuration.
cfg_clock_values.h
STM32F4 clock values definitions.