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		green_led: led_0 {
29			gpios = <&gpiob 0 GPIO_ACTIVE_HIGH>;
30			label = "User LD1";
31		};
32		yellow_led: led_1 {
33			gpios = <&gpioe 1 GPIO_ACTIVE_HIGH>;
34			label = "User LD2";
35		};
36	};
37
38	pwmleds {
39		compatible = "pwm-leds";
40
41		red_pwm_led: red_pwm_led {
42			pwms = <&pwm12 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
43		};
44	};
45
46	gpio_keys {
47		compatible = "gpio-keys";
48		user_button: button_0 {
49			label = "User";
50			gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
51			zephyr,code = <INPUT_KEY_0>;
52		};
53	};
54
55	aliases {
56		led0 = &green_led;
57		led1 = &yellow_led;
58		pwm-led0 = &red_pwm_led;
59		sw0 = &user_button;
60	};
61};
62
63&clk_hsi48 {
64	status = "okay";
65};
66
67&clk_hse {
68	hse-bypass;
69	clock-frequency = <DT_FREQ_M(8)>; /* STLink 8MHz clock */
70	status = "okay";
71};
72
73&pll {
74	div-m = <1>;
75	mul-n = <35>;
76	div-p = <1>;
77	div-q = <5>;
78	div-r = <2>;
79	clocks = <&clk_hse>;
80	status = "okay";
81};
82
83&rcc {
84	clocks = <&pll>;
85	clock-frequency = <DT_FREQ_M(280)>;
86	d1cpre = <1>;
87	hpre = <1>;
88	d1ppre = <2>;
89	d2ppre1 = <2>;
90	d2ppre2 = <2>;
91	d3ppre = <2>;
92};
93
94&usart3 {
95	pinctrl-0 = <&usart3_tx_pd8 &usart3_rx_pd9>;
96	pinctrl-names = "default";
97	current-speed = <115200>;
98	status = "okay";
99};
100
101&backup_sram {
102	status = "okay";
103};
104
105&timers12 {
106	st,prescaler = <10000>;
107	status = "okay";
108
109	pwm12: pwm {
110		status = "okay";
111		pinctrl-names = "default";
112		pinctrl-0 = <&tim12_ch1_pb14>;
113	};
114};
115
116&adc1 {
117	pinctrl-0 = <&adc1_inp15_pa3>;
118	pinctrl-names = "default";
119	st,adc-clock-source = "SYNC";
120	st,adc-prescaler = <4>;
121	status = "okay";
122};
123
124zephyr_udc0: &usbotg_hs {
125	pinctrl-0 = <&usb_otg_hs_dm_pa11 &usb_otg_hs_dp_pa12>;
126	pinctrl-names = "default";
127	status = "okay";
128};
129
130&rng {
131	status = "okay";
132};
133