1/*
2 * Copyright (c) 2017 BayLibre, SAS
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/f0/stm32f072Xb.dtsi>
9#include <st/f0/stm32f072v(8-b)tx-pinctrl.dtsi>
10#include <zephyr/dt-bindings/input/input-event-codes.h>
11
12/ {
13	model = "STMicroelectronics STM32F072-EVAL board";
14	compatible = "st,stm32f072-eval";
15
16	chosen {
17		zephyr,console = &usart2;
18		zephyr,shell-uart = &usart2;
19		zephyr,sram = &sram0;
20		zephyr,flash = &flash0;
21	};
22
23	leds {
24		compatible = "gpio-leds";
25		green_led_1: led_1 {
26			gpios = <&gpiod 8 GPIO_ACTIVE_HIGH>;
27			label = "User LD1";
28		};
29		orange_led_2: led_2 {
30			gpios = <&gpiod 9 GPIO_ACTIVE_HIGH>;
31			label = "User LD2";
32		};
33		red_led_3: led_3 {
34			gpios = <&gpiod 10 GPIO_ACTIVE_HIGH>;
35			label = "User LD3";
36		};
37		blue_led_4: led_4 {
38			gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
39			label = "User LD4";
40		};
41	};
42
43	gpio_keys {
44		compatible = "gpio-keys";
45		tamper: tamper_button {
46			label = "tamper button";
47			gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
48			zephyr,code = <INPUT_KEY_0>;
49		};
50		joy_sel: joystick_selection {
51			label = "joystick selection";
52			gpios = <&gpioa 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
53			zephyr,code = <INPUT_KEY_ENTER>;
54		};
55		joy_down: joystick_down {
56			label = "joystick down";
57			gpios = <&gpiof 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
58			zephyr,code = <INPUT_KEY_DOWN>;
59		};
60		joy_up: joystick_up {
61			label = "joystick up";
62			gpios = <&gpiof 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
63			zephyr,code = <INPUT_KEY_UP>;
64		};
65		joy_left: joystick_left {
66			label = "joystick left";
67			gpios = <&gpiof 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
68			zephyr,code = <INPUT_KEY_LEFT>;
69		};
70		joy_right: joystick_right {
71			label = "joystick right";
72			gpios = <&gpioe 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
73			zephyr,code = <INPUT_KEY_RIGHT>;
74		};
75	};
76
77	aliases {
78		led0 = &green_led_1;
79		led1 = &orange_led_2;
80		led2 = &red_led_3;
81		led3 = &blue_led_4;
82		sw0 = &joy_sel;
83		watchdog0 = &iwdg;
84	};
85};
86
87&clk_hse {
88	clock-frequency = <DT_FREQ_M(8)>;
89	status = "okay";
90};
91
92&pll {
93	prediv = <1>;
94	mul = <6>;
95	clocks = <&clk_hse>;
96	status = "okay";
97};
98
99&rcc {
100	clocks = <&pll>;
101	clock-frequency = <DT_FREQ_M(48)>;
102	ahb-prescaler = <1>;
103	apb1-prescaler = <1>;
104};
105
106&usart2 {
107	pinctrl-0 = <&usart2_tx_pd5 &usart2_rx_pd6>;
108	pinctrl-names = "default";
109	current-speed = <115200>;
110	status = "okay";
111};
112
113&iwdg {
114	status = "okay";
115};
116