Loading...
Searching...
No Matches
pll1.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024 Prime Controls, Inc.(R)
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
17
18#include "cfg_clock_default.h"
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/* PLL1 needed? */
25#if IS_ACTIVE(CONFIG_USE_HSI_PLL) || IS_ACTIVE(CONFIG_USE_HSE_PLL) || \
26 IS_ACTIVE(CONFIG_USE_CSI_PLL)
27
28/* PLL1 configuration */
29# define CLOCK_PLL1_M CONFIG_CLOCK_PLL1_M
30# define CLOCK_PLL1_N CONFIG_CLOCK_PLL1_N
31# define CLOCK_PLL1_P CONFIG_CLOCK_PLL1_P
32# define CLOCK_PLL1_Q CONFIG_CLOCK_PLL1_Q
33# define CLOCK_PLL1_R CONFIG_CLOCK_PLL1_R
34
35/* PLL1 input selection */
36# if IS_ACTIVE(CONFIG_USE_HSI_PLL)
37# define CLOCK_PLL1_INPUT CLOCK_HSI
38# elif IS_ACTIVE(CONFIG_USE_HSE_PLL)
39# define CLOCK_PLL1_INPUT CLOCK_HSE
40# elif IS_ACTIVE(CONFIG_USE_CSI_PLL)
41# define CLOCK_PLL1_INPUT CLOCK_CSI
42#endif
43
44/* PLL1 output frequencies */
45# define CLOCK_PLL1_VCO ((CLOCK_PLL1_INPUT * CLOCK_PLL1_N) / (CLOCK_PLL1_M))
46# define CLOCK_PLL1_P_OUT (CLOCK_PLL1_VCO / CLOCK_PLL1_P)
47# define CLOCK_PLL1_Q_OUT (CLOCK_PLL1_VCO / CLOCK_PLL1_Q)
48# define CLOCK_PLL1_R_OUT (CLOCK_PLL1_VCO / CLOCK_PLL1_R)
49
50#endif
51
52#ifdef __cplusplus
53}
54#endif
55
Main header for STM32H7 clock configuration (STM32H753ZI)