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

📄 timer_a.lst

📁 瑞萨单片机LCD控制
💻 LST
📖 第 1 页 / 共 5 页
字号:
    269          /*         as start condition                                             */
    270          /*                                                                        */
    271          /*       Name         :      timer_a0_start                               */
    272          /*       Date/Author  :      08.04.1997/ST                                */
    273          /*       Parameter    :                                                   */
    274          /*       Return       :                                                   */
    275          /*                                                                        */
    276          /**************************************************************************/
    277          void near timer_a0_start (void)
    278          {
    279              TABSR |= 0x01;          // ---- ---1
   \   000066   9F018003             OR.B    #1,896
    280                                      //         +- 1: start timer A0 (count flag)
    281          
    282              ONSF  |= 0x01;          // ---- ---1
   \   00006A   9F018203             OR.B    #1,898
    283                                      //         +- 1: start timer A0 (one-shot flag)
    284          }
   \   00006E   F3                   RTS     
   \                     timer_a0_stop:
    285          
    286          /**************************************************************************/
    287          /*                                                                        */
    288          /*       Timer A0 - stop                                                  */
    289          /*       In following cases this routine takes no effect:                 */
    290          /*       - in one-shot timer mode if ext. trigger or timer overflow is    */
    291          /*         selected as start condition                                    */
    292          /*       - in pwm mode if external trigger or timer overflow is selected  */
    293          /*         as start condition                                             */
    294          /*                                                                        */
    295          /*       Name         :      timer_a0_stop                                */
    296          /*       Date/Author  :      08.04.1997/ST                                */
    297          /*       Parameter    :                                                   */
    298          /*       Return       :                                                   */
    299          /*                                                                        */
    300          /**************************************************************************/
    301          void near timer_a0_stop (void)
    302          {
    303              TABSR &= ~(0x01);           // ---- ---0
   \   00006F   97FE8003             AND.B   #254,896
    304                                          //         +- 0: stop  timer A0 (count flag)
    305          
    306              ONSF  &= ~(0x01);           // ---- ---0
   \   000073   97FE8203             AND.B   #254,898
    307                                          //         +- 0: stop  timer A0 (one-shot flag)
    308          }
   \   000077   F3                   RTS     
   \                     timer_a0_get:
    309          
    310          /**************************************************************************/
    311          /*                                                                        */
    312          /*       Timer A0 - get current value                                     */
    313          /*                                                                        */
    314          /*       Name         :      timer_a0_get                                 */
    315          /*       Date/Author  :      08.04.1997/ST                                */
    316          /*       Parameter    :                                                   */
    317          /*       Return       :      - current count value in timer mode or event */
    318          /*                             counter mode                               */
    319          /*                           - indeterminate in one-shot mode or pwm mode */
    320          /*                                                                        */
    321          /**************************************************************************/
    322          unsigned int near timer_a0_get (void)
    323          {
    324              return(TA0);
   \   000078   73F08603             MOV.W   902,R0
    325          }
   \   00007C   F3                   RTS     
   \                     timer_a0_set:
    326          
    327          /**************************************************************************/
    328          /*                                                                        */
    329          /*       timer A0 - set current value                                     */
    330          /*       when counting stopped    : write value to reload register and    */
    331          /*                                  counter                               */
    332          /*       when counting in progress: write value only to reload register   */
    333          /*                                  transferred to counter at next reload */
    334          /*                                  time                                  */
    335          /*       In 8-bit pwm mode highbyte gives time of high level and          */
    336          /*                         lowbyte gives time of low level                */
    337          /*                                                                        */
    338          /*       Name         :      timer_a0_set                                 */
    339          /*       Date/Author  :      08.04.1997/ST                                */
    340          /*       Parameter    :      load value                                   */
    341          /*       Return       :                                                   */
    342          /*                                                                        */
    343          /**************************************************************************/
    344          void near timer_a0_set (unsigned int value)
    345          {
   \   00007D   EC02                 PUSHM   SB
   \   00007F   7540                 PUSH.W  R0
   \   000081   EB52                 PUSHC   SP
   \   000083   EB63                 POPC    SB
    346              TA0 = value;
   \   000085   73AF0086             MOV.W   0[SB],902
   \            03      
    347          }
   \   00008A   7DB2                 ADD.B   #2,SP
   \   00008C   ED40                 POPM    SB
   \   00008E   F3                   RTS     
   \                     timer_a0_interrupt_set:
    348          
    349          
    350          /**************************************************************************/
    351          /*                                                                        */
    352          /*       Timer A0 - set interrupt                                         */
    353          /*       user must adapt interrupt priority level                         */
    354          /*                                                                        */
    355          /*       Name         :      timer_a0_interrupt_set                       */
    356          /*       Date/Author  :      14.04.1997/ST                                */
    357          /*       Parameter    :                                                   */
    358          /*       Return       :                                                   */
    359          /*                                                                        */
    360          /**************************************************************************/
    361          void near timer_a0_interrupt_set (void)
    362          {
    363              TA0IC = 0x01;           // ---- XXXX
   \   00008F   C7015500             MOV.B   #1,85
    364                                      //      ||||
    365                                      //      |||+-- Interupt priority level select bit
    366                                      //      ||+--- Interupt priority level select bit
    367                                      //      |+---- Interupt priority level select bit
    368                                      //      |      000: Level 0 (interrupt disabled)
    369                                      //      |      001: Level 1
    370                                      //      |      010: Level 2
    371                                      //      |      011: Level 3
    372                                      //      |      100: Level 4
    373                                      //      |      101: Level 5
    374                                      //      |      110: Level 6
    375                                      //      |      111: Level 7
    376                                      //      +----- Interupt request bit 
    377                                      //             0: Interrupt not requested
    378                                      //             1: Interrupt requested
    379          }
   \   000093   F3                   RTS     
   \                     timer_a0_interrupt_clr:
    380          
    381          /**************************************************************************/
    382          /*                                                                        */
    383          /*       Timer A0 - clear interrupt                                       */
    384          /*                                                                        */
    385          /*       Name         :      timer_a0_interrupt_clr                       */
    386          /*       Date/Author  :      14.04.1997/ST                                */
    387          /*       Parameter    :                                                   */
    388          /*       Return       :                                                   */
    389          /*                                                                        */
    390          /**************************************************************************/
    391          void near timer_a0_interrupt_clr (void)
    392          {
    393              TA0IC = 0x00;           // ---- 0000
   \   000094   B75500               MOV.B   #0,85
    394                                      //      ||||
    395                                      //      |||+-- Interupt priority level select bit
    396                                      //      ||+--- Interupt priority level select bit
    397                                      //      |+---- Interupt priority level select bit
    398                                      //      |      000: Level 0 (interrupt disabled)
    399                                      //      |      001: Level 1
    400                                      //      |      010: Level 2
    401                                      //      |      011: Level 3
    402                                      //      |      100: Level 4
    403                                      //      |      101: Level 5
    404                                      //      |      110: Level 6
    405                                      //      |      111: Level 7
    406                                      //      +----- Interupt request bit 
    407                                      //             0: Interrupt not requested
    408                                      //             1: Interrupt requested
    409          }
   \   000097   F3                   RTS     
   \                     timer_a1_init_timer_mode:
    410          
    411          /**************************************************************************/
    412          /*                                                                        */
    413          /*       Timer A1 - Initialization for timer mode                         */
    414          /*       The timer counts an internal count source                        */
    415          /*       routine may be customized to the user's needs                    */
    416          /*                                                                        */
    417          /*       Name         :      timer_a1_init_timer_mode                     */
    418          /*       Date/Author  :      08.04.1997/ST                                */
    419          /*       Parameter    :                                                   */
    420          /*       Return       :                                                   */
    421          /*                                                                        */

⌨️ 快捷键说明

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