1/*
2 * Copyright (c) 2018 Phytec Messtechnik GmbH
3 * Copyright (c) 2017 Linaro Limited
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#include <nordic/nrf52840_partition.dtsi>
9#include "reel_board-pinctrl.dtsi"
10#include <zephyr/dt-bindings/input/input-event-codes.h>
11
12/ {
13	chosen {
14		zephyr,ieee802154 = &ieee802154;
15	};
16
17	leds {
18		compatible = "gpio-leds";
19		red_led: led_0 {
20			gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
21			label = "User D3 red";
22		};
23		green_led: led_1 {
24			gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
25			label = "User D3 green";
26		};
27		blue_led: led_2 {
28			gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
29			label = "User D3 blue";
30		};
31	};
32
33	pwmleds {
34		compatible = "pwm-leds";
35		red_pwm_led: pwm_led_0 {
36			pwms = <&pwm0 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
37		};
38		green_pwm_led: pwm_led_1 {
39			pwms = <&pwm0 2 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
40		};
41		blue_pwm_led: pwm_led_2 {
42			pwms = <&pwm0 3 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
43		};
44	};
45
46	gpio_keys {
47		compatible = "gpio-keys";
48		user_button: button_0 {
49			gpios = <&gpio0 7 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
50			label = "User Button";
51			zephyr,code = <INPUT_KEY_0>;
52		};
53	};
54
55	arduino_header: connector {
56		compatible = "arduino-header-r3";
57		#gpio-cells = <2>;
58		gpio-map-mask = <0xffffffff 0xffffffc0>;
59		gpio-map-pass-thru = <0 0x3f>;
60		gpio-map = <0 0 &gpio0 3 0>,	/* A0 */
61			   <1 0 &gpio0 4 0>,	/* A1 */
62			   <2 0 &gpio0 28 0>,	/* A2 */
63			   <3 0 &gpio0 29 0>,	/* A3 */
64			   <4 0 &gpio0 30 0>,	/* A4 */
65			   <5 0 &gpio0 31 0>,	/* A5 */
66			   <6 0 &gpio1 1 0>,	/* D0 */
67			   <7 0 &gpio1 2 0>,	/* D1 */
68			   <8 0 &gpio1 3 0>,	/* D2 */
69			   <9 0 &gpio1 4 0>,	/* D3 */
70			   <10 0 &gpio1 5 0>,	/* D4 */
71			   <11 0 &gpio1 6 0>,	/* D5 */
72			   <12 0 &gpio1 7 0>,	/* D6 */
73			   <13 0 &gpio1 8 0>,	/* D7 */
74			   <14 0 &gpio1 10 0>,	/* D8 */
75			   <15 0 &gpio1 11 0>,	/* D9 */
76			   <16 0 &gpio1 12 0>,	/* D10 */
77			   <17 0 &gpio1 13 0>,	/* D11 */
78			   <18 0 &gpio1 14 0>,	/* D12 */
79			   <19 0 &gpio1 15 0>,	/* D13 */
80			   <20 0 &gpio0 26 0>,	/* D14 */
81			   <21 0 &gpio0 27 0>;	/* D15 */
82	};
83
84	aliases {
85		led0 = &red_led;
86		led1 = &green_led;
87		led2 = &blue_led;
88		pwm-led0 = &red_pwm_led;
89		pwm-led1 = &green_pwm_led;
90		pwm-led2 = &blue_pwm_led;
91		red-pwm-led = &red_pwm_led;
92		green-pwm-led = &green_pwm_led;
93		blue-pwm-led = &blue_pwm_led;
94		sw0 = &user_button;
95		accel0 = &mma8642fc;
96	};
97};
98
99&reg1 {
100	regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
101};
102
103&uicr {
104	gpio-as-nreset;
105};
106
107&gpiote {
108	status = "okay";
109};
110
111&gpio0 {
112	status = "okay";
113};
114
115&gpio1 {
116	status = "okay";
117};
118
119&uart0 {
120	compatible = "nordic,nrf-uart";
121	current-speed = <115200>;
122	status = "okay";
123	pinctrl-0 = <&uart0_default>;
124	pinctrl-1 = <&uart0_sleep>;
125	pinctrl-names = "default", "sleep";
126};
127
128arduino_serial: &uart1 {
129	status = "okay";
130	current-speed = <115200>;
131	pinctrl-0 = <&uart1_default>;
132	pinctrl-1 = <&uart1_sleep>;
133	pinctrl-names = "default", "sleep";
134};
135
136arduino_i2c: &i2c0 {
137	compatible = "nordic,nrf-twim";
138	status = "okay";
139	clock-frequency = <I2C_BITRATE_FAST>;
140
141	pinctrl-0 = <&i2c0_default>;
142	pinctrl-1 = <&i2c0_sleep>;
143	pinctrl-names = "default", "sleep";
144	mma8642fc: mma8652fc@1d {
145		compatible = "nxp,fxos8700","nxp,mma8652fc";
146		reg = <0x1d>;
147		int1-gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
148		int2-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
149	};
150
151	ti_hdc@43 {
152		compatible = "ti,hdc","ti,hdc1010";
153		reg = <0x43>;
154		drdy-gpios = <&gpio0 22 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
155	};
156
157	apds9960@39 {
158		compatible = "avago,apds9960";
159		reg = <0x39>;
160		int-gpios = <&gpio0 23 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
161	};
162};
163
164&pwm0 {
165	status = "okay";
166	pinctrl-0 = <&pwm0_default>;
167	pinctrl-1 = <&pwm0_sleep>;
168	pinctrl-names = "default", "sleep";
169};
170
171&ieee802154 {
172	status = "okay";
173};
174
175arduino_spi: &spi3 {
176	status = "okay";
177	cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */
178	pinctrl-0 = <&spi3_default>;
179	pinctrl-1 = <&spi3_sleep>;
180	pinctrl-names = "default", "sleep";
181};
182
183zephyr_udc0: &usbd {
184	compatible = "nordic,nrf-usbd";
185	status = "okay";
186};
187