This repository has been archived by the owner on May 10, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
gc9a01-overlay.dts
153 lines (140 loc) · 6.06 KB
/
gc9a01-overlay.dts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*
Device Tree overlay for Galaxycore GC9A01A single chip driver
for use on SPI TFT LCD, 240x240 65K RGB
Based on Galaxycore's GC9A01A datasheet Rev.1.0 (2019/07/02)
Copyright (C) 2022, Julianno F. C. Silva (@juliannojungle)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/agpl-3.0.html>.
Init sequence partially based on Waveshare team's Arduino LCD_Driver V1.0 (2020/12/09).
Permission is hereby granted, free of UBYTEge, to any person obtaining a copy
of this software and associated documnetation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
*/
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
fragment@0 {
target = <&spi0>;
__overlay__ {
status = "okay";
spidev@0 {
status = "disabled";
};
};
};
fragment@1 {
target = <&gpio>;
__overlay__ {
gc9a01_pins: gc9a01_pins {
brcm,pins = <25 27>;
brcm,function = <1 1>; /* out */
brcm,pull = <0 0>; /* none */
};
};
};
fragment@2 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
gc9a01: gc9a01@0 {
compatible = "ilitek,ili9340";
reg = <0>;
pinctrl-names = "default";
pinctrl-0 = <&gc9a01_pins>;
reset-gpios = <&gpio 27 1>;
dc-gpios = <&gpio 25 0>;
led-gpios = <&gpio 18 0>;
spi-max-frequency = <40000000>;
buswidth = <8>;
width = <240>;
height = <240>;
rotate = <0>;
fps = <50>;
bgr;
debug = <0>;
init = <
0x01000011 /* Sleep mode OFF */
0x02000078 /* Delay 120ms */
0x010000EF /* Inter register enable 2 */
0x010000EB 0x14
/* BEGIN set inter_command HIGH */
0x010000FE /* Inter register enable 1 */
0x010000EF /* Inter register enable 2 */
/* END set inter_command HIGH */
0x010000EB 0x14
0x01000084 0x40
0x01000085 0xFF
0x01000086 0xFF
0x01000087 0xFF
0x01000088 0x0A
0x01000089 0x21
0x0100008A 0x00
0x0100008B 0x80
0x0100008C 0x01
0x0100008D 0x01
0x0100008E 0xFF
0x0100008F 0xFF
0x010000B6 0x00 0x00 /* Display function control */
0x01000036 0x08 /* Memory access control */
0x0100003A 0x05 /* Pixel format */
0x01000090 0x08 0x08 0x08 0x08
0x010000BD 0x06
0x010000BC 0x00
0x010000FF 0x60 0x01 0x04
0x010000C3 0x13 /* Voltage regulator 1a */
0x010000C4 0x13 /* Voltage regulator 1b */
0x010000C9 0x22 /* Voltage regulator 2a */
0x010000BE 0x11
0x010000E1 0x10 0x0E
0x010000DF 0x21 0x0c 0x02
0x010000F0 0x45 0x09 0x08 0x08 0x26 0x2A /* Set gamma1 */
0x010000F1 0x43 0x70 0x72 0x36 0x37 0x6F /* Set gamma2 */
0x010000F2 0x45 0x09 0x08 0x08 0x26 0x2A /* Set gamma3 */
0x010000F3 0x43 0x70 0x72 0x36 0x37 0x6F /* Set gamma4 */
0x010000ED 0x1B 0x0B
0x010000AE 0x77
0x010000CD 0x63
0x01000070 0x07 0x07 0x04 0x0E 0x0F 0x09 0x07 0x08 0x03
0x010000E8 0x34 /* Frame rate */
0x01000062 0x18 0x0D 0x71 0xED 0x70 0x70 0x18 0x0F 0x71 0xEF 0x70 0x70
0x01000063 0x18 0x11 0x71 0xF1 0x70 0x70 0x18 0x13 0x71 0xF3 0x70 0x70
0x01000064 0x28 0x29 0xF1 0x01 0xF1 0x00 0x07
0x01000066 0x3C 0x00 0xCD 0x67 0x45 0x45 0x10 0x00 0x00 0x00
0x01000067 0x00 0x3C 0x00 0x00 0x00 0x01 0x54 0x10 0x32 0x98
0x01000074 0x10 0x85 0x80 0x00 0x00 0x4E 0x00
0x01000098 0x3e 0x07
0x01000035 /* Tearing effect ON */
0x01000021 /* Display inversion ON */
0x01000011 /* Sleep mode OFF */
0x0200000C /* Delay 12ms */
0x01000029 /* Display ON */
0x02000014 /* Delay 20ms */
>;
};
};
};
__overrides__ {
speed = <&gc9a01>,"spi-max-frequency:0";
rotate = <&gc9a01>,"rotate:0";
width = <&gc9a01>,"width:0";
height = <&gc9a01>,"height:0";
fps = <&gc9a01>,"fps:0";
debug = <&gc9a01>,"debug:0";
};
};