1/*
2 * Copyright (c) 2019 Stéphane D'Alu
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <nordic/nrf52832_qfaa.dtsi>
9#include "decawave_dwm1001_dev-pinctrl.dtsi"
10#include <zephyr/dt-bindings/input/input-event-codes.h>
11
12/ {
13	model = "Decawave DWM1001-DEV";
14	compatible = "decawave,dwm1001";
15
16	chosen {
17		zephyr,console        = &uart0;
18		zephyr,shell-uart     = &uart0;
19		zephyr,uart-mcumgr    = &uart0;
20		zephyr,bt-mon-uart    = &uart0;
21		zephyr,bt-c2h-uart    = &uart0;
22		zephyr,sram           = &sram0;
23		zephyr,flash          = &flash0;
24		zephyr,code-partition = &slot0_partition;
25		zephyr,ieee802154     = &ieee802154;
26	};
27
28	leds {
29		compatible = "gpio-leds";
30		led0_red: led_0 {
31			gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
32			label = "Red LED 0";
33		};
34		led1_green: led_1 {
35			gpios = <&gpio0 30 GPIO_ACTIVE_LOW>;
36			label = "Green LED 1";
37		};
38		led2_red: led_2 {
39			gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
40			label = "Red LED 2";
41		};
42		led3_blue: led_3 {
43			gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
44			label = "Blue LED 3";
45		};
46	};
47
48	pwmleds {
49		compatible = "pwm-leds";
50		pwm_led0_red: pwm_led_0 {
51			pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
52			label = "Red PWM LED";
53		};
54	};
55
56	buttons {
57		compatible = "gpio-keys";
58		button0: button_0 {
59			gpios = <&gpio0 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
60			label = "Push button switch 0";
61			zephyr,code = <INPUT_KEY_0>;
62		};
63	};
64
65	/* These aliases are provided for compatibility with samples */
66	aliases {
67		sw0        = &button0;
68		led0       = &led0_red;
69		led1       = &led1_green;
70		led2       = &led2_red;
71		led3       = &led3_blue;
72		led0-red   = &led0_red;
73		led1-green = &led1_green;
74		led2-red   = &led2_red;
75		led3-blue  = &led3_blue;
76		pwm-led0   = &pwm_led0_red;
77		watchdog0 = &wdt0;
78		accel0     = &lis2dh12;
79	};
80
81};
82
83&reg {
84	regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
85};
86
87&adc {
88	status = "okay";
89};
90
91&uicr {
92	gpio-as-nreset;
93};
94
95&gpiote {
96	status = "okay";
97};
98
99&gpio0 {
100	status = "okay";
101};
102
103&uart0 {
104	status = "okay";
105	compatible = "nordic,nrf-uart";
106	current-speed = <115200>;
107	pinctrl-0 = <&uart0_default>;
108	pinctrl-1 = <&uart0_sleep>;
109	pinctrl-names = "default", "sleep";
110};
111
112&i2c0 {
113	compatible = "nordic,nrf-twim";
114	status = "okay";
115	clock-frequency = <I2C_BITRATE_FAST>;
116
117	pinctrl-0 = <&i2c0_default>;
118	pinctrl-1 = <&i2c0_sleep>;
119	pinctrl-names = "default", "sleep";
120	lis2dh12: lis2dh12@19 {
121		compatible = "st,lis2dh12", "st,lis2dh";
122		reg = <0x19>;
123		irq-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>;
124	};
125};
126
127&spi1 {
128	compatible = "nordic,nrf-spi";
129	status = "okay";
130	cs-gpios = <&gpio0 3 0>;
131	pinctrl-0 = <&spi1_default>;
132	pinctrl-1 = <&spi1_sleep>;
133	pinctrl-names = "default", "sleep";
134};
135
136&spi2 {
137	compatible = "nordic,nrf-spi";
138	status = "okay";
139	cs-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
140
141	pinctrl-0 = <&spi2_default>;
142	pinctrl-1 = <&spi2_sleep>;
143	pinctrl-names = "default", "sleep";
144	ieee802154: dw1000@0 {
145		compatible = "decawave,dw1000";
146		spi-max-frequency = <8000000>;
147		int-gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>;	/* P0.19 */
148		reset-gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;	/* P0.24 */
149		status = "okay";
150		reg = <0>;
151	};
152};
153
154&pwm0 {
155	status = "okay";
156	pinctrl-0 = <&pwm0_default>;
157	pinctrl-1 = <&pwm0_sleep>;
158	pinctrl-names = "default", "sleep";
159};
160
161&flash0 {
162
163	partitions {
164		compatible = "fixed-partitions";
165		#address-cells = <1>;
166		#size-cells = <1>;
167
168		boot_partition: partition@0 {
169			label = "mcuboot";
170			reg = <0x00000000 0xc000>;
171		};
172		slot0_partition: partition@c000 {
173			label = "image-0";
174			reg = <0x0000C000 0x32000>;
175		};
176		slot1_partition: partition@3e000 {
177			label = "image-1";
178			reg = <0x0003E000 0x32000>;
179		};
180		scratch_partition: partition@70000 {
181			label = "image-scratch";
182			reg = <0x00070000 0xa000>;
183		};
184		storage_partition: partition@7a000 {
185			label = "storage";
186			reg = <0x0007a000 0x00006000>;
187		};
188	};
189};
190