⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prd_rf_comm.lst

📁 读RF卡的源代码
💻 LST
📖 第 1 页 / 共 4 页
字号:
ARM COMPILER V2.40e,  PRD_RF_Comm                                                          12/12/07  14:35:10  PAGE 1   


ARM COMPILER V2.40e, COMPILATION OF MODULE PRD_RF_Comm
OBJECT MODULE PLACED IN .\PRD_RF_Comm.obj
COMPILER INVOKED BY: C:\DEV\Tools\Keil\ARM\BIN\CA.exe ..\..\..\..\LIB\PicoRead\u03\Level_1\COMMON\sources\PRD_RF_Comm.c 
                    -THUMB DEBUG PRINT(.\LISTING\PRD_RF_COMM.LST) TABS(4) PREPRINT(.\LISTING\PRD_RF_COMM.I) OBJECT(.\PRD_RF_Comm.obj) 

stmt  level    source

    1          //=============================================================================
    2          //                  Copyright (C) INSIDE Contactless 1998-2005
    3          //
    4          // INSIDE Contactless reserves the right to make changes, without notice,
    5          // to any product (including application note) herein to improve
    6          // reliability, functionality, or design. INSIDE Contactless advises its
    7          // customers to obtain the latest version of device data sheets to verify,
    8          // before placing orders, that the information being relied upon by the
    9          // customer is current.
   10          //
   11          // INSIDE Contactless makes no warranty that the use will not infringe any
   12          // third party patent, copyright or trademark.
   13          //
   14          // Information furnished by INSIDE Contactless is believed to be accurate
   15          // and reliable. However, INSIDE Contactless does not assume any liability
   16          // resulting from the application or use of any product described within.
   17          //
   18          // All rights are reserved. Reproduction in whole or in part is prohibited
   19          // without the written consent of the copyright owner.
   20          //
   21          //      Bat 11a,
   22          //      Parc Club du Golf,
   23          //      Z.A.C. du Pichaury                      Tel :   +33 (0)4.42.39.33.00
   24          //      13856 Aix-en-Provence Cedex 3           Fax :   +33 (0)4.42.39.63.19
   25          //      FRANCE                                  Email : info@insidefr.com
   26          //
   27          //-----------------------------------------------------------------------------
   28          // Project Code : PICOREAD LIBRARY
   29          // Project Name : PICOREAD LIBRARY
   30          // Module Name  : PRD_RF_Comm.c
   31          // Platform dev : Keil 礦ision 3 (IDE ) + Keil ARM Compiler
   32          // Target       : LPC2103 (ARM7TDMI Core)
   33          // Language     : C ANSI
   34          // Revision     : 1.0
   35          // Description  : Low level communication protocol with Picoread RF chip
   36          //=============================================================================
   37          // When     Who Ver     What
   38          // 06-04-24 MCY 1.1     restructuration
   39          // 06-05-12 FPK 1.2     restructuration
   40          //=============================================================================
   41          
   42          
   43          // Defines standard
   44          
   45          
   46          // Defines for common C writting
   47          #include "Defines_C.h"              // TRUE, FALSE, etc
*** ERROR C318 IN LINE 47 OF ..\..\..\..\LIB\PicoRead\u03\Level_1\COMMON\sources\PRD_RF_Comm.c: can't open file 'Defines
             -_C.h'
   48          
   49          // Defines for PicoRead
   50          #include "PRD_PicoReadRF_Pages_Parameters.h" // Definition of PicoRead chip registers
*** ERROR C318 IN LINE 50 OF ..\..\..\..\LIB\PicoRead\u03\Level_1\COMMON\sources\PRD_RF_Comm.c: can't open file 'PRD_Pic
             -oReadRF_Pages_Parameters.h'
   51          #include "PRD_RF_Comm.h" 
*** ERROR C318 IN LINE 51 OF ..\..\..\..\LIB\PicoRead\u03\Level_1\COMMON\sources\PRD_RF_Comm.c: can't open file 'PRD_RF_
             -Comm.h'
   52          
