1/*
2 * Copyright (c) 2018 Endre Karlson
3 * Copyright (c) 2018 Peter Bigot Consulting, LLC
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8/* Assignments common to all Feather-based Particle mesh boards.
9 *
10 * NOTE: This file is replicated in particle_{argon,boron,xenon}.
11 * Changes should be made in all instances. */
12
13#include <nordic/nrf52840_partition.dtsi>
14#include "mesh_feather-pinctrl.dtsi"
15#include <zephyr/dt-bindings/input/input-event-codes.h>
16
17/ {
18	aliases {
19		led0 = &user_led;
20		led1 = &status_red;
21		led2 = &status_green;
22		led3 = &status_blue;
23		sw0 = &mode_button;
24		sw1 = &reset_button;
25	};
26
27	chosen {
28		zephyr,console = &uart0;
29		zephyr,uart-mcumgr = &uart0;
30		zephyr,shell-uart = &uart0;
31		zephyr,ieee802154 = &ieee802154;
32	};
33
34	leds {
35		compatible = "gpio-leds";
36		user_led: led_0 {
37			gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
38			label = "User LED";
39		};
40		status_red: led_1 {
41			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
42			label = "Red LED";
43		};
44		status_green: led_2 {
45			gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
46			label = "Green LED";
47		};
48		status_blue: led_3 {
49			gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
50			label = "Blue LED";
51		};
52	};
53
54	gpio_keys {
55		compatible = "gpio-keys";
56		mode_button: button_0 {
57			gpios = <&gpio0 11 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
58			label = "Mode Button";
59			zephyr,code = <INPUT_BTN_MODE>;
60		};
61
62		reset_button: button_1 {
63			gpios = <&gpio0 18 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
64			label = "Reset Button";
65			zephyr,code = <INPUT_KEY_1>;
66		};
67	};
68
69	mesh_header: connector {
70		compatible = "particle-gen3-header";
71		#gpio-cells = <2>;
72		gpio-map-mask = <0xffffffff 0xffffffc0>;
73		gpio-map-pass-thru = <0 0x3f>;
74		gpio-map = <0 0 &gpio0 26 0>,   /* SDA */
75			   <1 0 &gpio0 27 0>,   /* SCL */
76			   <2 0 &gpio1 1 0>,    /* PWM3 */
77			   <3 0 &gpio1 2 0>,    /* PWM3 */
78			   <4 0 &gpio1 8 0>,    /* PWM1 */
79			   <5 0 &gpio1 10 0>,   /* PWM1 */
80			   <6 0 &gpio1 11 0>,   /* PWM1 */
81			   <7 0 &gpio1 12 0>,   /* PWM0 */
82			   <8 0 &gpio1 3 0>,    /* PWM1 */
83			   <9 0 &gpio0 6 0>,    /* TX */
84			   <10 0 &gpio0 8 0>,   /* RX */
85			   <11 0 &gpio1 14 0>,  /* MISO */
86			   <12 0 &gpio1 13 0>,  /* MOSI */
87			   <13 0 &gpio1 15 0>,  /* SCK */
88			   <14 0 &gpio0 31 0>,  /* SS */
89			   <15 0 &gpio0 30 0>,  /* ADC4 = AIN6 */
90			   <16 0 &gpio0 29 0>,  /* ADC3 = AIN5 */
91			   <17 0 &gpio0 28 0>,  /* ADC2 = AIN4 */
92			   <18 0 &gpio0 4 0>,   /* ADC1 = AIN2 */
93			   <19 0 &gpio0 3 0>,   /* ADC0 = AIN1 */
94			   <20 0 &gpio0 11 0>,  /* MODEn */
95			   <21 0 &gpio0 18 0>;  /* RESETn */
96	};
97
98	feather_header: feather_connector {
99		compatible = "adafruit-feather-header";
100		#gpio-cells = <2>;
101		gpio-map-mask = <0xffffffff 0xffffffc0>;
102		gpio-map-pass-thru = <0 0x3f>;
103		gpio-map = <12 0 &gpio0 26 0>,  /* SDA */
104			   <13 0 &gpio0 27 0>,  /* SCL */
105			   <14 0 &gpio1 1 0>,   /* PWM3 */
106			   <15 0 &gpio1 2 0>,   /* PWM3 */
107			   <16 0 &gpio1 8 0>,   /* PWM1 */
108			   <17 0 &gpio1 10 0>,  /* PWM1 */
109			   <18 0 &gpio1 11 0>,  /* PWM1 */
110			   <19 0 &gpio1 12 0>,  /* PWM0 */
111			   <20 0 &gpio1 3 0>,   /* PWM1 */
112			   /* 11 not connected */
113			   <10 0 &gpio0 6 0>,   /* TX */
114			   <9 0 &gpio0 8 0>,    /* RX */
115			   <8 0 &gpio1 14 0>,   /* MISO */
116			   <7 0 &gpio1 13 0>,   /* MOSI */
117			   <6 0 &gpio1 15 0>,   /* SCK */
118			   <5 0 &gpio0 31 0>,   /* SS */
119			   <4 0 &gpio0 30 0>,   /* ADC4 = AIN6 */
120			   <3 0 &gpio0 29 0>,   /* ADC3 = AIN5 */
121			   <2 0 &gpio0 28 0>,   /* ADC2 = AIN4 */
122			   <1 0 &gpio0 4 0>,    /* ADC1 = AIN2 */
123			   <0 0 &gpio0 3 0>;    /* ADC0 = AIN1 */
124	};
125};
126
127feather_adc: &adc { /* feather ADC */
128	status = "okay";
129};
130
131&ieee802154 {
132	status = "okay";
133};
134
135&gpio0 {
136	status = "okay";
137};
138
139&gpio1 {
140	status = "okay";
141};
142
143&gpiote {
144	status = "okay";
145};
146
147arduino_i2c: &i2c0 { /* feather I2C */
148	compatible = "nordic,nrf-twi";
149	status = "okay";
150	clock-frequency = <I2C_BITRATE_FAST>;
151	pinctrl-0 = <&i2c0_default>;
152	pinctrl-1 = <&i2c0_sleep>;
153	pinctrl-names = "default", "sleep";
154};
155
156feather_i2c: &i2c0 { };
157
158/* TWI1 used on Boron; also see mesh_feather_spi_spi1.dtsi */
159
160&spi2 { /* dedicated MX25L */
161	compatible = "nordic,nrf-spi";
162	status = "okay";
163	cs-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
164	pinctrl-0 = <&spi2_default>;
165	pinctrl-1 = <&spi2_sleep>;
166	pinctrl-names = "default", "sleep";
167	mx25l32: mx25l3233f@0 {
168		compatible = "jedec,spi-nor";
169		reg = <0>;
170		spi-max-frequency = <80000000>;
171		wp-gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
172		hold-gpios = <&gpio0 23 GPIO_ACTIVE_LOW>;
173		size = <0x2000000>;
174		has-dpd;
175		t-enter-dpd = <10000>;
176		t-exit-dpd = <100000>;
177		jedec-id = [c2 20 16];
178		sfdp-bfp = [
179			e5 20 f1 ff  ff ff ff 01  44 eb 08 6b  08 3b 04 bb
180			ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
181			10 d8 00 ff
182		];
183	};
184};
185
186/* see mesh_feather_spi1_spi3.dtsi */
187
188feather_serial: &uart0 { /* feather UART1 */
189	compatible = "nordic,nrf-uarte";
190	current-speed = <115200>;
191	status = "okay";
192	/* optional mesh_feather_uart1_rtscts.dtsi */
193	pinctrl-0 = <&uart0_default>;
194	pinctrl-1 = <&uart0_sleep>;
195	pinctrl-names = "default", "sleep";
196};
197
198zephyr_udc0: &usbd {
199	compatible = "nordic,nrf-usbd";
200	status = "okay";
201};
202