1/*
2 * Copyright (c) 2021 u-blox AG
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <nordic/nrf52840_qiaa.dtsi>
9#include <nordic/nrf52840_partition.dtsi>
10#include "ubx_evkninab3_nrf52840-pinctrl.dtsi"
11#include <zephyr/dt-bindings/input/input-event-codes.h>
12
13/ {
14	model = "u-blox EVK NINA-B3 nRF52840";
15	compatible = "nordic,ubx_evkninab3_nrf52840";
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,ieee802154 = &ieee802154;
24	};
25
26	leds {
27		compatible = "gpio-leds";
28		led0: led_0 {
29			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
30			label = "Red LED 0";
31		};
32		led1: led_1 {
33			gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
34			label = "Green LED 1";
35		};
36		led2: led_2 {
37			gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
38			label = "Blue LED 2";
39		};
40	};
41
42	pwmleds {
43		compatible = "pwm-leds";
44		red_pwm_led: red_pwm_led {
45			pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
46		};
47		green_pwm_led: green_pwm_led {
48			pwms = <&pwm0 2 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
49		};
50		blue_pwm_led: blue_pwm_led {
51			pwms = <&pwm0 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
52		};
53	};
54
55	buttons {
56		compatible = "gpio-keys";
57		button0: button_0 {
58			gpios = <&gpio0 25 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
59			label = "Push button switch 0 (SW1)";
60			zephyr,code = <INPUT_KEY_0>;
61		};
62		button1: button_1 {
63			gpios = <&gpio0 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
64			label = "Push button switch 1 (SW2)";
65			zephyr,code = <INPUT_KEY_1>;
66		};
67	};
68
69	arduino_header: connector {
70		compatible = "arduino-header-r3";
71		#gpio-cells = <2>;
72		gpio-map-mask = <0xffffffff 0xffffffc0>;
73		gpio-map-pass-thru = <0 0x3f>;
74		gpio-map = <0 0 &gpio0 04 0>,	/* A0 */
75			   <1 0 &gpio0 30 0>,	/* A1 */
76			   <2 0 &gpio0 5 0>,	/* A2 */
77			   <3 0 &gpio0 2 0>,	/* A3 */
78			   <4 0 &gpio0 28 0>,	/* A4 */
79			   <5 0 &gpio0 3 0>,	/* A5 */
80			   <6 0 &gpio0 29 0>,	/* D0 */
81			   <7 0 &gpio1 13 0>,	/* D1 */
82			   <8 0 &gpio1 12 0>,	/* D2 */
83			   <9 0 &gpio0 31 0>,	/* D3 */
84			   <10 0 &gpio0 13 0>,	/* D4 */
85			   <11 0 &gpio0 11 0>,	/* D5 */
86			   <12 0 &gpio0 9 0>,	/* D6 */
87			   <13 0 &gpio0 10 0>,	/* D7 */
88			   <14 0 &gpio1 9 0>,	/* D8 */
89			   <15 0 &gpio0 12 0>,	/* D9 */
90			   <16 0 &gpio0 14 0>,	/* D10 */
91			   <17 0 &gpio0 15 0>,	/* D11 */
92			   <18 0 &gpio1 0 0>,	/* D12 */
93			   <19 0 &gpio0 7 0>,	/* D13 */
94			   <20 0 &gpio0 16 0>,	/* D14 */
95			   <21 0 &gpio0 24 0>;	/* D15 */
96	};
97
98	arduino_adc: analog-connector {
99		compatible = "arduino,uno-adc";
100		#io-channel-cells = <1>;
101		io-channel-map = <0 &adc 2>,	/* A0 = P0.04 = AIN2 */
102				 <1 &adc 6>,	/* A1 = P0.30 = AIN6 */
103				 <2 &adc 3>,	/* A2 = P0.5 = AIN3 */
104				 <3 &adc 0>,	/* A3 = P0.2 = AIN0 */
105				 <4 &adc 4>,	/* A4 = P0.28 = AIN4 */
106				 <5 &adc 1>;	/* A5 = P0.3 = AIN1 */
107	};
108
109	/* These aliases are provided for compatibility with samples */
110	aliases {
111		led0 = &led0;
112		led1 = &led1;
113		led2 = &led2;
114		pwm-led0 = &red_pwm_led;
115		pwm-led1 = &green_pwm_led;
116		pwm-led2 = &blue_pwm_led;
117		red-pwm-led = &red_pwm_led;
118		green-pwm-led = &green_pwm_led;
119		blue-pwm-led = &blue_pwm_led;
120		sw0 = &button0;
121		sw1 = &button1;
122		watchdog0 = &wdt0;
123	};
124};
125
126&reg1 {
127	regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
128};
129
130&adc {
131	status = "okay";
132};
133
134&uicr {
135	gpio-as-nreset;
136};
137
138&gpiote {
139	status = "okay";
140};
141
142&gpio0 {
143	status = "okay";
144};
145
146&gpio1 {
147	status = "okay";
148};
149
150&uart0 {
151	compatible = "nordic,nrf-uarte";
152	status = "okay";
153	current-speed = <115200>;
154	pinctrl-0 = <&uart0_default>;
155	pinctrl-1 = <&uart0_sleep>;
156	pinctrl-names = "default", "sleep";
157};
158
159arduino_i2c: &i2c0 {
160	compatible = "nordic,nrf-twi";
161	status = "okay";
162	pinctrl-0 = <&i2c0_default>;
163	pinctrl-1 = <&i2c0_sleep>;
164	pinctrl-names = "default", "sleep";
165};
166
167&spi0 {
168	compatible = "nordic,nrf-spi";
169	/* Cannot be used together with i2c0. */
170	/* status = "okay"; */
171	pinctrl-0 = <&spi0_default>;
172	pinctrl-1 = <&spi0_sleep>;
173	pinctrl-names = "default", "sleep";
174};
175
176&spi1 {
177	compatible = "nordic,nrf-spi";
178	status = "okay";
179	pinctrl-0 = <&spi1_default>;
180	pinctrl-1 = <&spi1_sleep>;
181	pinctrl-names = "default", "sleep";
182};
183
184&pwm0 {
185	status = "okay";
186	pinctrl-0 = <&pwm0_default>;
187	pinctrl-1 = <&pwm0_sleep>;
188	pinctrl-names = "default", "sleep";
189};
190
191&ieee802154 {
192	status = "okay";
193};
194
195zephyr_udc0: &usbd {
196	compatible = "nordic,nrf-usbd";
197	status = "okay";
198};
199