1/*
2 * Copyright (c) 2022 Andreas Sandberg
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include "waveshare_epaper_common.dtsi"
8
9/ {
10	chosen {
11		zephyr,display = &uc8176_waveshare_epaper_gdew042t2_p;
12	};
13
14	mipi_dbi_waveshare_epaper_gdew042t2-p {
15		compatible = "zephyr,mipi-dbi-spi";
16		spi-dev = <&arduino_spi>;
17		dc-gpios = <&arduino_header 15 GPIO_ACTIVE_HIGH>;	/* D9 */
18		reset-gpios = <&arduino_header 14 GPIO_ACTIVE_LOW>;	/* D8 */
19		write-only;
20		#address-cells = <1>;
21		#size-cells = <0>;
22
23		/*
24		 * GoodDisplay GDEW042T2 with fast partial refresh. Based on
25		 * configuration from GoodDisplay's Arduino example.
26		 */
27		uc8176_waveshare_epaper_gdew042t2_p: uc8176@0 {
28			compatible = "gooddisplay,gdew042t2", "ultrachip,uc8176";
29			mipi-max-frequency = <4000000>;
30			reg = <0>;
31			width = <400>;
32			height = <300>;
33			busy-gpios = <&arduino_header 13 GPIO_ACTIVE_LOW>; /* D7 */
34
35			softstart = [ 17 17 17 ];
36
37			full {
38				cdi = <0x07>;
39			};
40
41			partial {
42				pwr = [ 03 02 2b 2b ];
43				cdi = <0x07>;
44				pll = <0x3c>;
45				vdcs = <0x08>;
46
47				lutc = [
48					00 01 0E 00 00 01
49					00 00 00 00 00 00
50					00 00 00 00 00 00
51					00 00 00 00 00 00
52					00 00 00 00 00 00
53					00 00 00 00 00 00
54					00 00 00 00 00 00
55					00 00
56				];
57
58				lutww = [
59					00 01 0E 00 00 01
60					00 00 00 00 00 00
61					00 00 00 00 00 00
62					00 00 00 00 00 00
63					00 00 00 00 00 00
64					00 00 00 00 00 00
65					00 00 00 00 00 00
66				];
67
68				lutkw = [
69					20 01 0E 00 00 01
70					00 00 00 00 00 00
71					00 00 00 00 00 00
72					00 00 00 00 00 00
73					00 00 00 00 00 00
74					00 00 00 00 00 00
75					00 00 00 00 00 00
76				];
77
78				lutwk = [
79					10 01 0E 00 00 01
80					00 00 00 00 00 00
81					00 00 00 00 00 00
82					00 00 00 00 00 00
83					00 00 00 00 00 00
84					00 00 00 00 00 00
85					00 00 00 00 00 00
86				];
87
88				lutkk = [
89					00 01 0E 00 00 01
90					00 00 00 00 00 00
91					00 00 00 00 00 00
92					00 00 00 00 00 00
93					00 00 00 00 00 00
94					00 00 00 00 00 00
95					00 00 00 00 00 00
96				];
97			};
98		};
99	};
100};
101