forked from parallaxinc/spin-standard-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore.con.il3897.spin
156 lines (104 loc) · 3.74 KB
/
core.con.il3897.spin
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
{
--------------------------------------------
Filename: core.con.il3897.spin
Author: Jesse Burt
Description: IL3897-specific Low-level constants
Copyright (c) 2022
Started Feb 21, 2021
Updated Jan 21, 2022
See end of file for terms of use.
--------------------------------------------
}
CON
' SPI Configuration
SPI_MAX_FREQ = 20_000_000 ' device max SPI bus freq
SPI_MODE = 0 ' 0..3
T_POR = 2_000 ' startup time (usecs)
DEVID_RESP = $01 ' device ID expected response
' Register definitions
DRV_OUT_CTRL = $01
DRVOUT_CTRL_MASK= $07 ' param 'B' only
GD = 2
SM = 1
TB = 0
GD_MASK = (1 << GD) ^ DRVOUT_CTRL_MASK
SM_MASK = (1 << SM) ^ DRVOUT_CTRL_MASK
TB_MASK = 1 ^ DRVOUT_CTRL_MASK
GATE_DRV_CTRL = $03
SRC_DRV_CTRL = $04
BOOST_CTRL = $0C
GATE_ST_POS = $0F
DEEP_SLP = $10
DATA_ENT_MD = $11
DATA_ENT_MD_MASK= $07
AM = 2
ID = 0
ID_BITS = %11
AM_MASK = (1 << AM) ^ DATA_ENT_MD_MASK
ID_MASK = ID_BITS ^ DATA_ENT_MD_MASK
SWRESET = $12
HV_RDY_DET = $14
VCI_DET = $15
TEMP_CTRL_W = $1A
TEMP_CTRL_R = $1B
TEMP_CMD_W = $1C
MASTER_ACT = $20
DISP_UP_CTRL1 = $21
DISP_UP_CTRL2 = $22
WR_RAM_BW = $24
WR_RAM_RED = $26
RD_RAM = $27
VCOM_SNS = $28
VCOM_SNS_DUR = $29
PRG_VCOM_OTP = $2A
WR_VCOM = $2C
RD_OTP = $2D
STATUS = $2F
PRG_WS_OTP = $30
LD_WS_OTP = $31
WR_LUT = $32
PRG_OTP_SEL = $36
WR_OTP_SEL = $37
DUMMY_LN_PER = $3A
GATE_LN_WID = $3B
BRD_WV_CTRL = $3C
BRD_WV_CTRL_MASK= $F7
VBDOPT = 6
VBDLVL = 4
GSTRC = 2
GSTRS = 0
VBDOPT_BITS = %11
VBDLVL_BITS = %11
GSTRS_BITS = %11
VBDOPT_MASK = (VBDOPT_BITS << VBDOPT) ^ BRD_WV_CTRL_MASK
VBDLVL_MASK = (VBDLVL_BITS << VBDLVL) ^ BRD_WV_CTRL_MASK
GSTRC_MASK = (1 << GSTRC) ^ BRD_WV_CTRL_MASK
GSTRS_MASK = 1 ^ BRD_WV_CTRL_MASK
RD_RAM_OPT = $41
RAM_X_WIND = $44
RAM_Y_WIND = $45
AUTO_WR_RED_PAT = $46
AUTO_WR_BW_PAT = $47
RAM_X = $4E
RAM_Y = $4F
ANLG_BLK_CTRL = $74
DIGI_BLK_CTRL = $7E
NOOP = $FF
PUB null{}
' This is not a top-level object
DAT
{
Copyright 2022 Jesse Burt
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.
}