]> cvs.zerfleddert.de Git - proxmark3-svn/blame_incremental - armsrc/apps.h
client/cmdparser.c: Cosmetic changes.
[proxmark3-svn] / armsrc / apps.h
... / ...
CommitLineData
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#include "stdint.h"\r
11#include "stddef.h"\r
12typedef unsigned char byte_t;\r
13\r
14// The large multi-purpose buffer, typically used to hold A/D samples,\r
15// maybe processed in some way.\r
16DWORD BigBuf[8000];\r
17\r
18/// appmain.h\r
19void ReadMem(int addr);\r
20void __attribute__((noreturn)) AppMain(void);\r
21void SamyRun(void);\r
22//void DbpIntegers(int a, int b, int c);\r
23void DbpString(char *str);\r
24void Dbprintf(const char *fmt, ...);\r
25\r
26void ToSendStuffBit(int b);\r
27void ToSendReset(void);\r
28void ListenReaderField(int limit);\r
29void AcquireRawAdcSamples125k(BOOL at134khz);\r
30void DoAcquisition125k(void);\r
31extern int ToSendMax;\r
32extern BYTE ToSend[];\r
33extern DWORD BigBuf[];\r
34\r
35/// fpga.h\r
36void FpgaSendCommand(WORD cmd, WORD v);\r
37void FpgaWriteConfWord(BYTE v);\r
38void FpgaDownloadAndGo(void);\r
39void FpgaGatherVersion(char *dst, int len);\r
40void FpgaSetupSsc(void);\r
41void SetupSpi(int mode);\r
42void FpgaSetupSscDma(BYTE *buf, int len);\r
43void SetAdcMuxFor(DWORD whichGpio);\r
44\r
45// Definitions for the FPGA commands.\r
46#define FPGA_CMD_SET_CONFREG (1<<12)\r
47#define FPGA_CMD_SET_DIVISOR (2<<12)\r
48// Definitions for the FPGA configuration word.\r
49#define FPGA_MAJOR_MODE_LF_READER (0<<5)\r
50#define FPGA_MAJOR_MODE_LF_SIMULATOR (1<<5)\r
51#define FPGA_MAJOR_MODE_HF_READER_TX (2<<5)\r
52#define FPGA_MAJOR_MODE_HF_READER_RX_XCORR (3<<5)\r
53#define FPGA_MAJOR_MODE_HF_SIMULATOR (4<<5)\r
54#define FPGA_MAJOR_MODE_HF_ISO14443A (5<<5)\r
55#define FPGA_MAJOR_MODE_LF_PASSTHRU (6<<5)\r
56#define FPGA_MAJOR_MODE_OFF (7<<5)\r
57// Options for the HF reader, tx to tag\r
58#define FPGA_HF_READER_TX_SHALLOW_MOD (1<<0)\r
59// Options for the HF reader, correlating against rx from tag\r
60#define FPGA_HF_READER_RX_XCORR_848_KHZ (1<<0)\r
61#define FPGA_HF_READER_RX_XCORR_SNOOP (1<<1)\r
62#define FPGA_HF_READER_RX_XCORR_QUARTER_FREQ (1<<2)\r
63// Options for the HF simulated tag, how to modulate\r
64#define FPGA_HF_SIMULATOR_NO_MODULATION (0<<0)\r
65#define FPGA_HF_SIMULATOR_MODULATE_BPSK (1<<0)\r
66#define FPGA_HF_SIMULATOR_MODULATE_212K (2<<0)\r
67// Options for ISO14443A\r
68#define FPGA_HF_ISO14443A_SNIFFER (0<<0)\r
69#define FPGA_HF_ISO14443A_TAGSIM_LISTEN (1<<0)\r
70#define FPGA_HF_ISO14443A_TAGSIM_MOD (2<<0)\r
71#define FPGA_HF_ISO14443A_READER_LISTEN (3<<0)\r
72#define FPGA_HF_ISO14443A_READER_MOD (4<<0)\r
73\r
74/// lfops.h\r
75void AcquireRawAdcSamples125k(BOOL at134khz);\r
76void ModThenAcquireRawAdcSamples125k(int delay_off,int period_0,int period_1,BYTE *command);\r
77void ReadTItag(void);\r
78void WriteTItag(DWORD idhi, DWORD idlo, WORD crc);\r
79void AcquireTiType(void);\r
80void AcquireRawBitsTI(void);\r
81void SimulateTagLowFrequency(int period, int gap, int ledcontrol);\r
82void CmdHIDsimTAG(int hi, int lo, int ledcontrol);\r
83void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol);\r
84void SimulateTagLowFrequencyBidir(int divisor, int max_bitlen);\r
85\r
86/// iso14443.h\r
87void SimulateIso14443Tag(void);\r
88void AcquireRawAdcSamplesIso14443(DWORD parameter);\r
89void ReadSRI512Iso14443(DWORD parameter);\r
90void ReadSRIX4KIso14443(DWORD parameter);\r
91void ReadSTMemoryIso14443(DWORD parameter,DWORD dwLast);\r
92void SnoopIso14443(void);\r
93\r
94/// iso14443a.h\r
95void SnoopIso14443a(void);\r
96void SimulateIso14443aTag(int tagType, int TagUid); // ## simulate iso14443a tag\r
97void ReaderIso14443a(DWORD parameter);\r
98void ReaderMifare(DWORD parameter);\r
99\r
100/// iso15693.h\r
101void AcquireRawAdcSamplesIso15693(void);\r
102void ReaderIso15693(DWORD parameter); // Simulate an ISO15693 reader - greg\r
103void SimTagIso15693(DWORD parameter); // simulate an ISO15693 tag - greg\r
104\r
105/// util.h\r
106#define LED_RED 1\r
107#define LED_ORANGE 2\r
108#define LED_GREEN 4\r
109#define LED_RED2 8\r
110#define BUTTON_HOLD 1\r
111#define BUTTON_NO_CLICK 0\r
112#define BUTTON_SINGLE_CLICK -1\r
113#define BUTTON_DOUBLE_CLICK -2\r
114#define BUTTON_ERROR -99\r
115int strlen(char *str);\r
116void *memcpy(void *dest, const void *src, int len);\r
117void *memset(void *dest, int c, int len);\r
118int memcmp(const void *av, const void *bv, int len);\r
119char *strncat(char *dest, const char *src, unsigned int n);\r
120void num_to_bytes(uint64_t n, size_t len, byte_t* dest);\r
121uint64_t bytes_to_num(byte_t* src, size_t len);\r
122\r
123void SpinDelay(int ms);\r
124void SpinDelayUs(int us);\r
125void LED(int led, int ms);\r
126void LEDsoff();\r
127int BUTTON_CLICKED(int ms);\r
128int BUTTON_HELD(int ms);\r
129void FormatVersionInformation(char *dst, int len, const char *prefix, void *version_information);\r
130\r
131#endif\r
Impressum, Datenschutz