annotate lcdtest/init.c @ 20:2e4f27ea7067

lcdtest: init-st command implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 10 Apr 2018 23:55:42 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * ST7775R register init, same for Crystalfontz CFAF176220U-020T
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * and Startek KD020C-2A.
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 */
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 cmd_init_st()
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 {
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 /* basic settings */
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 write_ir(0x01);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 write_dr(0x011C);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 write_ir(0x02);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 write_dr(0x0100);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 write_ir(0x03);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 write_dr(0x1030);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 write_ir(0x0F);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 write_dr(0x0001);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 write_ir(0x10);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 write_dr(0x0000);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 write_ir(0x11);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 write_dr(0x1000);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 /* gamma control registers */
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 write_ir(0x50);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 write_dr(0x0203);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 write_ir(0x51);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 write_dr(0x0A09);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 write_ir(0x52);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 write_dr(0x0005);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 write_ir(0x53);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 write_dr(0x1021);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 write_ir(0x54);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 write_dr(0x0602);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 write_ir(0x55);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 write_dr(0x0003);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 write_ir(0x56);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 write_dr(0x0703);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 write_ir(0x57);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 write_dr(0x0507);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 write_ir(0x58);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 write_dr(0x1021);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 write_ir(0x59);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 write_dr(0x0703);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 /* VCOM */
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 write_ir(0xB0);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 write_dr(0x2501);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 /* turn it on! */
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 write_ir(0x07);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 write_dr(0x1017);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 return(0);
2e4f27ea7067 lcdtest: init-st command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 }