ARM COMPILER V2.40e,  PRD_RF_Comm                                                          12/12/07  14:35:10  PAGE 2   

   53          // Defines for LPC2129 or LPC2103
   54          #include "Target.H"             // Definition of processor registers  & Low level functions to be modified accor
             -ding to the target, and the user needs
*** ERROR C318 IN LINE 54 OF ..\..\..\..\LIB\PicoRead\u03\Level_1\COMMON\sources\PRD_RF_Comm.c: can't open file 'Target.
             -H'
   55          
   56           #if ((defined PAYPASS) || (defined FULL))
               #include "PayPass_Anticollision.h"
               #include "PayPass_TTAL1_Default_Anticollision_Options.h"
               #endif
   60          
   61          
   62          #ifdef MODE_DEBUG_TCL
               #include <stdio.h>
               #endif
   65          
   66          
   67          //-----------------------------------------------------------------------------
   68          // Function name : void v_fnCS_reset( ) or v_fnSPI_reset()
   69          //-----------------------------------------------------------------------------
   70          // Description : Reset the SPI address
   71          //
   72          // IN       :   - none -
   73          // OUT      :   - none -
   74          // RETURN   :   - none -
   75          // Notes    :   - none -
   76          //-----------------------------------------------------------------------------
   77          #define v_fnSPI_reset() v_fnCS_reset()
   78          void v_fnCS_reset()
   79          {
   80   1          setCS_PIN();
*** WARNING C140 IN LINE 80 OF ..\..\..\..\LIB\PICOREAD\U03\LEVEL_1\COMMON\SOURCES\PRD_RF_COMM.C: 'setCS_PIN' undefined;
             - assuming 'extern int setCS_PIN()'
   81   1          delay_us(1);
*** WARNING C140 IN LINE 81 OF ..\..\..\..\LIB\PICOREAD\U03\LEVEL_1\COMMON\SOURCES\PRD_RF_COMM.C: 'delay_us' undefined; 
             -assuming 'extern int delay_us()'
   82   1          clearCS_PIN();
*** WARNING C140 IN LINE 82 OF ..\..\..\..\LIB\PICOREAD\U03\LEVEL_1\COMMON\SOURCES\PRD_RF_COMM.C: 'clearCS_PIN' undefine
             -d; assuming 'extern int clearCS_PIN()'
   83   1      }
   84          
   85          
   86          //-----------------------------------------------------------------------------
   87          // Function name : void v_fnSPI_WaitForEOT( )
   88          //-----------------------------------------------------------------------------
   89          // Description : Wait for end of transmission from PicoRead (always happen).
   90          //
   91          // IN       :   - none -
   92          // OUT      :   - none -
   93          // RETURN   :   - none -
   94          // Notes    :   - none -
   95          //-----------------------------------------------------------------------------
   96          
   97          void v_fnSPI_WaitForEOT()
   98          {
   99   1        
  100   1          while(testSDI_PIN());
*** WARNING C140 IN LINE 100 OF ..\..\..\..\LIB\PICOREAD\U03\LEVEL_1\COMMON\SOURCES\PRD_RF_COMM.C: 'testSDI_PIN' undefin
             -ed; assuming 'extern int testSDI_PIN()'
  101   1          while(!(testSDI_PIN()));
  102   1      }
  103          
  104          
  105          //-----------------------------------------------------------------------------
  106          // Function name : void v_fnSPI_SendBuffer
  107          //-----------------------------------------------------------------------------
