1/*
2 * Copyright (c) 2024 STMicroelectronics
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/h7rs/stm32h7s7X8.dtsi>
9#include <st/h7/stm32h7s7l8hx-pinctrl.dtsi>
10#include "arduino_r3_connector.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12
13/ {
14	model = "STMicroelectronics STM32H7S78 DISCOVERY KIT board";
15	compatible = "st,stm32h7s78-dk";
16
17	chosen {
18		zephyr,console = &uart4;
19		zephyr,shell-uart = &uart4;
20		zephyr,flash = &flash0;
21		zephyr,sram = &sram0;
22	};
23
24	leds {
25		compatible = "gpio-leds";
26		green_led: led_1 {
27			gpios = <&gpioo 1 GPIO_ACTIVE_LOW>;
28			label = "User LD1";
29		};
30		orange_led: led_2 {
31			gpios = <&gpioo 5 GPIO_ACTIVE_LOW>;
32			label = "User LD2";
33		};
34		red_led: led_3 {
35			gpios = <&gpiom 2 GPIO_ACTIVE_LOW>;
36			label = "User LD3";
37		};
38		blue_led: led_4 {
39			gpios = <&gpiom 3 GPIO_ACTIVE_LOW>;
40			label = "User LD4";
41		};
42	};
43
44	gpio_keys {
45		compatible = "gpio-keys";
46		user_button: button {
47			label = "User";
48			gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
49			zephyr,code = <INPUT_KEY_0>;
50		};
51	};
52
53	aliases {
54		led0 = &blue_led;
55		sw0 = &user_button;
56		watchdog0 = &iwdg;
57		die-temp0 = &die_temp;
58		volt-sensor0 = &vref;
59		volt-sensor1 = &vbat;
60	};
61};
62
63&clk_hsi48 {
64	status = "okay";
65};
66
67&clk_lse {
68	status = "okay";
69};
70
71&clk_hse {
72	clock-frequency = <DT_FREQ_M(24)>;
73	hse-bypass; /* X3 is a 24MHz oscillator on PH0 */
74	status = "okay";
75};
76
77&pll {
78	div-m = <12>;
79	mul-n = <250>;
80	div-p = <2>;
81	div-q = <2>;
82	div-r = <2>;
83	div-s = <2>;
84	div-t = <2>;
85	clocks = <&clk_hse>;
86	status = "okay";
87};
88
89&rcc {
90	clocks = <&pll>;
91	clock-frequency = <DT_FREQ_M(250)>;
92	dcpre = <1>;
93	hpre = <1>;
94	ppre1 = <2>;
95	ppre2 = <2>;
96	ppre4 = <2>;
97	ppre5 = <2>;
98};
99
100&uart4 {
101	pinctrl-0 = <&uart4_tx_pd1 &uart4_rx_pd0>;
102	pinctrl-names = "default";
103	current-speed = <115200>;
104	status = "okay";
105};
106
107&uart7 {
108	pinctrl-0 = <&uart7_tx_pe8 &uart7_rx_pe7>;
109	pinctrl-names = "default";
110	current-speed = <115200>;
111	status = "okay";
112};
113
114&timers2 {
115	st,prescaler = <10000>;
116	status = "okay";
117
118	pwm2: pwm {
119		status = "okay";
120		pinctrl-0 = <&tim2_ch4_pa3>;
121		pinctrl-names = "default";
122	};
123};
124
125&timers3 {
126	st,prescaler = <10000>;
127	status = "okay";
128
129	pwm3: pwm {
130		status = "okay";
131		pinctrl-0 = <&tim3_ch2_pb5>;
132		pinctrl-names = "default";
133	};
134};
135
136&rng {
137	status = "okay";
138};
139
140&iwdg {
141	status = "okay";
142};
143
144&wwdg {
145	status = "okay";
146};
147
148&adc1 {
149	pinctrl-0 = <&adc1_inp6_pf12>; /* Arduino A3 */
150	pinctrl-names = "default";
151	st,adc-clock-source = "SYNC";
152	st,adc-prescaler = <4>;
153	status = "okay";
154};
155
156&adc2 {
157	pinctrl-0 = <&adc2_inp2_pf13>; /* Arduino A4 */
158	pinctrl-names = "default";
159	st,adc-clock-source = "SYNC";
160	st,adc-prescaler = <4>;
161	status = "okay";
162};
163
164&spi4 {
165	pinctrl-0 = <&spi4_nss_pe4 &spi4_sck_pe12
166		     &spi4_miso_pe13 &spi4_mosi_pe14>;
167	pinctrl-names = "default";
168	status = "okay";
169};
170
171&i2c1 {
172	pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb9>;
173	pinctrl-names = "default";
174};
175
176&die_temp {
177	status = "okay";
178};
179
180&vref {
181	status = "okay";
182};
183
184&vbat {
185	status = "okay";
186};
187