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

📄 gpt1.lst

📁 xc164CM的PEC功能使用例程
💻 LST
字号:
C166 COMPILER V6.02, GPT1                                                                  08/15/2006 16:21:25 PAGE 1   


C166 COMPILER V6.02, COMPILATION OF MODULE GPT1
OBJECT MODULE PLACED IN GPT1.OBJ
COMPILER INVOKED BY: C:\Keil\C166\BIN\C166.EXE GPT1.C MODV2 BROWSE MODV2 DEBUG

 stmt lvl     source

    1         //****************************************************************************
    2         // @Module        General Purpose Timer Unit (GPT1)
    3         // @Filename      GPT1.C
    4         // @Project       PEC.dav
    5         //----------------------------------------------------------------------------
    6         // @Controller    Infineon XC164CM-8F40
    7         //
    8         // @Compiler      Keil
    9         //
   10         // @Codegenerator 0.2
   11         //
   12         // @Description   This file contains functions that use the GPT1 module.
   13         //
   14         //----------------------------------------------------------------------------
   15         // @Date          2006-8-15 15:54:58
   16         //
   17         //****************************************************************************
   18         
   19         // USER CODE BEGIN (GPT1_General,1)
   20         
   21         // USER CODE END
   22         
   23         
   24         
   25         //****************************************************************************
   26         // @Project Includes
   27         //****************************************************************************
   28         
   29         #include "MAIN.H"
   30         
   31         // USER CODE BEGIN (GPT1_General,2)
   32         
   33         // USER CODE END
   34         
   35         
   36         //****************************************************************************
   37         // @Macros
   38         //****************************************************************************
   39         
   40         // USER CODE BEGIN (GPT1_General,3)
   41         
   42         // USER CODE END
   43         
   44         
   45         //****************************************************************************
   46         // @Defines
   47         //****************************************************************************
   48         
   49         // USER CODE BEGIN (GPT1_General,4)
   50         
   51         // USER CODE END
   52         
   53         
   54         //****************************************************************************
   55         // @Typedefs
C166 COMPILER V6.02, GPT1                                                                  08/15/2006 16:21:25 PAGE 2   

   56         //****************************************************************************
   57         
   58         // USER CODE BEGIN (GPT1_General,5)
   59         
   60         // USER CODE END
   61         
   62         
   63         //****************************************************************************
   64         // @Imported Global Variables
   65         //****************************************************************************
   66         
   67         // USER CODE BEGIN (GPT1_General,6)
   68         
   69         // USER CODE END
   70         
   71         
   72         //****************************************************************************
   73         // @Global Variables
   74         //****************************************************************************
   75         
   76         // USER CODE BEGIN (GPT1_General,7)
   77         unsigned int PEC_Source[10] = {0,1,2,3,4,5,6,7,8,9};
   78         unsigned int PEC_Des[10];
   79         
   80         unsigned char GPT1_Index;
   81         // USER CODE END
   82         
   83         
   84         //****************************************************************************
   85         // @External Prototypes
   86         //****************************************************************************
   87         
   88         // USER CODE BEGIN (GPT1_General,8)
   89         
   90         // USER CODE END
   91         
   92         
   93         //****************************************************************************
   94         // @Prototypes Of Local Functions
   95         //****************************************************************************
   96         
   97         // USER CODE BEGIN (GPT1_General,9)
   98         
   99         // USER CODE END
  100         
  101         
  102         //****************************************************************************
  103         // @Function      void GPT1_vInit(void) 
  104         //
  105         //----------------------------------------------------------------------------
  106         // @Description   This is the initialization function of the GPT1 function 
  107         //                library. It is assumed that the SFRs used by this library 
  108         //                are in reset state. 
  109         //
  110         //----------------------------------------------------------------------------
  111         // @Returnvalue   None
  112         //
  113         //----------------------------------------------------------------------------
  114         // @Parameters    None
  115         //
  116         //----------------------------------------------------------------------------
  117         // @Date          2006-8-15
