1/*
2 * Copyright (c) 2019 Brett Witherspoon
3 * Copyright (c) 2020 Friedt Professional Engineering Services, Inc
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8/dts-v1/;
9
10#include <ti/cc1352r.dtsi>
11#include "../common/boosterpack_connector.dtsi"
12#include "cc1352r_sensortag-pinctrl.dtsi"
13#include <zephyr/dt-bindings/input/input-event-codes.h>
14
15#define BTN_GPIO_FLAGS (GPIO_ACTIVE_LOW | GPIO_PULL_UP)
16
17/ {
18	model = "TI CC1352R1 SensorTag";
19	compatible = "ti,sensortag-cc1352r";
20
21	aliases {
22		led0 = &led0;
23		led1 = &led1;
24		led2 = &led2;
25		sw0 = &btn0;
26		sw1 = &btn1;
27		sensor0 = &sensor0;
28		sensor1 = &sensor1;
29		sensor2 = &sensor2;
30		accel0 = &sensor1;
31		watchdog0 = &wdt0;
32		mcuboot-led0 = &led1;
33		mcuboot-button0 = &btn1;
34	};
35
36	chosen {
37		zephyr,sram = &sram0;
38		zephyr,flash = &flash0;
39		zephyr,console = &uart0;
40		zephyr,shell-uart = &uart0;
41		zephyr,ieee802154 = &ieee802154;
42		zephyr,code-partition = &slot0_partition;
43	};
44
45	leds {
46		compatible = "gpio-leds";
47		led0: led_0 {
48			gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
49			label = "Green LED";
50		};
51		led1: led_1 {
52			gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
53			label = "Red LED";
54		};
55		led2: led_2 {
56			gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>;
57			label = "Blue LED";
58		};
59	};
60
61	keys {
62		compatible = "gpio-keys";
63		btn0: btn_0 {
64			gpios = <&gpio0 15 BTN_GPIO_FLAGS>;
65			label = "Push button 1";
66			zephyr,code = <INPUT_KEY_0>;
67		};
68		btn1: btn_1 {
69			gpios = <&gpio0 14 BTN_GPIO_FLAGS>;
70			label = "Push button 2";
71			zephyr,code = <INPUT_KEY_1>;
72		};
73	};
74};
75
76&flash0 {
77	partitions {
78		/* 40 KiB (0xa000) for MCUboot */
79		boot_partition: partition@0 {
80			label = "mcuboot";
81			reg = <0x00000000 0x0000a000>;
82		};
83
84		/* 136 KiB (0x22000) per slot for application */
85		slot0_partition: partition@a000 {
86			label = "image-0";
87			reg = <0x0000a000 0x00022000>;
88		};
89
90		slot1_partition: partition@2c000 {
91			label = "image-1";
92			reg = <0x0002c000 0x00022000>;
93		};
94
95		/* 32 KiB (0x8000) for storage */
96		storage_partition: partition@4e000 {
97			label = "storage";
98			reg = <0x0004e000 0x00008000>;
99		};
100
101		/* CCFG (customer configuration area) is located in uppermost
102		 * flash sector (0x2000/8 KiB @ 0x56000), keep it unused.
103		 */
104	};
105};
106
107&cpu0 {
108	clock-frequency = <48000000>;
109};
110
111&trng {
112	status = "okay";
113};
114
115&gpio0 {
116	status = "okay";
117};
118
119&adc0 {
120	status = "okay";
121};
122
123&uart0 {
124	status = "okay";
125	current-speed = <115200>;
126	pinctrl-0 = <&uart0_rx_default &uart0_tx_default>;
127	pinctrl-names = "default";
128};
129
130&i2c0 {
131	status = "okay";
132	pinctrl-0 = <&i2c0_scl_default &i2c0_sda_default>;
133	pinctrl-1 = <&i2c0_scl_sleep &i2c0_sda_sleep>;
134	pinctrl-names = "default", "sleep";
135
136	sensor0: sensor@44 {
137		compatible = "ti,opt3001";
138		reg = <0x44>;
139	};
140
141	sensor2: sensor@41 {
142		compatible = "ti,hdc2080";
143		reg = <0x41>;
144		int-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
145	};
146};
147
148&spi0 {
149	status = "okay";
150	pinctrl-0 = <&spi0_sck_default &spi0_mosi_default
151				 &spi0_miso_default>;
152	pinctrl-names = "default";
153	cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
154
155	sensor1: sensor@0 {
156		compatible = "adi,adxl362";
157		reg = <0>;
158		int1-gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>;
159		spi-max-frequency = <8000000>;
160	};
161
162	/* TODO: "jedec,spi-nor" for the mx25r8035 */
163};
164
165&radio {
166	status = "okay";
167};
168
169&ieee802154 {
170	status = "okay";
171};
172
173&ieee802154g {
174	status = "okay";
175};
176
177&wdt0 {
178	status = "okay";
179};
180