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

📄 usbd_udp.lst

📁 本代bootloader通过usb下载代码首先存放在sdram中
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   00000000                      DS8 1
    183          /// Indicates the previous device state

   \                                 In section .bss, align 1
    184          static unsigned char previousDeviceState;
   \                     previousDeviceState:
   \   00000000                      DS8 1
    185          
    186          //------------------------------------------------------------------------------
    187          //      Internal Functions
    188          //------------------------------------------------------------------------------
    189          
    190          //------------------------------------------------------------------------------
    191          /// Enables the clock of the UDP peripheral.
    192          //------------------------------------------------------------------------------

   \                                 In section .text, align 4, keep-with-next
    193          static inline void UDP_EnablePeripheralClock(void)
    194          {
    195              AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_UDP;
   \                     UDP_EnablePeripheralClock:
   \   00000000   EF00E0E3           MVN      R0,#+239
   \   00000004   ........           B        ?Subroutine0
    196          }

   \                                 In section .text, align 4, keep-with-next
   \                     ?Subroutine0:
   \   00000000   C00FC0E3           BIC      R0,R0,#0x300
   \   00000004   801EA0E3           MOV      R1,#+2048
   \                     ??Subroutine0_0:
   \   00000008   001080E5           STR      R1,[R0, #+0]
   \   0000000C   1EFF2FE1           BX       LR               ;; return
    197          
    198          //------------------------------------------------------------------------------
    199          /// Disables the UDP peripheral clock.
    200          //------------------------------------------------------------------------------

   \                                 In section .text, align 4, keep-with-next
    201          static inline void UDP_DisablePeripheralClock(void)
    202          {
    203              AT91C_BASE_PMC->PMC_PCDR = 1 << AT91C_ID_UDP;
   \                     UDP_DisablePeripheralClock:
   \   00000000   EB00E0E3           MVN      R0,#+235
   \   00000004                      REQUIRE ?Subroutine0
   \   00000004                      ;; // Fall through to label ?Subroutine0
    204          }
    205          
    206          //------------------------------------------------------------------------------
    207          /// Enables the 48MHz USB clock.
    208          //------------------------------------------------------------------------------

   \                                 In section .text, align 4, keep-with-next
    209          static inline void UDP_EnableUsbClock(void)
    210          {
    211              AT91C_BASE_PMC->PMC_SCER = AT91C_PMC_UDP;
   \                     UDP_EnableUsbClock:
   \   00000000   FF00E0E3           MVN      R0,#+255
   \   00000004   C00FC0E3           BIC      R0,R0,#0x300
   \   00000008   8010A0E3           MOV      R1,#+128
   \   0000000C   ........           B        ??Subroutine0_0
    212          }
    213          
    214          //------------------------------------------------------------------------------
    215          ///  Disables the 48MHz USB clock.
    216          //------------------------------------------------------------------------------

   \                                 In section .text, align 4, keep-with-next
    217          static inline void UDP_DisableUsbClock(void)
    218          {
    219              AT91C_BASE_PMC->PMC_SCDR = AT91C_PMC_UDP;
   \                     UDP_DisableUsbClock:
   \   00000000   FB00E0E3           MVN      R0,#+251
   \   00000004   C00FC0E3           BIC      R0,R0,#0x300
   \   00000008   8010A0E3           MOV      R1,#+128
   \   0000000C   ........           B        ??Subroutine0_0
    220          }
    221          
    222          //------------------------------------------------------------------------------
    223          /// Enables the UDP transceiver.
    224          //------------------------------------------------------------------------------

   \                                 In section .text, align 4, keep-with-next
    225          static inline void UDP_EnableTransceiver(void)
    226          {
    227              AT91C_BASE_UDP->UDP_TXVC &= ~AT91C_UDP_TXVDIS;
   \                     UDP_EnableTransceiver:
   \   00000000   ........           LDR      R0,??DataTable2  ;; 0xfffb0074
   \   00000004   000090E5           LDR      R0,[R0, #+0]
   \   00000008   400FC0E3           BIC      R0,R0,#0x100
   \   0000000C   ........           B        ?Subroutine1
    228          }

   \                                 In section .text, align 4, keep-with-next
   \                     ?Subroutine1:
   \   00000000   ........           LDR      R1,??DataTable2  ;; 0xfffb0074
   \   00000004   000081E5           STR      R0,[R1, #+0]
   \   00000008   1EFF2FE1           BX       LR               ;; return
    229          
    230          //------------------------------------------------------------------------------
    231          /// Disables the UDP transceiver.
    232          //------------------------------------------------------------------------------

   \                                 In section .text, align 4, keep-with-next
    233          static inline void UDP_DisableTransceiver(void)
    234          {
    235              AT91C_BASE_UDP->UDP_TXVC |= AT91C_UDP_TXVDIS;
   \                     UDP_DisableTransceiver:
   \   00000000   ........           LDR      R0,??DataTable2  ;; 0xfffb0074
   \   00000004   000090E5           LDR      R0,[R0, #+0]
   \   00000008   400F80E3           ORR      R0,R0,#0x100
   \   0000000C                      REQUIRE ?Subroutine1
   \   0000000C                      ;; // Fall through to label ?Subroutine1
    236          }
    237          
    238          //------------------------------------------------------------------------------
    239          /// Handles a completed transfer on the given endpoint, invoking the
    240          /// configured callback if any.
    241          /// \param bEndpoint Number of the endpoint for which the transfer has completed.
    242          /// \param bStatus   Status code returned by the transfer operation
    243          //------------------------------------------------------------------------------

   \                                 In section .text, align 4, keep-with-next
    244          static void UDP_EndOfTransfer(unsigned char bEndpoint, char bStatus)
    245          {
   \                     UDP_EndOfTransfer:
   \   00000000   01402DE9           PUSH     {R0,LR}
    246              Endpoint *pEndpoint = &(endpoints[bEndpoint]);
   \   00000004   1C20A0E3           MOV      R2,#+28
   \   00000008   ........           LDR      R3,??DataTable60  ;; endpoints
   \   0000000C   923020E0           MLA      R0,R2,R0,R3
    247              Transfer *pTransfer = &(pEndpoint->transfer);
   \   00000010   04C080E2           ADD      R12,R0,#+4
    248          
    249              // Check that endpoint was sending or receiving data
    250              if( (pEndpoint->state == UDP_ENDPOINT_RECEIVING)
    251                  || (pEndpoint->state == UDP_ENDPOINT_SENDING)) {
   \   00000014   0020D0E5           LDRB     R2,[R0, #+0]
   \   00000018   040052E3           CMP      R2,#+4
   \   0000001C   0020D015           LDRBNE   R2,[R0, #+0]
   \   00000020   03005213           CMPNE    R2,#+3
   \   00000024   0C00001A           BNE      ??UDP_EndOfTransfer_0
    252          
    253                  TRACE_DEBUG_WP("Eo");
    254          
    255                  // Endpoint returns in Idle state
    256                  pEndpoint->state = UDP_ENDPOINT_IDLE;
   \   00000028   0220A0E3           MOV      R2,#+2
   \   0000002C   0020C0E5           STRB     R2,[R0, #+0]
    257          
    258                  // Invoke callback is present
    259                  if (pTransfer->fCallback != 0) {
   \   00000030   10009CE5           LDR      R0,[R12, #+16]
   \   00000034   000050E3           CMP      R0,#+0
   \   00000038   0700000A           BEQ      ??UDP_EndOfTransfer_0
    260          
    261                      ((TransferCallback) pTransfer->fCallback)
    262                          (pTransfer->pArgument,
    263                           bStatus,
    264                           pTransfer->transferred,
    265                           pTransfer->remaining + pTransfer->buffered);
                                                                             ^
Warning[Pa082]: undefined behavior: the order of volatile accesses is
          undefined in this statement
   \   0000003C   0C009CE5           LDR      R0,[R12, #+12]
   \   00000040   04209CE5           LDR      R2,[R12, #+4]
   \   00000044   003082E0           ADD      R3,R2,R0
   \   00000048   08209CE5           LDR      R2,[R12, #+8]
   \   0000004C   14009CE5           LDR      R0,[R12, #+20]
   \   00000050   10C09CE5           LDR      R12,[R12, #+16]
   \   00000054   0FE0A0E1           MOV      LR,PC
   \   00000058   1CFF2FE1           BX       R12
    266                  }
    267                  else {
    268                      TRACE_DEBUG_WP("No callBack\n\r");
    269                  }
    270              }
    271          }
   \                     ??UDP_EndOfTransfer_0:
   \   0000005C   0050BDE8           POP      {R12,LR}
   \   00000060   1EFF2FE1           BX       LR               ;; return
    272          
    273          //------------------------------------------------------------------------------
    274          /// Clears the correct reception flag (bank 0 or bank 1) of an endpoint
    275          /// \param bEndpoint Index of endpoint
    276          //------------------------------------------------------------------------------

   \                                 In section .text, align 4, keep-with-next
    277          static void UDP_ClearRxFlag(unsigned char bEndpoint)
    278          {
   \                     UDP_ClearRxFlag:
   \   00000000   08D04DE2           SUB      SP,SP,#+8
    279              Endpoint *pEndpoint = &(endpoints[bEndpoint]);
   \   00000004   0010A0E1           MOV      R1,R0
   \   00000008   1C20A0E3           MOV      R2,#+28
   \   0000000C   ........           LDR      R3,??DataTable60  ;; endpoints
   \   00000010   923121E0           MLA      R1,R2,R1,R3
    280          
    281              // Clear flag and change banks
    282              if (pEndpoint->bank == 0) {
   \   00000014   0120D1E5           LDRB     R2,[R1, #+1]
   \   00000018   000052E3           CMP      R2,#+0
   \   0000001C   0020A0E1           MOV      R2,R0
   \   00000020   ........           LDR      R3,??DataTable61  ;; 0xfffb0030
   \   00000024   022193E7           LDR      R2,[R3, +R2, LSL #+2]
   \   00000028   00208DE5           STR      R2,[SP, #+0]
   \   0000002C   00209DE5           LDR      R2,[SP, #+0]
   \   00000030   4F2082E3           ORR      R2,R2,#0x4F
   \   00000034   00208DE5           STR      R2,[SP, #+0]
   \   00000038   00209DE5           LDR      R2,[SP, #+0]
   \   0000003C   0D00001A           BNE      ??UDP_ClearRxFlag_0
    283          
    284                  CLEAR_CSR(bEndpoint, AT91C_UDP_RX_DATA_BK0);
   \   00000040   0220C2E3           BIC      R2,R2,#0x2
   \   00000044   00208DE5           STR      R2,[SP, #+0]
   \   00000048   0020A0E1           MOV      R2,R0
   \   0000004C   00C09DE5           LDR      R12,[SP, #+0]
   \   00000050   02C183E7           STR      R12,[R3, +R2, LSL #+2]
   \                     ??UDP_ClearRxFlag_1:
   \   00000054   0020A0E1           MOV      R2,R0
   \   00000058   022193E7           LDR      R2,[R3, +R2, LSL #+2]
   \   0000005C   020012E3           TST      R2,#0x2
   \   00000060   FBFFFF1A           BNE      ??UDP_ClearRxFlag_1
    285                  // Swap bank if in dual-fifo mode
    286                  if (BOARD_USB_ENDPOINTS_BANKS(bEndpoint) > 1) {
   \   00000064   000050E3           CMP      R0,#+0
   \   00000068   03005013           CMPNE    R0,#+3
   \   0000006C   0C00000A           BEQ      ??UDP_ClearRxFlag_2
    287          
    288                      pEndpoint->bank = 1;
   \   00000070   0100A0E3           MOV      R0,#+1
   \   00000074   090000EA           B        ??UDP_ClearRxFlag_3

⌨️ 快捷键说明

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