comparison lcdtest/haoran.c @ 25:0a44549a64c8

lcdtest: implemented ILI9225G register init for HT020K1QC36S
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 25 May 2018 02:41:30 +0000
parents
children
comparison
equal deleted inserted replaced
24:94521a02c33d 25:0a44549a64c8
1 #include <unistd.h>
2
3 /*
4 * ILI9225G register init for HaoRan HT020K1QC36S LCD.
5 */
6
7 static void
8 init_data(addr, data)
9 {
10 write_ir(addr);
11 write_dr(data);
12 }
13
14 init_haoran()
15 {
16 init_data(0x0001, 0x011c); // set SS and NL bit
17 init_data(0x0002, 0x0100); // set 1 line inversion
18 init_data(0x0003, 0x1030); // set GRAM write direction and BGR=1.
19 init_data(0x0008, 0x0808); // set BP and FP
20 init_data(0x000F, 0x0901); // Set frame rate
21 usleep(10000);
22 init_data(0x0010, 0x0000); // Set SAP,DSTB,STB
23 init_data(0x0011, 0x1B41); // Set APON,PON,AON,VCI1EN,VC
24 usleep(50000);
25 init_data(0x0012, 0x200E); // Internal reference voltage= Vci;
26 init_data(0x0013, 0x0052); // Set GVDD
27 init_data(0x0014, 0x4B5C); // Set VCOMH/VCOML voltage
28 //------------- Set GRAM area ------------------//
29 init_data(0x0030, 0x0000);
30 init_data(0x0031, 0x00DB);
31 init_data(0x0032, 0x0000);
32 init_data(0x0033, 0x0000);
33 init_data(0x0034, 0x00DB);
34 init_data(0x0035, 0x0000);
35 init_data(0x0036, 0x00AF);
36 init_data(0x0037, 0x0000);
37 init_data(0x0038, 0x00DB);
38 init_data(0x0039, 0x0000);
39 // ----------- Adjust the Gamma Curve ----------//
40 init_data(0x0050, 0x0000);
41 init_data(0x0051, 0x0705);
42 init_data(0x0052, 0x0C0A);
43 init_data(0x0053, 0x0401);
44 init_data(0x0054, 0x040C);
45 init_data(0x0055, 0x0608);
46 init_data(0x0056, 0x0000);
47 init_data(0x0057, 0x0104);
48 init_data(0x0058, 0x0E06);
49 init_data(0x0059, 0x060E);
50 usleep(50000);
51 init_data(0x0007, 0x1017);
52 return(0);
53 }