1/*
2 * Copyright (c) 2022 Embla Flatlandsmo <embla.flatlandsmo@gmail.com>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <nordic/nrf52840_qiaa.dtsi>
9#include "adafruit_itsybitsy_nrf52840-pinctrl.dtsi"
10#include <zephyr/dt-bindings/input/input-event-codes.h>
11#include <zephyr/dt-bindings/led/led.h>
12
13/ {
14	model = "Adafruit ItsyBitsy nRF52840 Express";
15	compatible = "adafruit,itsybitsy-nrf52840";
16
17	chosen {
18		zephyr,console = &cdc_acm_uart0;
19		zephyr,shell-uart = &cdc_acm_uart0;
20		zephyr,uart-mcumgr = &cdc_acm_uart0;
21		zephyr,bt-mon-uart = &cdc_acm_uart0;
22		zephyr,bt-c2h-uart = &cdc_acm_uart0;
23		zephyr,sram = &sram0;
24		zephyr,flash = &flash0;
25		zephyr,code-partition = &code_partition;
26		zephyr,ieee802154 = &ieee802154;
27	};
28
29	leds {
30		compatible = "gpio-leds";
31		led0: led_0 {
32			gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
33			label = "Red LED";
34		};
35	};
36
37	buttons {
38		compatible = "gpio-keys";
39		button0: button_0 {
40			gpios = <&gpio0 29 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
41			label = "Push button switch";
42			zephyr,code = <INPUT_KEY_0>;
43		};
44	};
45
46	/* These aliases are provided for compatibility with samples */
47	aliases {
48		led0 = &led0;
49		sw0 = &button0;
50		watchdog0 = &wdt0;
51		led-strip = &apa102;
52	};
53};
54
55&adc {
56	status = "okay";
57};
58
59&uicr {
60	gpio-as-nreset;
61};
62
63&gpiote {
64	status = "okay";
65};
66
67&gpio0 {
68	status = "okay";
69};
70
71&gpio1 {
72	status = "okay";
73};
74
75&uart0 {
76	compatible = "nordic,nrf-uarte";
77	current-speed = <115200>;
78	status = "disabled";
79	pinctrl-0 = <&uart0_default>;
80	pinctrl-1 = <&uart0_sleep>;
81	pinctrl-names = "default", "sleep";
82};
83
84&i2c0 {
85	compatible = "nordic,nrf-twi";
86	status = "okay";
87	pinctrl-0 = <&i2c0_default>;
88	pinctrl-1 = <&i2c0_sleep>;
89	pinctrl-names = "default", "sleep";
90};
91
92&spi1 {
93	compatible = "nordic,nrf-spi";
94	status = "okay";
95	pinctrl-0 = <&spi1_default>;
96	pinctrl-1 = <&spi1_sleep>;
97	pinctrl-names = "default", "sleep";
98};
99
100&spi2 {
101	compatible = "nordic,nrf-spi";
102	status = "okay";
103	pinctrl-0 = <&spi2_default>;
104	pinctrl-1 = <&spi2_sleep>;
105	pinctrl-names = "default", "sleep";
106	apa102: apa102@0 {
107		compatible = "apa,apa102";
108		reg = <0>;
109		spi-max-frequency = <5250000>;
110		chain-length = <1>;
111		color-mapping = <LED_COLOR_ID_BLUE
112				 LED_COLOR_ID_GREEN
113				 LED_COLOR_ID_RED>;
114	};
115};
116
117&qspi {
118	status = "okay";
119	pinctrl-0 = <&qspi_default>;
120	pinctrl-1 = <&qspi_sleep>;
121	pinctrl-names = "default", "sleep";
122	gd25q16: gd25q16@0 {
123		compatible = "nordic,qspi-nor";
124		reg = <0>;
125		writeoc = "pp4o";
126		readoc = "read4io";
127		sck-frequency = <32000000>;
128		jedec-id = [c8 40 15];
129		size = <16777216>;
130		has-dpd;
131		t-enter-dpd = <20000>;
132		t-exit-dpd = <20000>;
133		quad-enable-requirements = "S2B1v1";
134	};
135};
136
137&ieee802154 {
138	status = "okay";
139};
140
141&flash0 {
142	partitions {
143		compatible = "fixed-partitions";
144		#address-cells = <1>;
145		#size-cells = <1>;
146
147		/* To enable flashing with UF2 bootloader, we
148		 * must reserve a partition for SoftDevice.
149		 * See https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather?view=all#hathach-memory-map
150		 */
151		reserved_partition_0: partition@0 {
152			label = "SoftDevice";
153			reg = <0x000000000 DT_SIZE_K(152)>;
154		};
155		code_partition: partition@26000 {
156			label = "Application";
157			reg = <0x00026000 DT_SIZE_K(796)>;
158		};
159
160		/*
161		 * The flash starting at 0x000ed000 and ending at
162		 * 0x000f4000 is reserved for use by the application.
163		 */
164		storage_partition: partition@ed000 {
165			label = "storage";
166			reg = <0x0000ed000 DT_SIZE_K(28)>;
167		};
168
169		boot_partition: partition@f4000 {
170			label = "UF2";
171			reg = <0x000f4000 DT_SIZE_K(48)>;
172		};
173	};
174};
175
176&gd25q16 {
177	partitions {
178		compatible = "fixed-partitions";
179		#address-cells = <1>;
180		#size-cells = <1>;
181		lfs_partition: partition@0 {
182			label = "lfs_storage";
183			reg = <0x00000000 DT_SIZE_M(2)>;
184		};
185	};
186};
187
188zephyr_udc0: &usbd {
189	compatible = "nordic,nrf-usbd";
190	status = "okay";
191
192	cdc_acm_uart0: cdc_acm_uart0 {
193		compatible = "zephyr,cdc-acm-uart";
194	};
195};
196