1/*
2 * Copyright (c) 2025 STMicroelectronics
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/wb0/stm32wb07Xc.dtsi>
9#include <st/wb0/stm32wb07ccvx-pinctrl.dtsi>
10#include <zephyr/dt-bindings/input/input-event-codes.h>
11
12#include "arduino_r3_connector.dtsi"
13
14/ {
15	model = "STMicroelectronics STM32WB07CC-NUCLEO board";
16	compatible = "st,stm32wb07cc-nucleo";
17
18	#address-cells = <1>;
19	#size-cells = <1>;
20
21	chosen {
22		zephyr,console = &usart1;
23		zephyr,shell-uart = &usart1;
24		zephyr,sram = &sram0;
25		zephyr,flash = &flash0;
26		zephyr,bt-c2h-uart = &usart1;
27	};
28
29	leds: leds {
30		compatible ="gpio-leds";
31		blue_led_1: led_0 {
32			gpios = <&gpiob 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
33		};
34		green_led_1: led_1 {
35			gpios = <&gpiob 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
36		};
37		red_led_1: led_2 {
38			gpios = <&gpiob 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
39		};
40	};
41
42	pwmleds: pwmleds {
43		compatible = "pwm-leds";
44		pwm_red_led_1: pwm_red_led_1 {
45			pwms = <&pwm1 3 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
46		};
47	};
48
49	gpio_keys {
50		compatible = "gpio-keys";
51		user_button_1: button_0 {
52			label = "SW1";
53			gpios = <&gpioa 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
54			zephyr,code = <INPUT_KEY_0>;
55		};
56		user_button_2: button_1 {
57			label = "SW2";
58			gpios = <&gpiob 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
59			zephyr,code = <INPUT_KEY_1>;
60		};
61		user_button_3: button_2 {
62			label = "SW3";
63			gpios = <&gpiob 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
64			zephyr,code = <INPUT_KEY_2>;
65		};
66	};
67
68	aliases {
69		led0 = &blue_led_1;
70		led1 = &green_led_1;
71		led2 = &red_led_1;
72		pwm-led0 = &pwm_red_led_1;
73		sw0 = &user_button_1;
74		sw1 = &user_button_2;
75		sw2 = &user_button_3;
76	};
77};
78
79&pwrc {
80	smps-mode = "RUN";
81	smps-bom = <3>;
82};
83
84&clk_lse {
85	status = "okay";
86};
87
88&clk_hse {
89	status = "okay";
90};
91
92&clk_hsi {
93	status = "okay";
94};
95
96&pll {
97	status = "okay";
98};
99
100&rcc {
101	clocks = <&pll>;
102	clock-frequency = <DT_FREQ_M(64)>;
103	clksys-prescaler = <1>;
104	slow-clock = <&clk_lse>;
105};
106
107&bt_hci_wb0 {
108	status = "okay";
109};
110
111&usart1 {
112	pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa8>;
113	pinctrl-names = "default";
114	current-speed = <115200>;
115	status = "okay";
116};
117
118&i2c2 {
119	pinctrl-0 = <&i2c2_scl_pb6 &i2c2_sda_pb7>;
120	pinctrl-names = "default";
121	status = "okay";
122};
123
124&spi2 {
125	pinctrl-0 = <&spi2_nss_pa4 &spi2_sck_pa5 &spi2_miso_pa7 &spi2_mosi_pa6>;
126	pinctrl-names = "default";
127	status = "okay";
128	/* Select 32MHz clock for SPI2 */
129	clocks = <&rcc STM32_CLOCK(APB1, 12)>,
130		<&rcc STM32_SRC_SYSCLK SPI2_I2S2_SEL(1)>;
131};
132
133&timers1 {
134	status = "okay";
135	st,prescaler = <10000>;
136
137	pwm1: pwm {
138		status = "okay";
139		pinctrl-0 = <&tim1_ch3_pb2>;
140		pinctrl-names = "default";
141	};
142};
143
144&flash0 {
145	partitions {
146		compatible = "fixed-partitions";
147		#address-cells = <1>;
148		#size-cells = <1>;
149		/* Set aside 16KB of storage at the end of 256KB flash */
150		storage_partition: partition@3c000 {
151			label = "storage";
152			reg = <0x0003c000 DT_SIZE_K(16)>;
153		};
154	};
155};
156