]> git.zerfleddert.de Git - proxmark3-svn/blob - armsrc/apps.h
7605baa3c51f4a205329352fbb349440d72c4374
[proxmark3-svn] / armsrc / apps.h
1 //-----------------------------------------------------------------------------
2 // Definitions internal to the app source.
3 // Jonathan Westhues, Aug 2005
4 // Added ISO14443-A support by Gerhard de Koning Gans, April 2008
5 //-----------------------------------------------------------------------------
6
7 #ifndef __APPS_H
8 #define __APPS_H
9
10 // The large multi-purpose buffer, typically used to hold A/D samples,
11 // maybe processed in some way.
12 DWORD BigBuf[12000];
13
14 /// appmain.h
15 void ReadMem(int addr);
16 void AppMain(void);
17 void SamyRun(void);
18 void DbpIntegers(int a, int b, int c);
19 void DbpString(char *str);
20 void ToSendStuffBit(int b);
21 void ToSendReset(void);
22 void ListenReaderField(int limit);
23 void AcquireRawAdcSamples125k(BOOL at134khz);
24 void DoAcquisition125k(BOOL at134khz);
25 extern int ToSendMax;
26 extern BYTE ToSend[];
27 extern DWORD BigBuf[];
28
29 /// fpga.h
30 void FpgaSendCommand(WORD cmd, WORD v);
31 void FpgaWriteConfWord(BYTE v);
32 void FpgaDownloadAndGo(void);
33 void FpgaGatherVersion(char *dst, int len);
34 void FpgaSetupSsc(void);
35 void SetupSpi(int mode);
36 void FpgaSetupSscDma(BYTE *buf, int len);
37 void SetAdcMuxFor(int whichGpio);
38
39 // Definitions for the FPGA commands.
40 #define FPGA_CMD_SET_CONFREG (1<<12)
41 #define FPGA_CMD_SET_DIVISOR (2<<12)
42 // Definitions for the FPGA configuration word.
43 #define FPGA_MAJOR_MODE_LF_READER (0<<5)
44 #define FPGA_MAJOR_MODE_LF_SIMULATOR (1<<5)
45 #define FPGA_MAJOR_MODE_HF_READER_TX (2<<5)
46 #define FPGA_MAJOR_MODE_HF_READER_RX_XCORR (3<<5)
47 #define FPGA_MAJOR_MODE_HF_SIMULATOR (4<<5)
48 #define FPGA_MAJOR_MODE_HF_ISO14443A (5<<5)
49 #define FPGA_MAJOR_MODE_LF_PASSTHRU (6<<5)
50 #define FPGA_MAJOR_MODE_OFF (7<<5)
51 // Options for the HF reader, tx to tag
52 #define FPGA_HF_READER_TX_SHALLOW_MOD (1<<0)
53 // Options for the HF reader, correlating against rx from tag
54 #define FPGA_HF_READER_RX_XCORR_848_KHZ (1<<0)
55 #define FPGA_HF_READER_RX_XCORR_SNOOP (1<<1)
56 // Options for the HF simulated tag, how to modulate
57 #define FPGA_HF_SIMULATOR_NO_MODULATION (0<<0)
58 #define FPGA_HF_SIMULATOR_MODULATE_BPSK (1<<0)
59 // Options for ISO14443A
60 #define FPGA_HF_ISO14443A_SNIFFER (0<<0)
61 #define FPGA_HF_ISO14443A_TAGSIM_LISTEN (1<<0)
62 #define FPGA_HF_ISO14443A_TAGSIM_MOD (2<<0)
63 #define FPGA_HF_ISO14443A_READER_LISTEN (3<<0)
64 #define FPGA_HF_ISO14443A_READER_MOD (4<<0)
65
66 /// lfops.h
67 void AcquireRawAdcSamples125k(BOOL at134khz);
68 void DoAcquisition125k(BOOL at134khz);
69 void ModThenAcquireRawAdcSamples125k(int delay_off,int period_0,int period_1,BYTE *command);
70 void ReadTItag();
71 void WriteTItag(DWORD idhi, DWORD idlo, WORD crc);
72 void AcquireTiType(void);
73 void AcquireRawBitsTI(void);
74 void SimulateTagLowFrequency(int period, int ledcontrol);
75 void CmdHIDsimTAG(int hi, int lo, int ledcontrol);
76 void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol);
77
78 /// iso14443.h
79 void SimulateIso14443Tag(void);
80 void AcquireRawAdcSamplesIso14443(DWORD parameter);
81 void ReadSRI512Iso14443(DWORD parameter);
82 void SnoopIso14443(void);
83
84 /// iso14443a.h
85 void SnoopIso14443a(void);
86 void SimulateIso14443aTag(int tagType, int TagUid); // ## simulate iso14443a tag
87 void ReaderIso14443a(DWORD parameter);
88
89 /// iso15693.h
90 void AcquireRawAdcSamplesIso15693(void);
91 void ReaderIso15693(DWORD parameter); // Simulate an ISO15693 reader - greg
92 void SimTagIso15693(DWORD parameter); // simulate an ISO15693 tag - greg
93
94 /// util.h
95 #define LED_RED 1
96 #define LED_ORANGE 2
97 #define LED_GREEN 4
98 #define LED_RED2 8
99 #define BUTTON_HOLD 1
100 #define BUTTON_NO_CLICK 0
101 #define BUTTON_SINGLE_CLICK -1
102 #define BUTTON_DOUBLE_CLICK -2
103 #define BUTTON_ERROR -99
104 int strlen(char *str);
105 void *memcpy(void *dest, const void *src, int len);
106 void *memset(void *dest, int c, int len);
107 int memcmp(const void *av, const void *bv, int len);
108 char *strncat(char *dest, const char *src, unsigned int n);
109 void SpinDelay(int ms);
110 void SpinDelayUs(int us);
111 void LED(int led, int ms);
112 void LEDsoff();
113 int BUTTON_CLICKED(int ms);
114 int BUTTON_HELD(int ms);
115
116 #endif
Impressum, Datenschutz