1/*
2 * Copyright (c) 2018 Seitz & Associates
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/f3/stm32f302X8.dtsi>
9#include <st/f3/stm32f302r(6-8)tx-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 STM32F302R8-NUCLEO board";
16	compatible = "st,stm32f302r8-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 = <&gpiob 13 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		volt-sensor0 = &vref;
46		volt-sensor1 = &vbat;
47	};
48};
49
50&clk_lsi {
51	status = "okay";
52};
53
54&clk_hse {
55	hse-bypass;
56	clock-frequency = <DT_FREQ_M(8)>; /* STLink 8MHz clock */
57	status = "okay";
58};
59
60&pll {
61	prediv = <1>;
62	mul = <9>;
63	clocks = <&clk_hse>;
64	status = "okay";
65};
66
67&rcc {
68	clocks = <&pll>;
69	clock-frequency = <DT_FREQ_M(72)>;
70	ahb-prescaler = <1>;
71	apb1-prescaler = <2>;
72	apb2-prescaler = <1>;
73};
74
75&i2c1 {
76	pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
77	pinctrl-names = "default";
78	status = "okay";
79	clock-frequency = <I2C_BITRATE_FAST>;
80};
81
82&spi2 {
83	pinctrl-0 = <&spi2_sck_pb13 &spi2_miso_pb14 &spi2_mosi_pb15>;
84	pinctrl-names = "default";
85	cs-gpios = <&gpiob 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
86	status = "okay";
87};
88
89&usart1 {
90	pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
91	pinctrl-names = "default";
92	current-speed = <115200>;
93	status = "okay";
94};
95&usart2 {
96	pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
97	pinctrl-names = "default";
98	current-speed = <115200>;
99	status = "okay";
100};
101&usart3 {
102	pinctrl-0 = <&usart3_tx_pc10 &usart3_rx_pc11>;
103	pinctrl-names = "default";
104	current-speed = <115200>;
105	status = "okay";
106};
107
108&timers2 {
109	status = "okay";
110
111	pwm2: pwm {
112		status = "okay";
113		pinctrl-0 = <&tim2_ch1_pa0>;
114		pinctrl-names = "default";
115	};
116};
117
118&rtc {
119	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
120		 <&rcc STM32_SRC_LSI RTC_SEL(2)>;
121	status = "okay";
122};
123
124&adc1 {
125	pinctrl-0 = <&adc1_in1_pa0>;
126	pinctrl-names = "default";
127	st,adc-clock-source = <SYNC>;
128	st,adc-prescaler = <2>;
129	status = "okay";
130};
131
132&vref {
133	status = "okay";
134};
135
136&vbat {
137	status = "okay";
138};
139