MIFARE Plus 4b UID: fix signature check
[RRG-proxmark3.git] / armsrc / appmain.h
blobfdc520f5f6e7fb08da9a472f3da09e525d93e71c
1 //-----------------------------------------------------------------------------
2 // Copyright (C) Jonathan Westhues, Aug 2005
3 // Copyright (C) Gerhard de Koning Gans, April 2008
4 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
5 //
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // See LICENSE.txt for the text of the license.
17 //-----------------------------------------------------------------------------
18 // Definitions internal to the app source.
19 //-----------------------------------------------------------------------------
20 #ifndef __APPMAIN_H
21 #define __APPMAIN_H
23 #include "common.h"
25 extern uint8_t g_trigger;
26 extern bool g_hf_field_active;
27 void hf_field_off(void);
28 int tearoff_hook(void);
30 #if defined RDV4 || defined ICOPYX
31 // ADC Vref = 3300mV, and an (10000k+240k):240k voltage divider on the LF input can measure voltages up to 140800 mV
32 #define MAX_ADC_HF_VOLTAGE 140800
33 #else
34 // ADC Vref = 3300mV, and an (10M+1M):1M voltage divider on the HF input can measure voltages up to 36300 mV
35 #define MAX_ADC_HF_VOLTAGE 36300
36 #endif
37 // ADC Vref = 3300mV, (240k-10M):240k voltage divider, 140800 mV
38 #define MAX_ADC_LF_VOLTAGE 140800
40 // Default connection speed test timeout, used in hw status
41 #define CONN_SPEED_TEST_MIN_TIME_DEFAULT 500 // in milliseconds
43 extern int ToSendMax;
44 extern uint8_t ToSend[];
46 void send_wtx(uint16_t wtx);
47 void ReadMem(int addr);
48 void __attribute__((noreturn)) AppMain(void);
50 uint16_t AvgAdc(uint8_t ch);
51 uint16_t SumAdc(uint8_t ch, uint8_t NbSamples);
53 //void PrintToSendBuffer(void);
54 void ToSendStuffBit(int b);
55 void ToSendReset(void);
56 void ListenReaderField(uint8_t limit);
57 void StandAloneMode(void);
58 void printStandAloneModes(void);
59 void print_stack_usage(void);
61 #endif