1/*
2 * Copyright (c) 2024 STMicroelectronics
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/u0/stm32u083Xc.dtsi>
9#include <st/u0/stm32u083mctx-pinctrl.dtsi>
10#include "arduino_r3_connector.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12#include <zephyr/dt-bindings/input/stm32-tsc-defines.h>
13
14/ {
15	model = "STMicroelectronics STM32U83C-DK board";
16	compatible = "st,stm32u083c-dk";
17
18	#address-cells = <1>;
19	#size-cells = <1>;
20
21	chosen {
22		zephyr,console = &usart2;
23		zephyr,shell-uart = &usart2;
24		zephyr,sram = &sram0;
25		zephyr,flash = &flash0;
26	};
27
28	leds: leds {
29		compatible = "gpio-leds";
30		green_led_1: led_3 {
31			gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
32			label = "User LD3";
33		};
34	};
35
36	aliases {
37		led0 = &green_led_1;
38	};
39};
40
41&usart1 {
42	pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
43	pinctrl-names = "default";
44	current-speed = <115200>;
45	status = "okay";
46};
47
48&usart2 {
49	pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
50	pinctrl-names = "default";
51	current-speed = <115200>;
52	status = "okay";
53};
54
55&clk_hsi {
56	status = "okay";
57};
58
59&pll {
60	div-m = <1>;
61	mul-n = <6>;
62	div-p = <2>;
63	div-q = <2>;
64	div-r = <2>;
65	clocks = <&clk_hsi>;
66	status = "okay";
67};
68
69&rcc {
70	clocks = <&pll>;
71	clock-frequency = <DT_FREQ_M(48)>;
72	ahb-prescaler = <1>;
73	apb1-prescaler = <1>;
74};
75
76&adc1 {
77	pinctrl-0 = <&adc1_in0_pc0 &adc1_in1_pc1>;
78	pinctrl-names = "default";
79	st,adc-clock-source = "ASYNC";
80	clocks = <&rcc STM32_CLOCK_BUS_APB1_2 0x00100000>,
81		 <&rcc STM32_SRC_HSI ADC_SEL(2)>;
82	st,adc-prescaler = <4>;
83	status = "okay";
84	vref-mv = <3300>;
85};
86
87&dac1 {
88	status = "okay";
89	pinctrl-0 = <&dac1_out1_pa4>;
90	pinctrl-names = "default";
91};
92
93&i2c1 {
94	pinctrl-0 = <&i2c1_scl_pa9 &i2c1_sda_pa10>;
95	pinctrl-names = "default";
96	status = "okay";
97	clock-frequency = <I2C_BITRATE_FAST>;
98};
99
100&i2c2 {
101	pinctrl-0 = <&i2c2_scl_pa7 &i2c2_sda_pa6>;
102	pinctrl-names = "default";
103	status = "okay";
104	clock-frequency = <I2C_BITRATE_FAST>;
105};
106
107&timers1 {
108	st,prescaler = <10000>;
109	status = "okay";
110
111	pwm1: pwm {
112		status = "okay";
113		pinctrl-0 = <&tim1_ch1_pa8>;
114		pinctrl-names = "default";
115	};
116};
117
118&timers2 {
119	st,prescaler = <10000>;
120	status = "okay";
121
122	pwm2: pwm {
123		pinctrl-0 = <&tim2_ch1_pa5>;
124		pinctrl-names = "default";
125		status = "okay";
126	};
127};
128
129&tsc {
130	status = "okay";
131	pinctrl-0 = <&tsc_g1_io1_pb12 &tsc_g1_io2_pb13 &tsc_g6_io1_pd10 &tsc_g6_io2_pd11>;
132	pinctrl-names = "default";
133
134	st,pulse-generator-prescaler = <2>;
135	st,charge-transfer-pulse-high = <2>;
136	st,charge-transfer-pulse-low = <2>;
137	st,spread-spectrum;
138	st,spread-spectrum-prescaler = <2>;
139	st,spread-spectrum-deviation = <100>;
140	st,max-count-value = <8191>;
141
142	tsc_group1: g1 {
143		group = <1>;
144		st,use-as-shield;
145		channel-ios = <TSC_IO2>;
146		sampling-io = <TSC_IO1>;
147	};
148
149	tsc_group6: g6 {
150		group = <6>;
151		channel-ios = <TSC_IO2>;
152		sampling-io = <TSC_IO1>;
153		ts1 {
154			compatible = "tsc-keys";
155			sampling-interval-ms = <10>;
156			oversampling = <10>;
157			noise-threshold = <50>;
158			sticky-key-timeout-ms = <10000>;
159			zephyr,code = <INPUT_KEY_0>;
160		};
161	};
162};
163