Skip to content

Commit a624fe0

Browse files
joerchancarlescufi
authored andcommitted
boards: Add MCO support for the stm32c0xx family
Add MCO support for the stm32c0xx family. Signed-off-by: Joakim Andersson <[email protected]>
1 parent 0a2c6a0 commit a624fe0

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

dts/arm/st/c0/stm32c0.dtsi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@
6767
};
6868
};
6969

70+
mcos {
71+
mco1: mco1 {
72+
compatible = "st,stm32-clock-mco";
73+
status = "disabled";
74+
};
75+
76+
mco2: mco2 {
77+
compatible = "st,stm32-clock-mco";
78+
status = "disabled";
79+
};
80+
};
81+
7082
soc {
7183
flash: flash-controller@40022000 {
7284
compatible = "st,stm32-flash-controller";

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
/** @brief RCC_CSR1 register offset */
6464
#define CSR1_REG 0x5C
6565

66+
/** @brief RCC_CFGRx register offset */
67+
#define CFGR1_REG 0x08
68+
6669
/** @brief Device domain clocks selection helpers */
6770
/** CCIPR devices */
6871
#define USART1_SEL(val) STM32_CLOCK(val, 3, 0, CCIPR_REG)
@@ -72,4 +75,10 @@
7275
/** CSR1 devices */
7376
#define RTC_SEL(val) STM32_CLOCK(val, 3, 8, CSR1_REG)
7477

78+
/** CFGR1 devices */
79+
#define MCO1_SEL(val) STM32_MCO_CFGR(val, 0x7, 24, CFGR1_REG)
80+
#define MCO1_PRE(val) STM32_MCO_CFGR(val, 0x7, 28, CFGR1_REG)
81+
#define MCO2_SEL(val) STM32_MCO_CFGR(val, 0x7, 16, CFGR1_REG)
82+
#define MCO2_PRE(val) STM32_MCO_CFGR(val, 0x7, 20, CFGR1_REG)
83+
7584
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_CLOCK_STM32C0_CLOCK_H_ */

0 commit comments

Comments
 (0)