1/*
2 * Copyright (c) 2024 STMicroelectronics
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/c0/stm32c071Xb.dtsi>
9#include <st/c0/stm32c071rbtx-pinctrl.dtsi>
10#include "arduino_r3_connector.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12
13/ {
14	model = "STMicroelectronics STM32C071RB-NUCLEO board";
15	compatible = "st,stm32c071rb-nucleo";
16
17	chosen {
18		zephyr,console = &usart2;
19		zephyr,shell-uart = &usart2;
20		zephyr,sram = &sram0;
21		zephyr,flash = &flash0;
22	};
23
24	leds: leds {
25		compatible = "gpio-leds";
26		green_led_1: led_1 {
27			gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>;
28			label = "User LD1";
29		};
30
31		blue_led: led_2 {
32			gpios = <&gpioc 9 GPIO_ACTIVE_HIGH>;
33			label = "User LD2";
34		};
35	};
36
37	pwmleds {
38		compatible = "pwm-leds";
39
40		green_pwm_led: green_pwm_led {
41			pwms = <&pwm1 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
42		};
43	};
44
45	gpio_keys {
46		compatible = "gpio-keys";
47		user_button: button {
48			label = "user button";
49			gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
50			status = "okay";
51			zephyr,code = <INPUT_KEY_0>;
52		};
53	};
54
55	aliases {
56		led0 = &green_led_1;
57		led1 = &blue_led;
58		pwm-led0 = &green_pwm_led;
59		sw0 = &user_button;
60		watchdog0 = &iwdg;
61		die-temp0 = &die_temp;
62		volt-sensor0 = &vref;
63	};
64};
65
66&clk_lse {
67	status = "okay";
68};
69
70&clk_hse {
71	clock-frequency = <DT_FREQ_M(48)>;
72	status = "okay";
73};
74
75&rcc {
76	clocks = <&clk_hse>;
77	clock-frequency = <DT_FREQ_M(48)>;
78	ahb-prescaler = <1>;
79	apb1-prescaler = <1>;
80};
81
82&usart1 {
83	pinctrl-0 = <&usart1_tx_pb6 &usart1_rx_pb7>;
84	pinctrl-names = "default";
85	current-speed = <115200>;
86	status = "okay";
87};
88
89&usart2 {
90	pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
91	pinctrl-names = "default";
92	current-speed = <115200>;
93	status = "okay";
94};
95
96&rtc {
97	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00000400>,
98		 <&rcc STM32_SRC_LSE RTC_SEL(1)>;
99	status = "okay";
100};
101
102&iwdg {
103	status = "okay";
104};
105
106&timers1 {
107	st,prescaler = <10000>;
108	status = "okay";
109
110	pwm1: pwm {
111		pinctrl-0 = <&tim1_ch1_pa5>;
112		pinctrl-names = "default";
113		status = "okay";
114	};
115};
116
117&i2c1 {
118	pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
119	pinctrl-names = "default";
120	status = "okay";
121	clock-frequency = <I2C_BITRATE_FAST>;
122};
123
124&spi1 {
125	pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5
126		     &spi1_miso_pa11 &spi1_mosi_pa12>;
127	pinctrl-names = "default";
128	status = "okay";
129};
130
131&adc1 {
132	pinctrl-0 = <&adc1_in0_pa0 &adc1_in1_pa1 &adc1_in4_pa4>;
133	pinctrl-names = "default";
134	st,adc-clock-source = "SYNC";
135	st,adc-prescaler = <4>;
136	status = "okay";
137	vref-mv = <3300>;
138};
139
140&die_temp {
141	status = "okay";
142};
143
144&vref {
145	status = "okay";
146};
147
148&dma1 {
149	status = "okay";
150};
151
152&dmamux1 {
153	status = "okay";
154};
155