21 * acquisition of Cotag LF signal. Similar to other LF, since the Cotag has such long datarate RF/384
22 * and is Manchester?, we directly gather the manchester data into bigbuff
24 void doCotagAcquisition(void);
25 uint16_t doCotagAcquisitionManchester(uint8_t *dest
, uint16_t destlen
);
28 * acquisition of T55x7 LF signal. Similar to other LF, but adjusted with @marshmellows thresholds
29 * the data is collected in BigBuf.
31 void doT55x7Acquisition(size_t sample_size
);
34 * Initializes the FPGA for reader-mode (field on), and acquires the samples.
35 * @return number of bits sampled
37 uint32_t SampleLF(bool verbose
, uint32_t sample_size
);
40 * Initializes the FPGA for sniff-mode (field off), and acquires the samples.
41 * @return number of bits sampled
43 uint32_t SniffLF(bool verbose
, uint32_t sample_size
);
45 uint32_t DoAcquisition(uint8_t decimation
, uint8_t bits_per_sample
, bool avg
, int16_t trigger_threshold
,
46 bool verbose
, uint32_t sample_size
, uint32_t cancel_after
, int32_t samples_to_skip
);
48 // adds sample size to default options
49 uint32_t DoPartialAcquisition(int trigger_threshold
, bool verbose
, uint32_t sample_size
, uint32_t cancel_after
);
52 * @brief Does sample acquisition, ignoring the config values set in the sample_config.
53 * This method is typically used by tag-specific readers who just wants to read the samples
55 * @param trigger_threshold
57 * @return number of bits sampled
59 uint32_t DoAcquisition_default(int trigger_threshold
, bool verbose
);
61 * @brief Does sample acquisition, using the config values set in the sample_config.
62 * @param trigger_threshold
64 * @return number of bits sampled
67 uint32_t DoAcquisition_config(bool verbose
, uint32_t sample_size
);
70 * Refactoring of lf sampling buffer
72 void initSampleBuffer(uint32_t *sample_size
);
73 void initSampleBufferEx(uint32_t *sample_size
, bool use_malloc
);
74 void logSampleSimple(uint8_t sample
);
75 void logSample(uint8_t sample
, uint8_t decimation
, uint8_t bits_per_sample
, bool avg
);
76 uint32_t getSampleCounter(void);
79 * Setup the FPGA to listen for samples. This method downloads the FPGA bitstream
80 * if not already loaded, sets divisor and starts up the antenna.
81 * @param divisor : 1, 88> 255 or negative ==> 134.8 kHz
85 void LFSetupFPGAForADC(int divisor
, bool reader_field
);
88 * Called from the USB-handler to set the sampling configuration
89 * The sampling config is used for std reading and sniffing.
91 * Other functions may read samples and ignore the sampling config,
92 * such as functions to read the UID from a prox tag or similar.
94 * Values set to '0' implies no change (except for averaging)
95 * @brief setSamplingConfig
98 void setSamplingConfig(sample_config
*sc
);
100 sample_config
*getSamplingConfig(void);
102 void printLFConfig(void);
103 void printSamples(void);
105 #endif // __LFSAMPLING_H