1/*
2 * Copyright (c) 2017 RnDity Sp. z o.o.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/f0/stm32f030X8.dtsi>
9#include <st/f0/stm32f030r8tx-pinctrl.dtsi>
10#include "arduino_r3_connector.dtsi"
11#include "st_morpho_connector.dtsi"
12#include <zephyr/dt-bindings/input/input-event-codes.h>
13
14/ {
15	model = "STMicroelectronics STM32F030R8-NUCLEO board";
16	compatible = "st,stm32f030r8-nucleo";
17
18	chosen {
19		zephyr,console = &usart2;
20		zephyr,shell-uart = &usart2;
21		zephyr,sram = &sram0;
22		zephyr,flash = &flash0;
23	};
24
25	leds: leds {
26		compatible = "gpio-leds";
27		green_led_2: led_2 {
28			gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>;
29			label = "User LD2";
30		};
31	};
32
33	gpio_keys {
34		compatible = "gpio-keys";
35		user_button: button {
36			label = "User";
37			gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
38			zephyr,code = <INPUT_KEY_0>;
39		};
40	};
41
42	aliases {
43		led0 = &green_led_2;
44		sw0 = &user_button;
45		watchdog0 = &iwdg;
46		die-temp0 = &die_temp;
47		volt-sensor0 = &vref;
48	};
49};
50
51&clk_hse {
52	hse-bypass;
53	clock-frequency = <DT_FREQ_M(8)>; /* STLink 8MHz clock */
54	status = "okay";
55};
56
57&pll {
58	prediv = <1>;
59	mul = <6>;
60	clocks = <&clk_hse>;
61	status = "okay";
62};
63
64&rcc {
65	clocks = <&pll>;
66	clock-frequency = <DT_FREQ_M(48)>;
67	ahb-prescaler = <1>;
68	apb1-prescaler = <1>;
69};
70
71/* Due to limited available memory, don't enable gpiod and gpiof */
72/* (Test cases fail due to 'SRAM' region overflow) */
73&gpiod {status = "disabled";};
74&gpiof {status = "disabled";};
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_nss_pb12 &spi2_sck_pb13
113		     &spi2_miso_pb14 &spi2_mosi_pb15>;
114	pinctrl-names = "default";
115	status = "okay";
116};
117
118&adc1 {
119	pinctrl-0 = <&adc_in0_pa0>;
120	pinctrl-names = "default";
121	st,adc-clock-source = <SYNC>;
122	st,adc-prescaler = <4>;
123	status = "okay";
124};
125
126&iwdg {
127	status = "okay";
128};
129
130&die_temp {
131	status = "okay";
132};
133
134&vref {
135	status = "okay";
136};
137