1/*
2 * Copyright (c) 2024 Luis Ubieda
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <nordic/nrf52840_qiaa.dtsi>
9#include "croxel_cx1825_nrf52840-pinctrl.dtsi"
10#include <zephyr/dt-bindings/input/input-event-codes.h>
11
12/ {
13	model = "Croxel CX1825 NRF52840";
14	compatible = "croxel,cx1825-nrf52840";
15
16	chosen {
17		zephyr,sram = &sram0;
18		zephyr,flash = &flash0;
19		zephyr,code-partition = &slot0_partition;
20	};
21
22	leds {
23		compatible = "gpio-leds";
24		led0: led_0 {
25			gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
26			label = "Red LED";
27		};
28		led1: led_1 {
29			gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
30			label = "Green LED";
31		};
32	};
33
34	buttons {
35		compatible = "gpio-keys";
36		button0: button_0 {
37			gpios = <&gpio0 16 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
38			label = "Push button switch 0";
39			zephyr,code = <INPUT_KEY_0>;
40		};
41	};
42
43	/* These aliases are provided for compatibility with samples */
44	aliases {
45		led0 = &led0;
46		led1 = &led1;
47		sw0 = &button0;
48		bootloader-led0 = &led0;
49		mcuboot-button0 = &button0;
50		mcuboot-led0 = &led0;
51		watchdog0 = &wdt0;
52		dht0 = &hts221;
53		accel0 = &lis3dh;
54		prox-sensor0 = &apds9960;
55	};
56};
57
58&reg0 {
59	status = "okay";
60};
61
62&reg1 {
63	regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
64};
65
66&adc {
67	status = "okay";
68};
69
70&uicr {
71	gpio-as-nreset;
72};
73
74&gpiote {
75	status = "okay";
76};
77
78&gpio0 {
79	status = "okay";
80};
81
82&gpio1 {
83	status = "okay";
84};
85
86&pwm0 {
87	status = "okay";
88	pinctrl-0 = <&pwm0_default>;
89	pinctrl-1 = <&pwm0_sleep>;
90	pinctrl-names = "default", "sleep";
91};
92
93&i2c0 {
94	compatible = "nordic,nrf-twi";
95	status = "okay";
96	pinctrl-0 = <&i2c0_default>;
97	pinctrl-1 = <&i2c0_sleep>;
98	pinctrl-names = "default", "sleep";
99
100	hts221: hts221@5f {
101		compatible = "st,hts221";
102		status = "okay";
103		reg = <0x5f>;
104		drdy-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
105	};
106
107	lps22hb: lps22hb-press@5c {
108		compatible = "st,lps22hb-press";
109		status = "okay";
110		reg = <0x5c>;
111	};
112
113	apds9960: apds9960@39 {
114		compatible = "avago,apds9960";
115		status = "okay";
116		reg = <0x39>;
117		int-gpios = <&gpio0 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
118	};
119
120	lis3dh: lis3dh@18 {
121		compatible = "st,lis3dh", "st,lis2dh";
122		status = "okay";
123		reg = <0x18>;
124		irq-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
125	};
126};
127
128zephyr_udc0: &usbd {
129	compatible = "nordic,nrf-usbd";
130	status = "okay";
131};
132
133#include <../boards/common/usb/cdc_acm_serial.dtsi>
134
135&flash0 {
136
137	partitions {
138		compatible = "fixed-partitions";
139		#address-cells = <1>;
140		#size-cells = <1>;
141
142		boot_partition: partition@0 {
143			label = "mcuboot";
144			reg = <0x00000000 0x0000C000>;
145		};
146		slot0_partition: partition@c000 {
147			label = "image-0";
148			reg = <0x0000C000 0x00076000>;
149		};
150		slot1_partition: partition@82000 {
151			label = "image-1";
152			reg = <0x00082000 0x00076000>;
153		};
154
155		/*
156		 * Storage partition will be used by FCB/LittleFS/NVS
157		 * if enabled.
158		 */
159		storage_partition: partition@f8000 {
160			label = "storage";
161			reg = <0x000f8000 0x00008000>;
162		};
163	};
164};
165