1/*
2 * Copyright (c) 2020, Kim Bøndergaard, <kim@fam-boendergaard.dk>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>
8
9/ {
10	chosen {
11		zephyr,display = &st7735r_st7735r_ada_160x128;
12	};
13
14	mipi_dbi_st7735r_ada_160x128 {
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		#address-cells = <1>;
20		#size-cells = <0>;
21
22		st7735r_st7735r_ada_160x128: st7735r@0 {
23			compatible = "sitronix,st7735r";
24			mipi-max-frequency = <20000000>;
25			mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE";
26			reg = <0>;
27			width = <160>;
28			height = <128>;
29			x-offset = <0>;
30			y-offset = <0>;
31			madctl = <0x60>;
32			colmod = <0x55>;
33			vmctr1 = <0x0e>;
34			pwctr1 = [a2 02 84];
35			pwctr2 = [c5];
36			pwctr3 = [0a 00];
37			pwctr4 = [8a 2a];
38			pwctr5 = [8a ee];
39			frmctr1 = [01 2c 2d];
40			frmctr2 = [01 2c 2d];
41			frmctr3 = [01 2c 2d 01 2c 2d];
42			gamctrp1 = [02 1c 07 12 37 32 29 2d 29 25 2b 39 00 01 03 10];
43			gamctrn1 = [03 1d 07 06 2e 2c 29 2d 2e 2e 37 3f 00 00 02 10];
44		};
45	};
46};
47
48&arduino_spi {
49	status = "okay";
50	cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>;	/* D10 */
51};
52