#ifndef __APPS_H
#define __APPS_H
-#include <stdint.h>
-#include <stddef.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stdlib.h>
-//#include <sys/types.h>
+#include <stdarg.h>
#include "common.h"
+#include "usb_cdc.h"
#include "crc32.h"
#include "lfdemod.h"
#include "BigBuf.h"
#include "fpgaloader.h"
-#include "usb_cdc.h"
#include "hitag2.h"
#include "hitagS.h"
#include "mifare.h"
#include "pcf7931.h"
-//#include "des.h"
-//#include "aes.h"
#include "desfire.h"
#include "iso14443b.h"
-extern const uint8_t OddByteParity[256];
extern int rsamples; // = 0;
extern int tracing; // = TRUE;
extern uint8_t trigger;
//void DbpIntegers(int a, int b, int c);
void DbpString(char *str);
void Dbprintf(const char *fmt, ...);
+void DbprintfEx(uint32_t cmd, const char *fmt, ...);
void Dbhexdump(int len, uint8_t *d, bool bAsci);
// ADC Vref = 3300mV, and an (10M+1M):1M voltage divider on the HF input can measure voltages up to 36300 mV
#define MAX_ADC_LF_VOLTAGE 140800
int AvgAdc(int ch);
+void print_result(char *name, uint8_t *buf, size_t len);
void PrintToSendBuffer(void);
void ToSendStuffBit(int b);
void ToSendReset(void);
void T55xxWriteBlockExt(uint32_t Data, uint8_t Block, uint32_t Pwd, uint8_t PwdMode);
void T55xxReadBlock(uint16_t arg0, uint8_t Block, uint32_t Pwd);
void T55xxWakeUp(uint32_t Pwd);
-void TurnReadLFOn();
-void EM4xReadWord(uint8_t Address, uint32_t Pwd, uint8_t PwdMode);
-void EM4xWriteWord(uint32_t Data, uint8_t Address, uint32_t Pwd, uint8_t PwdMode);
+void TurnReadLFOn(uint32_t delay);
+void EM4xReadWord(uint8_t addr, uint32_t pwd, uint8_t usepwd);
+void EM4xWriteWord(uint32_t flag, uint32_t data, uint32_t pwd);
+void Cotag(uint32_t arg0);
/// iso14443b.h
void SimulateIso14443bTag(uint32_t pupi);
void ReadSTMemoryIso14443b(uint8_t numofblocks);
void RAMFUNC SnoopIso14443b(void);
void SendRawCommand14443B(uint32_t, uint32_t, uint8_t, uint8_t[]);
+void SendRawCommand14443B_Ex(UsbCommand *c);
+void AppendCrc14443b(uint8_t* data, int len);
+void ClearFpgaShiftingRegisters(void);
// iso14443a.h
void RAMFUNC SniffIso14443a(uint8_t param);
void OnSuccess();
void OnError(uint8_t reason);
-
// desfire_crypto.h
void *mifare_cryto_preprocess_data (desfiretag_t tag, void *data, size_t *nbytes, size_t offset, int communication_settings);
void *mifare_cryto_postprocess_data (desfiretag_t tag, void *data, size_t *nbytes, int communication_settings);
void EMVloadvalue(uint32_t tag, uint8_t* datain);
void EMVdumpcard(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif