comparison lunalcd/haoran.c @ 67:286289d551ee

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