-extern byte_t oddparity (const byte_t bt);
-extern uint32_t GetParity(const uint8_t * pbtCmd, int iLen);
-extern void AppendCrc14443a(uint8_t* data, int len);
+#include <stdint.h>
+#include <stdbool.h>
+#include "usb_cmd.h"
+#include "mifare.h"
+
+typedef struct {
+ uint8_t* response;
+ uint8_t* modulation;
+ uint16_t response_n;
+ uint16_t modulation_n;
+ uint32_t ProxToAirDuration;
+ uint8_t par; // enough for precalculated parity of 8 Byte responses
+} tag_response_info_t;
+
+extern void GetParity(const uint8_t *pbtCmd, uint16_t len, uint8_t *par);
+extern void AppendCrc14443a(uint8_t *data, int len);
+
+extern void RAMFUNC SnoopIso14443a(uint8_t param);
+extern void SimulateIso14443aTag(int tagType, int uid_1st, int uid_2nd, byte_t *data);
+extern void ReaderIso14443a(UsbCommand *c);
+extern void ReaderTransmit(uint8_t *frame, uint16_t len, uint32_t *timing);
+extern void ReaderTransmitBitsPar(uint8_t *frame, uint16_t bits, uint8_t *par, uint32_t *timing);
+extern void ReaderTransmitPar(uint8_t *frame, uint16_t len, uint8_t *par, uint32_t *timing);
+extern int ReaderReceive(uint8_t *receivedAnswer, uint8_t *par);
+extern void ReaderMifare(bool first_try);