-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBridgetek_EVE2_2.cpp
More file actions
246 lines (237 loc) · 7.46 KB
/
Bridgetek_EVE2_2.cpp
File metadata and controls
246 lines (237 loc) · 7.46 KB
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
/**
* @file Bridgetek_EVE2_2.cpp
* @brief Support BT880/BT881/BT882/BT883
*/
/*
* ============================================================================
* (C) Copyright, Bridgetek Pte. Ltd.
* ============================================================================
*
* This source code ("the Software") is provided by Bridgetek Pte Ltd
* ("Bridgetek") subject to the licence terms set out
* https://brtchip.com/wp-content/uploads/2021/11/BRT_Software_License_Agreement.pdf ("the Licence Terms").
* You must read the Licence Terms before downloading or using the Software.
* By installing or using the Software you agree to the Licence Terms. If you
* do not agree to the Licence Terms then do not download or use the Software.
*
* Without prejudice to the Licence Terms, here is a summary of some of the key
* terms of the Licence Terms (and in the event of any conflict between this
* summary and the Licence Terms then the text of the Licence Terms will
* prevail).
*
* The Software is provided "as is".
* There are no warranties (or similar) in relation to the quality of the
* Software. You use it at your own risk.
* The Software should not be used in, or for, any medical device, system or
* appliance. There are exclusions of Bridgetek liability for certain types of loss
* such as: special loss or damage; incidental loss or damage; indirect or
* consequential loss or damage; loss of income; loss of business; loss of
* profits; loss of revenue; loss of contracts; business interruption; loss of
* the use of money or anticipated savings; loss of information; loss of
* opportunity; loss of goodwill or reputation; and/or loss of, damage to or
* corruption of data.
* There is a monetary cap on Bridgetek's liability.
* The Software may have subsequently been amended by another user and then
* distributed by that other user ("Adapted Software"). If so that user may
* have additional licence terms that apply to those amendments. However, Bridgetek
* has no liability in relation to those amendments.
* ============================================================================
*/
#include "Arduino.h"
#include "Bridgetek_EVE2_2.h"
uint32_t EVE_DISP_WIDTH, EVE_DISP_HEIGHT;
uint32_t EVE_DISP_HCYCLE, EVE_DISP_VCYCLE;
uint32_t EVE_DISP_HOFFSET, EVE_DISP_VOFFSET;
uint32_t EVE_DISP_HSYNC0, EVE_DISP_HSYNC1, EVE_DISP_VSYNC0, EVE_DISP_VSYNC1;
uint32_t EVE_DISP_PCLKPOL, EVE_DISP_SWIZZLE, EVE_DISP_CSPREAD, EVE_DISP_DITHER;
uint32_t EVE_DISP_PCLK, EVE_DISP_PCLK_FREQ;
uint32_t EVE_TOUCH_ADDR;
Bridgetek_EVE2_2::Bridgetek_EVE2_2(void)
{
}
void Bridgetek_EVE2_2::setup(uint32_t panel)
{
setpanel(panel);
}
uint16_t Bridgetek_EVE2_2::DISP_WIDTH(void)
{
return EVE_DISP_WIDTH;
}
uint16_t Bridgetek_EVE2_2::DISP_HEIGHT(void)
{
return EVE_DISP_HEIGHT;
}
void Bridgetek_EVE2_2::setpanel(uint32_t panel)
{
if (panel == QVGA)
{
EVE_DISP_WIDTH = 320;
EVE_DISP_HEIGHT = 240;
EVE_DISP_HCYCLE = 408;
EVE_DISP_VCYCLE = 263;
EVE_DISP_HOFFSET = 70;
EVE_DISP_VOFFSET = 13;
EVE_DISP_HSYNC0 = 0;
EVE_DISP_HSYNC1 = 10;
EVE_DISP_VSYNC0 = 0;
EVE_DISP_VSYNC1 = 2;
EVE_DISP_PCLKPOL = 0;
EVE_DISP_SWIZZLE = 2;
EVE_DISP_CSPREAD = 0;
EVE_DISP_DITHER = 1;
EVE_DISP_PCLK = 8;
EVE_DISP_PCLK_FREQ = 0x8A1;
// Default - automatic
EVE_TOUCH_ADDR = 0;
}
else if (panel == WQVGA)
{
EVE_DISP_WIDTH = 480;
EVE_DISP_HEIGHT = 272;
EVE_DISP_HCYCLE = 548;
EVE_DISP_VCYCLE = 292;
EVE_DISP_HOFFSET = 43;
EVE_DISP_VOFFSET = 12;
EVE_DISP_HSYNC0 = 0;
EVE_DISP_HSYNC1 = 41;
EVE_DISP_VSYNC0 = 0;
EVE_DISP_VSYNC1 = 10;
EVE_DISP_PCLKPOL = 1;
EVE_DISP_SWIZZLE = 0;
EVE_DISP_CSPREAD = 0;
EVE_DISP_DITHER = 1;
EVE_DISP_PCLK = 5;
EVE_DISP_PCLK_FREQ = 0x8A1;
// Default - automatic
EVE_TOUCH_ADDR = 0;
}
else if (panel == WVGA)
{
EVE_DISP_WIDTH = 800;
EVE_DISP_HEIGHT = 480;
EVE_DISP_HCYCLE = 928;
EVE_DISP_VCYCLE = 525;
EVE_DISP_HOFFSET = 88;
EVE_DISP_VOFFSET = 32;
EVE_DISP_HSYNC0 = 0;
EVE_DISP_HSYNC1 = 48;
EVE_DISP_VSYNC0 = 0;
EVE_DISP_VSYNC1 = 3;
EVE_DISP_PCLKPOL = 1;
EVE_DISP_SWIZZLE = 0;
EVE_DISP_CSPREAD = 0;
EVE_DISP_DITHER = 1;
EVE_DISP_PCLK = 2;
EVE_DISP_PCLK_FREQ = 0x8A1;
// Default - automatic
EVE_TOUCH_ADDR = 0;
}
else if (panel == WSVGA)
{
EVE_DISP_WIDTH = 1024;
EVE_DISP_HEIGHT = 600;
EVE_DISP_HCYCLE = 1344;
EVE_DISP_VCYCLE = 635;
EVE_DISP_HOFFSET = 160;
EVE_DISP_VOFFSET = 23;
EVE_DISP_HSYNC0 = 0;
EVE_DISP_HSYNC1 = 100;
EVE_DISP_VSYNC0 = 0;
EVE_DISP_VSYNC1 = 10;
EVE_DISP_PCLKPOL = 1;
EVE_DISP_SWIZZLE = 0;
EVE_DISP_CSPREAD = 0;
EVE_DISP_DITHER = 1;
EVE_DISP_PCLK = 1;
EVE_DISP_PCLK_FREQ = 0xd12;
// Default - automatic
EVE_TOUCH_ADDR = 0;
}
else if (panel == WXGA)
{
EVE_DISP_WIDTH = 1280;
EVE_DISP_HEIGHT = 800;
EVE_DISP_HCYCLE = 1411;
EVE_DISP_VCYCLE = 815;
EVE_DISP_HOFFSET = 120;
EVE_DISP_VOFFSET = 14;
EVE_DISP_HSYNC0 = 0;
EVE_DISP_HSYNC1 = 100;
EVE_DISP_VSYNC0 = 0;
EVE_DISP_VSYNC1 = 10;
EVE_DISP_PCLKPOL = 0;
EVE_DISP_SWIZZLE = 0;
EVE_DISP_CSPREAD = 0;
EVE_DISP_DITHER = 0;
EVE_DISP_PCLK = 1;
EVE_DISP_PCLK_FREQ = 0x8B1;
// Default - automatic
EVE_TOUCH_ADDR = 0;
}
else if (panel == FULLHD)
{
EVE_DISP_WIDTH = 1920;
EVE_DISP_HEIGHT = 1080;
EVE_DISP_HCYCLE = 2140;
EVE_DISP_VCYCLE = 1108;
EVE_DISP_HOFFSET = 220;
EVE_DISP_VOFFSET = 28;
EVE_DISP_HSYNC0 = 0;
EVE_DISP_HSYNC1 = 20;
EVE_DISP_VSYNC0 = 0;
EVE_DISP_VSYNC1 = 4;
EVE_DISP_PCLKPOL = 0;
EVE_DISP_SWIZZLE = 0;
EVE_DISP_CSPREAD = 0;
EVE_DISP_DITHER = 1;
EVE_DISP_PCLK = 1;
EVE_DISP_PCLK_FREQ = 0x8B1;
// Default - automatic
EVE_TOUCH_ADDR = 0;
}
else if (panel == WUXGA)
{
EVE_DISP_WIDTH = 1920;
EVE_DISP_HEIGHT = 1200;
EVE_DISP_HCYCLE = (1920 + 180);
EVE_DISP_VCYCLE = (1200 + 45);
EVE_DISP_HOFFSET = 50;
EVE_DISP_VOFFSET = 10;
EVE_DISP_HSYNC0 = 0;
EVE_DISP_HSYNC1 = 30;
EVE_DISP_VSYNC0 = 0;
EVE_DISP_VSYNC1 = 3;
EVE_DISP_PCLKPOL = 0;
EVE_DISP_SWIZZLE = 0;
EVE_DISP_CSPREAD = 0;
EVE_DISP_DITHER = 1;
EVE_DISP_PCLK_FREQ = 0x8B1;
// Default - automatic
EVE_TOUCH_ADDR = 0;
}
else if (panel == WQVGAR)
{
EVE_DISP_WIDTH = 480;
EVE_DISP_HEIGHT = 480;
EVE_DISP_HCYCLE = 578;
EVE_DISP_VCYCLE = 576;
EVE_DISP_HOFFSET = 40;
EVE_DISP_VOFFSET = 12;
EVE_DISP_HSYNC0 = 0;
EVE_DISP_HSYNC1 = 40;
EVE_DISP_VSYNC0 = 0;
EVE_DISP_VSYNC1 = 10;
EVE_DISP_PCLKPOL = 0;
EVE_DISP_SWIZZLE = 0;
EVE_DISP_CSPREAD = 0;
EVE_DISP_DITHER = 1;
EVE_DISP_PCLK_FREQ = 0x8A1;
// Default - automatic
EVE_TOUCH_ADDR = 0;
}
else
{
// Panel type not defined.
Serial.print("ERROR: No panel selected!\n");
}
}