]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/iso15693.c
Add basic communication shell for Legic RF in reader mode. Needs the new receive...
[proxmark3-svn] / armsrc / iso15693.c
index 62e480c2c0b2ebb331649a6aaad9929515137bab..723d297d11a7059288a2d1e524322f0128f21c14 100644 (file)
@@ -236,7 +236,7 @@ static void BuildIdentifyRequest(void)
        CodeIso15693AsReader(cmd, sizeof(cmd));\r
 }\r
 \r
-static void BuildSysInfoRequest(BYTE *uid)\r
+static void __attribute__((unused)) BuildSysInfoRequest(BYTE *uid)\r
 {\r
        BYTE cmd[12];\r
 \r
@@ -304,7 +304,7 @@ static void BuildSelectRequest( BYTE uid[])
        CodeIso15693AsReader(cmd, sizeof(cmd));\r
 }\r
 \r
-static void BuildReadBlockRequest(BYTE *uid, BYTE blockNumber )\r
+static void __attribute__((unused)) BuildReadBlockRequest(BYTE *uid, BYTE blockNumber )\r
 {\r
        BYTE cmd[13];\r
 \r
@@ -335,7 +335,7 @@ static void BuildReadBlockRequest(BYTE *uid, BYTE blockNumber )
        CodeIso15693AsReader(cmd, sizeof(cmd));\r
 }\r
 \r
-static void BuildReadMultiBlockRequest(BYTE *uid)\r
+static void __attribute__((unused)) BuildReadMultiBlockRequest(BYTE *uid)\r
 {\r
        BYTE cmd[14];\r
 \r
@@ -368,7 +368,7 @@ static void BuildReadMultiBlockRequest(BYTE *uid)
        CodeIso15693AsReader(cmd, sizeof(cmd));\r
 }\r
 \r
-static void BuildArbitraryRequest(BYTE *uid,BYTE CmdCode)\r
+static void __attribute__((unused)) BuildArbitraryRequest(BYTE *uid,BYTE CmdCode)\r
 {\r
        BYTE cmd[14];\r
 \r
@@ -402,7 +402,7 @@ static void BuildArbitraryRequest(BYTE *uid,BYTE CmdCode)
        CodeIso15693AsReader(cmd, sizeof(cmd));\r
 }\r
 \r
