diff --git a/armsrc/Makefile b/armsrc/Makefile index 413570565..5505119b7 100644 --- a/armsrc/Makefile +++ b/armsrc/Makefile @@ -35,6 +35,7 @@ APP_CFLAGS = $(PLATFORM_DEFS) \ -ffunction-sections -fdata-sections SRC_LF = lfops.c lfsampling.c pcf7931.c lfdemod.c lfadc.c +SRC_HF = hfops.c SRC_ISO15693 = iso15693.c iso15693tools.c SRC_ISO14443a = iso14443a.c mifareutil.c mifarecmd.c epa.c mifaresim.c #UNUSED: mifaresniff.c @@ -132,6 +133,7 @@ THUMBSRC = start.c \ $(SRC_EM4x50) \ $(SRC_EM4x70) \ $(SRC_SPIFFS) \ + $(SRC_HF) \ $(SRC_ISO14443a) \ $(SRC_ISO14443b) \ $(SRC_CRAPTO1) \ diff --git a/armsrc/appmain.c b/armsrc/appmain.c index afcdc04ac..c28357108 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -33,6 +33,7 @@ #include "legicrf.h" #include "BigBuf.h" #include "iclass_cmd.h" +#include "hfops.h" #include "iso14443a.h" #include "iso14443b.h" #include "iso15693.h" @@ -1384,6 +1385,15 @@ static void PacketReceived(PacketCommandNG *packet) { } #endif +#ifdef WITH_GENERAL_HF + case CMD_HF_ACQ_RAW_ADC: { + uint32_t samplesCount = 0; + memcpy(&samplesCount, packet->data.asBytes, 4); + HfReadADC(samplesCount); + break; + } +#endif + #ifdef WITH_ISO14443a case CMD_HF_ISO14443A_PRINT_CONFIG: { printHf14aConfig(); diff --git a/armsrc/hfops.c b/armsrc/hfops.c new file mode 100644 index 000000000..180cca409 --- /dev/null +++ b/armsrc/hfops.c @@ -0,0 +1,41 @@ +//----------------------------------------------------------------------------- +// 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. +//----------------------------------------------------------------------------- +// HF general operations +//----------------------------------------------------------------------------- + +#include "hfops.h" + +#include "proxmark3_arm.h" +#include "cmd.h" +#include "BigBuf.h" +#include "fpgaloader.h" +#include "ticks.h" +#include "dbprint.h" +#include "util.h" +#include "commonutil.h" + + +int HfReadADC(uint32_t samplesCount) { + + + + + DbpString("HfReadADC " _GREEN_("success")); + + return 0; +} + + diff --git a/armsrc/hfops.h b/armsrc/hfops.h new file mode 100644 index 000000000..76ed4b8bc --- /dev/null +++ b/armsrc/hfops.h @@ -0,0 +1,27 @@ +//----------------------------------------------------------------------------- +// 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. +//----------------------------------------------------------------------------- +// HF general operations +//----------------------------------------------------------------------------- + +#ifndef HFOPS_H +#define HFOPS_H + +#include "common.h" + +int HfReadADC(uint32_t samplesCount); + + +#endif \ No newline at end of file diff --git a/client/src/cmdhftexkom.c b/client/src/cmdhftexkom.c index 54a1e47c7..51758af3e 100644 --- a/client/src/cmdhftexkom.c +++ b/client/src/cmdhftexkom.c @@ -40,8 +40,8 @@ static int CmdHFTexkomReader(const char *Cmd) { CLIExecWithReturn(ctx, Cmd, argtable, true); CLIParserFree(ctx); -// uint8_t param = 0; -// SendCommandNG(CMD_HF_TEXKOM_READER, (uint8_t *)¶m, sizeof(uint8_t)); + uint32_t samplesCount = 40000; + SendCommandNG(CMD_HF_ACQ_RAW_ADC, (uint8_t *)&samplesCount, sizeof(uint32_t)); return PM3_SUCCESS; } diff --git a/common_arm/Makefile.hal b/common_arm/Makefile.hal index 62b99020d..68417eb60 100644 --- a/common_arm/Makefile.hal +++ b/common_arm/Makefile.hal @@ -143,6 +143,9 @@ ifneq ($(SKIP_ZX8211),1) endif # common HF support +ifneq ($(SKIP_HF),1) + PLATFORM_DEFS += -DWITH_GENERAL_HF +endif ifneq ($(SKIP_ISO15693),1) PLATFORM_DEFS += -DWITH_ISO15693 endif diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index c900eb952..e53132309 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -511,6 +511,7 @@ typedef struct { // For the 13.56 MHz tags #define CMD_HF_ISO15693_ACQ_RAW_ADC 0x0300 +#define CMD_HF_ACQ_RAW_ADC 0x0301 #define CMD_HF_SRI_READ 0x0303 #define CMD_HF_ISO14443B_COMMAND 0x0305 #define CMD_HF_ISO15693_READER 0x0310