1/*
2 * Copyright (c) 2020 WuhanStudio
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/f1/stm32f103Xc.dtsi>
9#include <st/f1/stm32f103r(c-d-e)tx-pinctrl.dtsi>
10
11/ {
12	model = "stm32f103_mini board";
13	compatible = "stm32f103";
14
15	chosen {
16		zephyr,console = &usart1;
17		zephyr,shell-uart = &usart1;
18		zephyr,sram = &sram0;
19		zephyr,flash = &flash0;
20	};
21
22	leds {
23		compatible = "gpio-leds";
24		green_led_1: led_1 {
25			gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
26			label = "User LD1";
27		};
28	};
29
30	aliases {
31		led0 = &green_led_1;
32		watchdog0 = &iwdg;
33		die-temp0 = &die_temp;
34	};
35};
36
37&clk_lsi {
38	status = "okay";
39};
40
41&clk_hse {
42	clock-frequency = <DT_FREQ_M(8)>;
43	status = "okay";
44};
45
46&pll {
47	mul = <9>;
48	clocks = <&clk_hse>;
49	status = "okay";
50};
51
52&rcc {
53	clocks = <&pll>;
54	clock-frequency = <DT_FREQ_M(72)>;
55	ahb-prescaler = <1>;
56	apb1-prescaler = <2>;
57	apb2-prescaler = <1>;
58	/* usbpre not set: USB clock = 72 / 1.5: 48MHz */
59};
60
61&usart1 {
62	pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
63	pinctrl-names = "default";
64	current-speed = <115200>;
65	status = "okay";
66};
67
68&usart2 {
69	pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
70	pinctrl-names = "default";
71	current-speed = <115200>;
72};
73
74&usart3 {
75	pinctrl-0 = <&usart3_tx_pb10 &usart3_rx_pb11>;
76	pinctrl-names = "default";
77	current-speed = <115200>;
78};
79
80&i2c1 {
81	pinctrl-0 = <&i2c1_scl_remap1_pb8 &i2c1_sda_remap1_pb9>;
82	pinctrl-names = "default";
83	status = "okay";
84	clock-frequency = <I2C_BITRATE_FAST>;
85};
86
87&spi1 {
88	pinctrl-0 = <&spi1_nss_master_pa4 &spi1_sck_master_pa5
89		     &spi1_miso_master_pa6 &spi1_mosi_master_pa7>;
90	pinctrl-names = "default";
91	status = "okay";
92};
93
94&spi2 {
95	pinctrl-0 = <&spi2_nss_master_pb12 &spi2_sck_master_pb13
96		     &spi2_miso_master_pb14 &spi2_mosi_master_pb15>;
97	pinctrl-names = "default";
98	status = "okay";
99};
100
101&iwdg {
102	status = "okay";
103};
104
105&timers1 {
106	st,prescaler = <10000>;
107	status = "okay";
108
109	pwm1: pwm {
110		status = "okay";
111		pinctrl-0 = <&tim1_ch1_pwm_out_pa8>;
112		pinctrl-names = "default";
113	};
114};
115
116zephyr_udc0: &usb {
117	pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
118	pinctrl-names = "default";
119	status = "okay";
120};
121
122&rtc {
123	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
124		 <&rcc STM32_SRC_LSI RTC_SEL(2)>;
125	status = "okay";
126};
127
128&adc1 {
129	pinctrl-0 = <&adc1_in0_pa0>;
130	pinctrl-names = "default";
131	status = "okay";
132};
133
134&die_temp {
135	status = "okay";
136};
137