1/*
2 * Copyright (c) 2018 qianfan Zhao
3 * Copyright (c) 2024 STMicroelectronics
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8/dts-v1/;
9#include <st/f0/stm32f070Xb.dtsi>
10#include <st/f0/stm32f070rbtx-pinctrl.dtsi>
11#include "arduino_r3_connector.dtsi"
12#include "st_morpho_connector.dtsi"
13#include <zephyr/dt-bindings/input/input-event-codes.h>
14
15/ {
16	model = "STMicroelectronics NUCLEO-F070RB board";
17	compatible = "st,stm32f070rb-nucleo";
18
19	chosen {
20		zephyr,console = &usart2;
21		zephyr,shell-uart = &usart2;
22		zephyr,sram = &sram0;
23		zephyr,flash = &flash0;
24	};
25
26	leds: leds {
27		compatible = "gpio-leds";
28		green_led_2: led_2 {
29			gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>;
30			label = "User LD2";
31		};
32	};
33
34	gpio_keys {
35		compatible = "gpio-keys";
36		user_button: button {
37			label = "User";
38			gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
39			zephyr,code = <INPUT_KEY_0>;
40		};
41	};
42
43	aliases {
44		led0 = &green_led_2;
45		sw0 = &user_button;
46		watchdog0 = &iwdg;
47		die-temp0 = &die_temp;
48		volt-sensor0 = &vref;
49	};
50};
51
52&clk_lse {
53	status = "okay";
54};
55
56&clk_hse {
57	hse-bypass;
58	clock-frequency = <DT_FREQ_M(8)>; /* STLink 8MHz clock */
59	status = "okay";
60};
61
62&pll {
63	clocks = <&clk_hse>;
64	prediv = <1>;
65	mul = <6>;
66	status = "okay";
67};
68
69&rcc {
70	clocks = <&pll>;
71	clock-frequency = <DT_FREQ_M(48)>;
72	ahb-prescaler = <1>;
73	apb1-prescaler = <2>;
74};
75
76&usart1 {
77	pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
78	pinctrl-names = "default";
79	current-speed = <115200>;
80	status = "okay";
81};
82
83&usart2 {
84	pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
85	pinctrl-names = "default";
86	current-speed = <115200>;
87	status = "okay";
88};
89
90&i2c1 {
91	pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
92	pinctrl-names = "default";
93	status = "okay";
94	clock-frequency = <I2C_BITRATE_FAST>;
95};
96
97&i2c2 {
98	pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>;
99	pinctrl-names = "default";
100	status = "okay";
101	clock-frequency = <I2C_BITRATE_FAST>;
102};
103
104&spi1 {
105	pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>;
106	pinctrl-names = "default";
107	cs-gpios = <&gpiob 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
108	status = "okay";
109};
110
111&spi2 {
112	pinctrl-0 = <&spi2_sck_pb13 &spi2_miso_pb14 &spi2_mosi_pb15>;
113	pinctrl-names = "default";
114	status = "okay";
115};
116
117&iwdg {
118	status = "okay";
119};
120
121&adc1 {
122	pinctrl-0 = <&adc_in0_pa0>;
123	pinctrl-names = "default";
124	st,adc-clock-source = "SYNC";
125	st,adc-prescaler = <4>;
126	status = "okay";
127};
128
129&rtc {
130	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
131		 <&rcc STM32_SRC_LSE RTC_SEL(1)>;
132	status = "okay";
133};
134
135&die_temp {
136	status = "okay";
137};
138
139&vref {
140	status = "okay";
141};
142