1/*
2 * Copyright (c) 2018 Zelin <zelin@makerdiary.com>
3 * Copyright (c) 2018 makerdiary.com.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8/dts-v1/;
9#include <nordic/nrf52832_qfaa.dtsi>
10#include "nrf52832_mdk-pinctrl.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12
13/ {
14	model = "nRF52832-MDK Micro Dev Kit";
15	compatible = "nrf52832-mdk";
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_green: led_0 {
31			gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
32			label = "Green LED 0";
33		};
34		led1_red: led_1 {
35			gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
36			label = "Red LED 1";
37		};
38		led2_blue: led_2 {
39			gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
40			label = "Blue LED 1";
41		};
42	};
43
44	pwmleds {
45		compatible = "pwm-leds";
46		pwm_led0_green: pwm_led_0 {
47			pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
48			label = "Green PWM LED 0";
49		};
50		pwm_led1_red: pwm_led_1 {
51			pwms = <&pwm0 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
52			label = "Red PWM LED 1";
53		};
54		pwm_led2_blue: pwm_led_2 {
55			pwms = <&pwm0 2 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
56			label = "Blue PWM LED 1";
57		};
58	};
59
60	buttons {
61		compatible = "gpio-keys";
62		button0: button_0 {
63			gpios = <&gpio0 18 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
64			label = "Push button switch 0";
65			zephyr,code = <INPUT_KEY_0>;
66		};
67	};
68
69	/* These aliases are provided for compatibility with samples */
70	aliases {
71		sw0 = &button0;
72		led0 = &led0_green;
73		led1 = &led1_red;
74		led2 = &led2_blue;
75		led0-green = &led0_green;
76		led1-red   = &led1_red;
77		led2-blue  = &led2_blue;
78		pwm-led0 = &pwm_led0_green;
79		pwm-led1 = &pwm_led1_red;
80		pwm-led2 = &pwm_led2_blue;
81		green-pwm-led = &pwm_led0_green;
82		red-pwm-led = &pwm_led1_red;
83		blue-pwm-led = &pwm_led2_blue;
84		watchdog0 = &wdt0;
85	};
86
87};
88
89&uicr {
90	gpio-as-nreset;
91};
92
93&gpiote {
94	status = "okay";
95};
96
97&gpio0 {
98	status = "okay";
99};
100
101&uart0 {
102	status = "okay";
103	compatible = "nordic,nrf-uart";
104	current-speed = <115200>;
105	pinctrl-0 = <&uart0_default>;
106	pinctrl-1 = <&uart0_sleep>;
107	pinctrl-names = "default", "sleep";
108};
109
110&i2c0 {
111	compatible = "nordic,nrf-twi";
112	status = "okay";
113	pinctrl-0 = <&i2c0_default>;
114	pinctrl-1 = <&i2c0_sleep>;
115	pinctrl-names = "default", "sleep";
116};
117
118&i2c1 {
119	compatible = "nordic,nrf-twi";
120	status = "okay";
121	pinctrl-0 = <&i2c1_default>;
122	pinctrl-1 = <&i2c1_sleep>;
123	pinctrl-names = "default", "sleep";
124};
125
126&pwm0 {
127	status = "okay";
128	pinctrl-0 = <&pwm0_default>;
129	pinctrl-1 = <&pwm0_sleep>;
130	pinctrl-names = "default", "sleep";
131};
132
133&flash0 {
134
135	partitions {
136		compatible = "fixed-partitions";
137		#address-cells = <1>;
138		#size-cells = <1>;
139
140		boot_partition: partition@0 {
141			label = "mcuboot";
142			reg = <0x00000000 0xc000>;
143		};
144		slot0_partition: partition@c000 {
145			label = "image-0";
146			reg = <0x0000C000 0x32000>;
147		};
148		slot1_partition: partition@3e000 {
149			label = "image-1";
150			reg = <0x0003E000 0x32000>;
151		};
152		scratch_partition: partition@70000 {
153			label = "image-scratch";
154			reg = <0x00070000 0xa000>;
155		};
156		storage_partition: partition@7a000 {
157			label = "storage";
158			reg = <0x0007a000 0x00006000>;
159		};
160	};
161};
162