1/*
2 * Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6/dts-v1/;
7
8#include "espressif/esp32s3/esp32s3_wroom_n8r8.dtsi"
9#include "esp32s3_eye-pinctrl.dtsi"
10#include <zephyr/dt-bindings/input/input-event-codes.h>
11#include <zephyr/dt-bindings/input/esp32-touch-sensor-input.h>
12#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>
13#include <espressif/partitions_0x0_amp.dtsi>
14
15/ {
16	model = "Espressif ESP32S3-EYE PROCPU";
17	compatible = "espressif,esp32s3";
18
19	aliases {
20		i2c-0 = &i2c0;
21		watchdog0 = &wdt0;
22		sw0 = &button0;
23		led0 = &green_led;
24	};
25
26	chosen {
27		zephyr,sram = &sram1;
28		zephyr,console = &usb_serial;
29		zephyr,shell-uart = &usb_serial;
30		zephyr,flash = &flash0;
31		zephyr,code-partition = &slot0_partition;
32		zephyr,bt-hci = &esp32_bt_hci;
33		zephyr,display = &st7789v;
34		zephyr,camera = &lcd_cam;
35	};
36
37	buttons {
38		compatible = "gpio-keys";
39		button0: button_0 {
40			gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
41			label = "BOOT Button";
42			zephyr,code = <INPUT_KEY_0>;
43		};
44	};
45
46	adc-keys {
47		compatible = "adc-keys";
48		io-channels = <&adc0 0>;
49		keyup-threshold-mv = <3300>;
50		sample-period-ms = <50>;
51
52		menu_key {
53			press-thresholds-mv = <2800>;
54			zephyr,code = <INPUT_KEY_MENU>;
55		};
56
57		play_key {
58			press-thresholds-mv = <1920>;
59			zephyr,code = <INPUT_KEY_PLAY>;
60		};
61
62		up_key {
63			press-thresholds-mv = <350>;
64			zephyr,code = <INPUT_KEY_UP>;
65		};
66
67		down_key {
68			press-thresholds-mv = <800>;
69			zephyr,code = <INPUT_KEY_DOWN>;
70		};
71	};
72
73	leds {
74		compatible = "gpio-leds";
75		green_led: led0 {
76			gpios =  <&gpio0 3 GPIO_OPEN_DRAIN>;
77			label = "Power LED";
78		};
79	};
80
81	mipi_dbi {
82		compatible = "zephyr,mipi-dbi-spi";
83		dc-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
84		spi-dev = <&spi3>;
85		write-only;
86		#address-cells = <1>;
87		#size-cells = <0>;
88
89		st7789v: st7789v@0 {
90			compatible = "sitronix,st7789v";
91			mipi-max-frequency = <20000000>;
92			reg = <0>;
93			width = <240>;
94			height = <240>;
95			x-offset = <0>;
96			y-offset = <0>;
97			vcom = <0x19>;
98			gctrl = <0x35>;
99			vrhs = <0x12>;
100			vdvs = <0x20>;
101			mdac = <0x00>;
102			gamma = <0x01>;
103			colmod = <0x55>;
104			lcm = <0x2c>;
105			porch-param = [0c 0c 00 33 33];
106			cmd2en-param = [5a 69 02 01];
107			pwctrl1-param = [a4 a1];
108			pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23];
109			nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23];
110			ram-param = [00 F0];
111			rgb-param = [CD 08 14];
112			mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE";
113		};
114	};
115};
116
117&dma {
118	status = "okay";
119};
120
121&i2c1 {
122	status = "okay";
123	clock-frequency = <I2C_BITRATE_STANDARD>;
124	pinctrl-0 = <&i2c1_default>;
125	pinctrl-names = "default";
126	ov2640: ov2640@30 {
127			compatible = "ovti,ov2640";
128			reg = <0x30>;
129			status = "okay";
130			clock-rate-control = <0x80>;
131			port {
132					ov2640_ep_out: endpoint {
133							remote-endpoint = <&dvp_ep_in>;
134					};
135			};
136	};
137};
138
139&lcd_cam {
140	status = "okay";
141	cam-clk = < 10000000 >;
142	pinctrl-0 = <&lcd_cam_default>;
143	pinctrl-names = "default";
144	source = <&ov2640>;
145	dmas = <&dma 2>;
146	dma-names = "rx";
147	port {
148			dvp_ep_in: endpoint {
149					remote-endpoint = <&ov2640_ep_out>;
150			};
151	};
152};
153
154&usb_serial {
155	status = "okay";
156};
157
158&timer0 {
159	status = "okay";
160};
161
162&timer1 {
163	status = "okay";
164};
165
166&gpio0 {
167	status = "okay";
168};
169
170&gpio1 {
171	status = "okay";
172};
173
174&adc0 {
175	status = "okay";
176	#address-cells = <1>;
177	#size-cells = <0>;
178
179	channel@0 {
180		reg = <0>;
181		zephyr,gain = "ADC_GAIN_1_4";
182		zephyr,reference = "ADC_REF_INTERNAL";
183		zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
184		zephyr,resolution = <12>;
185	};
186};
187
188&spi3 {
189	#address-cells = <1>;
190	#size-cells = <0>;
191	status = "okay";
192	pinctrl-0 = <&spim3_default>;
193	pinctrl-names = "default";
194};
195
196&wdt0 {
197	status = "okay";
198};
199
200&trng0 {
201	status = "okay";
202};
203
204&esp32_bt_hci {
205	status = "okay";
206};
207