forked from SanniZ/fpc1020-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fpc1020_regs.h
103 lines (93 loc) · 4.25 KB
/
fpc1020_regs.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
/* FPC1020 Touch sensor driver
*
* Copyright (c) 2013,2014 Fingerprint Cards AB <[email protected]>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License Version 2
* as published by the Free Software Foundation.
*/
#ifndef __FPC1020_REGS_H
#define __FPC1020_REGS_H
typedef enum {
/* --- Common registers --- */
FPC102X_REG_FPC_STATUS = 20, /* RO, 1 bytes */
FPC102X_REG_READ_INTERRUPT = 24, /* RO, 1 byte */
FPC102X_REG_READ_INTERRUPT_WITH_CLEAR = 28, /* RO, 1 byte */
FPC102X_REG_READ_ERROR_WITH_CLEAR = 56, /* RO, 1 byte */
FPC102X_REG_MISO_EDGE_RIS_EN = 64, /* WO, 1 byte */
FPC102X_REG_FPC_CONFIG = 68, /* RW, 1 byte */
FPC102X_REG_IMG_SMPL_SETUP = 76, /* RW, 3 bytes */
FPC102X_REG_CLOCK_CONFIG = 80, /* RW, 1 byte */
FPC102X_REG_IMG_CAPT_SIZE = 84, /* RW, 4 bytes */
FPC102X_REG_IMAGE_SETUP = 92, /* RW, 1 byte */
FPC102X_REG_ADC_TEST_CTRL = 96, /* RW, 1 byte */
FPC102X_REG_IMG_RD = 100, /* RW, 1 byte */
FPC102X_REG_SAMPLE_PX_DLY = 104, /* RW, 8 bytes */
FPC102X_REG_PXL_RST_DLY = 108, /* RW, 1 byte */
FPC102X_REG_TST_COL_PATTERN_EN = 120, /* RW, 2 bytes */
FPC102X_REG_CLK_BIST_RESULT = 124, /* RW, 4 bytes */
FPC102X_REG_ADC_WEIGHT_SETUP = 132, /* RW, 1 byte */
FPC102X_REG_ANA_TEST_MUX = 136, /* RW, 4 bytes */
FPC102X_REG_FINGER_DRIVE_CONF = 140, /* RW, 1 byte */
FPC102X_REG_FINGER_DRIVE_DLY = 144, /* RW, 1 byte */
FPC102X_REG_OSC_TRIM = 148, /* RW, 2 bytes */
FPC102X_REG_ADC_WEIGHT_TABLE = 152, /* RW, 10 bytes */
FPC102X_REG_ADC_SETUP = 156, /* RW, 5 bytes */
FPC102X_REG_ADC_SHIFT_GAIN = 160, /* RW, 2 bytes */
FPC102X_REG_BIAS_TRIM = 164, /* RW, 1 byte */
FPC102X_REG_PXL_CTRL = 168, /* RW, 2 bytes */
FPC102X_REG_FPC_DEBUG = 208, /* RO, 1 bytes */
FPC102X_REG_FINGER_PRESENT_STATUS = 212, /* RO, 2 bytes */
FPC102X_REG_HWID = 252, /* RO, 2 bytes */
/* --- fpc1020/21 specific --- */
FPC1020_REG_FNGR_DET_THRES = 216, /* RW, 1 byte */
FPC1020_REG_FNGR_DET_CNTR = 220, /* RW, 2 bytes */
/* --- fpc1150 specific --- */
FPC1150_REG_OFFSET = 1000, /* Not a register ! */
FPC1150_REG_FNGR_DET_THRES = 1216, /* RW, 4 byte */
FPC1150_REG_FNGR_DET_CNTR = 1220, /* RW, 4 bytes */
} fpc1020_reg_t;
#define FPC1020_REG_MAX_SIZE 10
#define FPC1020_REG_SIZE(reg) ( \
((reg) == FPC102X_REG_FPC_STATUS) ? 1 : \
((reg) == FPC102X_REG_READ_INTERRUPT) ? 1 : \
((reg) == FPC102X_REG_READ_INTERRUPT_WITH_CLEAR) ? 1 : \
((reg) == FPC102X_REG_READ_ERROR_WITH_CLEAR) ? 1 : \
((reg) == FPC102X_REG_MISO_EDGE_RIS_EN) ? 1 : \
((reg) == FPC102X_REG_FPC_CONFIG) ? 1 : \
((reg) == FPC102X_REG_IMG_SMPL_SETUP) ? 3 : \
((reg) == FPC102X_REG_CLOCK_CONFIG) ? 1 : \
((reg) == FPC102X_REG_IMG_CAPT_SIZE) ? 4 : \
((reg) == FPC102X_REG_IMAGE_SETUP) ? 1 : \
((reg) == FPC102X_REG_ADC_TEST_CTRL) ? 1 : \
((reg) == FPC102X_REG_IMG_RD) ? 1 : \
((reg) == FPC102X_REG_SAMPLE_PX_DLY) ? 8 : \
((reg) == FPC102X_REG_PXL_RST_DLY) ? 1 : \
((reg) == FPC102X_REG_TST_COL_PATTERN_EN) ? 2 : \
((reg) == FPC102X_REG_CLK_BIST_RESULT) ? 4 : \
((reg) == FPC102X_REG_ADC_WEIGHT_SETUP) ? 1 : \
((reg) == FPC102X_REG_ANA_TEST_MUX) ? 4 : \
((reg) == FPC102X_REG_FINGER_DRIVE_CONF) ? 1 : \
((reg) == FPC102X_REG_FINGER_DRIVE_DLY) ? 1 : \
((reg) == FPC102X_REG_OSC_TRIM) ? 2 : \
((reg) == FPC102X_REG_ADC_WEIGHT_TABLE) ? 10 :\
((reg) == FPC102X_REG_ADC_SETUP) ? 5 : \
((reg) == FPC102X_REG_ADC_SHIFT_GAIN) ? 2 : \
((reg) == FPC102X_REG_BIAS_TRIM) ? 1 : \
((reg) == FPC102X_REG_PXL_CTRL) ? 2 : \
((reg) == FPC102X_REG_FPC_DEBUG) ? 2 : \
((reg) == FPC102X_REG_FINGER_PRESENT_STATUS) ? 2 : \
((reg) == FPC102X_REG_HWID) ? 2 : \
\
((reg) == FPC1020_REG_FNGR_DET_THRES) ? 1 : \
((reg) == FPC1020_REG_FNGR_DET_CNTR) ? 2 : \
\
((reg) == FPC1150_REG_FNGR_DET_THRES) ? 4 : \
((reg) == FPC1150_REG_FNGR_DET_CNTR) ? 4 : \
0)
#define FPC1020_REG_ACCESS_DUMMY_BYTES(reg) ( \
((reg) == FPC102X_REG_FPC_STATUS) ? 1 : \
((reg) == FPC102X_REG_FPC_DEBUG) ? 1 : 0)
#define FPC1020_REG_TO_ACTUAL(reg) ( \
((reg) >= FPC1150_REG_OFFSET) ? ((reg) - FPC1150_REG_OFFSET) : (reg) )
#endif /* __FPC1020_REGS_H */