1 //-----------------------------------------------------------------------------
4 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
5 // at your option, any later version. See the LICENSE.txt file for the text of
7 //-----------------------------------------------------------------------------
8 // ISO 14443B type prototyping
9 //-----------------------------------------------------------------------------
21 } PACKED iso14b_card_select_t
;
27 } PACKED iso14b_cts_card_select_t
;
29 typedef enum ISO14B_COMMAND
{
30 ISO14B_CONNECT
= (1 << 0),
31 ISO14B_DISCONNECT
= (1 << 1),
32 ISO14B_APDU
= (1 << 2),
33 ISO14B_RAW
= (1 << 3),
34 ISO14B_REQUEST_TRIGGER
= (1 << 4),
35 ISO14B_APPEND_CRC
= (1 << 5),
36 ISO14B_SELECT_STD
= (1 << 6),
37 ISO14B_SELECT_SR
= (1 << 7),
38 ISO14B_SET_TIMEOUT
= (1 << 8),
39 ISO14B_SEND_CHAINING
= (1 << 9),
40 ISO14B_SELECT_CTS
= (1 << 10),
41 ISO14B_CLEARTRACE
= (1 << 11),
45 uint16_t flags
; // the ISO14B_COMMAND enum
49 } PACKED iso14b_raw_cmd_t
;
52 #define US_TO_SSP(x) ( (uint32_t)((x) * 3.39) )
53 #define SSP_TO_US(x) ( (uint32_t)((x) / 3.39) )
55 #define ETU_TO_SSP(x) ((x) * 32)
56 #define SSP_TO_ETU(x) ((x) / 32)
58 #define ETU_TO_US(x) ((((x) * 9440000) / 1000000) + 0.5)
59 #define US_TO_ETU(x) ((((x) * 1000000 / 9440000) + 0.5))