1/*
2 * Copyright (c) 2020 InnBlue
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6#include "nrf9160_innblue21_common-pinctrl.dtsi"
7#include <zephyr/dt-bindings/input/input-event-codes.h>
8
9/ {
10	model = "innblue v21 Dev Kit";
11	compatible = "innblue,innblue21";
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		red_led: led_1 {
22			gpios = <&gpio0 7 0>;
23			label = "RGB red channel";
24		};
25		green_led: led_2 {
26			gpios = <&gpio0 6 0>;
27			label = "RGB green channel";
28		};
29		blue_led: led_3 {
30			gpios = <&gpio0 5 0>;
31			label = "RGB blue channel";
32		};
33
34		mode_led: led_4 {
35			gpios = <&gpio0 4 0>;
36			label = "mode red channel";
37		};
38	};
39
40	buttons {
41		compatible = "gpio-keys";
42
43		button0: button_0 {
44			gpios = <&gpio0 31 GPIO_PULL_UP>;
45			label = "Button 0";
46			zephyr,code = <INPUT_KEY_0>;
47		};
48	};
49
50	en_3v3_sensor: enable-3v3-sensor {
51		compatible = "regulator-fixed";
52		regulator-name = "en_3v3_sensor";
53		enable-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
54		startup-delay-us = <10000>;
55		regulator-boot-on;
56	};
57
58	en_5v0_boost: enable-5v0-boost {
59		compatible = "regulator-fixed";
60		regulator-name = "en_5v0_boost";
61		enable-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>;
62		startup-delay-us = <10000>;
63		regulator-boot-on;
64	};
65
66	/* These aliases are provided for compatibility with samples */
67	aliases {
68		led0 = &red_led;
69		led1 = &green_led;
70		led2 = &blue_led;
71		led3 = &mode_led;
72		sw0  = &button0;
73		rgb-pwm  = &pwm0;
74		mode-pwm = &pwm1;
75		watchdog0 = &wdt0;
76		accel0 = &lis2dh12_accel;
77	};
78};
79
80&gpiote {
81	status = "okay";
82};
83
84&gpio0 {
85	status = "okay";
86};
87
88&uart0 {
89	status = "okay";
90	current-speed = <115200>;
91	pinctrl-0 = <&uart0_default>;
92	pinctrl-1 = <&uart0_sleep>;
93	pinctrl-names = "default", "sleep";
94};
95
96&uart1 {
97	status = "okay";
98	current-speed = <115200>;
99	pinctrl-0 = <&uart1_default>;
100	pinctrl-1 = <&uart1_sleep>;
101	pinctrl-names = "default", "sleep";
102};
103
104&uart2 {
105	current-speed = <115200>;
106	pinctrl-0 = <&uart2_default>;
107	pinctrl-1 = <&uart2_sleep>;
108	pinctrl-names = "default", "sleep";
109};
110
111&i2c2 {
112	compatible = "nordic,nrf-twim";
113	status = "okay";
114
115	clock-frequency = <I2C_BITRATE_FAST>;
116
117	pinctrl-0 = <&i2c2_default>;
118	pinctrl-1 = <&i2c2_sleep>;
119	pinctrl-names = "default", "sleep";
120	lis2dh12_accel: lis2dh12-accel@19 {
121		compatible = "st,lis2dh";
122		reg = <0x19>;
123		irq-gpios = <&gpio0 0 0>, <&gpio0 1 0>;
124	};
125
126	hts221@5f {
127		compatible = "st,hts221";
128		reg = <0x5f>;
129		drdy-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
130	};
131
132	lps22hb-press@5c {
133		compatible = "st,lps22hb-press";
134		reg = <0x5c>;
135	};
136
137	ccs811: ccs811@5a {
138		compatible = "ams,ccs811";
139		reg = <0x5a>;
140	};
141
142	bme680@76 {
143		compatible = "bosch,bme680";
144		reg = <0x76>;
145	};
146};
147
148&pwm0 {
149	status = "okay";
150	pinctrl-0 = <&pwm0_default>;
151	pinctrl-1 = <&pwm0_sleep>;
152	pinctrl-names = "default", "sleep";
153};
154
155&pwm1 {
156	status = "okay";
157	pinctrl-0 = <&pwm1_default>;
158	pinctrl-1 = <&pwm1_sleep>;
159	pinctrl-names = "default", "sleep";
160};
161
162&flash0 {
163
164	partitions {
165		compatible = "fixed-partitions";
166		#address-cells = <1>;
167		#size-cells = <1>;
168
169		boot_partition: partition@0 {
170			label = "mcuboot";
171			reg = <0x00000000 0xc000>;
172		};
173		slot0_partition: partition@c000 {
174			label = "image-0";
175		};
176		slot0_ns_partition: partition@3e000 {
177			label = "image-0-nonsecure";
178		};
179		slot1_partition: partition@7e000 {
180			label = "image-1";
181		};
182		slot1_ns_partition: partition@b0000 {
183			label = "image-1-nonsecure";
184		};
185		scratch_partition: partition@f0000 {
186			label = "image-scratch";
187			reg = <0x000f0000 0xa000>;
188		};
189		storage_partition: partition@fa000 {
190			label = "storage";
191			reg = <0x000fa000 0x00006000>;
192		};
193	};
194};
195
196/ {
197	/* SRAM allocated and used by the BSD library */
198	sram0_bsd: memory@20010000 {
199		compatible = "mmio-sram";
200	};
201
202	/* SRAM allocated to the Non-Secure image */
203	sram0_ns: memory@20020000 {
204		compatible = "mmio-sram";
205	};
206};
207
208/* Include partition configuration file */
209#include "nrf9160_innblue21_partition_conf.dtsi"
210