1/*
2 * Copyright (c) 2020 Jefferson Lee
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/ {
8	chosen {
9		zephyr,console = &uart0;
10		zephyr,shell-uart = &uart0;
11		zephyr,uart-mcumgr = &uart0;
12		zephyr,bt-mon-uart = &uart0;
13		zephyr,bt-c2h-uart = &uart0;
14		zephyr,sram = &sram0;
15		zephyr,flash = &flash0;
16		zephyr,code-partition = &code_partition;
17		zephyr,ieee802154 = &ieee802154;
18	};
19
20	leds {
21		compatible = "gpio-leds";
22		led0: led_0 {
23			gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
24			label = "Red LED";
25		};
26		led1: led_1 {
27			gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
28			label = "Green LED";
29		};
30		led2: led_2 {
31			gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
32			label = "Blue LED";
33		};
34		led3: led_3 {
35			/* Cannot be used together with spi2. */
36			gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
37			label = "Yellow LED";
38		};
39		led4: led_4 {
40			gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
41			label = "User LED";
42		};
43	};
44
45	pwmleds {
46		compatible = "pwm-leds";
47
48		red_pwm_led: led_pwm_0 {
49			pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
50			label = "Red PWM LED";
51		};
52		green_pwm_led: led_pwm_1 {
53			pwms = <&pwm0 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
54			label = "Green PWM LED";
55		};
56		blue_pwm_led: led_pwm_2 {
57			pwms = <&pwm0 2 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
58			label = "Blue PWM LED";
59		};
60		user_pwm_led: led_pwm_4 {
61			pwms = <&pwm1 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
62			label = "User PWM LED";
63		};
64	};
65
66	pwmleds2 {
67		compatible = "pwm-leds";
68		/* Cannot be used together with spi2. */
69		status = "disabled";
70
71		yellow_pwm_led: led_pwm_3 {
72			pwms = <&pwm2 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
73			label = "Yellow PWM LED";
74		};
75	};
76
77	vdd_env: vdd-env {
78		compatible = "regulator-fixed";
79		regulator-name = "vdd_env";
80		enable-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
81		regulator-boot-on;
82		startup-delay-us = <5000>;
83	};
84
85	zephyr,user {
86		/* I2C pull-ups are connected to VDD via pin voltage level */
87		pull-up-gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
88	};
89
90	/* These aliases are provided for compatibility with samples */
91	aliases {
92		led0 = &led0;
93		led1 = &led1;
94		led2 = &led2;
95		led3 = &led3;
96		led4 = &led4;
97		pwm-led0 = &red_pwm_led;
98		pwm-led1 = &green_pwm_led;
99		pwm-led2 = &blue_pwm_led;
100		pwm-led3 = &yellow_pwm_led;
101		pwm-led4 = &user_pwm_led;
102		red-pwm-led = &red_pwm_led;
103		green-pwm-led = &green_pwm_led;
104		blue-pwm-led = &blue_pwm_led;
105		spi = &spi2;
106		watchdog0 = &wdt0;
107		accel0 = &lsm9ds1;
108	};
109};
110
111&flash0 {
112	partitions {
113		compatible = "fixed-partitions";
114		#address-cells = <1>;
115		#size-cells = <1>;
116
117		boot_partition: partition@0 {
118			label = "sam-ba";
119			reg = <0x00000000 0x00010000>;
120			read-only;
121		};
122
123		code_partition: partition@10000 {
124			label = "code";
125			reg = <0x00010000 0x000e8000>;
126			read-only;
127		};
128
129		/*
130		 * The flash starting at 0x000f8000 and ending at
131		 * 0x000fffff is reserved for use by the application.
132		 *
133		 * Storage partition will be used by FCB/LittleFS/NVS
134		 * if enabled.
135		 */
136		storage_partition: partition@f8000 {
137			label = "storage";
138			reg = <0x000f8000 0x00008000>;
139		};
140	};
141};
142
143&adc {
144	status = "okay";
145};
146
147&uart0 {
148	compatible = "nordic,nrf-uart";
149	current-speed = <115200>;
150	status = "okay";
151	pinctrl-0 = <&uart0_default>;
152	pinctrl-1 = <&uart0_sleep>;
153	pinctrl-names = "default", "sleep";
154};
155
156arduino_i2c: &i2c0 {
157	compatible = "nordic,nrf-twim";
158	status = "okay";
159	pinctrl-0 = <&i2c0_default>;
160	pinctrl-1 = <&i2c0_sleep>;
161	pinctrl-names = "default", "sleep";
162};
163
164&i2c1 {
165	compatible = "nordic,nrf-twim";
166	status = "okay";
167	pinctrl-0 = <&i2c1_default>;
168	pinctrl-1 = <&i2c1_sleep>;
169	pinctrl-names = "default", "sleep";
170
171	lsm9ds1: lsm9ds1@6b {
172		compatible = "st,lsm9ds1";
173		reg = <0x6b>;
174	};
175
176};
177
178/* SPI2 is used because SPI1/0 shares conflicts with I2C1/0 */
179arduino_spi: &spi2 {
180	compatible = "nordic,nrf-spim";
181	status = "okay";
182	pinctrl-0 = <&spi2_default>;
183	pinctrl-1 = <&spi2_sleep>;
184	pinctrl-names = "default", "sleep";
185};
186
187&uicr {
188	gpio-as-nreset;
189};
190
191&gpio0 {
192	status = "okay";
193};
194
195&gpio1 {
196	status = "okay";
197};
198
199&gpiote {
200	status = "okay";
201};
202
203&pwm0 {
204	status = "okay";
205	pinctrl-0 = <&pwm0_default>;
206	pinctrl-1 = <&pwm0_sleep>;
207	pinctrl-names = "default", "sleep";
208};
209
210&pwm1 {
211	status = "okay";
212	pinctrl-0 = <&pwm1_default>;
213	pinctrl-1 = <&pwm1_sleep>;
214	pinctrl-names = "default", "sleep";
215};
216
217&pwm2 {
218	/* Cannot be used together with spi2 because of conflict on P0.13. */
219	status = "disabled";
220	pinctrl-0 = <&pwm2_default>;
221	pinctrl-1 = <&pwm2_sleep>;
222	pinctrl-names = "default", "sleep";
223};
224
225zephyr_udc0: &usbd {
226	compatible = "nordic,nrf-usbd";
227	status = "okay";
228};
229
230&ieee802154 {
231	status = "okay";
232};
233