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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
|
#ifndef __LINUX_FT5402_INI_CONFIG_H__
#define __LINUX_FT5402_INI_CONFIG_H
/*Init param register address*/
/*factory mode register from 14-131*/
#define FT5402_REG_TX_NUM 0x03
#define FT5402_REG_RX_NUM 0x04
#define FT5402_REG_VOLTAGE 0x05
#define FT5402_REG_GAIN 0x07
#define FT5402_REG_SCAN_SELECT 0x4E
#define FT5402_REG_TX_ORDER_START 0x50
#define FT5402_REG_TX_CAP_START 0x78
#define FT5402_REG_TX_OFFSET_START 0xBF
#define FT5402_REG_RX_ORDER_START 0xeb
#define FT5402_REG_RX_CAP_START 0xA0
#define FT5402_REG_RX_OFFSET_START 0xD3
#define FT5402_REG_START_RX 0x06
#define FT5402_REG_ADC_TARGET_HIGH 0x08
#define FT5402_REG_ADC_TARGET_LOW 0x09
#define FT5402_REG_DEVICE_MODE 0x00
/*work mode register from 0-13(0,1,12,13verify or Reserved)and 132-177(159 Reserved)*/
#define FT5402_REG_THGROUP (0x00+0x80)
#define FT5402_REG_THPEAK (0x01+0x80)
#define FT5402_REG_PWMODE_CTRL (0x06+0x80)
#define FT5402_REG_PERIOD_ACTIVE (0x59+0x80)
#define FT5402_REG_POINTS_SUPPORTED (0x0A+0x80)
#define FT5402_REG_ESD_FILTER_FRAME (0x4F+0x80)
#define FT5402_REG_RESOLUTION_X_H (0x18+0x80)
#define FT5402_REG_RESOLUTION_X_L (0x19+0x80)
#define FT5402_REG_RESOLUTION_Y_H (0x1a+0x80)
#define FT5402_REG_RESOLUTION_Y_L (0x1b+0x80)
#define FT5402_REG_KX_H (0x1c+0x80)
#define FT5402_REG_KX_L (0x9d)
#define FT5402_REG_KY_H (0x9e)
#define FT5402_REG_KY_L (0x1f+0x80)
#define FT5402_REG_CUSTOMER_ID (0xA8)
#define FT5402_REG_DRAW_LINE_TH (0xAe)
#define FT5402_REG_FACE_DETECT_MODE (0xB0)
#define FT5402_REG_MAX_TOUCH_VALUE_HIGH (0xD0)
#define FT5402_REG_MAX_TOUCH_VALUE_LOW (0xD1)
#define FT5402_REG_DIRECTION (0x53+0x80)
#define FT5402_REG_LEMDA_X (0x41+0x80)
#define FT5402_REG_LEMDA_Y (0x42+0x80)
#define FT5402_REG_FACE_DETECT_STATISTICS_TX_NUM (0x43+0x80)
#define FT5402_REG_FACE_DETECT_PRE_VALUE (0x44+0x80)
#define FT5402_REG_FACE_DETECT_NUM (0x45+0x80)
#define FT5402_REG_BIGAREA_PEAK_VALUE_MIN (0x33+0x80)
#define FT5402_REG_BIGAREA_DIFF_VALUE_OVER_NUM (0x34+0x80)
/**************************************************************************/
#define FT5402_REG_FT5402_POINTS_STABLE_MACRO (0x57+0x80)
#define FT5402_REG_FT5402_MIN_DELTA_X (0x4a+0x80)
#define FT5402_REG_FT5402_MIN_DELTA_Y (0x4b+0x80)
#define FT5402_REG_FT5402_MIN_DELTA_STEP (0x4c+0x80)
#define FT5402_REG_FT5402_ESD_NOISE_MACRO (0x58+0x80)
#define FT5402_REG_FT5402_ESD_DIFF_VAL (0x4d+0x80)
#define FT5402_REG_FT5402_ESD_NEGTIVE (0xCe)
#define FT5402_REG_FT5402_ESD_FILTER_FRAMES (0x4f+0x80)
#define FT5402_REG_FT5402_IO_LEVEL_SELECT (0x52+0x80)
#define FT5402_REG_FT5402_POINTID_DELAY_COUNT (0x54+0x80)
#define FT5402_REG_FT5402_LIFTUP_FILTER_MACRO (0x55+0x80)
#define FT5402_REG_FT5402_DIFF_HANDLE_MACRO (0x5A+0x80)
#define FT5402_REG_FT5402_MIN_WATER (0x5B+0x80)
#define FT5402_REG_FT5402_MAX_NOISE (0x5C+0x80)
#define FT5402_REG_FT5402_WATER_START_RX (0x5D+0x80)
#define FT5402_REG_FT5402_WATER_START_TX (0xDE)
#define FT5402_REG_FT5402_HOST_NUMBER_SUPPORTED_MACRO (0x38+0x80)
#define FT5402_REG_FT5402_RAISE_THGROUP (0x36+0x80)
#define FT5402_REG_FT5402_CHARGER_STATE (0x35+0x80)
#define FT5402_REG_FT5402_FILTERID_START (0x37+0x80)
#define FT5402_REG_FT5402_FRAME_FILTER_EN_MACRO (0x5F+0x80)
#define FT5402_REG_FT5402_FRAME_FILTER_SUB_MAX_TH (0x60+0x80)
#define FT5402_REG_FT5402_FRAME_FILTER_ADD_MAX_TH (0x61+0x80)
#define FT5402_REG_FT5402_FRAME_FILTER_SKIP_START_FRAME (0x62+0x80)
#define FT5402_REG_FT5402_FRAME_FILTER_BAND_EN (0x63+0x80)
#define FT5402_REG_FT5402_FRAME_FILTER_BAND_WIDTH (0x64+0x80)
/**************************************************************************/
#define FT5402_REG_TEST_MODE 0x04
#define FT5402_REG_TEST_MODE_2 0x05
#define FT5402_TX_TEST_MODE_1 0x28
#define FT5402_RX_TEST_MODE_1 0x1E
#define FT5402_FACTORYMODE_VALUE 0x40
#define FT5402_WORKMODE_VALUE 0x00
/************************************************************************/
/* string */
/************************************************************************/
#define STRING_FT5402_KX "FT5X02_KX"
#define STRING_FT5402_KY "FT5X02_KY"
#define STRING_FT5402_LEMDA_X "FT5X02_LEMDA_X"
#define STRING_FT5402_LEMDA_Y "FT5X02_LEMDA_Y"
#define STRING_FT5402_RESOLUTION_X "FT5X02_RESOLUTION_X"
#define STRING_FT5402_RESOLUTION_Y "FT5X02_RESOLUTION_Y"
#define STRING_FT5402_DIRECTION "FT5X02_DIRECTION"
#define STRING_FT5402_FACE_DETECT_PRE_VALUE "FT5X02_FACE_DETECT_PRE_VALUE"
#define STRING_FT5402_FACE_DETECT_NUM "FT5X02_FACE_DETECT_NUM"
#define STRING_FT5402_BIGAREA_PEAK_VALUE_MIN "FT5X02_BIGAREA_PEAK_VALUE_MIN"
#define STRING_FT5402_BIGAREA_DIFF_VALUE_OVER_NUM "FT5X02_BIGAREA_DIFF_VALUE_OVER_NUM"
#define STRING_FT5402_CUSTOMER_ID "FT5X02_CUSTOMER_ID"
#define STRING_FT5402_PERIOD_ACTIVE "FT5X02_RV_G_PERIOD_ACTIVE"
#define STRING_FT5402_FACE_DETECT_STATISTICS_TX_NUM "FT5X02_FACE_DETECT_STATISTICS_TX_NUM"
#define STRING_FT5402_THGROUP "FT5X02_THGROUP"
#define STRING_FT5402_THPEAK "FT5X02_THPEAK"
#define STRING_FT5402_FACE_DETECT_MODE "FT5X02_FACE_DETECT_MODE"
#define STRING_FT5402_MAX_TOUCH_VALUE "FT5X02_MAX_TOUCH_VALUE"
#define STRING_FT5402_PWMODE_CTRL "FT5X02_PWMODE_CTRL"
#define STRING_FT5402_DRAW_LINE_TH "FT5X02_DRAW_LINE_TH"
#define STRING_FT5402_POINTS_SUPPORTED "FT5X02_POINTS_SUPPORTED"
#define STRING_FT5402_START_RX "FT5X02_START_RX"
#define STRING_FT5402_ADC_TARGET "FT5X02_ADC_TARGET"
#define STRING_FT5402_ESD_FILTER_FRAME "FT5X02_ESD_FILTER_FRAME"
#define STRING_FT5402_POINTS_STABLE_MACRO "FT5X02_POINTS_STABLE_MACRO"
#define STRING_FT5402_MIN_DELTA_X "FT5X02_MIN_DELTA_X"
#define STRING_FT5402_MIN_DELTA_Y "FT5X02_MIN_DELTA_Y"
#define STRING_FT5402_MIN_DELTA_STEP "FT5X02_MIN_DELTA_STEP"
#define STRING_FT5402_ESD_NOISE_MACRO "FT5X02_ESD_NOISE_MACRO"
#define STRING_FT5402_ESD_DIFF_VAL "FT5X02_ESD_DIFF_VAL"
#define STRING_FT5402_ESD_NEGTIVE "FT5X02_ESD_NEGTIVE"
#define STRING_FT5402_ESD_FILTER_FRAME "FT5X02_ESD_FILTER_FRAME"
#define STRING_FT5402_IO_LEVEL_SELECT "FT5X02_IO_LEVEL_SELECT"
#define STRING_FT5402_POINTID_DELAY_COUNT "FT5X02_POINTID_DELAY_COUNT"
#define STRING_FT5402_LIFTUP_FILTER_MACRO "FT5X02_LIFTUP_FILTER_MACRO"
#define STRING_FT5402_DIFFDATA_HANDLE "FT5X02_DIFFDATA_HANDLE" //_MACRO
#define STRING_FT5402_MIN_WATER_VAL "FT5X02_MIN_WATER_VAL"
#define STRING_FT5402_MAX_NOISE_VAL "FT5X02_MAX_NOISE_VAL"
#define STRING_FT5402_WATER_HANDLE_START_RX "FT5X02_WATER_HANDLE_START_RX"
#define STRING_FT5402_WATER_HANDLE_START_TX "FT5X02_WATER_HANDLE_START_TX"
#define STRING_FT5402_HOST_NUMBER_SUPPORTED "FT5X02_HOST_NUMBER_SUPPORTED"
#define STRING_FT5402_RV_G_RAISE_THGROUP "FT5X02_RV_G_RAISE_THGROUP"
#define STRING_FT5402_RV_G_CHARGER_STATE "FT5X02_RV_G_CHARGER_STATE"
#define STRING_FT5402_RV_G_FILTERID_START "FT5X02_RV_G_FILTERID_START"
#define STRING_FT5402_FRAME_FILTER_EN "FT5X02_FRAME_FILTER_EN"
#define STRING_FT5402_FRAME_FILTER_SUB_MAX_TH "FT5X02_FRAME_FILTER_SUB_MAX_TH"
#define STRING_FT5402_FRAME_FILTER_ADD_MAX_TH "FT5X02_FRAME_FILTER_ADD_MAX_TH"
#define STRING_FT5402_FRAME_FILTER_SKIP_START_FRAME "FT5X02_FRAME_FILTER_SKIP_START_FRAME"
#define STRING_FT5402_FRAME_FILTER_BAND_EN "FT5X02_FRAME_FILTER_BAND_EN"
#define STRING_FT5402_FRAME_FILTER_BAND_WIDTH "FT5X02_FRAME_FILTER_BAND_WIDTH"
#define STRING_ft5402_tx_num "FT5X02_tx_num"
#define STRING_ft5402_rx_num "FT5X02_rx_num"
#define STRING_ft5402_gain "FT5X02_gain"
#define STRING_ft5402_voltage "FT5X02_voltage"
#define STRING_ft5402_scanselect "FT5X02_scanselect"
#define STRING_ft5402_tx_order "FT5X02_tx_order"
#define STRING_ft5402_tx_offset "FT5X02_tx_offset"
#define STRING_ft5402_tx_cap "FT5X02_tx_cap"
#define STRING_ft5402_rx_order "FT5X02_rx_order"
#define STRING_ft5402_rx_offset "FT5X02_rx_offset"
#define STRING_ft5402_rx_cap "FT5X02_rx_cap"
struct Struct_Param_FT5402 {
short ft5402_KX;
short ft5402_KY;
unsigned char ft5402_LEMDA_X;
unsigned char ft5402_LEMDA_Y;
short ft5402_RESOLUTION_X;
short ft5402_RESOLUTION_Y;
unsigned char ft5402_DIRECTION;
unsigned char ft5402_FACE_DETECT_PRE_VALUE;
unsigned char ft5402_FACE_DETECT_NUM;
unsigned char ft5402_BIGAREA_PEAK_VALUE_MIN;
unsigned char ft5402_BIGAREA_DIFF_VALUE_OVER_NUM;
unsigned char ft5402_CUSTOMER_ID;
unsigned char ft5402_PERIOD_ACTIVE;
unsigned char ft5402_FACE_DETECT_STATISTICS_TX_NUM;
short ft5402_THGROUP;
unsigned char ft5402_THPEAK;
unsigned char ft5402_FACE_DETECT_MODE;
short ft5402_MAX_TOUCH_VALUE;
unsigned char ft5402_PWMODE_CTRL;
unsigned char ft5402_DRAW_LINE_TH;
unsigned char ft5402_POINTS_SUPPORTED;
unsigned char ft5402_START_RX;
short ft5402_ADC_TARGET;
unsigned char ft5402_ESD_FILTER_FRAME;
unsigned char ft5402_POINTS_STABLE_MACRO;
unsigned char ft5402_MIN_DELTA_X;
unsigned char ft5402_MIN_DELTA_Y;
unsigned char ft5402_MIN_DELTA_STEP;
unsigned char ft5402_ESD_NOISE_MACRO;
unsigned char ft5402_ESD_DIFF_VAL;
char ft5402_ESD_NEGTIVE; //negtive
unsigned char ft5402_ESD_FILTER_FRAMES;
unsigned char ft5402_IO_LEVEL_SELECT;
unsigned char ft5402_POINTID_DELAY_COUNT;
unsigned char ft5402_LIFTUP_FILTER_MACRO;
unsigned char ft5402_DIFF_HANDLE_MACRO;
char ft5402_MIN_WATER; //negtive
unsigned char ft5402_MAX_NOISE;
unsigned char ft5402_WATER_START_RX;
unsigned char ft5402_WATER_START_TX;
unsigned char ft5402_HOST_NUMBER_SUPPORTED_MACRO;
unsigned char ft5402_RAISE_THGROUP;
unsigned char ft5402_CHARGER_STATE;
unsigned char ft5402_FILTERID_START;
unsigned char ft5402_FRAME_FILTER_EN_MACRO;
unsigned char ft5402_FRAME_FILTER_SUB_MAX_TH;
unsigned char ft5402_FRAME_FILTER_ADD_MAX_TH;
unsigned char ft5402_FRAME_FILTER_SKIP_START_FRAME;
unsigned char ft5402_FRAME_FILTER_BAND_EN;
unsigned char ft5402_FRAME_FILTER_BAND_WIDTH;
};
struct Struct_Param_FT5402 g_param_ft5402 = {
FT5402_KX,
FT5402_KY,
FT5402_LEMDA_X,
FT5402_LEMDA_Y,
FT5402_RESOLUTION_X,
FT5402_RESOLUTION_Y,
FT5402_DIRECTION,
FT5402_FACE_DETECT_PRE_VALUE,
FT5402_FACE_DETECT_NUM,
FT5402_BIGAREA_PEAK_VALUE_MIN,
FT5402_BIGAREA_DIFF_VALUE_OVER_NUM,
FT5402_CUSTOMER_ID,
FT5402_RV_G_PERIOD_ACTIVE,
FT5402_FACE_DETECT_STATISTICS_TX_NUM,
FT5402_THGROUP,
FT5402_THPEAK,
FT5402_FACE_DETECT_MODE,
FT5402_MAX_TOUCH_VALUE,
FT5402_PWMODE_CTRL,
FT5402_DRAW_LINE_TH,
FT5402_POINTS_SUPPORTED,
FT5402_START_RX,
FT5402_ADC_TARGET,
FT5402_ESD_FILTER_FRAME,
FT5402_POINTS_STABLE_MACRO,
FT5402_MIN_DELTA_X,
FT5402_MIN_DELTA_Y,
FT5402_MIN_DELTA_STEP,
FT5402_ESD_NOISE_MACRO,
FT5402_ESD_DIFF_VAL,
FT5402_ESD_NEGTIVE,
FT5402_ESD_FILTER_FRAME,
FT5402_IO_LEVEL_SELECT,
FT5402_POINTID_DELAY_COUNT,
FT5402_LIFTUP_FILTER_MACRO,
FT5402_DIFFDATA_HANDLE,
FT5402_MIN_WATER_VAL,
FT5402_MAX_NOISE_VAL,
FT5402_WATER_HANDLE_START_RX,
FT5402_WATER_HANDLE_START_TX,
FT5402_HOST_NUMBER_SUPPORTED,
FT5402_RV_G_RAISE_THGROUP,
FT5402_RV_G_CHARGER_STATE,
FT5402_RV_G_FILTERID_START,
FT5402_FRAME_FILTER_EN,
FT5402_FRAME_FILTER_SUB_MAX_TH,
FT5402_FRAME_FILTER_ADD_MAX_TH,
FT5402_FRAME_FILTER_SKIP_START_FRAME,
FT5402_FRAME_FILTER_BAND_EN,
FT5402_FRAME_FILTER_BAND_WIDTH,
};
char String_Param_FT5402[][64] = {
STRING_FT5402_KX,
STRING_FT5402_KY,
STRING_FT5402_LEMDA_X,
STRING_FT5402_LEMDA_Y,
STRING_FT5402_RESOLUTION_X,
STRING_FT5402_RESOLUTION_Y,
STRING_FT5402_DIRECTION,
STRING_FT5402_FACE_DETECT_PRE_VALUE,
STRING_FT5402_FACE_DETECT_NUM,
STRING_FT5402_BIGAREA_PEAK_VALUE_MIN,
STRING_FT5402_BIGAREA_DIFF_VALUE_OVER_NUM,
STRING_FT5402_CUSTOMER_ID,
STRING_FT5402_PERIOD_ACTIVE,
STRING_FT5402_FACE_DETECT_STATISTICS_TX_NUM,
STRING_FT5402_THGROUP,
STRING_FT5402_THPEAK,
STRING_FT5402_FACE_DETECT_MODE,
STRING_FT5402_MAX_TOUCH_VALUE,
STRING_FT5402_PWMODE_CTRL,
STRING_FT5402_DRAW_LINE_TH,
STRING_FT5402_POINTS_SUPPORTED,
STRING_FT5402_START_RX,
STRING_FT5402_ADC_TARGET,
STRING_FT5402_ESD_FILTER_FRAME,
STRING_ft5402_tx_num,
STRING_ft5402_rx_num,
STRING_ft5402_gain,
STRING_ft5402_voltage ,
STRING_ft5402_scanselect,
STRING_ft5402_tx_order,
STRING_ft5402_tx_offset,
STRING_ft5402_tx_cap,
STRING_ft5402_rx_order,
STRING_ft5402_rx_offset,
STRING_ft5402_rx_cap,
STRING_FT5402_POINTS_STABLE_MACRO,
STRING_FT5402_MIN_DELTA_X,
STRING_FT5402_MIN_DELTA_Y,
STRING_FT5402_MIN_DELTA_STEP,
STRING_FT5402_ESD_NOISE_MACRO,
STRING_FT5402_ESD_DIFF_VAL,
STRING_FT5402_ESD_NEGTIVE,
STRING_FT5402_ESD_FILTER_FRAME,
STRING_FT5402_IO_LEVEL_SELECT,
STRING_FT5402_POINTID_DELAY_COUNT,
STRING_FT5402_LIFTUP_FILTER_MACRO,
STRING_FT5402_DIFFDATA_HANDLE,
STRING_FT5402_MIN_WATER_VAL,
STRING_FT5402_MAX_NOISE_VAL,
STRING_FT5402_WATER_HANDLE_START_RX,
STRING_FT5402_WATER_HANDLE_START_TX,
STRING_FT5402_HOST_NUMBER_SUPPORTED,
STRING_FT5402_RV_G_RAISE_THGROUP,
STRING_FT5402_RV_G_CHARGER_STATE,
STRING_FT5402_RV_G_FILTERID_START,
STRING_FT5402_FRAME_FILTER_EN,
STRING_FT5402_FRAME_FILTER_SUB_MAX_TH,
STRING_FT5402_FRAME_FILTER_ADD_MAX_TH,
STRING_FT5402_FRAME_FILTER_SKIP_START_FRAME,
STRING_FT5402_FRAME_FILTER_BAND_EN,
STRING_FT5402_FRAME_FILTER_BAND_WIDTH,
};
#define FT5402_APP_NAME "FT5X02_param"
#define FT5402_APP_LEGAL "Legal_File"
#define FT5402_APP_LEGAL_BYTE_1_STR "BYTE_1"
#define FT5402_APP_LEGAL_BYTE_2_STR "BYTE_2"
#define FT5402_APP_LEGAL_BYTE_1_VALUE 107
#define FT5402_APP_LEGAL_BYTE_2_VALUE 201
#define FT5402_INI_FILEPATH "/system/etc/firmware/"
#endif
|