]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
#defines for ADC channels so we can see what's what
authoradam@algroup.co.uk <adam@algroup.co.uk@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Mon, 6 Jul 2009 16:40:03 +0000 (16:40 +0000)
committeradam@algroup.co.uk <adam@algroup.co.uk@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Mon, 6 Jul 2009 16:40:03 +0000 (16:40 +0000)
armsrc/appmain.c
include/at91sam7s128.h

index 01e3efc98274b5a73e80e68f97d84af0395bca60..fcb910c9b1bdfcf43d350f24927548f6a783b932 100644 (file)
@@ -249,7 +249,7 @@ void SweepLFrange()
        for (i=255; i>19; i--) {
                FpgaSendCommand(FPGA_CMD_SET_DIVISOR, i);
                SpinDelay(20);
-               dest[i] = (137500 * AvgAdc(4)) >> 18;
+               dest[i] = (137500 * AvgAdc(ADC_CHAN_LF)) >> 18;
        }
 }
 
@@ -267,7 +267,7 @@ void MeasureAntennaTuning(void)
        FpgaSendCommand(FPGA_CMD_SET_DIVISOR, 95); //125Khz
        FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_READER | FPGA_LF_READER_USE_125_KHZ);
        SpinDelay(20);
-       vLf125 = AvgAdc(4);
+       vLf125 = AvgAdc(ADC_CHAN_LF);
        // Vref = 3.3V, and a 10000:240 voltage divider on the input
        // can measure voltages up to 137500 mV
        vLf125 = (137500 * vLf125) >> 10;
@@ -276,7 +276,7 @@ void MeasureAntennaTuning(void)
        FpgaSendCommand(FPGA_CMD_SET_DIVISOR, 88); //134.8Khz
        FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_READER | FPGA_LF_READER_USE_134_KHZ);
        SpinDelay(20);
-       vLf134 = AvgAdc(4);
+       vLf134 = AvgAdc(ADC_CHAN_LF);
        // Vref = 3.3V, and a 10000:240 voltage divider on the input
        // can measure voltages up to 137500 mV
        vLf134 = (137500 * vLf134) >> 10;
@@ -284,7 +284,7 @@ void MeasureAntennaTuning(void)
        // Let the FPGA drive the high-frequency antenna around 13.56 MHz.
        FpgaWriteConfWord(FPGA_MAJOR_MODE_HF_READER_RX_XCORR);
        SpinDelay(20);
-       vHf = AvgAdc(5);
+       vHf = AvgAdc(ADC_CHAN_HF);
        // Vref = 3300mV, and an 10:1 voltage divider on the input
        // can measure voltages up to 33000 mV
        vHf = (33000 * vHf) >> 10;
index 1a5fe1c455a07f44670d8f08bf276b5addbd867d..7e7b350650726493761e86720a3b706aa680a65e 100644 (file)
 #define ADC_END_OF_RX_BUFFER                                           (1<<18)\r
 #define ADC_RX_BUFFER_FULL                                                     (1<<19)\r
 \r
+#define ADC_CHAN_LF                                                    4\r
+#define ADC_CHAN_HF                                                    5\r
 //-------------\r
 // Synchronous Serial Controller\r
 \r
Impressum, Datenschutz