text
[RRG-proxmark3.git] / armsrc / iso15693.h
blobdb25e2c60fc6c35ae41f3050bbfc76ff49ee02a8
1 //-----------------------------------------------------------------------------
2 // Jonathan Westhues, Aug 2005
3 // Gerhard de Koning Gans, April 2008, May 2011
4 //
5 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
6 // at your option, any later version. See the LICENSE.txt file for the text of
7 // the license.
8 //-----------------------------------------------------------------------------
9 // Definitions internal to the app source.
10 //-----------------------------------------------------------------------------
11 #ifndef __ISO15693_H
12 #define __ISO15693_H
14 #include "common.h"
15 #include "pm3_cmd.h" // struct
16 #include "iso15.h"
19 // Delays in SSP_CLK ticks.
20 // SSP_CLK runs at 13,56MHz / 32 = 423.75kHz when simulating a tag
21 #define DELAY_ISO15693_VCD_TO_VICC_SIM 132 // 132/423.75kHz = 311.5us from end of command EOF to start of tag response
23 //SSP_CLK runs at 13.56MHz / 4 = 3,39MHz when acting as reader. All values should be multiples of 16
24 #define DELAY_ISO15693_VCD_TO_VICC_READER 1056 // 1056/3,39MHz = 311.5us from end of command EOF to start of tag response
25 #define DELAY_ISO15693_VICC_TO_VCD_READER 1024 // 1024/3.39MHz = 302.1us between end of tag response and next reader command
27 void Iso15693InitReader(void);
28 void Iso15693InitTag(void);
29 void CodeIso15693AsReader(uint8_t *cmd, int n);
30 void CodeIso15693AsTag(uint8_t *cmd, size_t len);
32 void TransmitTo15693Reader(const uint8_t *cmd, size_t len, uint32_t *start_time, uint32_t slot_time, bool slow);
33 int GetIso15693CommandFromReader(uint8_t *received, size_t max_len, uint32_t *eof_time);
34 void TransmitTo15693Tag(const uint8_t *cmd, int len, uint32_t *start_time);
35 int GetIso15693AnswerFromTag(uint8_t *response, uint16_t max_len, uint16_t timeout, uint32_t *eof_time);
37 //void RecordRawAdcSamplesIso15693(void);
38 void AcquireRawAdcSamplesIso15693(void);
39 void ReaderIso15693(uint32_t parameter, iso15_card_select_t *p_card); // Simulate an ISO15693 reader - greg
40 void SimTagIso15693(uint8_t *uid); // simulate an ISO15693 tag - greg
41 void BruteforceIso15693Afi(uint32_t speed); // find an AFI of a tag - atrox
42 void DirectTag15693Command(uint32_t datalen, uint32_t speed, uint32_t recv, uint8_t *data); // send arbitrary commands from CLI - atrox
44 void SniffIso15693(uint8_t jam_search_len, uint8_t *jam_search_string);
46 int SendDataTag(uint8_t *send, int sendlen, bool init, bool speed_fast, uint8_t *recv,
47 uint16_t max_recv_len, uint32_t start_time, uint16_t timeout, uint32_t *eof_time);
49 int SendDataTagEOF(uint8_t *recv, uint16_t max_recv_len, uint32_t start_time, uint16_t timeout, uint32_t *eof_time);
51 void SetTag15693Uid(uint8_t *uid);
53 void DisablePrivacySlixLIso15693(uint8_t *password);
54 #endif