Skip to content

Commit 6b13cc8

Browse files
Alain Volmatkartben
authored andcommitted
include: zephyr: dt-bindings: clock: l4: add MCO SEL/PRE macros
Add macros in order to select the MCO input clock and prescaler value. Signed-off-by: Alain Volmat <[email protected]>
1 parent e944957 commit 6b13cc8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

include/zephyr/dt-bindings/clock/stm32l4_clock.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,21 @@
8989
#define MCO1_SEL(val) STM32_DT_CLOCK_SELECT((val), 0xF, 24, CFGR_REG)
9090
#define MCO1_PRE(val) STM32_DT_CLOCK_SELECT((val), 0x7, 28, CFGR_REG)
9191

92+
/* MCO prescaler : division factor */
93+
#define MCO_PRE_DIV_1 0
94+
#define MCO_PRE_DIV_2 1
95+
#define MCO_PRE_DIV_4 2
96+
#define MCO_PRE_DIV_8 3
97+
#define MCO_PRE_DIV_16 4
98+
99+
/* MCO clock output */
100+
#define MCO_SEL_SYSCLK 1
101+
#define MCO_SEL_MSI 2
102+
#define MCO_SEL_HSI16 3
103+
#define MCO_SEL_HSE 4
104+
#define MCO_SEL_PLLCLK 5
105+
#define MCO_SEL_LSI 6
106+
#define MCO_SEL_LSE 7
107+
#define MCO_SEL_HSI48 8
108+
92109
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32L4_CLOCK_H_ */

0 commit comments

Comments
 (0)