forked from RudolphRiedel/FT800-FT813
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EVE_config.h
1178 lines (998 loc) · 39.1 KB
/
EVE_config.h
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
@file EVE_config.h
@brief configuration information for some TFTs
@version 5.0
@date 2022-03-19
@author Rudolph Riedel
@section LICENSE
MIT License
Copyright (c) 2016-2022 Rudolph Riedel
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation 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 furnished 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.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@section History
4.0
- renamed from EVE_config.h to EVE_config.h
- renamed EVE_81X_ENABLE to FT81X_ENABLE
- added a fictitious BT81x entry under the made-up name EVE_EVE3_70G, just to see the project compile with additional BT81x includes and functions
- added profiles for the BT81x 4.3", 5" and 7" modules from Riverdi - the only tested is the 4.3" with a RVT43ULBNWC00
- moved all target specific lines from EVE_config.h to EVE_target.h
- cleaned up history
- added profiles for EVE3-35G, EVE3-43G, EVE3-50G
- added a profile for the CFAF800480E0-050SC from Crystalfontz
- changed EVE_RiTFT50 to use the RVT70 config instead of the RVT50 config since RVT50 uses a different HOFFSET value
- added EVE_PAF90, a profile for the PAF90B5WFNWC01 from Panasys
- added EVE_EVE3_35, EVE_EVE3_43, EVE_EVE3_50 and EVE_EVE3_70 - the resistive touch BT816 versions of the EVE3 series
- added a profile for the Sunflower Arduino Shield
- looked into adding Gameduino3 / Gameduino3X profiles but there are no documented timing parameters for these panels
- added a profile for the MikroElektronika ConnectEVE module
- added a profile for the CFAF240400C0-030SC from Crystalfontz
- added a profile for the CFAF480128A0-039TC from Crystalfontz
- added a profile for the CFAF320240F-035T from Crystalfontz
- condensed several equal timing sets into fewer profiles
- added 4D Systems GEN4-FT81x-xx profiles
- removed parameter: EVE_CSPREAD - left on default=1 for all displays now
- adjusted several PCLK settings to bring the frame-rates closer to 60Hz
- sorted displays by resolution
- added profiles for EVE3x-39A/EVE3x-39G
- updated EVE3x-39A/EVE3x-39G profiles
- added EVE_NHD_43_800480 for the NHD-4.3-800480FT-CSXP-CTP from Newhaven
5.0
- re-added the EVE_CSPREAD parameters to all profiles
- added a profile for the Gameduino3 shield
- cleanup: removed FT80x profiles
- replaced FT81x_enable and BT81x_enable with "EVE_GEN n"
- added a couple of test profiles for BT817
- moved the profile for the RiTFT50 over to the one for the RiTFT70
- added a profile for the VM816C50A-D from Bridgetek
- added a profile for PH800480T024-IFC03 and PH800480T013-IFC05 from PowerTip
- added profiles for EVE4_40G and EVE4_101G from Matrix Orbital
- added profiles for the EVE4 series modules from Riverdi
- tuned the profile for the RVT101H a little
- sorted the display-defines by chip
- added a profile for the EVE4x-70G IPS from Matrix Orbital
- added a profile for RiTFT35 from Riverdi
- changed the clock-polarity for EVE_EVE4_70G
- added a profile for CFAF800480Ex-050SC-A2 modules from Crystalfontz
- removed the define for the selected configuration to allow setting the define in the build-enviroment instead
- added an error message if no valid define was setup and therefore no set of parameters is configured
- converted all TABs to SPACEs
- removed EVE_TOUCH_RZTHRESH as it only applies to resistive touch screens and as EVE_init() still writes it if the define exists in can be configured thru project options
- added EVE_Display_Parameters_t to be used with an additional init function, still not sure how to procede exactly
- split the settings for EVE_RiTFT70 and EVE_RiTFT50 after a report for the EVE_RiTFT70 not working properly and confirmation
that the provided alternative parameters do work, the EVE_RiTFT50 however are confirmed to be working with the IOT5
- commented out EVE_Display_Parameters_t for now
*/
#ifndef EVE_CONFIG_H
#define EVE_CONFIG_H
#pragma once
/* define one of these in your build-enviroment to select the settings for the TFT attached */
#if 0
/* BT817 / BT818 */
#define EVE_RVT35H
#define EVE_RVT43H
#define EVE_RVT50H
#define EVE_RVT70H
#define EVE_RVT101H
#define EVE_EVE4_40G
#define EVE_EVE4_70G
#define EVE_EVE4_101G
#define EVE_CFAF800480Ex_050SC_A2
/* BT815 / BT816 */
#define EVE_VM816C50AD
#define EVE_PAF90
#define EVE_RiTFT35
#define EVE_RiTFT43
#define EVE_RiTFT50
#define EVE_RiTFT70
#define EVE_EVE3_35
#define EVE_EVE3_35G
#define EVE_EVE3_43
#define EVE_EVE3_43G
#define EVE_EVE3_50
#define EVE_EVE3_50G
#define EVE_EVE3_70
#define EVE_EVE3_70G
#define EVE_EVE3x_39
#define EVE_EVE3x_39G
/* FT812 / F813 */
#define EVE_ME812A
#define EVE_ME813A
#define EVE_ET07
#define EVE_RVT50
#define EVE_RVT70
#define EVE_EVE2_29
#define EVE_EVE2_35
#define EVE_EVE2_35G
#define EVE_EVE2_38
#define EVE_EVE2_38G
#define EVE_EVE2_43
#define EVE_EVE2_43G
#define EVE_EVE2_50
#define EVE_EVE2_50G
#define EVE_EVE2_70
#define EVE_EVE2_70G
#define EVE_NHD_35
#define EVE_NHD_43
#define EVE_NHD_43_800480
#define EVE_NHD_50
#define EVE_NHD_70
#define EVE_ADAM101
#define EVE_CFAF240400C1_030SC
#define EVE_CFAF320240F_035T
#define EVE_CFAF480128A0_039TC
#define EVE_CFAF800480E0_050SC
#define EVE_GEN4_FT81x_43
#define EVE_GEN4_FT812_50
#define EVE_GEN4_FT812_70
#define EVE_GEN4_FT813_50
#define EVE_GEN4_FT813_70
#define EVE_SUNFLOWER
#define EVE_PH800480
/* F810 / F811 */
#define EVE_VM810C
#define EVE_FT810CB_HY50HD
#define EVE_FT811CB_HY50HD
#endif
#if 0
typedef struct
{
uint16_t hsize; /* valid range: 12 bits / 0-4095, Thd, length of the visible part of a line (in PCLKs) - active display width */
uint16_t vsize; /* valid range: 12 bits / 0-4095, Tvd, number of visible lines (in lines) - active display height */
uint16_t hsync0; /* valid range: 12 bits / 0-4095, Thf, Horizontal Front Porch */
uint16_t hsync1; /* valid range: 12 bits / 0-4095, Tvf + Tvp, Vertical Front Porch plus Vsync Pulse width */
uint16_t hoffset; /* valid range: 12 bits / 0-4095, Thf + Thp + Thb, length of non-visible part of line (in PCLK cycles) */
uint16_t hcycle; /* valid range: 12 bits / 0-4095, Th, total length of line (visible and non-visible) (in PCLKs) */
uint16_t vsync0; /* valid range: 12 bits / 0-4095, Tvf, Vertical Front Porch */
uint16_t vsync1; /* valid range: 12 bits / 0-4095, Tvf + Tvp, Vertical Front Porch plus Vsync Pulse width */
uint16_t voffset; /* valid range: 12 bits / 0-4095, Tvf + Tvp + Tvb Number of non-visible lines (in lines) */
uint16_t vcycle; /* valid range: 12 bits / 0-4095, Tv, total number of lines (visible and non-visible) (in lines) */
uint8_t swizzle; /* 4 bits, controls the arrangement of the output colour pins */
uint8_t pclkpol; /* 1 bit, 0 = rising edge, 1 = falling edge */
uint8_t cspread; /* helps with noise, when set to 1 fewer signals are changed simultaneously, reset-default: 1 */
uint8_t pclk; /* pixel-clock divider, 0 = no PCLK output, 1 = use second PLL for pixel-clock in BT817 / BT818 */
uint32_t pclk_freq; /* frequency in Hz for BT817 / BT818 to be used with EVE_cmd_pclkfreq() in order to write REG_PCLK_FREQ */
uint8_t pwm_duty; /* valid range: 0-128, backlight PWM level, 0 = off, 128 = max */
bool has_crystal;
bool has_gt911;
} EVE_Display_Parameters_t;
#endif
/* display timing parameters below */
/* ----------- 320 x 240 ----------- */
/* EVE2-35A 320x240 3.5" Matrix Orbital, resistive, or non-touch, FT812 */
#if defined (EVE_EVE2_35)
#define Resolution_320x240
#define EVE_PCLK (9L)
#define EVE_PCLKPOL (0L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_GEN 2
#endif
/* EVE2-35G 320x240 3.5" Matrix Orbital, capacitive touch, FT813 */
#if defined (EVE_EVE2_35G)
#define Resolution_320x240
#define EVE_PCLK (9L)
#define EVE_PCLKPOL (0L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_GEN 2
#define EVE_HAS_GT911 /* special treatment required for out-of-spec touch-controller */
#endif
/* untested */
/* EVE3-35A 320x240 3.5" Matrix Orbital, resistive, or non-touch, BT816 */
#if defined (EVE_EVE3_35)
#define Resolution_320x240
#define EVE_PCLK (11L)
#define EVE_PCLKPOL (0L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 3
#endif
/* EVE3-35G 320x240 3.5" Matrix Orbital, capacitive-touch, BT815 */
#if defined (EVE_EVE3_35G)
#define Resolution_320x240
#define EVE_PCLK (11L)
#define EVE_PCLKPOL (0L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 3
#define EVE_HAS_GT911 /* special treatment required for out-of-spec touch-controller */
#endif
/* Crystalfonts CFAF320240F-035T 320x240 3.5" , FT810 resistive touch */
#if defined (EVE_CFAF320240F_035T)
#define EVE_HSIZE (320L)
#define EVE_VSIZE (240L)
#define EVE_VSYNC0 (1L)
#define EVE_VSYNC1 (4L)
#define EVE_VOFFSET (4L)
#define EVE_VCYCLE (245L)
#define EVE_HSYNC0 (10L)
#define EVE_HSYNC1 (20L)
#define EVE_HOFFSET (40L)
#define EVE_HCYCLE (510L)
#define EVE_PCLK (8L)
#define EVE_PCLKPOL (0L)
#define EVE_SWIZZLE (2L)
#define EVE_CSPREAD (0L)
#define EVE_GEN 2
#endif
/* untested */
/* Sunflower Arduino Shield, 320x240 3.5" from Cowfish, FT813, https://github.com/Cowfish-Studios/Cowfish_Sunflower_Shield_PCB */
/* set EVE_CS to 6 and EVE_PDN to 5 in the Arduino block in EVE_target.h */
#if defined (EVE_SUNFLOWER)
#define Resolution_320x240
#define EVE_PCLK (9L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (2L)
#define EVE_CSPREAD (0L)
#define EVE_GEN 2
#endif
/* NHD-3.5-320240FT-CxXx-xxx 320x240 3.5" Newhaven, resistive or capacitive, FT81x */
#if defined (EVE_NHD_35)
#define Resolution_320x240
#define EVE_PCLK (9L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (2L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 2
#endif
/* untested */
/* 320x240 3.5" Riverdi, various options, BT815/BT816 */
#if defined (EVE_RiTFT35)
#define EVE_HSIZE (320L)
#define EVE_VSIZE (240L)
#define EVE_VSYNC0 (0L)
#define EVE_VSYNC1 (2L)
#define EVE_VOFFSET (13L)
#define EVE_VCYCLE (263L)
#define EVE_HSYNC0 (0L)
#define EVE_HSYNC1 (10L)
#define EVE_HOFFSET (70L)
#define EVE_HCYCLE (408L)
#define EVE_PCLK (11L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (2L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 3
#endif
/* untested */
/* RVT35HHBxxxxx 320x240 3.5" Riverdi, various options, BT817 */
#if defined (EVE_RVT35H)
#define EVE_HSIZE (320L)
#define EVE_VSIZE (240L)
#define EVE_VSYNC0 (0L)
#define EVE_VSYNC1 (4L)
#define EVE_VOFFSET (12L)
#define EVE_VCYCLE (260L)
#define EVE_HSYNC0 (0L)
#define EVE_HSYNC1 (4L)
#define EVE_HOFFSET (43L)
#define EVE_HCYCLE (371L)
#define EVE_PCLK (12L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 4
#endif
/* ----------- 480 x 272 ----------- */
/* untested */
/* EVE2-43A 480x272 4.3" Matrix Orbital, resistive or no touch, FT812 */
#if defined (EVE_EVE2_43)
#define Resolution_480x272
#define EVE_PCLK (6L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_GEN 2
#endif
/* EVE2-43G 480x272 4.3" Matrix Orbital, capacitive touch, FT813 */
#if defined (EVE_EVE2_43G)
#define Resolution_480x272
#define EVE_PCLK (6L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_GEN 2
#define EVE_HAS_GT911 /* special treatment required for out-of-spec touch-controller */
#endif
/* untested */
/* EVE3-43A 480x272 4.3" Matrix Orbital, resistive, or non-touch, BT816 */
#if defined (EVE_EVE3_43)
#define Resolution_480x272
#define EVE_PCLK (7L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 3
#endif
/* EVE3-43G 480x272 4.3" Matrix Orbital, capacitive-touch, BT815 */
#if defined (EVE_EVE3_43G)
#define Resolution_480x272
#define EVE_PCLK (7L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 3
#define EVE_HAS_GT911
#endif
/* 480x272 4.3" Riverdi, various options, BT815/BT816 */
#if defined (EVE_RiTFT43)
#define Resolution_480x272
#define EVE_PCLK (7L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 3
#endif
/* untested */
/* RVT43HLBxxxxx 480x272 4.3" Riverdi, various options, BT817 */
#if defined (EVE_RVT43H)
#define EVE_HSIZE (480L)
#define EVE_VSIZE (272L)
#define EVE_VSYNC0 (0L)
#define EVE_VSYNC1 (4L)
#define EVE_VOFFSET (12L)
#define EVE_VCYCLE (292L)
#define EVE_HSYNC0 (0L)
#define EVE_HSYNC1 (4L)
#define EVE_HOFFSET (43L)
#define EVE_HCYCLE (531L)
#define EVE_PCLK (7L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 4
#endif
/* untested */
/* NHD-4.3-480272FT-CxXx-xxx 480x272 4.3" Newhaven, resistive or capacitive, FT81x */
#if defined (EVE_NHD_43)
#define Resolution_480x272
#define EVE_PCLK (6L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 2
#endif
/* untested */
/* 4D-Systems GEN4-FT81x-43xx 480x272 4.3",resistive or capacitive, FT812 / FT813 */
#if defined (EVE_GEN4_FT81x_43)
#define Resolution_480x272
#define EVE_PCLK (6L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 2
#endif
/* untested */
/* Gameduino 3, 480x272 4.3",resistive touch, FT810 */
#if defined (EVE_GEN4_FT81x_43)
#define Resolution_480x272
#define EVE_PCLK (6L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (3L)
#define EVE_CSPREAD (1L)
#define EVE_GEN 2
#endif
/* ----------- 800 x 480 ----------- */
/* untested */
/* FTDI/BRT EVE2 modules VM810C50A-D, ME812A-WH50R and ME813A-WH50C, 800x480 5.0" */
/* 4D-Systems GEN4 FT812/FT813 5.0/7.0 */
/* NHD-4.3-800480FT-CSXP-CTP 800x480 4.3" Newhaven, capacitive touch, FT813 */
#if defined (EVE_VM810C) || defined (EVE_ME812A) || defined (EVE_ME813A) || defined (EVE_GEN4_FT812_50) || defined (EVE_GEN4_FT813_50) || defined (EVE_GEN4_FT812_70) || defined (EVE_GEN4_FT813_70) || defined (EVE_NHD_43_800480)
#define Resolution_800x480
#define EVE_PCLK (2L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 2
#endif
/* untested */
/* PH800480T024-IFC03 800x480 7.0" FT813 from PowerTip */
/* PH800480T013-IFC05 800x480 7.0" FT813 from PowerTip */
#if defined (EVE_PH800480)
#define Resolution_800x480
#define EVE_PCLK (2L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 2
#endif
/* untested */
/* NHD-7.0-800480FT-CxXx-xxx 800x480 7.0" Newhaven, resistive or capacitive, FT81x */
#if defined (EVE_NHD_70)
#define Resolution_800x480
#define EVE_PCLK (2L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 2
#endif
/* untested */
/* Matrix Orbital EVE2 modules EVE2-50A, EVE2-70A : 800x480 5.0" and 7.0" resistive, or no touch, FT812 */
#if defined (EVE_EVE2_50) || defined (EVE_EVE2_70)
#define Resolution_800x480
#define EVE_PCLK (2L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (0L)
#define EVE_GEN 2
#endif
/* Matrix Orbital EVE2 modules EVE2-50G, EVE2-70G : 800x480 5.0" and 7.0" capacitive touch, FT813 */
/* Crystalfonts CFAF800480E0-050SC 800x480 5.0" , FT813 capacitive touch */
#if defined (EVE_EVE2_50G) || defined (EVE_EVE2_70G) || defined (EVE_CFAF800480E0_050SC)
#define Resolution_800x480
#define EVE_PCLK (2L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (0L)
#define EVE_GEN 2
#define EVE_HAS_GT911 /* special treatment required for out-of-spec touch-controller */
#endif
/* untested */
/* Crystalfonts CFAF800480E1-050SC-A2 800x480 5.0" , BT817 capacitive touch */
/* Crystalfonts CFAF800480E2-050SC-A2 800x480 5.0" , BT817 capacitive touch with overhanging glass bezel */
/* this should also work with CFAF800480E2-050SN-A2 (no touch) and CFAF800480E2-050SR-A2 (resistive touch) */
#if defined (EVE_CFAF800480Ex_050SC_A2)
#define Resolution_800x480
#define EVE_PCLK (1L) /* 1 = use second PLL for pixel-clock in BT817 / BT818 */
#define EVE_PCLK_FREQ (30000000L) /* EVE_PCLK needs to be set to 1 for this to take effect */
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 4
#define EVE_HAS_GT911 /* special treatment required for out-of-spec touch-controller */
#endif
/* untested */ /* Matrix Orbital EVE3 modules EVE3-50A, EVE3-70A : 800x480 5.0" and 7.0" resistive, or no touch, BT816 */
/* PAF90B5WFNWC01 800x480 9.0" Panasys, BT815 */
#if defined (EVE_EVE3_50) || defined (EVE_EVE3_70) || defined (EVE_PAF90)
#define Resolution_800x480
#define EVE_PCLK (2L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 3
#endif
/* Matrix Orbital EVE3 modules EVE3-50G, EVE3-70G : 800x480 5.0" and 7.0" capacitive touch, BT815 */
#if defined (EVE_EVE3_50G) || defined (EVE_EVE3_70G)
#define Resolution_800x480
#define EVE_PCLK (2L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 3
#define EVE_HAS_GT911
#endif
/* untested */
/* Bridgtek 800x480 5.0" BT816 */
#if defined (EVE_VM816C50AD)
#define Resolution_800x480
#define EVE_PCLK (2L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 3
#endif
/* RVT50xQFxxxxx 800x480 5.0" Riverdi, various options, FT812/FT813 */
/* RVT70xQFxxxxx 800x480 7.0" Riverdi, various options, FT812/FT813, tested with RVT70UQFNWC0x */
#if defined (EVE_RVT70) || defined (EVE_RVT50)
#define EVE_HSIZE (800L) /* Thd Length of visible part of line (in PCLKs) - display width */
#define EVE_VSIZE (480L) /* Tvd Number of visible lines (in lines) - display height */
#define EVE_VSYNC0 (0L) /* Tvf Vertical Front Porch */
#define EVE_VSYNC1 (10L) /* Tvf + Tvp Vertical Front Porch plus Vsync Pulse width */
#define EVE_VOFFSET (23L) /* Tvf + Tvp + Tvb Number of non-visible lines (in lines) */
#define EVE_VCYCLE (525L) /* Tv Total number of lines (visible and non-visible) (in lines) */
#define EVE_HSYNC0 (0L) /* Thf Horizontal Front Porch */
#define EVE_HSYNC1 (10L) /* Thf + Thp Horizontal Front Porch plus Hsync Pulse width */
#define EVE_HOFFSET (46L) /* Thf + Thp + Thb Length of non-visible part of line (in PCLK cycles) */
#define EVE_HCYCLE (1056L) /* Th Total length of line (visible and non-visible) (in PCLKs) */
#define EVE_PCLK (2L) /* 60MHz / REG_PCLK = PCLK frequency 30 MHz */
#define EVE_PCLKPOL (1L) /* PCLK polarity (0 = rising edge, 1 = falling edge) */
#define EVE_SWIZZLE (0L) /* Defines the arrangement of the RGB pins of the FT800 */
#define EVE_CSPREAD (1L)
#define EVE_GEN 2
#endif
/* untested but confirmed to be working */
/* RVT50xQBxxxxx 800x480 5.0" Riverdi, various options, BT815/BT816 */
/* not working properly? try the EVE_RiTFT70 profile */
#if defined (EVE_RiTFT50)
#define EVE_HSIZE (800L)
#define EVE_VSIZE (480L)
#define EVE_VSYNC0 (0L)
#define EVE_VSYNC1 (10L)
#define EVE_VOFFSET (23L)
#define EVE_VCYCLE (525L)
#define EVE_HSYNC0 (0L)
#define EVE_HSYNC1 (10L)
#define EVE_HOFFSET (46L)
#define EVE_HCYCLE (1056L)
#define EVE_PCLK (2L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 3
#endif
/* untested but confirmed to be working */
/* RVT70xQBxxxxx 800x480 7.0" Riverdi, various options, BT815/BT816 */
/* not working properly? try the EVE_RiTFT50 profile */
#if defined (EVE_RiTFT70)
#define Resolution_800x480
#define EVE_PCLK (2L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 3
#endif
/* untested */
/* RVT50HQBxxxxx 800x480 5.0" Riverdi, various options, BT817 */
#if defined (EVE_RVT50H)
#define EVE_HSIZE (800L)
#define EVE_VSIZE (480L)
#define EVE_VSYNC0 (0L)
#define EVE_VSYNC1 (4L)
#define EVE_VOFFSET (8L)
#define EVE_VCYCLE (496L)
#define EVE_HSYNC0 (0L)
#define EVE_HSYNC1 (4L)
#define EVE_HOFFSET (8L)
#define EVE_HCYCLE (816L)
#define EVE_PCLK (3L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 4
#endif
/* untested */
/* NHD-5.0-800480FT-CxXx-xxx 800x480 5.0" Newhaven, resistive or capacitive, FT81x */
#if defined (EVE_NHD_50)
#define Resolution_800x480
#define EVE_PCLK (2L)
#define EVE_PCLKPOL (0L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 2
#endif
/* FT810CB-HY50HD: FT810 800x480 5.0" HAOYU */
#if defined (EVE_FT810CB_HY50HD)
#define EVE_HSIZE (800L)
#define EVE_VSIZE (480L)
#define EVE_VSYNC0 (0L)
#define EVE_VSYNC1 (2L)
#define EVE_VOFFSET (13L)
#define EVE_VCYCLE (525L)
#define EVE_HSYNC0 (0L)
#define EVE_HSYNC1 (20L)
#define EVE_HOFFSET (64L)
#define EVE_HCYCLE (952L)
#define EVE_PCLK (2L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 2
#endif
/* FT811CB-HY50HD: FT811 800x480 5.0" HAOYU */
#if defined (EVE_FT811CB_HY50HD)
#define EVE_HSIZE (800L)
#define EVE_VSIZE (480L)
#define EVE_VSYNC0 (0L)
#define EVE_VSYNC1 (2L)
#define EVE_VOFFSET (13L)
#define EVE_VCYCLE (525L)
#define EVE_HSYNC0 (0L)
#define EVE_HSYNC1 (20L)
#define EVE_HOFFSET (64L)
#define EVE_HCYCLE (952L)
#define EVE_PCLK (2L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (1L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 2
#endif
/* untested */
/* G-ET0700G0DM6 800x480 7.0" Glyn */
#if defined (EVE_ET07)
#define EVE_HSIZE (800L)
#define EVE_VSIZE (480L)
#define EVE_VSYNC0 (0L)
#define EVE_VSYNC1 (2L)
#define EVE_VOFFSET (35L)
#define EVE_VCYCLE (525L)
#define EVE_HSYNC0 (0L)
#define EVE_HSYNC1 (128L)
#define EVE_HOFFSET (203L)
#define EVE_HCYCLE (1056L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_PCLK (2L)
#define EVE_CSPREAD (1L)
#define EVE_GEN 2
#endif
/* ----------- 1024 x 600 ----------- */
/* ADAM101-LCP-SWVGA-NEW 1024x600 10.1" Glyn, capacitive, FT813 */
#if defined (EVE_ADAM101)
#define EVE_HSIZE (1024L)
#define EVE_VSIZE (600L)
#define EVE_VSYNC0 (0L)
#define EVE_VSYNC1 (1L)
#define EVE_VOFFSET (1L)
#define EVE_VCYCLE (720L)
#define EVE_HSYNC0 (0L)
#define EVE_HSYNC1 (1L)
#define EVE_HOFFSET (1L)
#define EVE_HCYCLE (1100L)
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_PCLK (2L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 2
#endif
/* tested with RVT70HSBNWC00-B */
/* RVT70HSBxxxxx 1024x600 7.0" Riverdi, various options, BT817 */
#if defined (EVE_RVT70H)
#define EVE_HSIZE (1024L)
#define EVE_VSIZE (600L)
#define EVE_VSYNC0 (0L)
#define EVE_VSYNC1 (10L)
#define EVE_VOFFSET (23L)
#define EVE_VCYCLE (635L)
#define EVE_HSYNC0 (0L)
#define EVE_HSYNC1 (70L)
#define EVE_HOFFSET (160L)
#define EVE_HCYCLE (1344L)
#define EVE_PCLK (1L) /* 1 = use second PLL for pixel-clock in BT817 / BT818 */
#define EVE_PCLK_FREQ (51000000L) /* EVE_PCLK needs to be set to 1 for this to take effect */
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 4
#endif
/* untested but confirmed to be working */
/* EVE4x-70G IPS 1024x600 7" Matrix Orbital, capacitive touch, BT817 */
#if defined (EVE_EVE4_70G)
#define EVE_HSIZE (1024L)
#define EVE_VSIZE (600L)
#define EVE_VSYNC0 (0L)
#define EVE_VSYNC1 (10L)
#define EVE_VOFFSET (23L)
#define EVE_VCYCLE (632L)
#define EVE_HSYNC0 (0L)
#define EVE_HSYNC1 (70L)
#define EVE_HOFFSET (160L)
#define EVE_HCYCLE (1344L)
#define EVE_PCLK (1L) /* 1 = use second PLL for pixel-clock in BT817 / BT818 */
#define EVE_PCLK_FREQ (51000000L) /* 51MHz - value for EVE_cmd_pclkfreq -> 60 FPS */
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 4
#define EVE_HAS_GT911
#endif
#if defined (BT817_TEST1)
#define EVE_HSIZE (1024L) /* Thd Length of visible part of line (in PCLKs) - display width */
#define EVE_VSIZE (600L) /* Tvd Number of visible lines (in lines) - display height */
#define EVE_VSYNC0 (1L) /* Tvf Vertical Front Porch */
#define EVE_VSYNC1 (2L) /* Tvf + Tvp Vertical Front Porch plus Vsync Pulse width */
#define EVE_VOFFSET (25L) /* Tvf + Tvp + Tvb Number of non-visible lines (in lines) */
#define EVE_VCYCLE (626L) /* Tv Total number of lines (visible and non-visible) (in lines) */
#define EVE_HSYNC0 (16L) /* Thf Horizontal Front Porch */
#define EVE_HSYNC1 (17L) /* Thf + Thp Horizontal Front Porch plus Hsync Pulse width */
#define EVE_HOFFSET (177L) /* Thf + Thp + Thb Length of non-visible part of line (in PCLK cycles) */
#define EVE_HCYCLE (1597L) /* Th Total length of line (visible and non-visible) (in PCLKs) */
#define EVE_PCLKPOL (1L) /* PCLK polarity (0 = rising edge, 1 = falling edge) */
#define EVE_SWIZZLE (3L) /* Defines the arrangement of the RGB pins */
#define EVE_PCLK (1L) /* 1 = use second PLL for pixel-clock in BT817 / BT818 */
#define EVE_CSPREAD (0L) /* helps with noise, when set to 1 fewer signals are changed simultaneously, reset-default: 1 */
#define EVE_HAS_CRYSTAL
#define EVE_GEN 4
//#define EVE_PCLK_FREQ (51000000L) /* 51MHz - value for EVE_cmd_pclkfreq */
#endif
#if defined (BT817_TEST2)
#define EVE_HSIZE (1024L) /* Thd Length of visible part of line (in PCLKs) - display width */
#define EVE_VSIZE (600L) /* Tvd Number of visible lines (in lines) - display height */
#define EVE_VSYNC0 (1L) /* Tvf Vertical Front Porch */
#define EVE_VSYNC1 (2L) /* Tvf + Tvp Vertical Front Porch plus Vsync Pulse width */
#define EVE_VOFFSET (25L) /* Tvf + Tvp + Tvb Number of non-visible lines (in lines) */
#define EVE_VCYCLE (626L) /* Tv Total number of lines (visible and non-visible) (in lines) */
#define EVE_HSYNC0 (16L) /* Thf Horizontal Front Porch */
#define EVE_HSYNC1 (17L) /* Thf + Thp Horizontal Front Porch plus Hsync Pulse width */
#define EVE_HOFFSET (177L) /* Thf + Thp + Thb Length of non-visible part of line (in PCLK cycles) */
#define EVE_HCYCLE (1597L) /* Th Total length of line (visible and non-visible) (in PCLKs) */
#define EVE_PCLKPOL (1L) /* PCLK polarity (0 = rising edge, 1 = falling edge) */
#define EVE_SWIZZLE (3L) /* Defines the arrangement of the RGB pins */
#define EVE_PCLK (1L) /* 1 = use second PLL for pixel-clock in BT817 / BT818 */
#define EVE_CSPREAD (0L) /* helps with noise, when set to 1 fewer signals are changed simultaneously, reset-default: 1 */
#define EVE_HAS_CRYSTAL
#define EVE_GEN 4
#define EVE_PCLK_FREQ (51000000L) /* 51MHz - value for EVE_cmd_pclkfreq */
#endif
#if defined (BT817_TEST3)
#define EVE_HSIZE (1024L) /* Thd Length of visible part of line (in PCLKs) - display width */
#define EVE_VSIZE (600L) /* Tvd Number of visible lines (in lines) - display height */
#define EVE_VSYNC0 (1L) /* Tvf Vertical Front Porch */
#define EVE_VSYNC1 (2L) /* Tvf + Tvp Vertical Front Porch plus Vsync Pulse width */
#define EVE_VOFFSET (25L) /* Tvf + Tvp + Tvb Number of non-visible lines (in lines) */
#define EVE_VCYCLE (626L) /* Tv Total number of lines (visible and non-visible) (in lines) */
#define EVE_HSYNC0 (16L) /* Thf Horizontal Front Porch */
#define EVE_HSYNC1 (17L) /* Thf + Thp Horizontal Front Porch plus Hsync Pulse width */
#define EVE_HOFFSET (177L) /* Thf + Thp + Thb Length of non-visible part of line (in PCLK cycles) */
#define EVE_HCYCLE (1344L) /* Th Total length of line (visible and non-visible) (in PCLKs) */
#define EVE_PCLKPOL (1L) /* PCLK polarity (0 = rising edge, 1 = falling edge) */
#define EVE_SWIZZLE (3L) /* Defines the arrangement of the RGB pins */
#define EVE_PCLK (1L) /* 1 = use second PLL for pixel-clock in BT817 / BT818 */
#define EVE_CSPREAD (0L) /* helps with noise, when set to 1 fewer signals are changed simultaneously, reset-default: 1 */
#define EVE_HAS_CRYSTAL
#define EVE_GEN 4
#define EVE_PCLK_FREQ (51000000L) /* 51MHz - value for EVE_cmd_pclkfreq */
#endif
/* ----------- 1280 x 800 ------------ */
/* untested */
/* EVE4-101G 1280x800 10.1" Matrix Orbital, capacitive touch, BT817 */
#if defined (EVE_EVE4_101G)
#define EVE_HSIZE (1280L) /* Thd Length of visible part of line (in PCLKs) - display width */
#define EVE_VSIZE (800L) /* Tvd Number of visible lines (in lines) - display height */
#define EVE_VSYNC0 (11L) /* Tvf Vertical Front Porch */
#define EVE_VSYNC1 (12L) /* Tvf + Tvp Vertical Front Porch plus Vsync Pulse width */
#define EVE_VOFFSET (22L) /* Tvf + Tvp + Tvb Number of non-visible lines (in lines) */
#define EVE_VCYCLE (823L) /* Tv Total number of lines (visible and non-visible) (in lines) */
#define EVE_HSYNC0 (78L) /* Thf Horizontal Front Porch */
#define EVE_HSYNC1 (80L) /* Thf + Thp Horizontal Front Porch plus Hsync Pulse width */
#define EVE_HOFFSET (158L) /* Thf + Thp + Thb Length of non-visible part of line (in PCLK cycles) */
#define EVE_HCYCLE (1440L) /* Th Total length of line (visible and non-visible) (in PCLKs) */
#define EVE_PCLK (1L) /* 1 = use second PLL for pixel-clock in BT817 / BT818 */
#define EVE_PCLK_FREQ (71000000L) /* 71MHz - value for EVE_cmd_pclkfreq */
#define EVE_PCLKPOL (0L) /* PCLK polarity (0 = rising edge, 1 = falling edge) */
#define EVE_SWIZZLE (3L) /* Defines the arrangement of the RGB pins */
#define EVE_CSPREAD (0L) /* helps with noise, when set to 1 fewer signals are changed simultaneously, reset-default: 1 */
#define EVE_HAS_CRYSTAL
#define EVE_GEN 4
#define EVE_HAS_GT911
#endif
/* tested with RVT101HVBNWC00-B */
/* RVT101HVBxxxxx 1280x800 7.0" Riverdi, various options, BT817 */
#if defined (EVE_RVT101H)
#define EVE_HSIZE (1280L)
#define EVE_VSIZE (800L)
#define EVE_VSYNC0 (0L)
#define EVE_VSYNC1 (10L)
#define EVE_VOFFSET (23L)
#define EVE_VCYCLE (830L)
#define EVE_HSYNC0 (0L)
#define EVE_HSYNC1 (20L)
#define EVE_HOFFSET (88L)
#define EVE_HCYCLE (1440L)
#define EVE_PCLK (1L) /* 1 = use second PLL for pixel-clock in BT817 / BT818 */
#define EVE_PCLK_FREQ (71000000L) /* EVE_PCLK needs to be set to 1 for this to take effect */
#define EVE_PCLKPOL (1L)
#define EVE_SWIZZLE (0L)
#define EVE_CSPREAD (0L)
#define EVE_HAS_CRYSTAL
#define EVE_GEN 4
#endif
/* ----------- non-standard ----------- */
/* untested */
/* EVE2-29A 320x102 2.9" 1U Matrix Orbital, non-touch, FT812 */
#if defined (EVE_EVE2_29)
#define EVE_HSIZE (320L)
#define EVE_VSIZE (102L)
#define EVE_VSYNC0 (0L)
#define EVE_VSYNC1 (2L)
#define EVE_VOFFSET (156L)
#define EVE_VCYCLE (262L)
#define EVE_HSYNC0 (0L)
#define EVE_HSYNC1 (10L)
#define EVE_HOFFSET (70L)
#define EVE_HCYCLE (408L)
#define EVE_PCLKPOL (0L)
#define EVE_SWIZZLE (0L)
#define EVE_PCLK (9L)
#define EVE_CSPREAD (1L)
#define EVE_GEN 2
#endif
/* Crystalfonts CFAF240400C1-030SC 240x400 3.0" , FT811 capacitive touch */
#if defined (EVE_CFAF240400C1_030SC)
#define EVE_HSIZE (240L)
#define EVE_VSIZE (400L)
#define EVE_VSYNC0 (4L)
#define EVE_VSYNC1 (6L)
#define EVE_VOFFSET (8L)
#define EVE_VCYCLE (409L)
#define EVE_HSYNC0 (10L)
#define EVE_HSYNC1 (20L)
#define EVE_HOFFSET (40L)
#define EVE_HCYCLE (489L)
#define EVE_PCLKPOL (0L)
#define EVE_SWIZZLE (2L)
#define EVE_PCLK (5L)
#define EVE_CSPREAD (0L)
#define EVE_GEN 2
#endif
/* EVE2-38A 480x116 3.8" 1U Matrix Orbital, resistive touch, FT812 */
#if defined (EVE_EVE2_38)
#define EVE_HSIZE (480L)
#define EVE_VSIZE (272L)