1/*
2 * Copyright (c) 2023 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#include "nrf9151dk_nrf9151_common-pinctrl.dtsi"
7#include <zephyr/dt-bindings/input/input-event-codes.h>
8
9/ {
10	model = "Nordic nRF9151 DK NRF9151";
11	compatible = "nordic,nrf9151-dk-nrf9151";
12
13	chosen {
14		zephyr,console = &uart0;
15		zephyr,shell-uart = &uart0;
16		zephyr,uart-mcumgr = &uart0;
17	};
18
19	leds {
20		compatible = "gpio-leds";
21		led0: led_0 {
22			gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
23			label = "Green LED 1";
24		};
25		led1: led_1 {
26			gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
27			label = "Green LED 2";
28		};
29		led2: led_2 {
30			gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
31			label = "Green LED 3";
32		};
33		led3: led_3 {
34			gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
35			label = "Green LED 4";
36		};
37	};
38
39	pwmleds {
40		compatible = "pwm-leds";
41		pwm_led0: pwm_led_0 {
42			pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
43		};
44	};
45
46	buttons {
47		compatible = "gpio-keys";
48		button0: button_0 {
49			gpios = <&gpio0 8 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
50			label = "Push button 1";
51			zephyr,code = <INPUT_KEY_0>;
52		};
53		button1: button_1 {
54			gpios = <&gpio0 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
55			label = "Push button 2";
56			zephyr,code = <INPUT_KEY_1>;
57		};
58		button2: button_2 {
59			gpios = <&gpio0 18 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
60			label = "Push button 3";
61			zephyr,code = <INPUT_KEY_2>;
62		};
63		button3: button_3 {
64			gpios = <&gpio0 19 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
65			label = "Push button 4";
66			zephyr,code = <INPUT_KEY_3>;
67		};
68	};
69
70	nrf5340_reset: gpio-reset {
71		compatible = "nordic,nrf9151dk-nrf5340-reset";
72		status = "disabled";
73		gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
74	};
75
76	arduino_header: connector {
77		compatible = "arduino-header-r3";
78		#gpio-cells = <2>;
79		gpio-map-mask = <0xffffffff 0xffffffc0>;
80		gpio-map-pass-thru = <0 0x3f>;
81		gpio-map = <0 0 &gpio0 14 0>,	/* A0 */
82			   <1 0 &gpio0 15 0>,	/* A1 */
83			   <2 0 &gpio0 16 0>,	/* A2 */
84			   <3 0 &gpio0 17 0>,	/* A3 */
85			   <4 0 &gpio0 18 0>,	/* A4 */
86			   <5 0 &gpio0 19 0>,	/* A5 */
87			   <6 0 &gpio0 0 0>,	/* D0 */
88			   <7 0 &gpio0 1 0>,	/* D1 */
89			   <8 0 &gpio0 2 0>,	/* D2 */
90			   <9 0 &gpio0 3 0>,	/* D3 */
91			   <10 0 &gpio0 4 0>,	/* D4 */
92			   <11 0 &gpio0 5 0>,	/* D5 */
93			   <12 0 &gpio0 6 0>,	/* D6 */
94			   <13 0 &gpio0 7 0>,	/* D7 */
95			   <14 0 &gpio0 8 0>,	/* D8 */
96			   <15 0 &gpio0 9 0>,	/* D9 */
97			   <16 0 &gpio0 10 0>,	/* D10 */
98			   <17 0 &gpio0 11 0>,	/* D11 */
99			   <18 0 &gpio0 12 0>,	/* D12 */
100			   <19 0 &gpio0 13 0>,	/* D13 */
101			   <20 0 &gpio0 30 0>,	/* D14 */
102			   <21 0 &gpio0 31 0>;	/* D15 */
103	};
104
105	arduino_adc: analog-connector {
106		compatible = "arduino,uno-adc";
107		#io-channel-cells = <1>;
108		io-channel-map = <0 &adc 1>,	/* A0 = P0.14 = AIN1 */
109				 <1 &adc 2>,	/* A1 = P0.15 = AIN2 */
110				 <2 &adc 3>,	/* A2 = P0.16 = AIN3 */
111				 <3 &adc 4>,	/* A3 = P0.17 = AIN4 */
112				 <4 &adc 5>,	/* A4 = P0.18 = AIN5 */
113				 <5 &adc 6>;	/* A5 = P0.19 = AIN6 */
114	};
115
116	/* These aliases are provided for compatibility with samples */
117	aliases {
118		led0 = &led0;
119		led1 = &led1;
120		led2 = &led2;
121		led3 = &led3;
122		pwm-led0 = &pwm_led0;
123		sw0 = &button0;
124		sw1 = &button1;
125		sw2 = &button2;
126		sw3 = &button3;
127		bootloader-led0 = &led0;
128		mcuboot-button0 = &button0;
129		mcuboot-led0 = &led0;
130		watchdog0 = &wdt0;
131	};
132};
133
134&adc {
135	status = "okay";
136};
137
138&gpiote {
139	status = "okay";
140};
141
142&gpio0 {
143	status = "okay";
144};
145
146&uart0 {
147	status = "okay";
148	current-speed = <115200>;
149	pinctrl-0 = <&uart0_default>;
150	pinctrl-1 = <&uart0_sleep>;
151	pinctrl-names = "default", "sleep";
152};
153
154arduino_serial: &uart1 {
155	status = "okay";
156	current-speed = <115200>;
157	pinctrl-0 = <&uart1_default>;
158	pinctrl-1 = <&uart1_sleep>;
159	pinctrl-names = "default", "sleep";
160};
161
162arduino_i2c: &i2c2 {
163	compatible = "nordic,nrf-twim";
164	status = "okay";
165	pinctrl-0 = <&i2c2_default>;
166	pinctrl-1 = <&i2c2_sleep>;
167	pinctrl-names = "default", "sleep";
168	clock-frequency = <I2C_BITRATE_FAST>;
169
170	pcal6408a: pcal6408a@21 {
171		compatible = "nxp,pcal6408a";
172		status = "disabled";
173		reg = <0x21>;
174		gpio-controller;
175		#gpio-cells = <2>;
176		ngpios = <8>;
177		int-gpios = <&gpio0 19 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
178	};
179};
180
181&pwm0 {
182	status = "okay";
183	pinctrl-0 = <&pwm0_default>;
184	pinctrl-1 = <&pwm0_sleep>;
185	pinctrl-names = "default", "sleep";
186};
187
188arduino_spi: &spi3 {
189	compatible = "nordic,nrf-spim";
190	status = "okay";
191	cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>, /* D10 */
192		   <&gpio0 20 GPIO_ACTIVE_LOW>;
193	pinctrl-0 = <&spi3_default>;
194	pinctrl-1 = <&spi3_sleep>;
195	pinctrl-names = "default", "sleep";
196
197	gd25wb256: gd25wb256e3ir@1 {
198		compatible = "jedec,spi-nor";
199		status = "disabled";
200		reg = <1>;
201		spi-max-frequency = <8000000>;
202		size = <268435456>;
203		has-dpd;
204		t-enter-dpd = <3000>;
205		t-exit-dpd = <40000>;
206		sfdp-bfp = [
207			e5 20 f3 ff  ff ff ff 0f  44 eb 08 6b  08 3b 42 bb
208			ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
209			10 d8 00 ff  44 7a c9 fe  83 67 26 62  ec 82 18 44
210			7a 75 7a 75  04 c4 d5 5c  00 06 74 00  08 50 00 01
211			];
212		jedec-id = [c8 65 19];
213	};
214};
215
216/* Include default memory partition configuration file */
217#include <common/nordic/nrf91xx_partition.dtsi>
218