]>
Commit | Line | Data |
---|---|---|
6658905f | 1 | //-----------------------------------------------------------------------------\r |
2 | // Definitions internal to the app source.\r | |
3 | // Jonathan Westhues, Aug 2005\r | |
4 | // Added ISO14443-A support by Gerhard de Koning Gans, April 2008\r | |
5 | //-----------------------------------------------------------------------------\r | |
6 | \r | |
7 | #ifndef __APPS_H\r | |
8 | #define __APPS_H\r | |
9 | \r | |
10 | /// appmain.c\r | |
11 | void AppMain(void);\r | |
12 | void DbpIntegers(int a, int b, int c);\r | |
13 | void DbpString(char *str);\r | |
14 | void SpinDelay(int ms);\r | |
959baa89 | 15 | void SpinDelayUs(int us);\r |
6658905f | 16 | void ToSendStuffBit(int b);\r |
17 | void ToSendReset(void);\r | |
7f348042 | 18 | void ListenReaderField(int limit); |
959baa89 | 19 | void AcquireRawAdcSamples125k(BOOL at134khz); |
20 | void DoAcquisition125k(BOOL at134khz); | |
6658905f | 21 | extern int ToSendMax;\r |
22 | extern BYTE ToSend[];\r | |
23 | extern DWORD BigBuf[];\r | |
24 | \r | |
25 | /// fpga.c\r | |
30f2a7d3 | 26 | void FpgaSendCommand(WORD cmd, WORD v);\r |
6658905f | 27 | void FpgaWriteConfWord(BYTE v);\r |
28 | void FpgaDownloadAndGo(void);\r | |
29 | void FpgaSetupSsc(void);\r | |
30 | void SetupSpi(int mode);\r | |
31 | void FpgaSetupSscDma(BYTE *buf, int len);\r | |
32 | void SetAdcMuxFor(int whichGpio);\r | |
33 | \r | |
30f2a7d3 | 34 | // Definitions for the FPGA commands.\r |
35 | #define FPGA_CMD_SET_CONFREG (1<<12)\r | |
36 | #define FPGA_CMD_SET_DIVISOR (2<<12)\r | |
6658905f | 37 | // Definitions for the FPGA configuration word.\r |
38 | #define FPGA_MAJOR_MODE_LF_READER (0<<5)\r | |
39 | #define FPGA_MAJOR_MODE_LF_SIMULATOR (1<<5)\r | |
40 | #define FPGA_MAJOR_MODE_HF_READER_TX (2<<5)\r | |
41 | #define FPGA_MAJOR_MODE_HF_READER_RX_XCORR (3<<5)\r | |
42 | #define FPGA_MAJOR_MODE_HF_SIMULATOR (4<<5)\r | |
43 | #define FPGA_MAJOR_MODE_HF_ISO14443A (5<<5)\r | |
44 | #define FPGA_MAJOR_MODE_UNUSED (6<<5)\r | |
45 | #define FPGA_MAJOR_MODE_OFF (7<<5)\r | |
46 | // Options for the LF reader\r | |
47 | #define FPGA_LF_READER_USE_125_KHZ (1<<3)\r | |
48 | #define FPGA_LF_READER_USE_134_KHZ (0<<3)\r | |
49 | // Options for the HF reader, tx to tag\r | |
50 | #define FPGA_HF_READER_TX_SHALLOW_MOD (1<<0)\r | |
51 | // Options for the HF reader, correlating against rx from tag\r | |
52 | #define FPGA_HF_READER_RX_XCORR_848_KHZ (1<<0)\r | |
53 | #define FPGA_HF_READER_RX_XCORR_SNOOP (1<<1)\r | |
54 | // Options for the HF simulated tag, how to modulate\r | |
55 | #define FPGA_HF_SIMULATOR_NO_MODULATION (0<<0)\r | |
56 | #define FPGA_HF_SIMULATOR_MODULATE_BPSK (1<<0)\r | |
57 | // Options for ISO14443A\r | |
58 | #define FPGA_HF_ISO14443A_SNIFFER (0<<0)\r | |
59 | #define FPGA_HF_ISO14443A_TAGSIM_LISTEN (1<<0)\r | |
60 | #define FPGA_HF_ISO14443A_TAGSIM_MOD (2<<0)\r | |
61 | #define FPGA_HF_ISO14443A_READER_LISTEN (3<<0)\r | |
62 | #define FPGA_HF_ISO14443A_READER_MOD (4<<0)\r | |
63 | \r | |
64 | /// iso14443.h\r | |
65 | void SimulateIso14443Tag(void);\r | |
66 | void AcquireRawAdcSamplesIso14443(DWORD parameter);\r | |
fb25b483 | 67 | void ReadSRI512Iso14443(DWORD parameter); |
6658905f | 68 | void SnoopIso14443(void);\r |
69 | \r | |
70 | /// iso14443a.h\r | |
71 | void SnoopIso14443a(void);\r | |
72 | void SimulateIso14443aTag(int tagType, int TagUid); // ## simulate iso14443a tag\r | |
73 | void ReaderIso14443a(DWORD parameter);\r | |
74 | \r | |
75 | /// iso15693.h\r | |
76 | void AcquireRawAdcSamplesIso15693(void);\r | |
77 | void ReaderIso15693(DWORD parameter); // Simulate an ISO15693 reader - greg\r | |
78 | void SimTagIso15693(DWORD parameter); // simulate an ISO15693 tag - greg\r | |
79 | \r | |
80 | /// util.h\r | |
81 | int strlen(char *str);\r | |
82 | void *memcpy(void *dest, const void *src, int len);\r | |
83 | void *memset(void *dest, int c, int len);\r | |
84 | int memcmp(const void *av, const void *bv, int len);\r | |
85 | \r | |
86 | #endif\r |