Split str* and mem* into string.[ch]
[proxmark3-svn] / armsrc / apps.h
CommitLineData
15c4dc5a 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
f7e3ed82 10#include <stdint.h>
11#include <stddef.h>
15c4dc5a 12typedef unsigned char byte_t;
13
14// The large multi-purpose buffer, typically used to hold A/D samples,
15// maybe processed in some way.
f7e3ed82 16uint32_t BigBuf[8000];
15c4dc5a 17
18/// appmain.h
19void ReadMem(int addr);
20void __attribute__((noreturn)) AppMain(void);
21void SamyRun(void);
22//void DbpIntegers(int a, int b, int c);
23void DbpString(char *str);
24void Dbprintf(const char *fmt, ...);
25
26void ToSendStuffBit(int b);
27void ToSendReset(void);
28void ListenReaderField(int limit);
f7e3ed82 29void AcquireRawAdcSamples125k(int at134khz);
15c4dc5a 30void DoAcquisition125k(void);
31extern int ToSendMax;
f7e3ed82 32extern uint8_t ToSend[];
33extern uint32_t BigBuf[];
15c4dc5a 34
35/// fpga.h
f7e3ed82 36void FpgaSendCommand(uint16_t cmd, uint16_t v);
37void FpgaWriteConfWord(uint8_t v);
15c4dc5a 38void FpgaDownloadAndGo(void);
39void FpgaGatherVersion(char *dst, int len);
40void FpgaSetupSsc(void);
41void SetupSpi(int mode);
f7e3ed82 42void FpgaSetupSscDma(uint8_t *buf, int len);
43void SetAdcMuxFor(uint32_t whichGpio);
15c4dc5a 44
45// Definitions for the FPGA commands.
46#define FPGA_CMD_SET_CONFREG (1<<12)
47#define FPGA_CMD_SET_DIVISOR (2<<12)
48// Definitions for the FPGA configuration word.
49#define FPGA_MAJOR_MODE_LF_READER (0<<5)
50#define FPGA_MAJOR_MODE_LF_SIMULATOR (1<<5)
51#define FPGA_MAJOR_MODE_HF_READER_TX (2<<5)
52#define FPGA_MAJOR_MODE_HF_READER_RX_XCORR (3<<5)
53#define FPGA_MAJOR_MODE_HF_SIMULATOR (4<<5)
54#define FPGA_MAJOR_MODE_HF_ISO14443A (5<<5)
55#define FPGA_MAJOR_MODE_LF_PASSTHRU (6<<5)
56#define FPGA_MAJOR_MODE_OFF (7<<5)
57// Options for the HF reader, tx to tag
58#define FPGA_HF_READER_TX_SHALLOW_MOD (1<<0)
59// Options for the HF reader, correlating against rx from tag
60#define FPGA_HF_READER_RX_XCORR_848_KHZ (1<<0)
61#define FPGA_HF_READER_RX_XCORR_SNOOP (1<<1)
62#define FPGA_HF_READER_RX_XCORR_QUARTER_FREQ (1<<2)
63// Options for the HF simulated tag, how to modulate
64#define FPGA_HF_SIMULATOR_NO_MODULATION (0<<0)
65#define FPGA_HF_SIMULATOR_MODULATE_BPSK (1<<0)
66#define FPGA_HF_SIMULATOR_MODULATE_212K (2<<0)
67// Options for ISO14443A
68#define FPGA_HF_ISO14443A_SNIFFER (0<<0)
69#define FPGA_HF_ISO14443A_TAGSIM_LISTEN (1<<0)
70#define FPGA_HF_ISO14443A_TAGSIM_MOD (2<<0)
71#define FPGA_HF_ISO14443A_READER_LISTEN (3<<0)
72#define FPGA_HF_ISO14443A_READER_MOD (4<<0)
73
74/// lfops.h
f7e3ed82 75void AcquireRawAdcSamples125k(int at134khz);
76void ModThenAcquireRawAdcSamples125k(int delay_off,int period_0,int period_1,uint8_t *command);
15c4dc5a 77void ReadTItag(void);
f7e3ed82 78void WriteTItag(uint32_t idhi, uint32_t idlo, uint16_t crc);
15c4dc5a 79void AcquireTiType(void);
80void AcquireRawBitsTI(void);
81void SimulateTagLowFrequency(int period, int gap, int ledcontrol);
82void CmdHIDsimTAG(int hi, int lo, int ledcontrol);
83void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol);
84void SimulateTagLowFrequencyBidir(int divisor, int max_bitlen);
85
86/// iso14443.h
87void SimulateIso14443Tag(void);
f7e3ed82 88void AcquireRawAdcSamplesIso14443(uint32_t parameter);
89void ReadSRI512Iso14443(uint32_t parameter);
90void ReadSRIX4KIso14443(uint32_t parameter);
91void ReadSTMemoryIso14443(uint32_t parameter,uint32_t dwLast);
15c4dc5a 92void SnoopIso14443(void);
93
94/// iso14443a.h
95void SnoopIso14443a(void);
96void SimulateIso14443aTag(int tagType, int TagUid); // ## simulate iso14443a tag
f7e3ed82 97void ReaderIso14443a(uint32_t parameter);
98void ReaderMifare(uint32_t parameter);
15c4dc5a 99
100/// iso15693.h
101void AcquireRawAdcSamplesIso15693(void);
f7e3ed82 102void ReaderIso15693(uint32_t parameter); // Simulate an ISO15693 reader - greg
103void SimTagIso15693(uint32_t parameter); // simulate an ISO15693 tag - greg
15c4dc5a 104
105/// util.h
15c4dc5a 106
107#endif
Impressum, Datenschutz