1/*
2 * Copyright (c) 2019 Jan Van Winkel <jan.van_winkel@dxplore.eu>
3 * Copyright (c) 2019 PHYTEC Messtechnik GmbH
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>
9
10/ {
11	chosen {
12		zephyr,display = &st7789v_st7789v_waveshare_240x240;
13	};
14
15	mipi_dbi_st7789v_waveshare_240x240 {
16		compatible = "zephyr,mipi-dbi-spi";
17		spi-dev = <&arduino_spi>;
18		dc-gpios = <&arduino_header 15 GPIO_ACTIVE_HIGH>;	/* D9 */
19		reset-gpios = <&arduino_header 14 GPIO_ACTIVE_LOW>;	/* D8 */
20		write-only;
21		#address-cells = <1>;
22		#size-cells = <0>;
23
24		st7789v_st7789v_waveshare_240x240: st7789v@0 {
25			compatible = "sitronix,st7789v";
26			mipi-max-frequency = <20000000>;
27			reg = <0>;
28			width = <240>;
29			height = <240>;
30			x-offset = <0>;
31			y-offset = <0>;
32			vcom = <0x19>;
33			gctrl = <0x35>;
34			vrhs = <0x12>;
35			vdvs = <0x20>;
36			mdac = <0x00>;
37			gamma = <0x01>;
38			colmod = <0x05>;
39			lcm = <0x2c>;
40			porch-param = [0c 0c 00 33 33];
41			cmd2en-param = [5a 69 02 01];
42			pwctrl1-param = [a4 a1];
43			pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23];
44			nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23];
45			ram-param = [00 F0];
46			rgb-param = [CD 08 14];
47			mipi-mode = <MIPI_DBI_MODE_SPI_4WIRE>;
48		};
49	};
50};
51
52&arduino_spi {
53	status = "okay";
54	cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>;	/* D10 */
55};
56