1/*
2 * Copyright (c) 2020 Ruuvi Innovations Ltd (Oy)
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <nordic/nrf52832_qfaa.dtsi>
9#include "ruuvi_ruuvitag-pinctrl.dtsi"
10#include <zephyr/dt-bindings/input/input-event-codes.h>
11
12/ {
13	model = "Ruuvi RuuviTag";
14	compatible = "ruuvi,ruuvitag";
15
16	chosen {
17		zephyr,console = &uart0;
18		zephyr,shell-uart = &uart0;
19		zephyr,uart-mcumgr = &uart0;
20		zephyr,bt-mon-uart = &uart0;
21		zephyr,bt-c2h-uart = &uart0;
22		zephyr,sram = &sram0;
23		zephyr,flash = &flash0;
24		zephyr,code-partition = &slot0_partition;
25	};
26
27	/* These aliases are provided for compatibility with samples */
28	aliases {
29		led0 = &led0;
30		led1 = &led1;
31		sw0 = &button0;
32		watchdog0 = &wdt0;
33		accel0 = &lis2dh12;
34	};
35
36	leds {
37		compatible = "gpio-leds";
38		led0: led_0 {
39			gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
40			label = "Red LED 0";
41		};
42		led1: led_1 {
43			gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
44			label = "Green LED 1";
45		};
46	};
47
48	buttons {
49		compatible = "gpio-keys";
50		button0: button_0 {
51			gpios = <&gpio0 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
52			label = "Push button switch 0";
53			zephyr,code = <INPUT_KEY_0>;
54		};
55	};
56};
57
58&reg {
59	regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
60};
61
62&adc {
63	status = "okay";
64};
65
66&gpiote {
67	status = "okay";
68};
69
70&gpio0 {
71	status = "okay";
72};
73
74&uart0 {
75	status = "okay";
76	compatible = "nordic,nrf-uart";
77	current-speed = <115200>;
78	pinctrl-0 = <&uart0_default>;
79	pinctrl-1 = <&uart0_sleep>;
80	pinctrl-names = "default", "sleep";
81};
82
83&spi0 {
84	compatible = "nordic,nrf-spi";
85	status = "okay";
86	cs-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>, <&gpio0 8 GPIO_ACTIVE_LOW>;
87
88	pinctrl-0 = <&spi0_default>;
89	pinctrl-1 = <&spi0_sleep>;
90	pinctrl-names = "default", "sleep";
91	bme280@0 {
92		compatible = "bosch,bme280";
93		reg = <0>;
94		spi-max-frequency = <10000000>;
95	};
96
97	lis2dh12: lis2dh12@1 {
98		compatible = "st,lis2dh", "st,lis2dh12";
99		reg = <1>;
100		spi-max-frequency = <10000000>;
101		irq-gpios =  <&gpio0 2 GPIO_ACTIVE_HIGH>, <&gpio0 6 GPIO_ACTIVE_HIGH>;
102	};
103};
104
105
106&flash0 {
107
108	partitions {
109		compatible = "fixed-partitions";
110		#address-cells = <1>;
111		#size-cells = <1>;
112
113		boot_partition: partition@0 {
114			label = "mcuboot";
115			reg = <0x00000000 0xc000>;
116		};
117		slot0_partition: partition@c000 {
118			label = "image-0";
119			reg = <0x0000C000 0x32000>;
120		};
121		slot1_partition: partition@3e000 {
122			label = "image-1";
123			reg = <0x0003E000 0x32000>;
124		};
125		scratch_partition: partition@70000 {
126			label = "image-scratch";
127			reg = <0x00070000 0xa000>;
128		};
129
130		/*
131		 * The flash starting at 0x0007a000 and ending at
132		 * 0x0007ffff (sectors 122-127) is reserved for use
133		 * by the application.
134		 * Storage partition will be used by FCB/LittleFS/NVS
135		 * if enabled.
136		 */
137		storage_partition: partition@7a000 {
138			label = "storage";
139			reg = <0x0007a000 0x00006000>;
140		};
141	};
142};
143