2019-12-24 10:20:07 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
|
|
|
|
// at your option, any later version. See the LICENSE.txt file for the text of
|
|
|
|
// the license.
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// LF ADC read/write implementation
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifndef __LFADC_H__
|
|
|
|
#define __LFADC_H__
|
|
|
|
|
|
|
|
#include "proxmark3_arm.h"
|
|
|
|
#include "common.h"
|
|
|
|
#include "cmd.h"
|
|
|
|
#include "util.h"
|
|
|
|
#include "string.h"
|
|
|
|
|
2020-05-19 17:05:43 +02:00
|
|
|
extern bool g_logging;
|
2019-12-24 10:20:07 +01:00
|
|
|
|
2021-04-04 17:08:19 +02:00
|
|
|
uint8_t get_adc_avg(void);
|
2020-02-22 13:16:04 +01:00
|
|
|
void lf_sample_mean(void);
|
2019-12-24 10:20:07 +01:00
|
|
|
bool lf_test_periods(size_t expected, size_t count);
|
|
|
|
size_t lf_count_edge_periods(size_t max);
|
|
|
|
size_t lf_detect_gap(size_t max);
|
2020-05-10 16:59:38 +02:00
|
|
|
void lf_reset_counter(void);
|
2020-01-29 17:26:08 +01:00
|
|
|
|
2020-05-10 16:59:38 +02:00
|
|
|
bool lf_get_tag_modulation(void);
|
|
|
|
bool lf_get_reader_modulation(void);
|
2020-01-29 17:26:08 +01:00
|
|
|
|
2019-12-24 10:20:07 +01:00
|
|
|
void lf_wait_periods(size_t periods);
|
2020-01-29 05:12:36 +01:00
|
|
|
//void lf_init(bool reader);
|
2021-11-18 14:26:41 +01:00
|
|
|
void lf_init(bool reader, bool simulate, bool ledcontrol);
|
|
|
|
void lf_finalize(bool ledcontrol);
|
2019-12-24 10:20:07 +01:00
|
|
|
size_t lf_detect_field_drop(size_t max);
|
2020-09-05 13:25:57 +02:00
|
|
|
|
2021-11-18 14:26:41 +01:00
|
|
|
bool lf_manchester_send_bytes(const uint8_t *frame, size_t frame_len, bool ledcontrol);
|
2019-12-30 21:17:37 +01:00
|
|
|
void lf_modulation(bool modulation);
|
2019-12-24 10:20:07 +01:00
|
|
|
|
|
|
|
#endif // __LFADC_H__
|