C166 COMPILER V6.02, GPT1                                                                  08/15/2006 16:21:25 PAGE 3   

  118         //
  119         //****************************************************************************
  120         
  121         // USER CODE BEGIN (Init,1)
  122         
  123         // USER CODE END
  124         
  125         void GPT1_vInit(void)
  126         {
  127  1        // USER CODE BEGIN (Init,2)
  128  1      
  129  1        // USER CODE END
  130  1      
  131  1        ///  -----------------------------------------------------------------------
  132  1        ///  Configuration of Timer Block Prescaler 1:
  133  1        ///  -----------------------------------------------------------------------
  134  1        ///  - prescaler for timer block 1 is 8
  135  1      
  136  1      
  137  1        ///  -----------------------------------------------------------------------
  138  1        ///  Configuration of the GPT1 Core Timer 3:
  139  1        ///  -----------------------------------------------------------------------
  140  1        ///  - timer 3 works in timer mode
  141  1        ///  - external up/down control is disabled
  142  1        ///  - prescaler factor is 1024
  143  1        ///  - up/down control bit is reset
  144  1        ///  - alternate output function T3OUT (P3.3) is disabled
  145  1        ///  - timer 3 output toggle latch (T3OTL) is set to 0
  146  1        ///  - timer 3 run bit is reset
  147  1      
  148  1        GPT12E_T3CON   =  0x0007;      // load timer 3 control register
  149  1        GPT12E_T3      =  0x676A;      // load timer 3 register
  150  1      
  151  1        ///  -----------------------------------------------------------------------
  152  1        ///  Configuration of the GPT1 Auxiliary Timer 2:
  153  1        ///  -----------------------------------------------------------------------
  154  1        ///  - timer 2 works in timer mode
  155  1        ///  - external up/down control is disabled
  156  1        ///  - prescaler factor is 1024
  157  1        ///  - up/down control bit is reset
  158  1      
  159  1        GPT12E_T2CON   =  0x0007;      // load timer 2 control register
  160  1        GPT12E_T2      =  0x676A;      // load timer 2 register
  161  1      
  162  1        ///  -----------------------------------------------------------------------
  163  1        ///  Configuration of the GPT1 Auxiliary Timer 4:
  164  1        ///  -----------------------------------------------------------------------
  165  1        ///  - timer 4 works in timer mode
  166  1        ///  - external up/down control is disabled
  167  1        ///  - prescaler factor is 8
  168  1        ///  - up/down control bit is reset
  169  1        ///  - timer 4 run bit is reset
  170  1      
  171  1        GPT12E_T4CON   =  0x0000;      // load timer 4 control register
  172  1        GPT12E_T4      =  0x0000;      // load timer 4 register
  173  1      
  174  1        ///  -----------------------------------------------------------------------
  175  1        ///  Configuration of the used GPT1 Port Pins:
  176  1        ///  -----------------------------------------------------------------------
  177  1      
  178  1      
  179  1        ///  -----------------------------------------------------------------------
C166 COMPILER V6.02, GPT1                                                                  08/15/2006 16:21:25 PAGE 4   

  180  1        ///  Configuration of the used GPT1 Interrupts:
  181  1        ///  -----------------------------------------------------------------------
  182  1        ///  timer 2 service request node configuration:
  183  1        ///  - timer 2 interrupt priority level (ILVL) = 12
  184  1        ///  - timer 2 interrupt group level (GLVL) = 1
  185  1        ///  - timer 2 group priority extension (GPX) = 0
  186  1      
  187  1        GPT12E_T2IC    =  0x0071;     
  188  1      
  189  1        ///  Use PEC channel 1 for GPT1 T2 INT:
  190  1        ///  - decrement counter
  191  1        ///  - increment destination and source pointers
  192  1        ///  - transfer a word
  193  1        ///  - service End of PEC interrrupt by a EOP interrupt node is enabled
  194  1        ///  - End of PEC intrrupt request is enabled
  195  1      
  196  1        PECC1          =  0x560A;      // load PECC1 control register
  197  1      
  198  1        //// - SOURCE-POINTER for PECC channel 1 is set because it is selected for 
  199  1        ////   user defined
  200  1        SRCP1  =  _sof_(0x0000);      //set source pointer
  201  1      
  202  1        //// - DESTINATION-POINTER for PECC channel 1 is set because it is selected 
  203  1        ////   for user defined
  204  1        DSTP1  =  _sof_(0x0000);      //set destination pointer
  205  1      
  206  1      
  207  1        // USER CODE BEGIN (GPT1_Function,3)
  208  1        // manual define the source and destination address
  209  1        SRCP1  =  _sof_(PEC_Source);      //set source pointer
*** WARNING C98 IN LINE 209 OF GPT1.C: parameter 1: pointer to different objects
  210  1        DSTP1  =  _sof_(PEC_Des);      //set destination pointer
*** WARNING C98 IN LINE 210 OF GPT1.C: parameter 1: pointer to different objects
  211  1        // USER CODE END
  212  1      
  213  1        GPT12E_T2CON_T2R  =  1;        // set timer 2 run bit
  214  1      
  215  1      } //  End of function GPT1_vInit
  216         
  217         
  218         //****************************************************************************
  219         // @Function      void GPT1_viTmr2(void) 
  220         //
  221         //----------------------------------------------------------------------------
  222         // @Description   This is the interrupt service routine for the GPT1 timer 2. 
  223         //                It is called up in the case of over or underflow of the 
  224         //                timer 2 register.
  225         //                If the incremental interface mode is selected and the 
  226         //                interrupt for this mode is not disabled it is called up if 
  227         //                count edge or count direction was detected.
  228         //                
  229         //                Please note that you have to add application specific code 
  230         //                to this function.
  231         //
  232         //----------------------------------------------------------------------------
  233         // @Returnvalue   None
  234         //
  235         //----------------------------------------------------------------------------
  236         // @Parameters    None
  237         //
  238         //----------------------------------------------------------------------------
  239         // @Date          2006-8-15
