mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-02 21:54:10 +08:00
Added hitune command for continuously measuring HF antenna tuning
This commit is contained in:
parent
8b576d2d31
commit
1eb7596aad
4 changed files with 36 additions and 2 deletions
|
@ -202,6 +202,27 @@ void MeasureAntennaTuning(void)
|
|||
UsbSendPacket((BYTE *)&c, sizeof(c));
|
||||
}
|
||||
|
||||
void MeasureAntennaTuningHf(void)
|
||||
{
|
||||
int vHf = 0; // in mV
|
||||
|
||||
DbpString("Measuring HF antenna characteristics, press button to exit");
|
||||
|
||||
for (;;) {
|
||||
// Let the FPGA drive the high-frequency antenna around 13.56 MHz.
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_HF_READER_RX_XCORR);
|
||||
SpinDelay(20);
|
||||
// Vref = 3300mV, and an 10:1 voltage divider on the input
|
||||
// can measure voltages up to 33000 mV
|
||||
vHf = (33000 * AvgAdc(ADC_CHAN_HF)) >> 10;
|
||||
|
||||
Dbprintf("%d mV",vHf);
|
||||
if (BUTTON_PRESS()) break;
|
||||
}
|
||||
DbpString("cancelled");
|
||||
}
|
||||
|
||||
|
||||
void SimulateTagHfListen(void)
|
||||
{
|
||||
BYTE *dest = (BYTE *)BigBuf;
|
||||
|
@ -643,6 +664,10 @@ void UsbPacketReceived(BYTE *packet, int len)
|
|||
MeasureAntennaTuning();
|
||||
break;
|
||||
|
||||
case CMD_MEASURE_ANTENNA_TUNING_HF:
|
||||
MeasureAntennaTuningHf();
|
||||
break;
|
||||
|
||||
case CMD_LISTEN_READER_FIELD:
|
||||
ListenReaderField(c->arg[0]);
|
||||
break;
|
||||
|
|
|
@ -93,6 +93,12 @@ static void CmdTune(char *str)
|
|||
SendCommand(&c);
|
||||
}
|
||||
|
||||
static void CmdHiTune(char *str)
|
||||
{
|
||||
UsbCommand c={CMD_MEASURE_ANTENNA_TUNING_HF};
|
||||
SendCommand(&c);
|
||||
}
|
||||
|
||||
static void CmdHi15read(char *str)
|
||||
{
|
||||
UsbCommand c={CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_15693};
|
||||
|
@ -2825,6 +2831,7 @@ static struct {
|
|||
/* low-level hardware control */
|
||||
{"fpgaoff", CmdFPGAOff, 0, "Set FPGA off"},
|
||||
{"tune", CmdTune, 0, "Measure antenna tuning"},
|
||||
{"hitune", CmdHiTune, 0, "Continuously measure HF antenna tuning"},
|
||||
{"readmem", CmdReadmem, 0, "[address] -- Read memory at decimal address from flash"},
|
||||
{"reset", CmdReset, 0, "Reset the Proxmark3"},
|
||||
{"setlfdivisor", CmdSetDivisor, 0, "<19 - 255> -- Drive LF antenna at 12Mhz/(divisor+1)"},
|
||||
|
|
|
@ -44,6 +44,7 @@ int GetClock(char *str, int peak);
|
|||
static void CmdHIDdemodFSK(char *str);
|
||||
static void Cmdmanchestermod(char *str);
|
||||
static void CmdTune(char *str);
|
||||
static void CmdHiTune(char *str);
|
||||
static void CmdHi15read(char *str);
|
||||
static void CmdHi14read(char *str);
|
||||
static void CmdSri512read(char *str);
|
||||
|
|
|
@ -84,8 +84,9 @@ typedef struct {
|
|||
|
||||
// For measurements of the antenna tuning
|
||||
#define CMD_MEASURE_ANTENNA_TUNING 0x0400
|
||||
#define CMD_MEASURED_ANTENNA_TUNING 0x0401
|
||||
#define CMD_LISTEN_READER_FIELD 0x0402
|
||||
#define CMD_MEASURE_ANTENNA_TUNING_HF 0x0401
|
||||
#define CMD_MEASURED_ANTENNA_TUNING 0x0410
|
||||
#define CMD_LISTEN_READER_FIELD 0x0420
|
||||
|
||||
// For direct FPGA control
|
||||
#define CMD_FPGA_MAJOR_MODE_OFF 0x0500
|
||||
|
|
Loading…
Reference in a new issue