1/*
2 * Copyright (c) 2017 Shawn Nock <shawn@monadnock.ca>
3 * Copyright (c) 2017 Linaro Limited
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8/dts-v1/;
9#include <nordic/nrf52832_qfaa.dtsi>
10#include "nrf52dk_nrf52832-pinctrl.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12
13/ {
14	model = "Nordic nRF52 DK NRF52832";
15	compatible = "nordic,nrf52-dk-nrf52832";
16
17	chosen {
18		zephyr,console = &uart0;
19		zephyr,shell-uart = &uart0;
20		zephyr,uart-mcumgr = &uart0;
21		zephyr,bt-mon-uart = &uart0;
22		zephyr,bt-c2h-uart = &uart0;
23		zephyr,sram = &sram0;
24		zephyr,flash = &flash0;
25		zephyr,code-partition = &slot0_partition;
26	};
27
28	leds {
29		compatible = "gpio-leds";
30		led0: led_0 {
31			gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
32			label = "Green LED 0";
33		};
34		led1: led_1 {
35			gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
36			label = "Green LED 1";
37		};
38		led2: led_2 {
39			gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
40			label = "Green LED 2";
41		};
42		led3: led_3 {
43			gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
44			label = "Green LED 3";
45		};
46	};
47
48	pwmleds {
49		compatible = "pwm-leds";
50		pwm_led0: pwm_led_0 {
51			pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
52		};
53	};
54
55	buttons {
56		compatible = "gpio-keys";
57		button0: button_0 {
58			gpios = <&gpio0 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
59			label = "Push button switch 0";
60			zephyr,code = <INPUT_KEY_0>;
61		};
62		button1: button_1 {
63			gpios = <&gpio0 14 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
64			label = "Push button switch 1";
65			zephyr,code = <INPUT_KEY_1>;
66		};
67		button2: button_2 {
68			gpios = <&gpio0 15 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
69			label = "Push button switch 2";
70			zephyr,code = <INPUT_KEY_2>;
71		};
72		button3: button_3 {
73			gpios = <&gpio0 16 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
74			label = "Push button switch 3";
75			zephyr,code = <INPUT_KEY_3>;
76		};
77	};
78
79	arduino_header: connector {
80		compatible = "arduino-header-r3";
81		#gpio-cells = <2>;
82		gpio-map-mask = <0xffffffff 0xffffffc0>;
83		gpio-map-pass-thru = <0 0x3f>;
84		gpio-map = <0 0 &gpio0 3 0>,	/* A0 */
85			   <1 0 &gpio0 4 0>,	/* A1 */
86			   <2 0 &gpio0 28 0>,	/* A2 */
87			   <3 0 &gpio0 29 0>,	/* A3 */
88			   <4 0 &gpio0 30 0>,	/* A4 */
89			   <5 0 &gpio0 31 0>,	/* A5 */
90			   <6 0 &gpio0 11 0>,	/* D0 */
91			   <7 0 &gpio0 12 0>,	/* D1 */
92			   <8 0 &gpio0 13 0>,	/* D2 */
93			   <9 0 &gpio0 14 0>,	/* D3 */
94			   <10 0 &gpio0 15 0>,	/* D4 */
95			   <11 0 &gpio0 16 0>,	/* D5 */
96			   <12 0 &gpio0 17 0>,	/* D6 */
97			   <13 0 &gpio0 18 0>,	/* D7 */
98			   <14 0 &gpio0 19 0>,	/* D8 */
99			   <15 0 &gpio0 20 0>,	/* D9 */
100			   <16 0 &gpio0 22 0>,	/* D10 */
101			   <17 0 &gpio0 23 0>,	/* D11 */
102			   <18 0 &gpio0 24 0>,	/* D12 */
103			   <19 0 &gpio0 25 0>,	/* D13 */
104			   <20 0 &gpio0 26 0>,	/* D14 */
105			   <21 0 &gpio0 27 0>;	/* D15 */
106	};
107
108	arduino_adc: analog-connector {
109		compatible = "arduino,uno-adc";
110		#io-channel-cells = <1>;
111		io-channel-map = <0 &adc 1>,	/* A0 = P0.3 = AIN1 */
112				 <1 &adc 2>,	/* A1 = P0.4 = AIN2 */
113				 <2 &adc 4>,	/* A2 = P0.28 = AIN4 */
114				 <3 &adc 5>,	/* A3 = P0.29 = AIN5 */
115				 <4 &adc 6>,	/* A4 = P0.30 = AIN6 */
116				 <5 &adc 7>;	/* A5 = P0.31 = AIN7 */
117	};
118
119	/* These aliases are provided for compatibility with samples */
120	aliases {
121		led0 = &led0;
122		led1 = &led1;
123		led2 = &led2;
124		led3 = &led3;
125		pwm-led0 = &pwm_led0;
126		sw0 = &button0;
127		sw1 = &button1;
128		sw2 = &button2;
129		sw3 = &button3;
130		bootloader-led0 = &led0;
131		mcuboot-button0 = &button0;
132		mcuboot-led0 = &led0;
133		watchdog0 = &wdt0;
134	};
135};
136
137&adc {
138	status = "okay";
139};
140
141&uicr {
142	gpio-as-nreset;
143};
144
145&gpiote {
146	status = "okay";
147};
148
149&gpio0 {
150	status = "okay";
151};
152
153arduino_serial: &uart0 {
154	status = "okay";
155	compatible = "nordic,nrf-uarte";
156	current-speed = <115200>;
157	pinctrl-0 = <&uart0_default>;
158	pinctrl-1 = <&uart0_sleep>;
159	pinctrl-names = "default", "sleep";
160};
161
162arduino_i2c: &i2c0 {
163	compatible = "nordic,nrf-twi";
164	status = "okay";
165	pinctrl-0 = <&i2c0_default>;
166	pinctrl-1 = <&i2c0_sleep>;
167	pinctrl-names = "default", "sleep";
168};
169
170&i2c1 {
171	compatible = "nordic,nrf-twi";
172	/* Cannot be used together with spi1. */
173	/* status = "okay"; */
174	pinctrl-0 = <&i2c1_default>;
175	pinctrl-1 = <&i2c1_sleep>;
176	pinctrl-names = "default", "sleep";
177};
178
179&pwm0 {
180	status = "okay";
181	pinctrl-0 = <&pwm0_default>;
182	pinctrl-1 = <&pwm0_sleep>;
183	pinctrl-names = "default", "sleep";
184};
185
186&spi0 {
187	compatible = "nordic,nrf-spi";
188	/* Cannot be used together with i2c0. */
189	/* status = "okay"; */
190	pinctrl-0 = <&spi0_default>;
191	pinctrl-1 = <&spi0_sleep>;
192	pinctrl-names = "default", "sleep";
193};
194
195&spi1 {
196	compatible = "nordic,nrf-spi";
197	status = "okay";
198	pinctrl-0 = <&spi1_default>;
199	pinctrl-1 = <&spi1_sleep>;
200	pinctrl-names = "default", "sleep";
201};
202
203arduino_spi: &spi2 {
204	compatible = "nordic,nrf-spi";
205	status = "okay";
206	cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */
207	pinctrl-0 = <&spi2_default>;
208	pinctrl-1 = <&spi2_sleep>;
209	pinctrl-names = "default", "sleep";
210};
211
212&flash0 {
213
214	partitions {
215		compatible = "fixed-partitions";
216		#address-cells = <1>;
217		#size-cells = <1>;
218
219		boot_partition: partition@0 {
220			label = "mcuboot";
221			reg = <0x00000000 0xc000>;
222		};
223		slot0_partition: partition@c000 {
224			label = "image-0";
225			reg = <0x0000C000 0x37000>;
226		};
227		slot1_partition: partition@43000 {
228			label = "image-1";
229			reg = <0x00043000 0x37000>;
230		};
231		storage_partition: partition@7a000 {
232			label = "storage";
233			reg = <0x0007a000 0x00006000>;
234		};
235	};
236};
237