forked from indev29/egis0570
-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.h
212 lines (139 loc) · 4 KB
/
init.h
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
// Initialization packets (7 bytes each)
// First 4 bytes are equivalent to string "EGIS", which must be just a company identificator
// Other 3 bytes are not recognized yet
// Answers for each packet contains 7 bytes again
// First 4 bytes are reversed "EGIS", which is "SIGE", i guess it is company id again
// Other 3 bytes are not recognized yet
// Sending last packet makes sensor return image
static unsigned char init[][7] =
{
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x20, 0x3f },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x58, 0x3f },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x21, 0x09 },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x57, 0x09 },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x22, 0x03 },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x56, 0x03 },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x23, 0x01 },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x55, 0x01 },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x24, 0x01 },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x54, 0x01 },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x16, 0x3e },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x09, 0x0b },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x14, 0x03 },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x15, 0x00 },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x0f },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x10, 0x00 },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x11, 0x38 },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x12, 0x00 },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x13, 0x71 },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x03, 0x80 },
{ 0x45, 0x47, 0x49, 0x53, 0x00, 0x02, 0x80 },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x2f },
{ 0x45, 0x47, 0x49, 0x53, 0x06, 0x00, 0xfe }
};
// After sending initial packets device returns image data
// To ask device to send image data again, host needs to send four additional packets
// Further work is to repeatedly send four repeat packets and read image data
// Image repeat request
// First 4 bytes are the same as in initialization packets
static unsigned char repeat[][7] =
{
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x0f },
{ 0x45, 0x47, 0x49, 0x53, 0x00, 0x02, 0x0f },
{ 0x45, 0x47, 0x49, 0x53, 0x01, 0x02, 0x2f },
{ 0x45, 0x47, 0x49, 0x53, 0x06, 0x00, 0xfe }
};
/*
static const unsigned char init_1[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x20, 0x3f
},
static const unsigned char init_2[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x58, 0x3f
},
static const unsigned char init_3[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x21, 0x09
},
static const unsigned char init_4[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x57, 0x09
},
static const unsigned char init_5[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x22, 0x03
},
static const unsigned char init_6[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x56, 0x03
},
static const unsigned char init_7[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x23, 0x01
},
static const unsigned char Init_8[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x55, 0x01
},
static const unsigned char init_9[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x24, 0x01
},
static const unsigned char pkt19[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x54, 0x01
},
static const unsigned char pkt21[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x16, 0x3e
},
static const unsigned char pkt23[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x09, 0x0b
},
static const unsigned char pkt25[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x14, 0x03
},
static const unsigned char pkt27[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x15, 0x00
},
static const unsigned char pkt29[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x02, 0x0f
},
static const unsigned char pkt31[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x10, 0x00
},
static const unsigned char pkt33[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x11, 0x38
},
static const unsigned char pkt35[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x12, 0x00
},
static const unsigned char pkt37[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x13, 0x71
},
static const unsigned char pkt39[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x03, 0x80
},
static const unsigned char pkt41[7] = {
0x45, 0x47, 0x49, 0x53,
0x00, 0x02, 0x80
},
static const unsigned char pkt43[7] = {
0x45, 0x47, 0x49, 0x53,
0x01, 0x02, 0x2f
},
static const unsigned char pkt45[7] = {
0x45, 0x47, 0x49, 0x53,
0x06, 0x00, 0xfe
},
*/