2019-12-24 17:20:07 +08:00
|
|
|
//-----------------------------------------------------------------------------
|
2022-01-06 09:19:46 +08:00
|
|
|
// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
|
|
|
|
//
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// See LICENSE.txt for the text of the license.
|
2019-12-24 17:20:07 +08:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// 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 23:05:43 +08:00
|
|
|
extern bool g_logging;
|
2019-12-24 17:20:07 +08:00
|
|
|
|
2021-04-04 23:08:19 +08:00
|
|
|
uint8_t get_adc_avg(void);
|
2020-02-22 20:16:04 +08:00
|
|
|
void lf_sample_mean(void);
|
2019-12-24 17:20:07 +08: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 22:59:38 +08:00
|
|
|
void lf_reset_counter(void);
|
2020-01-30 00:26:08 +08:00
|
|
|
|
2020-05-10 22:59:38 +08:00
|
|
|
bool lf_get_tag_modulation(void);
|
|
|
|
bool lf_get_reader_modulation(void);
|
2020-01-30 00:26:08 +08:00
|
|
|
|
2019-12-24 17:20:07 +08:00
|
|
|
void lf_wait_periods(size_t periods);
|
2020-01-29 12:12:36 +08:00
|
|
|
//void lf_init(bool reader);
|
2021-11-18 21:26:41 +08:00
|
|
|
void lf_init(bool reader, bool simulate, bool ledcontrol);
|
|
|
|
void lf_finalize(bool ledcontrol);
|
2019-12-24 17:20:07 +08:00
|
|
|
size_t lf_detect_field_drop(size_t max);
|
2020-09-05 19:25:57 +08:00
|
|
|
|
2021-11-18 21:26:41 +08:00
|
|
|
bool lf_manchester_send_bytes(const uint8_t *frame, size_t frame_len, bool ledcontrol);
|
2019-12-31 04:17:37 +08:00
|
|
|
void lf_modulation(bool modulation);
|
2019-12-24 17:20:07 +08:00
|
|
|
|
|
|
|
#endif // __LFADC_H__
|