Zephyr Project API
4.1.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
stm32_common_clocks.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2023 STMicroelectronics
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32_COMMON_CLOCKS_H_
7
#define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32_COMMON_CLOCKS_H_
8
10
#define STM32_SRC_SYSCLK 0x001
12
#define STM32_SRC_LSE 0x002
13
#define STM32_SRC_LSI 0x003
14
16
#define NO_SEL 0xFF
17
18
#define STM32_CLOCK_DIV_SHIFT 12
19
21
#define STM32_CLOCK_DIV(div) (((div) - 1) << STM32_CLOCK_DIV_SHIFT)
22
24
#define STM32_DT_CLKSEL_REG_MASK 0xFFFFU
25
#define STM32_DT_CLKSEL_REG_SHIFT 0U
26
#define STM32_DT_CLKSEL_SHIFT_MASK 0x3FU
27
#define STM32_DT_CLKSEL_SHIFT_SHIFT 16U
28
#define STM32_DT_CLKSEL_MASK_MASK 0x1FU
29
#define STM32_DT_CLKSEL_MASK_SHIFT 22U
30
#define STM32_DT_CLKSEL_VAL_MASK 0x1FU
31
#define STM32_DT_CLKSEL_VAL_SHIFT 27U
32
46
#define STM32_DT_CLOCK_SELECT(val, mask, shift, reg) \
47
((((reg) & STM32_DT_CLKSEL_REG_MASK) << STM32_DT_CLKSEL_REG_SHIFT) | \
48
(((shift) & STM32_DT_CLKSEL_SHIFT_MASK) << STM32_DT_CLKSEL_SHIFT_SHIFT) | \
49
(((mask) & STM32_DT_CLKSEL_MASK_MASK) << STM32_DT_CLKSEL_MASK_SHIFT) | \
50
(((val) & STM32_DT_CLKSEL_VAL_MASK) << STM32_DT_CLKSEL_VAL_SHIFT))
51
59
#define STM32_CLOCK(bus, bit) (STM32_CLOCK_BUS_##bus) (1 << bit)
60
61
#endif
/* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32_COMMON_CLOCKS_H_ */
include
zephyr
dt-bindings
clock
stm32_common_clocks.h
Generated on Sun Mar 30 2025 16:03:57 for Zephyr Project API by
1.9.8