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