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

📄 at91.lst

📁 AT91M40800源码
💻 LST
📖 第 1 页 / 共 4 页
字号:
    340          #endif
    341          
    342          #if AT91_EB63
    343            // As seen from card edge: SW4 - PA9, SW3 - PB5, SW2 - PB4, SW1 - PB3
    344            pa = ~__PIO_PDSR; // Switch on PA9
    345            pb = ~__PIO_PDSRB; // Switch on PB3, PB4, PB5
    346            sw4 = !!(pa & 0x00000200); // pa9
    347            sw1 = !!(pb & 0x00000008); // pb3
    348            sw2 = !!(pb & 0x00000010); // pb4
    349            sw3 = !!(pb & 0x00000020); // pb5
    350          #endif
    351          
    352            mask = (sw1 << 3) | (sw2 << 2) | (sw3 << 1) | sw4;
   \   00000054   0221B0E1           LSLS     R2,R2,#+2
   \   00000058   800192E1           ORRS     R0,R2,R0, LSL #+3
   \   0000005C   830090E1           ORRS     R0,R0,R3, LSL #+1
   \   00000060   000091E1           ORRS     R0,R1,R0
    353          
    354            return mask;
   \   00000064   1EFF2FE1           BX       LR               ;; return
    355          }
    356          
    357          

   \                                 In segment CODE, align 4, keep-with-next
    358          void AT91InitPIO()
    359          {
    360          #if ANGEL
    361          // In Angel mode the serial port is already initialized and
    362          // used by the Angel monitor.
    363          
    364            // Initialize port B.
    365          #if AT91_EB40
    366            __PIO_PERB = 0x1236; // enable register
    367            __PIO_PDRB = 0x0000; // disable register
    368            __PIO_OERB = 0x0016; // output enable
    369            __PIO_ODRB = 0x1220; // output disable
    370            __PIO_SODRB = 0x0016; // LED's off
    371            __PIO_IDRB = 0x1220;
    372          #elif AT91_EB40A
    373            __PIO_PERB = 0xf127e; // enable register
    374            __PIO_PDRB = 0x00000; // disable register
    375            __PIO_OERB = 0xf0078; // output enable
    376            __PIO_ODRB = 0x01206; // output disable
    377            __PIO_SODRB = 0xf0078; // LED's off
    378            __PIO_IDRB = 0x1206;
    379          #else
    380            __PIO_PERB = 0xff00; // enable register
    381            __PIO_OERB = 0xff00; // output enable
    382            __PIO_SODRB = 0xff00; // LED's off
    383          #endif
    384          
    385          #else // ANGEL
    386          
    387            // Initialize port A.
    388          #if AT91_EB42
    389            __PIO_PER = 0x0040; // enable register (uart TX bit)
    390            __PIO_OER = 0x0040; // output enable (uart TX bit)
    391            __PIO_SODR = 0x0040; // inactive TX line
    392          #endif
    393          
    394          #if AT91_EB55 || AT91_EB63
    395            __PIO_PER = 0x8000; // enable register (uart TX bit)
    396            __PIO_OER = 0x8000; // output enable (uart TX bit)
    397            __PIO_SODR = 0x8000; // inactive TX line
    398          #endif
    399          
    400            // Initialize port B.
    401          #if AT91_EB40
    402            __PIO_PERB = 0x5236; // enable register
   \                     AT91InitPIO:
   \   00000000   FF04A0E3           MOV      R0,#-16777216
   \   00000004   FF0880E3           ORR      R0,R0,#0xFF0000
   \   00000008   3610A0E3           MOV      R1,#+54
   \   0000000C   521C81E3           ORR      R1,R1,#0x5200
   \   00000010   001080E5           STR      R1,[R0, #+0]
    403            __PIO_PDRB = 0x8000; // disable register
   \   00000014   FB00E0E3           MVN      R0,#+251
   \   00000018   FF0CC0E3           BIC      R0,R0,#0xFF00
   \   0000001C   801CA0E3           MOV      R1,#+32768
   \   00000020   001080E5           STR      R1,[R0, #+0]
    404            __PIO_OERB = 0x4016; // output enable
   \   00000024   EF00E0E3           MVN      R0,#+239
   \   00000028   FF0CC0E3           BIC      R0,R0,#0xFF00
   \   0000002C   1610A0E3           MOV      R1,#+22
   \   00000030   401C81E3           ORR      R1,R1,#0x4000
   \   00000034   001080E5           STR      R1,[R0, #+0]
    405            __PIO_ODRB = 0x1220; // output disable
   \   00000038   EB00E0E3           MVN      R0,#+235
   \   0000003C   FF0CC0E3           BIC      R0,R0,#0xFF00
   \   00000040   2010A0E3           MOV      R1,#+32
   \   00000044   481D81E3           ORR      R1,R1,#0x1200
   \   00000048   001080E5           STR      R1,[R0, #+0]
    406            __PIO_SODRB = 0x4016; // LED's off
   \   0000004C   CF00E0E3           MVN      R0,#+207
   \   00000050   FF0CC0E3           BIC      R0,R0,#0xFF00
   \   00000054   1610A0E3           MOV      R1,#+22
   \   00000058   401C81E3           ORR      R1,R1,#0x4000
   \   0000005C   001080E5           STR      R1,[R0, #+0]
    407            __PIO_IDRB = 0x1220;
   \   00000060   BB00E0E3           MVN      R0,#+187
   \   00000064   FF0CC0E3           BIC      R0,R0,#0xFF00
   \   00000068   2010A0E3           MOV      R1,#+32
   \   0000006C   481D81E3           ORR      R1,R1,#0x1200
   \   00000070   001080E5           STR      R1,[R0, #+0]
    408          #elif AT91_EB40A
    409            __PIO_PERB = 0xf527e; // enable register
    410            __PIO_PDRB = 0x08000; // disable register
    411            __PIO_OERB = 0xf4078; // output enable
    412            __PIO_ODRB = 0x01206; // output disable
    413            __PIO_SODRB = 0xf4078; // LED's off
    414            __PIO_IDRB = 0x1206;
    415          #else
    416            __PIO_PERB = 0xff00; // enable register
    417            __PIO_OERB = 0xff00; // output enable
    418            __PIO_SODRB = 0xff00; // LED's off
    419          #endif
    420          
    421          #endif // ANGEL
    422          }
   \   00000074   1EFF2FE1           BX       LR               ;; return
    423          
    424          
    425          //
    426          // LED output drivers.
    427          //
    428          

   \                                 In segment CODE, align 4, keep-with-next
    429          static void led_on(unsigned int mask)
    430          {
    431          #if AT91_EB40
    432            __PIO_CODRB = mask & 0x16;
   \                     led_on:
   \   00000000   CB10E0E3           MVN      R1,#+203
   \   00000004   FF1CC1E3           BIC      R1,R1,#0xFF00
   \   00000008   160010E2           ANDS     R0,R0,#0x16
   \   0000000C   000081E5           STR      R0,[R1, #+0]
    433          #elif AT91_EB40A
    434            __PIO_CODRB = (mask & 0x0f) << 16 | (mask & 0xf0) >> 1;
    435          #else
    436            __PIO_CODRB = mask << 8;
    437          #endif
    438          }
   \   00000010   1EFF2FE1           BX       LR               ;; return
    439          

   \                                 In segment CODE, align 4, keep-with-next
    440          static void led_off(unsigned int mask)
    441          {
    442          #if AT91_EB40
    443            __PIO_SODRB = mask & 0x16;
   \                     led_off:
   \   00000000   CF10E0E3           MVN      R1,#+207
   \   00000004   FF1CC1E3           BIC      R1,R1,#0xFF00
   \   00000008   160010E2           ANDS     R0,R0,#0x16
   \   0000000C   000081E5           STR      R0,[R1, #+0]
    444          #elif AT91_EB40A
    445            __PIO_SODRB = (mask & 0x0f) << 16 | (mask & 0xf0) >> 1;
    446          #else
    447            __PIO_SODRB = mask << 8;
    448          #endif
    449          }
   \   00000010   1EFF2FE1           BX       LR               ;; return
    450          

   \                                 In segment CODE, align 4, keep-with-next
    451          void AT91LedSet(unsigned int mask)
    452          {
   \                     AT91LedSet:
   \   00000000   10402DE9           PUSH     {R4,LR}
   \   00000004   0040B0E1           MOVS     R4,R0
    453            led_off(0xff); // Switch off all LED's.
   \   00000008   FF00A0E3           MOV      R0,#+255
   \   0000000C   ........           BL       led_off
    454            led_on(mask);  // Switch on selected LED's.
   \   00000010   0400B0E1           MOVS     R0,R4
   \   00000014   ........           BL       led_on
    455          }
   \   00000018   1040BDE8           POP      {R4,LR}
   \   0000001C   1EFF2FE1           BX       LR               ;; return

   \                                 In segment CODE, align 4, keep-with-next
   \                     ??DataTable3:
   \   00000000   ........           DC32     timer_function

   \                                 In segment CODE, align 4, keep-with-next
   \                     ??DataTable4:
   \   00000000   ........           DC32     rxrdy_function

   \                                 In segment CODE, align 4, keep-with-next
   \                     ??DataTable5:
   \   00000000   2000FEFF           DC32     0xfffffffffffe0020

   Maximum stack usage in bytes:

     Function                   CSTACK
     --------                   ------
     AT91EnablePeripheralClocks     0
     AT91GetButtons                 0
     AT91InitInterrupt              0
     AT91InitPIO                    0
     AT91InitTimer                  0
     AT91LedSet                     8
     AT91StartTimer                 0
     AT91UartGetchar                0
     AT91UartInit                   0
     AT91UartPutchar                0
     heartbeat_irq                 24
     led_off                        0
     led_on                         0
     undefined_irq                  8
     usart0_rxrdy_interrupt        24


   Segment part sizes:

     Function/Label             Bytes
     --------------             -----
     _A___PS_PCER                  4
     _A___AIC_SMR0                 4
     _A___AIC_SMR2                 4
     _A___AIC_SMR4                 4
     _A___AIC_SVR0                 4
     _A___AIC_SVR2                 4
     _A___AIC_SVR4                 4
     _A___AIC_IVR                  4
     _A___AIC_IECR                 4
     _A___AIC_IDCR                 4
     _A___AIC_ICCR                 4
     __AIC_EOICR                   4
     _A___AIC_SPU                  4
     _A___PIO_PER                  4
     _A___PIO_PDR                  4
     _A___PIO_OER                  4
     _A___PIO_ODR                  4
     _A___PIO_SODR                 4
     _A___PIO_CODR                 4
     _A___PIO_PDSR                 4
     _A___PIO_IDR                  4
     _A___SF_PMR                   4
     _A___US_CR                    4
     _A___US_MR                    4
     _A___US_IER                   4
     _A___US_IDR                   4
     _A___US_CSR                   4
     _A___US_RHR                   4
     _A___US_THR                   4
     _A___US_BRGR                  4
     _A___US_TTGR                  4
     _A___TC_CCR                   4
     _A___TC_CMR                   4
     _A___TC_RC                    4
     _A___TC_SR                    4
     _A___TC_IER                   4
     _A___TC_IDR                   4
     timer_function                4
     rxrdy_function                4
     AT91EnablePeripheralClocks   20
     heartbeat_irq                68
     usart0_rxrdy_interrupt       60
     undefined_irq                44
     AT91InitInterrupt           224
     AT91InitTimer               196
     AT91StartTimer               52
     AT91UartInit                256
     AT91UartGetchar              16
     ??AT91UartPutchar_0          36
     AT91GetButtons              104
     AT91InitPIO                 120
     led_on                       20
     led_off                      20
     AT91LedSet                   32
     ??DataTable3                  4
     ??DataTable4                  4
     ??DataTable5                  4
      Others                      60

 
 1 328 bytes in segment CODE
   148 bytes in segment DATA_AN
     8 bytes in segment DATA_Z
    12 bytes in segment INITTAB
 
 1 280 bytes of CODE memory (+  60 bytes shared)
     8 bytes of DATA memory (+ 148 bytes shared)

Errors: none
Warnings: none

⌨️ 快捷键说明

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