-static void BuildArbitraryCustomRequest(BYTE uid[], BYTE CmdCode)\r
+static void __attribute__((unused)) BuildArbitraryCustomRequest(BYTE uid[], BYTE CmdCode)\r
 {\r
        BYTE cmd[14];\r
 \r
@@ -478,12 +478,12 @@ static void TransmitTo15693Tag(const BYTE *cmd, int len, int *samples, int *wait
        if(*wait < 10) { *wait = 10; }\r
 \r
 //    for(c = 0; c < *wait;) {\r
-//        if(SSC_STATUS & (SSC_STATUS_TX_READY)) {\r
-//            SSC_TRANSMIT_HOLDING = 0x00;             // For exact timing!\r
+//        if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {\r
+//            AT91C_BASE_SSC->SSC_THR = 0x00;          // For exact timing!\r
 //            c++;\r
 //        }\r
-//        if(SSC_STATUS & (SSC_STATUS_RX_READY)) {\r
-//            volatile DWORD r = SSC_RECEIVE_HOLDING;\r
+//        if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {\r
+//            volatile DWORD r = AT91C_BASE_SSC->SSC_RHR;\r
 //            (void)r;\r
 //        }\r
 //        WDT_HIT();\r
@@ -491,15 +491,15 @@ static void TransmitTo15693Tag(const BYTE *cmd, int len, int *samples, int *wait
 \r
     c = 0;\r
     for(;;) {\r
-        if(SSC_STATUS & (SSC_STATUS_TX_READY)) {\r
-            SSC_TRANSMIT_HOLDING = cmd[c];\r
+        if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {\r
+            AT91C_BASE_SSC->SSC_THR = cmd[c];\r
             c++;\r
             if(c >= len) {\r
                 break;\r
             }\r
         }\r
-        if(SSC_STATUS & (SSC_STATUS_RX_READY)) {\r
-            volatile DWORD r = SSC_RECEIVE_HOLDING;\r
+        if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {\r
+            volatile DWORD r = AT91C_BASE_SSC->SSC_RHR;\r
             (void)r;\r
         }\r
         WDT_HIT();\r
@@ -520,15 +520,15 @@ static void TransmitTo15693Reader(const BYTE *cmd, int len, int *samples, int *w
 \r
     c = 0;\r
     for(;;) {\r
-        if(SSC_STATUS & (SSC_STATUS_TX_READY)) {\r
-            SSC_TRANSMIT_HOLDING = cmd[c];\r
+        if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {\r
+            AT91C_BASE_SSC->SSC_THR = cmd[c];\r
             c++;\r
             if(c >= len) {\r
                 break;\r
             }\r
         }\r
-        if(SSC_STATUS & (SSC_STATUS_RX_READY)) {\r
-            volatile DWORD r = SSC_RECEIVE_HOLDING;\r
+        if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {\r
+            volatile DWORD r = AT91C_BASE_SSC->SSC_RHR;\r
             (void)r;\r
         }\r
         WDT_HIT();\r
@@ -550,12 +550,12 @@ static int GetIso15693AnswerFromTag(BYTE *receivedResponse, int maxLen, int *sam
        c = 0;\r
        getNext = FALSE;\r
        for(;;) {\r
-               if(SSC_STATUS & (SSC_STATUS_TX_READY)) {\r
-                       SSC_TRANSMIT_HOLDING = 0x43;\r
+               if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {\r
+                       AT91C_BASE_SSC->SSC_THR = 0x43;\r
                }\r
-               if(SSC_STATUS & (SSC_STATUS_RX_READY)) {\r
+               if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {\r
                        SBYTE b;\r
-                       b = (SBYTE)SSC_RECEIVE_HOLDING;\r
+                       b = (SBYTE)AT91C_BASE_SSC->SSC_RHR;\r
 \r
                        // The samples are correlations against I and Q versions of the\r
                        // tone that the tag AM-modulates, so every other sample is I,\r
@@ -697,12 +697,12 @@ static int GetIso15693AnswerFromSniff(BYTE *receivedResponse, int maxLen, int *s
        c = 0;\r
        getNext = FALSE;\r
        for(;;) {\r
-               if(SSC_STATUS & (SSC_STATUS_TX_READY)) {\r
-                       SSC_TRANSMIT_HOLDING = 0x43;\r
+               if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {\r
+                       AT91C_BASE_SSC->SSC_THR = 0x43;\r
                }\r
-               if(SSC_STATUS & (SSC_STATUS_RX_READY)) {\r
+               if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {\r
                        SBYTE b;\r
-                       b = (SBYTE)SSC_RECEIVE_HOLDING;\r
+                       b = (SBYTE)AT91C_BASE_SSC->SSC_RHR;\r
 \r
                        // The samples are correlations against I and Q versions of the\r
                        // tone that the tag AM-modulates, so every other sample is I,\r
@@ -855,15 +855,15 @@ void AcquireRawAdcSamplesIso15693(void)
 \r
        c = 0;\r
        for(;;) {\r
-               if(SSC_STATUS & (SSC_STATUS_TX_READY)) {\r
-                       SSC_TRANSMIT_HOLDING = ToSend[c];\r
+               if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {\r
+                       AT91C_BASE_SSC->SSC_THR = ToSend[c];\r
                        c++;\r
                        if(c == ToSendMax+3) {\r
                                break;\r
                        }\r
                }\r
-               if(SSC_STATUS & (SSC_STATUS_RX_READY)) {\r
-                       volatile DWORD r = SSC_RECEIVE_HOLDING;\r
+               if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {\r
+                       volatile DWORD r = AT91C_BASE_SSC->SSC_RHR;\r
                        (void)r;\r
                }\r
                WDT_HIT();\r
@@ -874,12 +874,12 @@ void AcquireRawAdcSamplesIso15693(void)
        c = 0;\r
        getNext = FALSE;\r
        for(;;) {\r
-               if(SSC_STATUS & (SSC_STATUS_TX_READY)) {\r
-                       SSC_TRANSMIT_HOLDING = 0x43;\r
+               if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {\r
+                       AT91C_BASE_SSC->SSC_THR = 0x43;\r
                }\r
-               if(SSC_STATUS & (SSC_STATUS_RX_READY)) {\r
+               if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {\r
                        SBYTE b;\r
-                       b = (SBYTE)SSC_RECEIVE_HOLDING;\r
+                       b = (SBYTE)AT91C_BASE_SSC->SSC_RHR;\r
 \r
                        // The samples are correlations against I and Q versions of the\r
                        // tone that the tag AM-modulates, so every other sample is I,\r
Impressum, Datenschutz