FreeCalypso > hg > freecalypso-hwlab
annotate lunalcd/startek.c @ 163:5f9dd4056420
vbat-adc/crude-cal-test: an experiment to prove VBAT MADC linearity
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 04 Jun 2021 03:02:18 +0000 |
parents | cdf2c99e5025 |
children |
rev | line source |
---|---|
65
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * ST7775R register init for Startek LCDs KD020C-1 V2 and KD020C-2A, |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * the former of which is also sold by Crystalfontz as CFAF176220U-020T. |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 */ |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 lcd_init_seq() |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 { |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 /* basic settings */ |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 write_ir(0x01); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 write_dr(0x011C); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 write_ir(0x02); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 write_dr(0x0100); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 write_ir(0x03); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 write_dr(0x1030); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 write_ir(0x0F); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 write_dr(0x0001); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 write_ir(0x10); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 write_dr(0x0000); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 write_ir(0x11); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 write_dr(0x1000); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 /* gamma control registers */ |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 write_ir(0x50); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 write_dr(0x0203); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 write_ir(0x51); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 write_dr(0x0A09); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 write_ir(0x52); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 write_dr(0x0005); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 write_ir(0x53); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 write_dr(0x1021); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 write_ir(0x54); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 write_dr(0x0602); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 write_ir(0x55); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 write_dr(0x0003); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 write_ir(0x56); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 write_dr(0x0703); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 write_ir(0x57); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 write_dr(0x0507); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 write_ir(0x58); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 write_dr(0x1021); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 write_ir(0x59); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 write_dr(0x0703); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 /* VCOM */ |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 write_ir(0xB0); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 write_dr(0x2501); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 /* turn it on! */ |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 write_ir(0x07); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 write_dr(0x1017); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 return(0); |
cdf2c99e5025
lunalcd project started
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 } |