ARM COMPILER V2.40e,  PRD_RF_Comm                                                          12/12/07  14:35:10  PAGE 3   

  108          // Description : Send buffer in defined protocol.
  109          //
  110          // IN       :   p_bBytesLength   : Number of bytes to send
  111          //              p_bBitsLength    : Number of bits to send
  112          //              p_pabBuffer      : Pointer to Buffer to Send
  113          //
  114          // OUT      :   - none -
  115          // RETURN   :   - none -
  116          // Notes    :   - none -
  117          //-----------------------------------------------------------------------------
  118          
  119          void v_fnSPI_SendBuffer(unsigned char p_bBytesLength, unsigned char p_bBitsLength,unsigned char * p_pabBu
             -ffer)
  120          {
  121   1          signed char l_bBitNum;
  122   1          unsigned char l_bByteNum;
  123   1          unsigned char l_bByteToSend;
  124   1          unsigned char l_ilocalParity=1;
  125   1          
  126   1          delay_us(1); 
  127   1      
  128   1          for(l_bByteNum=0;l_bByteNum<p_bBytesLength;l_bByteNum++)                           //Byte cycling
  129   1          {
  130   2              l_bByteToSend =*p_pabBuffer;
  131   2              
  132   2              while(testSDI_PIN());
  133   2      
  134   2              for(l_bBitNum=7;l_bBitNum>=0;l_bBitNum--)      //bit cycling
  135   2              {
  136   3                  clearSDO_PIN();
*** WARNING C140 IN LINE 136 OF ..\..\..\..\LIB\PICOREAD\U03\LEVEL_1\COMMON\SOURCES\PRD_RF_COMM.C: 'clearSDO_PIN' undefi
             -ned; assuming 'extern int clearSDO_PIN()'
  137   3              
  138   3                  if ( (l_bByteToSend >> l_bBitNum) & 1 )
  139   3                  {
  140   4                       #if ((defined PAYPASS) || (defined FULL))
                               l_ilocalParity^=1;
                               #endif
  143   4                      setSDO_PIN();
*** WARNING C140 IN LINE 143 OF ..\..\..\..\LIB\PICOREAD\U03\LEVEL_1\COMMON\SOURCES\PRD_RF_COMM.C: 'setSDO_PIN' undefine
             -d; assuming 'extern int setSDO_PIN()'
  144   4                  }
  145   3                  setSCK_PIN();
*** WARNING C140 IN LINE 145 OF ..\..\..\..\LIB\PICOREAD\U03\LEVEL_1\COMMON\SOURCES\PRD_RF_COMM.C: 'setSCK_PIN' undefine
             -d; assuming 'extern int setSCK_PIN()'
  146   3          
  147   3                  clearSCK_PIN();
*** WARNING C140 IN LINE 147 OF ..\..\..\..\LIB\PICOREAD\U03\LEVEL_1\COMMON\SOURCES\PRD_RF_COMM.C: 'clearSCK_PIN' undefi
             -ned; assuming 'extern int clearSCK_PIN()'
  148   3          
  149   3              }
  150   2              p_pabBuffer++;
  151   2              
  152   2          }
  153   1           #if ((defined PAYPASS) || (defined FULL))
                   g_bLastBitSentValue=l_ilocalParity;
                   #endif
  156   1      
  157   1          if (p_bBitsLength & 0x07) // Bits to send  //max 7 bits
  158   1          {
  159   2              // Wait until the FIFO is empty
  160   2              while(testSDI_PIN());
  161   2      
  162   2              while (p_bBitsLength--)
  163   2              { 
  164   3                  // Position the correct SDI regarding the data
ARM COMPILER V2.40e,  PRD_RF_Comm                                                          12/12/07  14:35:10  PAGE 4   

  165   3                  clearSDO_PIN();
  166   3                  if ( bit_testChar(p_pabBuffer,p_bBitsLength) ) 
*** WARNING C140 IN LINE 166 OF ..\..\..\..\LIB\PICOREAD\U03\LEVEL_1\COMMON\SOURCES\PRD_RF_COMM.C: 'bit_testChar' undefi
             -ned; assuming 'extern int bit_testChar()'
  167   3                  {
  168   4                      setSDO_PIN();
  169   4                  }
  170   3                   #if ((defined PAYPASS) || (defined FULL))
                           if(p_bBitsLength==0) {g_bLastBitSentValue==bit_testChar(p_pabBuffer,0);}
                           #endif
  173   3                  // Make a clock cycle
  174   3                  setSCK_PIN();
  175   3                  clearSCK_PIN();
  176   3              }
  177   2          }
  178   1      
  179   1      
  180   1      

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -