mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-12-31 04:39:49 +08:00
LF sim
`lf sim` - use config values for setting the frequency.
This commit is contained in:
parent
cb0b8f94c9
commit
6fe5fe8d52
1 changed files with 11 additions and 0 deletions
|
@ -400,6 +400,17 @@ void SimulateTagLowFrequency(int period, int gap, int ledcontrol)
|
|||
FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_EDGE_DETECT);
|
||||
//FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_EDGE_DETECT | FPGA_LF_EDGE_DETECT_READER_FIELD);
|
||||
//FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_EDGE_DETECT | FPGA_LF_EDGE_DETECT_TOGGLE_MODE );
|
||||
|
||||
// set frequency, get values from 'lf config' command
|
||||
sample_config *sc = getSamplingConfig();
|
||||
|
||||
if ( (sc->divisor == 1) || (sc->divisor < 0) || (sc->divisor > 255) )
|
||||
FpgaSendCommand(FPGA_CMD_SET_DIVISOR, 88); //134.8Khz
|
||||
else if (sc->divisor == 0)
|
||||
FpgaSendCommand(FPGA_CMD_SET_DIVISOR, 95); //125Khz
|
||||
else
|
||||
FpgaSendCommand(FPGA_CMD_SET_DIVISOR, sc->divisor);
|
||||
|
||||
SetAdcMuxFor(GPIO_MUXSEL_LOPKD);
|
||||
|
||||
AT91C_BASE_PIOA->PIO_PER = GPIO_SSC_DOUT | GPIO_SSC_CLK;
|
||||
|
|
Loading…
Reference in a new issue