1/*
2 * Copyright (c) 2021 Electrolance Solutions
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/h7/stm32h7a3Xi.dtsi>
9#include <st/h7/stm32h7a3z(g-i)txq-pinctrl.dtsi>
10#include "arduino_r3_connector.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12
13/ {
14	model = "STMicroelectronics STM32H7A3ZI-Q-NUCLEO board";
15	compatible = "st,stm32h7a3zi-q-nucleo";
16
17	chosen {
18		zephyr,console = &usart3;
19		zephyr,shell-uart = &usart3;
20		zephyr,sram = &sram0;
21		zephyr,flash = &flash0;
22		zephyr,dtcm = &dtcm;
23		zephyr,itcm = &itcm;
24	};
25
26	leds: leds {
27		compatible = "gpio-leds";
28
29		green_led: led_0 {
30			gpios = <&gpiob 0 GPIO_ACTIVE_HIGH>;
31			label = "User LD1";
32		};
33
34		yellow_led: led_1 {
35			gpios = <&gpioe 1 GPIO_ACTIVE_HIGH>;
36			label = "User LD2";
37		};
38	};
39
40	pwmleds {
41		compatible = "pwm-leds";
42
43		red_pwm_led: red_pwm_led {
44			pwms = <&pwm12 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
45		};
46	};
47
48	gpio_keys {
49		compatible = "gpio-keys";
50
51		user_button: button_0 {
52			label = "User";
53			gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
54			zephyr,code = <INPUT_KEY_0>;
55		};
56	};
57
58	aliases {
59		led0 = &green_led;
60		led1 = &yellow_led;
61		pwm-led0 = &red_pwm_led;
62		sw0 = &user_button;
63	};
64};
65
66&clk_hsi48 {
67	status = "okay";
68};
69
70&clk_hse {
71	hse-bypass;
72	clock-frequency = <DT_FREQ_M(8)>; /* STLink 8MHz clock */
73	status = "okay";
74};
75
76&pll {
77	div-m = <1>;
78	mul-n = <35>;
79	div-p = <1>;
80	div-q = <5>;
81	div-r = <2>;
82	clocks = <&clk_hse>;
83	status = "okay";
84};
85
86&rcc {
87	clocks = <&pll>;
88	clock-frequency = <DT_FREQ_M(280)>;
89	d1cpre = <1>;
90	hpre = <1>;
91	d1ppre = <2>;
92	d2ppre1 = <2>;
93	d2ppre2 = <2>;
94	d3ppre = <2>;
95};
96
97&lpuart1 {
98	pinctrl-0 = <&lpuart1_tx_pb6 &lpuart1_rx_pb7>;
99	pinctrl-names = "default";
100	current-speed = <115200>;
101	status = "okay";
102};
103
104&usart3 {
105	pinctrl-0 = <&usart3_tx_pd8 &usart3_rx_pd9>;
106	pinctrl-names = "default";
107	current-speed = <115200>;
108	status = "okay";
109};
110
111&backup_sram {
112	status = "okay";
113};
114
115&timers12 {
116	st,prescaler = <10000>;
117	status = "okay";
118
119	pwm12: pwm {
120		status = "okay";
121		pinctrl-names = "default";
122		pinctrl-0 = <&tim12_ch1_pb14>;
123	};
124};
125
126&adc1 {
127	pinctrl-0 = <&adc1_inp15_pa3>;
128	pinctrl-names = "default";
129	st,adc-clock-source = "SYNC";
130	st,adc-prescaler = <4>;
131	status = "okay";
132};
133
134zephyr_udc0: &usbotg_hs {
135	pinctrl-0 = <&usb_otg_hs_dm_pa11 &usb_otg_hs_dp_pa12>;
136	pinctrl-names = "default";
137	status = "okay";
138};
139
140&rng {
141	status = "okay";
142};
143