Zephyr API Documentation
3.5.0
A Scalable Open Source RTOS
3.5.0
Toggle main menu visibility
Main Page
Related Pages
Modules
Data Structures
Data Structures
Data Structure Index
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
Files
File List
Globals
All
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
f
g
h
i
k
l
m
n
o
p
r
s
t
x
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Macros
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
▼
Zephyr API Documentation
►
Introduction
Deprecated List
►
Modules
►
Data Structures
▼
Files
►
File List
►
Globals
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
Loading...
Searching...
No Matches
stm32l1_clock.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2022 Linaro Limited
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32L1_CLOCK_H_
7
#define ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32L1_CLOCK_H_
8
10
#define STM32_CLOCK_BUS_AHB1 0x01c
11
#define STM32_CLOCK_BUS_APB2 0x020
12
#define STM32_CLOCK_BUS_APB1 0x024
13
14
#define STM32_PERIPH_BUS_MIN STM32_CLOCK_BUS_AHB1
15
#define STM32_PERIPH_BUS_MAX STM32_CLOCK_BUS_APB1
16
18
/* RM0038.pdf, §6.3.14 Control/status register (RCC_CSR) */
19
21
#define STM32_SRC_HSE 0x001
22
#define STM32_SRC_LSE 0x002
23
#define STM32_SRC_LSI 0x003
25
#define STM32_SRC_SYSCLK 0x004
26
27
#define STM32_CLOCK_REG_MASK 0xFFU
28
#define STM32_CLOCK_REG_SHIFT 0U
29
#define STM32_CLOCK_SHIFT_MASK 0x1FU
30
#define STM32_CLOCK_SHIFT_SHIFT 8U
31
#define STM32_CLOCK_MASK_MASK 0x7U
32
#define STM32_CLOCK_MASK_SHIFT 13U
33
#define STM32_CLOCK_VAL_MASK 0x7U
34
#define STM32_CLOCK_VAL_SHIFT 16U
35
49
#define STM32_CLOCK(val, mask, shift, reg) \
50
((((reg) & STM32_CLOCK_REG_MASK) << STM32_CLOCK_REG_SHIFT) | \
51
(((shift) & STM32_CLOCK_SHIFT_MASK) << STM32_CLOCK_SHIFT_SHIFT) | \
52
(((mask) & STM32_CLOCK_MASK_MASK) << STM32_CLOCK_MASK_SHIFT) | \
53
(((val) & STM32_CLOCK_VAL_MASK) << STM32_CLOCK_VAL_SHIFT))
54
56
#define CSR_REG 0x34
57
58
#define RTC_SEL(val) STM32_CLOCK(val, 3, 16, CSR_REG)
59
61
#define NO_SEL 0xFF
62
63
#endif
/* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32L1_CLOCK_H_ */
zephyr
dt-bindings
clock
stm32l1_clock.h
Generated on Fri Oct 20 2023 10:27:12 for Zephyr API Documentation by
1.9.6