📄 m500auc.lst
字号:
13 =1 ///////////////////////////////////////////////////////////////////////////////
14 =1 //
15 =1 // Projekt : M500
16 =1 // Files : M500A.h M500A.c
17 =1 // Created : 01.04.00
18 =1 //
19 =1 // COMMENT:
20 =1 // This header file can be used either for a uC environment or for
21 =1 // Win32 DLL. Therefore the header MfOsDefs.h is included. Depending
22 =1 // on the environment different definitions are used for "FCT_PREF".
23 =1 // For the microcontroller system, all functions have the return type
24 =1 // "char". For the Win32 DLL the return types are changed to "long".
25 =1 // Further more the DLL functions need to be exported, so the
26 =1 // corresponding declarations are made.
27 =1 // MODIFICATIONS:
28 =1 // 01.04.00 HB first issue
29 =1 ///////////////////////////////////////////////////////////////////////////////
30 =1 #ifndef M500A_H
31 =1 #define M500A_H
32 =1
33 =1 #ifdef __cplusplus
=1 extern "C"
=1 {
=1 #endif
37 =1
38 =1 // General Include File for serveral defines concerning conditional library
39 =1 // compilation and microcontroller usage
40 =1 //#include <MfOsDefs.h>
41 =1
42 =1
43 =1 // P I C C - C O M M A N D S
44 =1 // commands which are handled by the tag
45 =1 // Each tag command is written to the reader IC and transfered via RF
46 =1 #define PICC_REQSTD 0x26 // request idle
47 =1 #define PICC_REQALL 0x52 // request all
48 =1 #define PICC_ANTICOLL1 0x93 // anticollision level 1
49 =1 #define PICC_ANTICOLL2 0x95 // anticollision level 2
50 =1 #define PICC_ANTICOLL3 0x97 // anticollision level 3
51 =1 #define PICC_AUTHENT1A 0x60 // authentication step 1
52 =1 #define PICC_AUTHENT1B 0x61 // authentication step 2
53 =1 #define PICC_READ 0x30 // read block
54 =1 #define PICC_WRITE 0xA0 // write block
55 =1 #define PICC_DECREMENT 0xC0 // decrement value
56 =1 #define PICC_INCREMENT 0xC1 // increment value
57 =1 #define PICC_RESTORE 0xC2 // restore command code
58 =1 #define PICC_TRANSFER 0xB0 // transfer command code
59 =1 #define PICC_HALT 0x50 // halt
60 =1
61 =1 // Mifare Error Codes
62 =1 // Each function returns a status value, which corresponds to the
63 =1 // mifare error codes.
64 =1 #define MI_OK 0
65 =1 #define MI_CHK_OK 0
66 =1 #define MI_CRC_ZERO 0
C51 COMPILER V7.20 M500AUC 12/08/2004 10:59:24 PAGE 9
67 =1
68 =1 #define MI_CRC_NOTZERO 1
69 =1
70 =1 #define MI_NOTAGERR (-1)
71 =1 #define MI_CHK_FAILED (-1)
72 =1 #define MI_CRCERR (-2)
73 =1 #define MI_CHK_COMPERR (-2)
74 =1 #define MI_EMPTY (-3)
75 =1 #define MI_AUTHERR (-4)
76 =1 #define MI_PARITYERR (-5)
77 =1 #define MI_CODEERR (-6)
78 =1
79 =1 #define MI_SERNRERR (-8)
80 =1 #define MI_KEYERR (-9)
81 =1 #define MI_NOTAUTHERR (-10)
82 =1 #define MI_BITCOUNTERR (-11)
83 =1 #define MI_BYTECOUNTERR (-12)
84 =1 #define MI_IDLE (-13)
85 =1 #define MI_TRANSERR (-14)
86 =1 #define MI_WRITEERR (-15)
87 =1 #define MI_INCRERR (-16)
88 =1 #define MI_DECRERR (-17)
89 =1 #define MI_READERR (-18)
90 =1 #define MI_OVFLERR (-19)
91 =1 #define MI_POLLING (-20)
92 =1 #define MI_FRAMINGERR (-21)
93 =1 #define MI_ACCESSERR (-22)
94 =1 #define MI_UNKNOWN_COMMAND (-23)
95 =1 #define MI_COLLERR (-24)
96 =1 #define MI_RESETERR (-25)
97 =1 #define MI_INITERR (-25)
98 =1 #define MI_INTERFACEERR (-26)
99 =1 #define MI_ACCESSTIMEOUT (-27)
100 =1 #define MI_NOBITWISEANTICOLL (-28)
101 =1 #define MI_QUIT (-30)
102 =1
103 =1 #define MI_RECBUF_OVERFLOW (-50)
104 =1 #define MI_SENDBYTENR (-51)
105 =1
106 =1 #define MI_SENDBUF_OVERFLOW (-53)
107 =1 #define MI_BAUDRATE_NOT_SUPPORTED (-54)
108 =1 #define MI_SAME_BAUDRATE_REQUIRED (-55)
109 =1
110 =1 #define MI_WRONG_PARAMETER_VALUE (-60)
111 =1
112 =1 #define MI_BREAK (-99)
113 =1 #define MI_NY_IMPLEMENTED (-100)
114 =1 #define MI_NO_MFRC (-101)
115 =1 #define MI_MFRC_NOTAUTH (-102)
116 =1 #define MI_WRONG_DES_MODE (-103)
117 =1 #define MI_HOST_AUTH_FAILED (-104)
118 =1
119 =1 #define MI_WRONG_LOAD_MODE (-106)
120 =1 #define MI_WRONG_DESKEY (-107)
121 =1 #define MI_MKLOAD_FAILED (-108)
122 =1 #define MI_FIFOERR (-109)
123 =1 #define MI_WRONG_ADDR (-110)
124 =1 #define MI_DESKEYLOAD_FAILED (-111)
125 =1
126 =1 #define MI_WRONG_SEL_CNT (-114)
127 =1
128 =1 #define MI_WRONG_TEST_MODE (-117)
C51 COMPILER V7.20 M500AUC 12/08/2004 10:59:24 PAGE 10
129 =1 #define MI_TEST_FAILED (-118)
130 =1 #define MI_TOC_ERROR (-119)
131 =1 #define MI_COMM_ABORT (-120)
132 =1 #define MI_INVALID_BASE (-121)
133 =1 #define MI_MFRC_RESET (-122)
134 =1 #define MI_WRONG_VALUE (-123)
135 =1 #define MI_VALERR (-124)
136 =1
137 =1 // _____________________________________________________________________________
138 =1 //
139 =1 // FUNCTION: M500PcdReset
140 =1 // IN: -
141 =1 // OUT: -
142 =1 // RETURN: MI_OK
143 =1 // MI_RESETERR
144 =1 // MI_INTERFACEERR
145 =1 // COMMENT: This function initiates a reset of the reader IC. Note, that
146 =1 // the reset pin of the reader has to be connected to the
147 =1 // expected port pin of the microcontroller.
148 =1 //
149 =1 char M500PcdReset(void);
150 =1
151 =1 // _____________________________________________________________________________
152 =1 //
153 =1 // FUNCTION: M500PcdConfig
154 =1 // IN: -
155 =1 // OUT: -
156 =1 // RETURN: MI_OK
157 =1 // MI_RESETERR
158 =1 // MI_INTERFACEERR
159 =1 // COMMENT: Configuration of the reader IC. This function has to be called
160 =1 // before the first data is written to the reader. A reset
161 =1 // is initiated and several registers are set.
162 =1 //
163 =1 char M500PcdConfig(void);
164 =1
165 =1 // _____________________________________________________________________________
166 =1 //
167 =1 // FUNCTION: M500PcdInOutSlaveConfig
168 =1 // IN: -
169 =1 // OUT: -
170 =1 // RETURN: MI_OK
171 =1 // MI_UNKNOWN_COMMAND
172 =1 // MI_ACCESSTIMEOUT
173 =1 // COMMENT: The reader IC is able to communicate with another reader IC
174 =1 // via the digital "mifare in" and "mifare out" interface. Therefore
175 =1 // one reader acts as a master and sends commands via "mifare out".
176 =1 // The other reader ic acts as a slave and receives data via
177 =1 // "mifare in" interface. The slave module can not be initialised
178 =1 // by the microcontroller because only the "mifare in/out"
179 =1 // interface is connected.For this reason, the slave module has
180 =1 // to be initialised once. For that the appropriate parameter
181 =1 // settings are written to
182 =1 // the E2PROM. After POR (power on reset) the IC reads these settings
183 =1 // and initialises automatically as slave.
184 =1 //
185 =1 char M500PcdInOutSlaveConfig(void);
186 =1
187 =1 // _____________________________________________________________________________
188 =1 //
189 =1 // FUNCTION: M500PcdInOutMasterConfig
190 =1 // IN: -
C51 COMPILER V7.20 M500AUC 12/08/2004 10:59:24 PAGE 11
191 =1 // OUT: -
192 =1 // RETURN: MI_OK
193 =1 // COMMENT: Corresponding to the slave configuration routine. This function
194 =1 // initialises the master reader IC. The function is additional
195 =1 // to the standard configuration "M500PcdConfig".
196 =1 //
197 =1 char M500PcdInOutMasterConfig(void);
198 =1
199 =1 // _____________________________________________________________________________
200 =1 //
201 =1 // FUNCTION: MfPcdLoadMk
202 =1 // IN: kl_mode PICC_AUTHENT1A or PICC_AUTHENT1B
203 =1 // selects master key A or master key B
204 =1 // KS0, KS1, KS2 selects one of the three master key sets.
205 =1 // key_addr spec. the key RAM address to which the data shall be
206 =1 // written (0..15)
207 =1 // mk pointer to a 6 byte authentication key
208 =1 // OUT: -
209 =1 // RETURN: MI_OK
210 =1 // COMMENT: In order to be "calling compatibel" to former libraries, this
211 =1 // function enables to store all keys in the microcontroller.
212 =1 // When calling the authentication function "M500PiccAuth",
213 =1 // these keys can be used.
214 =1 // Note: This concept supports backward compatibility for the
215 =1 // application software, but does not fulfill the same security
216 =1 // level because keys are in this case stored autside the secure key
217 =1 // memory of the MF RC500.
218 =1 //
219 =1 char M500PcdLoadMk(unsigned char kl_mode,
220 =1 unsigned char key_addr,
221 =1 unsigned char *mk);
222 =1
223 =1 // _____________________________________________________________________________
224 =1 //
225 =1 // FUNCTION: M500PcdLoadKeyE2
226 =1 // IN: key_type PICC_AUTHENT1A or PICC_AUTHENT1B
227 =1 // sector key sector number, on which the key should be stored
228 =1 // values from 0 to 15 are valid
229 =1 // uncoded_keys 6 bytes key
230 =1 // OUT: -
231 =1 // RETURN:
232 =1 // COMMENT: This function stores the keys in the reader internal E2PROM.
233 =1 // These keys are available for the function M500PiccAuthE2.
234 =1 //
235 =1 char M500PcdLoadKeyE2(unsigned char key_type,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -