]> git.zerfleddert.de Git - proxmark3-svn/blob - armsrc/apps.h
fast flash mode (button already held down) and both (os & fpga) flashing mode
[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 /// appmain.c
11 void ReadMem(int addr);
12 void AppMain(void);
13 void SamyRun(void);
14 void DbpIntegers(int a, int b, int c);
15 void DbpString(char *str);
16 void ToSendStuffBit(int b);
17 void ToSendReset(void);
18 void ListenReaderField(int limit);
19 void AcquireRawAdcSamples125k(BOOL at134khz);
20 void DoAcquisition125k(BOOL at134khz);
21 extern int ToSendMax;
22 extern BYTE ToSend[];
23 extern DWORD BigBuf[];
24
25 /// fpga.c
26 void FpgaSendCommand(WORD cmd, WORD v);
27 void FpgaWriteConfWord(BYTE v);
28 void FpgaDownloadAndGo(void);
29 void FpgaSetupSsc(void);
30 void SetupSpi(int mode);
31 void FpgaSetupSscDma(BYTE *buf, int len);
32 void SetAdcMuxFor(int whichGpio);
33
34 // Definitions for the FPGA commands.
35 #define FPGA_CMD_SET_CONFREG (1<<12)
36 #define FPGA_CMD_SET_DIVISOR (2<<12)
37 // Definitions for the FPGA configuration word.
38 #define FPGA_MAJOR_MODE_LF_READER (0<<5)
39 #define FPGA_MAJOR_MODE_LF_SIMULATOR (1<<5)
40 #define FPGA_MAJOR_MODE_HF_READER_TX (2<<5)
41 #define FPGA_MAJOR_MODE_HF_READER_RX_XCORR (3<<5)
42 #define FPGA_MAJOR_MODE_HF_SIMULATOR (4<<5)
43 #define FPGA_MAJOR_MODE_HF_ISO14443A (5<<5)
44 #define FPGA_MAJOR_MODE_LF_PASSTHRU (6<<5)
45 #define FPGA_MAJOR_MODE_OFF (7<<5)
46 // Options for the HF reader, tx to tag
47 #define FPGA_HF_READER_TX_SHALLOW_MOD (1<<0)
48 // Options for the HF reader, correlating against rx from tag
49 #define FPGA_HF_READER_RX_XCORR_848_KHZ (1<<0)
50 #define FPGA_HF_READER_RX_XCORR_SNOOP (1<<1)
51 // Options for the HF simulated tag, how to modulate
52 #define FPGA_HF_SIMULATOR_NO_MODULATION (0<<0)
53 #define FPGA_HF_SIMULATOR_MODULATE_BPSK (1<<0)
54 // Options for ISO14443A
55 #define FPGA_HF_ISO14443A_SNIFFER (0<<0)
56 #define FPGA_HF_ISO14443A_TAGSIM_LISTEN (1<<0)
57 #define FPGA_HF_ISO14443A_TAGSIM_MOD (2<<0)
58 #define FPGA_HF_ISO14443A_READER_LISTEN (3<<0)
59 #define FPGA_HF_ISO14443A_READER_MOD (4<<0)
60
61 /// iso14443.h
62 void SimulateIso14443Tag(void);
63 void AcquireRawAdcSamplesIso14443(DWORD parameter);
64 void ReadSRI512Iso14443(DWORD parameter);
65 void SnoopIso14443(void);
66
67 /// iso14443a.h
68 void SnoopIso14443a(void);
69 void SimulateIso14443aTag(int tagType, int TagUid); // ## simulate iso14443a tag
70 void ReaderIso14443a(DWORD parameter);
71
72 /// iso15693.h
73 void AcquireRawAdcSamplesIso15693(void);
74 void ReaderIso15693(DWORD parameter); // Simulate an ISO15693 reader - greg
75 void SimTagIso15693(DWORD parameter); // simulate an ISO15693 tag - greg
76
77 /// util.h
78 #define LED_RED 1
79 #define LED_ORANGE 2
80 #define LED_GREEN 4
81 #define LED_RED2 8
82 #define BUTTON_HOLD 1
83 #define BUTTON_NO_CLICK 0
84 #define BUTTON_SINGLE_CLICK -1
85 #define BUTTON_DOUBLE_CLICK -2
86 #define BUTTON_ERROR -99
87 int strlen(char *str);
88 void *memcpy(void *dest, const void *src, int len);
89 void *memset(void *dest, int c, int len);
90 int memcmp(const void *av, const void *bv, int len);
91 void SpinDelay(int ms);
92 void SpinDelayUs(int us);
93 void LED(int led, int ms);
94 void LEDsoff();
95 int BUTTON_CLICKED(int ms);
96 int BUTTON_HELD(int ms);
97
98 #endif
Impressum, Datenschutz