iso15 sniffing: intragrate 2SC sniffing in same FPGA mode

switching Fpgamode while sniffing with FpgaWriteConfWord() was
sometimes too long so the tag answer start was lost.
Now, (only with FPGA_BITSTREAM_HF_15) with "FPGA_HF_READER_MODE_SNIFF_AMPLITUDE |
FPGA_HF_READER_2SUBCARRIERS_424_484_KHZ": the amplitude is shrank
from its 2 LSB bits and those 2 bits are now used to return the current
frequency. From my tests, this 2 bits reduction does not affect
quality of 1SC sniffing, but it may have slightly reduced the
receiving range.

FPGA FSK decoding code is also improved.
This commit is contained in:
Yann GASCUEL 2022-03-04 09:45:12 +01:00
commit 38d49097f9
7 changed files with 469 additions and 52 deletions

View file

@ -162,7 +162,9 @@ void FpgaSetupSsc(uint16_t fpga_mode) {
// 8, 16 or 32 bits per transfer, no loopback, MSB first, 1 transfer per sync
// pulse, no output sync
if ((fpga_mode & FPGA_MAJOR_MODE_MASK) == FPGA_MAJOR_MODE_HF_READER && (FpgaGetCurrent() == FPGA_BITSTREAM_HF || FpgaGetCurrent() == FPGA_BITSTREAM_HF_15)) {
if (((fpga_mode & FPGA_MAJOR_MODE_MASK) == FPGA_MAJOR_MODE_HF_READER ||
(fpga_mode & FPGA_MAJOR_MODE_MASK) == FPGA_MAJOR_MODE_HF_FSK_READER) &&
(FpgaGetCurrent() == FPGA_BITSTREAM_HF || FpgaGetCurrent() == FPGA_BITSTREAM_HF_15)) {
AT91C_BASE_SSC->SSC_RFMR = SSC_FRAME_MODE_BITS_IN_WORD(16) | AT91C_SSC_MSBF | SSC_FRAME_MODE_WORDS_PER_TRANSFER(0);
} else {
AT91C_BASE_SSC->SSC_RFMR = SSC_FRAME_MODE_BITS_IN_WORD(8) | AT91C_SSC_MSBF | SSC_FRAME_MODE_WORDS_PER_TRANSFER(0);