Merge pull request #2593 from Akury83/master
[RRG-proxmark3.git] / armsrc / lfadc.h
blob322584de29f46342b7909b7debab1d3e81be52d0
1 //-----------------------------------------------------------------------------
2 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // See LICENSE.txt for the text of the license.
15 //-----------------------------------------------------------------------------
16 // LF ADC read/write implementation
17 //-----------------------------------------------------------------------------
19 #ifndef __LFADC_H__
20 #define __LFADC_H__
22 #include "proxmark3_arm.h"
23 #include "common.h"
24 #include "cmd.h"
25 #include "util.h"
26 #include "string.h"
28 extern bool g_logging;
30 uint8_t get_adc_avg(void);
31 void lf_sample_mean(void);
32 bool lf_test_periods(size_t expected, size_t count);
33 size_t lf_count_edge_periods(size_t max);
34 size_t lf_detect_gap(size_t max);
35 void lf_reset_counter(void);
37 bool lf_get_tag_modulation(void);
38 bool lf_get_reader_modulation(void);
40 void lf_wait_periods(size_t periods);
41 //void lf_init(bool reader);
42 void lf_init(bool reader, bool simulate, bool ledcontrol);
43 void lf_finalize(bool ledcontrol);
44 size_t lf_detect_field_drop(size_t max);
46 bool lf_manchester_send_bytes(const uint8_t *frame, size_t frame_len, bool ledcontrol);
47 void lf_modulation(bool modulation);
49 #endif // __LFADC_H__