C166 COMPILER V6.02, GPT1                                                                  08/15/2006 16:21:25 PAGE 5   

  240         //
  241         //****************************************************************************
  242         
  243         // USER CODE BEGIN (Tmr2,1)
  244         
  245         // USER CODE END
  246         
  247         void GPT1_viTmr2(void) interrupt T2INT
  248         {
  249  1        // USER CODE BEGIN (Tmr2,2)
  250  1        
  251  1        // USER CODE END
  252  1      
  253  1      
  254  1        // USER CODE BEGIN (Tmr2,5)
  255  1              GPT1_Index++;                                                   
  256  1        // USER CODE END
  257  1      
  258  1      } //  End of function GPT1_viTmr2
  259         
  260         
  261         
  262         
  263         // USER CODE BEGIN (GPT1_General,10)
  264         
  265         // USER CODE END
  266         


MODULE INFORMATION:   INITIALIZED  UNINITIALIZED
  CODE SIZE        =          68     --------
  NEAR-CONST SIZE  =    --------     --------
  FAR-CONST SIZE   =    --------     --------
  HUGE-CONST SIZE  =    --------     --------
  XHUGE-CONST SIZE =    --------     --------
  NEAR-DATA SIZE   =          41     --------
  FAR-DATA SIZE    =    --------     --------
  XHUGE-DATA SIZE  =    --------     --------
  IDATA-DATA SIZE  =    --------     --------
  SDATA-DATA SIZE  =    --------     --------
  BDATA-DATA SIZE  =    --------     --------
  HUGE-DATA SIZE   =    --------     --------
  BIT SIZE         =    --------     --------
  INIT'L SIZE      =          24     --------
END OF MODULE INFORMATION.


C166 COMPILATION COMPLETE.  2 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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