1/*
2 * Copyright (c) 2022 Nikola Trifunovic
3 * Copyright (c) 2018 Nordic Semiconductor ASA
4 * Copyright (c) 2017 Linaro Limited
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8
9/dts-v1/;
10#include <nordic/nrf52840_qiaa.dtsi>
11#include "nrf52840_mdk_usb_dongle-pinctrl.dtsi"
12#include <zephyr/dt-bindings/input/input-event-codes.h>
13
14/ {
15	model = "nRF52840 MDK USB Dongle";
16	compatible = "nrf52840_mdk_usb_dongle";
17
18	chosen {
19		zephyr,sram = &sram0;
20		zephyr,flash = &flash0;
21		zephyr,code-partition = &slot0_partition;
22		zephyr,ieee802154 = &ieee802154;
23	};
24
25	leds {
26		compatible = "gpio-leds";
27		led0_red: led_0 {
28			gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
29			label = "Red LED 0";
30		};
31		led0_green: led_1 {
32			gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
33			label = "Green LED 0";
34		};
35		led0_blue: led_2 {
36			gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
37			label = "Blue LED 0";
38		};
39	};
40
41	pwmleds {
42		compatible = "pwm-leds";
43		red_pwm_led: pwm_led_0 {
44			pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
45		};
46		green_pwm_led: pwm_led_1 {
47			pwms = <&pwm0 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
48		};
49		blue_pwm_led: pwm_led_2 {
50			pwms = <&pwm0 2 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
51		};
52	};
53
54	buttons {
55		compatible = "gpio-keys";
56		reset_button: button_0 {
57			gpios = <&gpio0 18 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
58			label = "reset button";
59			zephyr,code = <INPUT_KEY_0>;
60		};
61	};
62
63	/* These aliases are provided for compatibility with samples */
64	aliases {
65		led0 = &led0_red;
66		led1 = &led0_green;
67		led2 = &led0_blue;
68		led0-red   = &led0_red;
69		led0-green = &led0_green;
70		led0-blue  = &led0_blue;
71		pwm-led0 = &red_pwm_led;
72		pwm-led1 = &green_pwm_led;
73		pwm-led2 = &blue_pwm_led;
74		red-pwm-led = &red_pwm_led;
75		green-pwm-led = &green_pwm_led;
76		blue-pwm-led = &blue_pwm_led;
77		watchdog0 = &wdt0;
78	};
79};
80
81&reg1 {
82	regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
83};
84
85&gpiote {
86	status = "okay";
87};
88
89&uicr {
90	nfct-pins-as-gpios;
91	gpio-as-nreset;
92};
93
94&gpio0 {
95	status = "okay";
96};
97
98&gpio1 {
99	status = "okay";
100};
101
102&uart0 {
103	compatible = "nordic,nrf-uarte";
104	status = "okay";
105	current-speed = <115200>;
106	pinctrl-0 = <&uart0_default>;
107	pinctrl-1 = <&uart0_sleep>;
108	pinctrl-names = "default", "sleep";
109};
110
111&ieee802154 {
112	status = "okay";
113};
114
115/* Include flash partition table.
116 * Two partition tables are available:
117 * fstab-stock		-compatible with Nordic nRF5 bootloader, default
118 * fstab-debugger	-to use an external debugger, w/o the nRF5 bootloader
119 */
120#include "fstab-stock.dtsi"
121
122zephyr_udc0: &usbd {
123	compatible = "nordic,nrf-usbd";
124	status = "okay";
125};
126
127#include <../boards/common/usb/cdc_acm_serial.dtsi>
128