FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/bsp/sim.h @ 143:afceeeb2cba1
Our nuc-fw is destined to become gsm-fw, so I went ahead and did the big hg mv
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Tue, 12 Nov 2013 05:35:48 +0000 |
parents | nuc-fw/bsp/sim.h@4179acab05f7 |
children |
comparison
equal
deleted
inserted
replaced
142:15d5977390c2 | 143:afceeeb2cba1 |
---|---|
1 /* | |
2 * SIM.H | |
3 * | |
4 * Pole Star SIM | |
5 * | |
6 * Target : ARM | |
7 * | |
8 * Copyright (c) Texas Instruments 1995-1997 | |
9 * | |
10 */ | |
11 | |
12 /* | |
13 * Device addresses - GCS000 (Gemini / Polestar) | |
14 * HER207 (Hercules) | |
15 */ | |
16 | |
17 #include "../include/config.h" | |
18 #include "../include/sys_types.h" | |
19 #include "../nucleus/nucleus.h" | |
20 | |
21 /* Flags activation section */ | |
22 // #define SIM_RETRY /* by default : NOT ACTIVE */ | |
23 //#define SIM_DEBUG_TRACE /* by default : NOT ACTIVE */ | |
24 //#define SIM_UWORD16_MASK 0x00ff //when using SIM entity not maped to length on 16 bits | |
25 #define SIM_UWORD16_MASK 0xffff //when using SIM entity maped to length on 16 bits | |
26 //#define SIM_APDU_TEST | |
27 //#define SIM_SAT_REFRESH_TEST | |
28 | |
29 #define SIM_CMD (MEM_SIM + 0x00) | |
30 #define SIM_STAT (MEM_SIM + 0x02) | |
31 #define SIM_CONF1 (MEM_SIM + 0x04) | |
32 #define SIM_CONF2 (MEM_SIM + 0x06) | |
33 #define SIM_IT (MEM_SIM + 0x08) | |
34 #define SIM_DRX (MEM_SIM + 0x0A) | |
35 #define SIM_DTX (MEM_SIM + 0x0C) | |
36 #define SIM_MASK (MEM_SIM + 0x0E) | |
37 | |
38 | |
39 | |
40 /* | |
41 * Bit definitions | |
42 */ | |
43 // control regidter | |
44 #define SIM_CMD_CRST 0x0001 | |
45 #define SIM_CMD_SWRST 0x0002 | |
46 #define SIM_CMD_STOP 0x0004 | |
47 #define SIM_CMD_START 0x0008 | |
48 #define SIM_CMD_CLKEN 0x0010 | |
49 | |
50 // status register | |
51 #define SIM_STAT_CD 0x0001 // card present | |
52 #define SIM_STAT_TXPAR 0x0002 // transmit parity status | |
53 #define SIM_STAT_FFULL 0x0004 // fifo full | |
54 #define SIM_STAT_FEMPTY 0x0008 // fifo empty | |
55 | |
56 // configuration register | |
57 #define SIM_CONF1_CHKPAR 0x0001 // enable receipt check parity | |
58 #define SIM_CONF1_CONV 0x0002 // coding convention | |
59 #define SIM_CONF1_TXRX 0x0004 // SIO line direction | |
60 #define SIM_CONF1_SCLKEN 0x0008 // enable SIM clock | |
61 #define SIM_CONF1_RSVD 0x0010 // reserved | |
62 #define SIM_CONF1_SCLKDIV 0x0020 // SIM clock frquency | |
63 #define SIM_CONF1_SCLKLEV 0x0040 // SIM clock idle level | |
64 #define SIM_CONF1_ETU 0x0080 // ETU period | |
65 #define SIM_CONF1_BYPASS 0x0100 // bypass hardware timers | |
66 #define SIM_CONF1_SVCCLEV 0x0200 | |
67 #define SIM_CONF1_SRSTLEV 0x0400 | |
68 #define SIM_CONF1_SIOLOW 0x8000 //force SIO to low level | |
69 | |
70 // interrupt status register | |
71 #define SIM_IT_NATR 0x0001 // No answer to reset | |
72 #define SIM_IT_WT 0x0002 | |
73 #define SIM_IT_ITOV 0x0004 | |
74 #define SIM_IT_ITTX 0x0008 // Transmit | |
75 #define SIM_IT_ITRX 0x0010 // Receipt | |
76 | |
77 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | |
78 #define SIM_IT_CD 0x0001 // Card insertion/extraction | |
79 #else | |
80 #define SIM_IT_CD 0x0020 // Card insertion/extraction | |
81 #endif | |
82 | |
83 // interrupt mask register | |
84 #define SIM_MASK_NATR 0x0001 // No answer to reset | |
85 #define SIM_MASK_WT 0x0002 | |
86 #define SIM_MASK_OV 0x0004 | |
87 #define SIM_MASK_TX 0x0008 // Transmit | |
88 #define SIM_MASK_RX 0x0010 // Receipt | |
89 #define SIM_MASK_CD 0x0020 // Card insertion/extraction | |
90 | |
91 // receveid byte register | |
92 #define SIM_DRX_STATRXPAR 0x0100 // received byte parity status | |
93 | |
94 // SIM return code OK | |
95 #define SIM_OK 0 | |
96 | |
97 // SIM return error codes | |
98 #define SIM_ERR_NOCARD 1 | |
99 #define SIM_ERR_NOINT 2 | |
100 #define SIM_ERR_NATR 3 | |
101 #define SIM_ERR_READ 4 | |
102 #define SIM_ERR_XMIT 5 | |
103 #define SIM_ERR_OVF 6 | |
104 #define SIM_ERR_LEN 7 | |
105 #define SIM_ERR_CARDREJECT 8 | |
106 #define SIM_ERR_WAIT 9 | |
107 #define SIM_ERR_ABNORMAL_CASE1 10 | |
108 #define SIM_ERR_ABNORMAL_CASE2 11 | |
109 #define SIM_ERR_BUFF_OVERFL 12 | |
110 | |
111 // begin of JYT modifications | |
112 #define SIM_ERR_HARDWARE_FAIL 13 | |
113 // end of JYT modifications | |
114 #define SIM_ERR_RETRY_FAILURE 14 | |
115 | |
116 #define SIM_SLEEP_NONE 0 // No SIM available | |
117 #define SIM_SLEEP_DESACT 1 // The Driver is NOT currently in sleep mode (clock is off) | |
118 #define SIM_SLEEP_ACT 2 // The Driver is currently in sleep mode (clock is on) | |
119 #define SIM_SLEEP_NOT_ALLOWED 3 // The Driver cannot stop the clock : | |
120 // The card don't want or the interface is not able | |
121 // to do it. | |
122 #define SIM_SLEEP_WAITING_TIME 500 //represent 2.3s of period before entering in sleep mode | |
123 | |
124 #define SIM_CLK_STOP_MASK 0x0D // Clock Stop mask defined by ETSI 11.11 | |
125 #define SIM_CLK_STOP_NOT_ALLWD 0x00 // see ETSI 11.11 : Clock Stop never allowed | |
126 #define SIM_CLK_STOP_ALLWD 0x01 // see ETSI 11.11 : No prefered level | |
127 #define SIM_CLK_STOP_HIGH 0x04 // see ETSI 11.11 : High level only | |
128 #define SIM_CLK_STOP_LOW 0x08 // see ETSI 11.11 : Low level only | |
129 | |
130 #if(ANALOG == 1) | |
131 //OMEGA specific definitions | |
132 #define MODE5V_OMEGA 0x06 // used in SIM_SwitchVolt | |
133 #define MODE_INIT_OMEGA_3V 0x05 // used in SIM_StartVolt | |
134 #define MODE_INIT_OMEGA_5V 0x07 // unused !!!! | |
135 #define MODE3V_OMEGA 0x01 // unused !!!! | |
136 #define MODE_DIS_SIMLDOEN 0xDF // used in SIM_PowerOff | |
137 #define MODE_DIS_SIMEN 0xFD // used in SIM_PowerOff | |
138 #define MODE_ENA_SIMLDOEN 0x20 // used in SIM_ManualStart | |
139 #define MODE_ENA_SIMEN 0x02 // used in SIM_ManualStart | |
140 #elif(ANALOG == 2) | |
141 //IOTA specific definitions | |
142 #define MODE1_8V_IOTA 0x00 | |
143 #define MODE_INIT_IOTA_3V 0x03 | |
144 #define MODE_INIT_IOTA_1_8V 0x02 | |
145 #define MODE3V_IOTA 0x01 | |
146 #define MODE_DIS_SIMLDOEN 0xFC // SIMSEL + Regulator RSIMEN | |
147 #define MODE_DIS_SIMEN 0xF7 | |
148 #define MODE_ENA_SIMLDOEN 0x03 // SIMSEL + Regulator RSIMEN | |
149 #define MODE_ENA_SIMEN 0x08 | |
150 #elif(ANALOG == 3) | |
151 //SYREN specific definitions | |
152 #define MODE1_8V_SYREN 0x00 | |
153 #define MODE_INIT_SYREN_3V 0x03 | |
154 #define MODE_INIT_SYREN_1_8V 0x02 | |
155 #define MODE3V_SYREN 0x01 | |
156 #define MODE_DIS_SIMLDOEN 0x1FC // SIMSEL + Regulator RSIMEN | |
157 #define MODE_DIS_SIMEN 0x1F7 | |
158 #define MODE_ENA_SIMLDOEN 0x03 // SIMSEL + Regulator RSIMEN | |
159 #define MODE_ENA_SIMEN 0x08 | |
160 #endif | |
161 | |
162 // define type of interface if not defined | |
163 // 5V only ME SIM_TYPE = 0 | |
164 // 3V technology ME SIM_TYPE = 1 | |
165 // 3V only ME SIM_TYPE = 2 | |
166 // 1.8V technology ME SIM_TYPE = 3 // JYT, 29/01/02, from new specs IOTA | |
167 // 1.8V Only ME SIM_TYPE = 4 // JYT, 29/01/02, from new specs IOTA | |
168 | |
169 #define SIM_TYPE_5V 0 | |
170 #define SIM_TYPE_3_5V 1 | |
171 #define SIM_TYPE_3V 2 | |
172 #define SIM_TYPE_1_8_3V 3 | |
173 #define SIM_TYPE_1_8V 4 | |
174 | |
175 //default configuration | |
176 #ifndef SIM_TYPE | |
177 #if((ANALOG == 2) || (ANALOG == 3)) | |
178 // Until now (20/03/2003), it is impossible to test IOTA or SYREN with 1.8V Sim Card, | |
179 // so SIM drv is configured in 3V only with IOTA.and SYREN | |
180 // When 1.8V Sim Card will be delivered and tested on IOTA and SYREN, then Sim driver will pass | |
181 // to : #define SIM_TYPE SIM_TYPE_1_8_3V | |
182 #define SIM_TYPE SIM_TYPE_1_8_3V // MODIFY BY JENNIFER SIM_TYPE_3V | |
183 #else | |
184 #define SIM_TYPE SIM_TYPE_3_5V | |
185 #endif | |
186 #endif | |
187 | |
188 // begin of modifications of JYT | |
189 | |
190 #if((ANALOG == 2) || (ANALOG == 3)) | |
191 #define SIM_MASK_INFO_VOLT 0x70 | |
192 #else | |
193 #define SIM_MASK_INFO_VOLT 0x10 | |
194 #endif | |
195 | |
196 #define SIM_1_8V 0x30 | |
197 #define SIM_3V 0x10 | |
198 #define SIM_5V 0x00 | |
199 | |
200 // end of modifications of JYT | |
201 | |
202 // Max size of Answer to Reset (GSM11.11 5.7.1) | |
203 #define MAX_ATR_SIZE 33 | |
204 | |
205 // GSM Instruction Class (GSM 11.11 SIM spec) | |
206 #define GSM_CLASS 0xA0 | |
207 | |
208 // SIM Instruction Codes | |
209 #define SIM_SELECT 0xA4 | |
210 #define SIM_STATUS 0xF2 | |
211 #define SIM_READ_BINARY 0xB0 | |
212 #define SIM_UPDATE_BINARY 0xD6 | |
213 #define SIM_READ_RECORD 0xB2 | |
214 #define SIM_UPDATE_RECORD 0xDC | |
215 #define SIM_SEEK 0xA2 | |
216 #define SIM_INCREASE 0x32 | |
217 #define SIM_VERIFY_CHV 0x20 | |
218 #define SIM_CHANGE_CHV 0x24 | |
219 #define SIM_DISABLE_CHV 0x26 | |
220 #define SIM_ENABLE_CHV 0x28 | |
221 #define SIM_UNBLOCK_CHV 0x2C | |
222 #define SIM_INVALIDATE 0x04 | |
223 #define SIM_REHABILITATE 0x44 | |
224 #define SIM_RUN_GSM_ALGO 0x88 | |
225 #define SIM_GET_RESPONSE 0xC0 | |
226 #define SIM_TERMINAL_PROFILE 0x10 | |
227 #define SIM_FETCH 0x12 | |
228 #define SIM_TERMINAL_RESPONSE 0x14 | |
229 #define SIM_ENVELOPE 0xC2 | |
230 | |
231 | |
232 | |
233 // SIM file identifiers | |
234 #define MF 0x3F00 | |
235 #define EF_ICCID 0x2FE2 | |
236 #define DF_GSM 0x7F20 | |
237 #define DF_DCS1800 0x7F21 | |
238 #define EF_LP 0x6F05 | |
239 #define EF_IMSI 0x6F07 | |
240 #define EF_KC 0x6F20 | |
241 #define EF_PLMNSEL 0x6F30 | |
242 #define EF_HPLMN 0x6F31 | |
243 #define EF_ACMAX 0x6F37 | |
244 #define EF_SST 0x6F38 | |
245 #define EF_ACM 0x6F39 | |
246 #define EF_PUCT 0x6F41 | |
247 #define EF_CBMI 0x6F45 | |
248 #define EF_BCCH 0x6F74 | |
249 #define EF_ACC 0x6F78 | |
250 #define EF_FPLMN 0x6F7B | |
251 #define EF_LOCI 0x6F7E | |
252 #define EF_AD 0x6FAD | |
253 #define EF_PHASE 0x6FAE | |
254 #define DF_TELECOM 0x7F10 | |
255 #define EF_ADN 0x6F3A | |
256 #define EF_FDN 0x6F3B | |
257 #define EF_SMS 0x6F3C | |
258 #define EF_CCP 0x6F3D | |
259 #define EF_MSISDN 0x6F40 | |
260 #define EF_SMSP 0x6F42 | |
261 #define EF_SMSS 0x6F43 | |
262 #define EF_LND 0x6F44 | |
263 #define EF_EXT1 0x6F4A | |
264 #define EF_EXT2 0x6F4B | |
265 #define EF_ECC 0x6FB7 | |
266 | |
267 | |
268 #define MASK_INS 0xFE | |
269 #define MASK_CMD 0x11 | |
270 #define MASK_RST 0x10 | |
271 | |
272 | |
273 // Buffer sizes | |
274 #define RSIMBUFSIZE 270 | |
275 #define RSIZESW1SW2 2 | |
276 #define XSIMBUFSIZE 270 | |
277 | |
278 | |
279 | |
280 | |
281 // Structures | |
282 typedef struct | |
283 { | |
284 volatile unsigned short cmd; | |
285 volatile unsigned short stat; | |
286 volatile unsigned short conf1; | |
287 volatile unsigned short conf2; | |
288 volatile unsigned short it; | |
289 volatile unsigned short rx; | |
290 volatile unsigned short tx; | |
291 volatile unsigned short maskit; | |
292 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | |
293 volatile unsigned short it_cd; | |
294 #endif | |
295 } SIM_CONTROLLER; | |
296 | |
297 | |
298 typedef struct | |
299 { | |
300 SYS_UWORD8 Inverse; | |
301 SYS_UWORD8 AtrSize; | |
302 SYS_UWORD8 AtrData[MAX_ATR_SIZE]; | |
303 } SIM_CARD; | |
304 | |
305 | |
306 typedef struct | |
307 { | |
308 SIM_CONTROLLER *c; | |
309 SYS_UWORD8 *xIn; // xmit input pointer | |
310 SYS_UWORD8 *xOut; // xmit output pointer | |
311 unsigned errorSIM; // code return in case of error detectd | |
312 unsigned short conf1; // image of the configuration register - avoids read/mod/write cycles | |
313 volatile unsigned short txParityErr; | |
314 unsigned short rxParityErr; // if 0 no parity error on receipt, 1 if... | |
315 SYS_UWORD8 Freq_Algo; //use to determine which sim clk freq to choose for running GSM algo | |
316 SYS_UWORD8 PTS_Try; //use to calculate how many PTS try were already done | |
317 SYS_UWORD8 FileC; //value of File Characteristic | |
318 SYS_UWORD16 etu9600; | |
319 SYS_UWORD16 etu400; | |
320 SYS_UWORD16 startclock; //744 clock cycle translated in ETU | |
321 SYS_UWORD16 stopclock; //1860 clock cycle translated in ETU | |
322 SYS_UWORD8 moderx; //inform that we are in receive mode | |
323 // 0 : mode of normal reception without procedure | |
324 // 1 : mode of wait for acknowledge during reception of char | |
325 // 2 : mode of reception of data by bloc | |
326 // 3 : mode of reception of data char by char (proc char) | |
327 // 4 : mode of reception of data char by char (data) | |
328 // 5 : mode of reception of procedure char SW1/SW2 | |
329 // 6 : mode of wait for acknowledge char after transmission of char | |
330 SYS_UWORD16 expected_data; //number of expected char in receive mode proc char | |
331 SYS_UWORD8 ack; //acknowledge char | |
332 SYS_UWORD8 null_received; //indicates if a NULL char was received | |
333 SYS_UWORD8 hw_mask; //mask used because of pole112 hw prb | |
334 | |
335 SYS_UWORD8 rbuf[RSIMBUFSIZE]; | |
336 SYS_UWORD8 rx_index; // receive index on rbuf buffer | |
337 | |
338 SYS_UWORD8 xbuf[XSIMBUFSIZE]; | |
339 SYS_UWORD8 rSW12[RSIZESW1SW2]; //buffer to store SW1 and SW2 | |
340 SYS_UWORD8 SWcount; //static counter | |
341 void (*InsertFunc)(SIM_CARD *); | |
342 void (*RemoveFunc)(void); | |
343 SYS_UWORD16 apdu_ans_length; | |
344 } | |
345 SIM_PORT; | |
346 | |
347 | |
348 | |
349 void SIM_IntHandler(void); | |
350 #if ((CHIPSET == 4) || (CHIPSET == 5) || (CHIPSET == 6) || (CHIPSET == 7) || (CHIPSET == 8) || (CHIPSET == 9) || (CHIPSET == 10) || (CHIPSET == 11) || (CHIPSET == 12)) | |
351 void SIM_CD_IntHandler(void); | |
352 #endif | |
353 | |
354 | |
355 | |
356 | |
357 | |
358 /* | |
359 * Prototypes | |
360 */ | |
361 // obsolete function | |
362 void SIM_Init(void (Insert(SIM_CARD *cP)), void (Remove(void))); | |
363 | |
364 // initialization | |
365 void SIM_Initialize(void); | |
366 SYS_UWORD16 SIM_Register(void (Insert(SIM_CARD *cP)), void (Remove(void))); | |
367 SYS_UWORD16 SIM_Reset(SIM_CARD *cP); | |
368 SYS_UWORD16 SIM_Restart(SIM_CARD *cP); | |
369 | |
370 // file commands | |
371 SYS_UWORD16 SIM_Select(SYS_UWORD16 id, SYS_UWORD8 *dat, SYS_UWORD16 *size); | |
372 SYS_UWORD16 SIM_Status(SYS_UWORD8 *dat, SYS_UWORD16 *size); | |
373 SYS_UWORD16 SIM_ReadBinary(SYS_UWORD8 *dat, SYS_UWORD16 offset, SYS_UWORD16 len, SYS_UWORD16 *size); | |
374 SYS_UWORD16 SIM_UpdateBinary(SYS_UWORD8 *result, SYS_UWORD8 *dat, SYS_UWORD16 offset, SYS_UWORD16 len, SYS_UWORD16 *size); | |
375 SYS_UWORD16 SIM_ReadRecord(SYS_UWORD8 *dat, SYS_UWORD8 mode, SYS_UWORD8 recNum, SYS_UWORD16 len, SYS_UWORD16 *size); | |
376 SYS_UWORD16 SIM_UpdateRecord(SYS_UWORD8 *result, SYS_UWORD8 *dat, SYS_UWORD8 mode, SYS_UWORD8 recNum, SYS_UWORD16 len, SYS_UWORD16 *size); | |
377 SYS_UWORD16 SIM_Seek(SYS_UWORD8 *result, SYS_UWORD8 *dat, SYS_UWORD8 mode, SYS_UWORD16 len, SYS_UWORD16 *size); | |
378 SYS_UWORD16 SIM_Increase(SYS_UWORD8 *result, SYS_UWORD8 *dat, SYS_UWORD16 *size); | |
379 | |
380 // Authentication | |
381 SYS_UWORD16 SIM_VerifyCHV(SYS_UWORD8 *result, SYS_UWORD8 *chv, SYS_UWORD8 chvType, SYS_UWORD16 *size); | |
382 SYS_UWORD16 SIM_ChangeCHV(SYS_UWORD8 *result,SYS_UWORD8 *oldChv, SYS_UWORD8 *newChv, SYS_UWORD8 chvType, SYS_UWORD16 *size); | |
383 SYS_UWORD16 SIM_DisableCHV(SYS_UWORD8 *result, SYS_UWORD8 *dat, SYS_UWORD16 *size); | |
384 SYS_UWORD16 SIM_EnableCHV(SYS_UWORD8 *result, SYS_UWORD8 *dat, SYS_UWORD16 *size); | |
385 SYS_UWORD16 SIM_UnblockCHV(SYS_UWORD8 *result, SYS_UWORD8 *unblockChv, SYS_UWORD8 *newChv, SYS_UWORD8 chvType, SYS_UWORD16 *size); | |
386 | |
387 // managing | |
388 SYS_UWORD16 SIM_Invalidate(SYS_UWORD8 *rP, SYS_UWORD16 *size); | |
389 SYS_UWORD16 SIM_Rehabilitate(SYS_UWORD8 *rP, SYS_UWORD16 *size); | |
390 SYS_UWORD16 SIM_RunGSMAlgo(SYS_UWORD8 *result, SYS_UWORD8 *rand, SYS_UWORD16 *size); | |
391 SYS_UWORD16 SIM_GetResponse(SYS_UWORD8 *dat, SYS_UWORD16 len, SYS_UWORD16 *size); | |
392 | |
393 // STK | |
394 SYS_UWORD16 SIM_TerminalProfile(SYS_UWORD8 *result, SYS_UWORD8 *dat, SYS_UWORD16 len, SYS_UWORD16 *rcvSize); | |
395 SYS_UWORD16 SIM_Fetch(SYS_UWORD8 *result, SYS_UWORD16 len, SYS_UWORD16 *rcvSize); | |
396 SYS_UWORD16 SIM_TerminalResponse(SYS_UWORD8 *result, SYS_UWORD8 *dat, SYS_UWORD16 len, SYS_UWORD16 *rcvSize); | |
397 SYS_UWORD16 SIM_Envelope(SYS_UWORD8 *result, SYS_UWORD8 *dat, SYS_UWORD16 len, SYS_UWORD16 *rcvSize); | |
398 | |
399 // power off | |
400 void SIM_PowerOff(void); | |
401 | |
402 // WIM | |
403 SYS_UWORD16 SIM_XchTPDU(SYS_UWORD8 *dat, SYS_UWORD16 trxLen, SYS_UWORD8 *result, | |
404 SYS_UWORD16 rcvLen, SYS_UWORD16 *rcvSize); | |
405 | |
406 void SIM_lock_cr17689(void); | |
407 | |
408 | |
409 | |
410 /* | |
411 * Internal Prototypes | |
412 */ | |
413 void SIM_WriteBuffer(SIM_PORT *p, SYS_UWORD16 offset, SYS_UWORD16 n); | |
414 SYS_UWORD16 SIM_Result(SIM_PORT *p, SYS_UWORD8 *rP, SYS_UWORD16 *lenP, SYS_UWORD8 offset); | |
415 SYS_UWORD16 SIM_Command(SIM_PORT *p, SYS_UWORD16 n, SYS_UWORD8 *rP, SYS_UWORD16 *lP); | |
416 SYS_UWORD16 SIM_Command_Base(SIM_PORT *p, SYS_UWORD16 n, SYS_UWORD8 *dP, SYS_UWORD16 *lP); | |
417 SYS_UWORD16 SIM_Dummy(void); | |
418 void SIM_InitLog(void); | |
419 | |
420 SYS_UWORD16 SIM_TxParityErrors(); | |
421 SYS_UWORD16 SIM_WaitReception(SIM_PORT *p); | |
422 void SIM_Interpret_FileCharacteristics(SIM_PORT *p); | |
423 SYS_UWORD16 SIM_PTSprocedure(SIM_CARD *cP, SIM_PORT *p); | |
424 void SIM_WARMReset (SIM_PORT *p); | |
425 void SIM_SleepMode_In(SYS_UWORD32 param); | |
426 void SIM_SleepMode_Out(SIM_PORT *p); | |
427 SYS_UWORD8 SIM_GetFileCharacteristics(SIM_PORT *p); | |
428 SYS_UWORD16 SIM_ATRdynamictreatement (SIM_PORT *p, SIM_CARD *cP); | |
429 SYS_UWORD16 SIM_Waitforchars (SIM_PORT *p, SYS_UWORD16 max_wait); | |
430 void SIM_Calcetu (SIM_PORT *p); | |
431 SYS_UWORD8 SIM_Translate_atr_char (SYS_UWORD8 input, SIM_CARD *cP); | |
432 | |
433 | |
434 SYS_UWORD8 SIM_StartVolt (SYS_UWORD8 ResetFlag); | |
435 SYS_UWORD8 SIM_SwitchVolt (SYS_UWORD8 ResetFlag); | |
436 | |
437 SYS_UWORD16 SIM_ManualStart (SIM_PORT *p); | |
438 SYS_UWORD8 SIM_Memcpy(SYS_UWORD8 *Buff_target, SYS_UWORD8 Buff_source[], SYS_UWORD16 len); | |
439 SYS_BOOL SIM_SleepStatus(void); | |
440 SYS_UWORD16 SIM_Reset_Restart_Internal(SIM_CARD *cP, SYS_UWORD8 ResetFlag); | |
441 | |
442 /* | |
443 * Global variables | |
444 */ | |
445 #ifdef SIM_C | |
446 #define SI_GLOBAL | |
447 #else | |
448 #define SI_GLOBAL extern | |
449 #endif | |
450 | |
451 | |
452 SI_GLOBAL SIM_PORT Sim[1]; | |
453 SI_GLOBAL NU_TIMER SIM_timer; | |
454 SI_GLOBAL STATUS status_os_sim; | |
455 SI_GLOBAL SYS_UWORD8 SIM_sleep_status; |