1 //-----------------------------------------------------------------------------
2 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // See LICENSE.txt for the text of the license.
15 //-----------------------------------------------------------------------------
16 // ISO 14443B type prototyping
17 //-----------------------------------------------------------------------------
29 } PACKED iso14b_card_select_t
;
35 } PACKED iso14b_cts_card_select_t
;
37 typedef enum ISO14B_COMMAND
{
38 ISO14B_CONNECT
= (1 << 0),
39 ISO14B_DISCONNECT
= (1 << 1),
40 ISO14B_APDU
= (1 << 2),
41 ISO14B_RAW
= (1 << 3),
42 ISO14B_REQUEST_TRIGGER
= (1 << 4),
43 ISO14B_APPEND_CRC
= (1 << 5),
44 ISO14B_SELECT_STD
= (1 << 6),
45 ISO14B_SELECT_SR
= (1 << 7),
46 ISO14B_SET_TIMEOUT
= (1 << 8),
47 ISO14B_SEND_CHAINING
= (1 << 9),
48 ISO14B_SELECT_CTS
= (1 << 10),
49 ISO14B_CLEARTRACE
= (1 << 11),
50 ISO14B_SELECT_XRX
= (1 << 12),
51 ISO14B_SELECT_PICOPASS
= (1 << 13),
54 typedef enum ISO14B_TYPE
{
62 uint16_t flags
; // the ISO14B_COMMAND enum
66 } PACKED iso14b_raw_cmd_t
;
69 uint8_t response_byte
;
72 } PACKED iso14b_raw_apdu_response_t
;
74 #define US_TO_SSP(x) ( (int32_t) ((x) * 3.39) )
75 #define SSP_TO_US(x) ( (int32_t)((x) / 3.39) )
77 #define HF14_ETU_TO_SSP(x) ((x) << 5) // 1 ETU = 32 SSP
78 #define HF14_SSP_TO_ETU(x) ((x) >> 5) //
80 #define HF14_ETU_TO_US(x) ( (float)((x) * 9.4396) )
81 #define HF14_ETU_TO_US_2(x) ( (int32_t)( ((x) * 9439600) / 1000000) )
83 // #define US_TO_ETU(x) ( (int32_t)( ((x) * 1000000) / 9439600) )
85 #define US_TO_ETU(x) ( (float)((x) / 9.4396) )