| 1 | //----------------------------------------------------------------------------- |
| 2 | // Hagen Fritsch - June 2010 |
| 3 | // |
| 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 |
| 6 | // the license. |
| 7 | |
| 8 | //----------------------------------------------------------------------------- |
| 9 | // Interlib Definitions |
| 10 | //----------------------------------------------------------------------------- |
| 11 | |
| 12 | #ifndef __COMMON_H |
| 13 | #define __COMMON_H |
| 14 | |
| 15 | #include <stdint.h> |
| 16 | |
| 17 | //----------------------------------------------------------------------------- |
| 18 | // ISO 14443A |
| 19 | //----------------------------------------------------------------------------- |
| 20 | typedef struct { |
| 21 | uint8_t atqa[2]; |
| 22 | uint8_t sak; |
| 23 | uint8_t ats_len; |
| 24 | uint8_t ats[20]; //FIXME: size? |
| 25 | } __attribute__((__packed__)) iso14a_card_select_t; |
| 26 | |
| 27 | typedef enum ISO14A_COMMAND { |
| 28 | ISO14A_CONNECT = 1, |
| 29 | ISO14A_NO_DISCONNECT = 2, |
| 30 | ISO14A_APDU = 4, |
| 31 | ISO14A_RAW = 8, |
| 32 | ISO14A_REQUEST_TRIGGER = 0x10, |
| 33 | ISO14A_APPEND_CRC = 0x20, |
| 34 | ISO14A_SET_TIMEOUT = 0x40 |
| 35 | } iso14a_command_t; |
| 36 | |
| 37 | #endif |