]>
Commit | Line | Data |
---|---|---|
31abe49f MHS |
1 | #ifndef LFSAMPLING_H |
2 | #define LFSAMPLING_H | |
3 | ||
24c49d36 | 4 | #include "proxmark3.h" |
5 | #include "apps.h" | |
6 | #include "util.h" | |
7 | #include "string.h" | |
8 | #include "usb_cdc.h" // for usb_poll_validate_length | |
9 | #include "ticks.h" // for StartTicks | |
10 | ||
ac2df346 | 11 | /** |
12 | * acquisition of T55x7 LF signal. Similart to other LF, but adjusted with @marshmellows thresholds | |
13 | * the data is collected in BigBuf. | |
14 | **/ | |
94422fa2 | 15 | void doT55x7Acquisition(size_t sample_size); |
ac2df346 | 16 | |
31abe49f MHS |
17 | /** |
18 | * Initializes the FPGA for reader-mode (field on), and acquires the samples. | |
19 | * @return number of bits sampled | |
20 | **/ | |
1fbf8956 | 21 | uint32_t SampleLF(bool silent); |
31abe49f MHS |
22 | |
23 | /** | |
24 | * Initializes the FPGA for snoop-mode (field off), and acquires the samples. | |
25 | * @return number of bits sampled | |
26 | **/ | |
27 | ||
28 | uint32_t SnoopLF(); | |
29 | ||
30 | /** | |
31 | * @brief Does sample acquisition, ignoring the config values set in the sample_config. | |
32 | * This method is typically used by tag-specific readers who just wants to read the samples | |
33 | * the normal way | |
34 | * @param trigger_threshold | |
35 | * @param silent | |
36 | * @return number of bits sampled | |
37 | */ | |
38 | uint32_t DoAcquisition_default(int trigger_threshold, bool silent); | |
39 | /** | |
40 | * @brief Does sample acquisition, using the config values set in the sample_config. | |
41 | * @param trigger_threshold | |
42 | * @param silent | |
43 | * @return number of bits sampled | |
44 | */ | |
45 | ||
46 | uint32_t DoAcquisition_config( bool silent); | |
47 | ||
48 | /** | |
49 | * Setup the FPGA to listen for samples. This method downloads the FPGA bitstream | |
50 | * if not already loaded, sets divisor and starts up the antenna. | |
51 | * @param divisor : 1, 88> 255 or negative ==> 134.8 KHz | |
52 | * 0 or 95 ==> 125 KHz | |
53 | * | |
54 | **/ | |
55 | void LFSetupFPGAForADC(int divisor, bool lf_field); | |
56 | ||
31abe49f MHS |
57 | /** |
58 | * Called from the USB-handler to set the sampling configuration | |
59 | * The sampling config is used for std reading and snooping. | |
60 | * | |
61 | * Other functions may read samples and ignore the sampling config, | |
62 | * such as functions to read the UID from a prox tag or similar. | |
63 | * | |
64 | * Values set to '0' implies no change (except for averaging) | |
65 | * @brief setSamplingConfig | |
66 | * @param sc | |
67 | */ | |
68 | void setSamplingConfig(sample_config *sc); | |
69 | ||
70 | sample_config * getSamplingConfig(); | |
7838f4be | 71 | |
72 | void printConfig(); | |
73 | ||
74 | ||
31abe49f | 75 | #endif // LFSAMPLING_H |