-
Notifications
You must be signed in to change notification settings - Fork 0
/
core.con.fingerprint-8552.spin
131 lines (101 loc) · 3.42 KB
/
core.con.fingerprint-8552.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
{
----------------------------------------------------------------------------------------------------
Filename: core.con.fingerprint-8552.spin
Description: Fingerprint-8552-specific constants
Author: Jesse Burt
Started: May 18, 2020
Updated: Oct 21, 2024
Copyright (c) 2024 - See end of file for terms of use.
----------------------------------------------------------------------------------------------------
}
CON
' UART configuration
UART_MODE = %0000
UART_MAX_BPS = 19_200
SOM = $F5
EOM = $F5
' Structure of 8 byte command
IDX_SOM = 0
IDX_CMD = 1
IDX_P1 = 2
IDX_P2 = 3
IDX_P3 = 4
IDX_0 = 5
IDX_CHK = 6
IDX_EOM = 7
' Structure of 8 byte response (as above, but with these differences)
IDX_Q1 = 2
IDX_Q2 = 3
IDX_Q3 = 4
' Structure of >8 byte command (as above, but with these differences)
IDX_LENMSB = 2
IDX_LENLSB = 3
IDX_0M = 4
IDX_0L = 5
' Checksum start and end
CKSUM_START = 1
CKSUM_END = 5
' Status bytes
ACK_SUCCESS = $00
ACK_FAIL = $01
ACK_FULL = $04
ACK_NOUSER = $05
ACK_USER_EXIST = $06
ACK_FIN_EXIST = $07
ACK_TIMEOUT = $08
' Command set
ADD_FNGPRT_01 = $01
ADD_FNGPRT_02 = $02
ADD_FNGPRT_03 = $03
UIDMSB = 0 '
UIDLSB = 1 ' $01-$FFF
PRIVILEGE = 2 ' 1, 2, 3
DEL_USER = $04
' UIDMSB = 0
' UIDLSB = 1
DEL_ALL_USERS = $05
RD_NR_USERS = $09
RD_USER_PRIV = $0A
' UIDMSB = 0
' UIDLSB = 1
COMPARE1TO1 = $0B
' UIDMSB = 0
' UIDLSB = 1
COMPARE1TON = $0C
RD_IMAGES = $23
RD_DSP_VER = $26
CMP_LEVEL = $28
CMP_LEVEL_R = $01
' 0 = 0
NEWLEVEL = 1
RW_CMPLEV = 2
RD_UID_PRIVS = $2B
DORMANT = $2C
FNGPRT_ADDMODE = $2D
' 0 = 0
RPT = 1
RW_ADD = 2
ADDMODE_W = 0
ADDMODE_R = 1
CAPTURE_TIMEOUT = $2E
' 0 = 0
TIMEOUT = 1
RW_TIMEOUT = 2
PUB null()
' This is not a top-level object
DAT
{
Copyright 2024 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.
}