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

📄 main.lst

📁 at91sam7x256 mac驱动演示程序
💻 LST
📖 第 1 页 / 共 4 页
字号:
##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.40A/W32 EVALUATION    29/Feb/2008  22:29:24 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  interwork                                            #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  C:\AT91SAM7X256-BasicEmac-IAR4_30A-1_21\AT91SAM7X-Ba #
#                       sicEmac\src\main.c                                   #
#    Command line    =  C:\AT91SAM7X256-BasicEmac-IAR4_30A-1_21\AT91SAM7X-Ba #
#                       sicEmac\src\main.c -D ESS -lC                        #
#                       C:\AT91SAM7X256-BasicEmac-IAR4_30A-1_21\AT91SAM7X-Ba #
#                       sicEmac\compil\RAM_Debug\List\ -o                    #
#                       C:\AT91SAM7X256-BasicEmac-IAR4_30A-1_21\AT91SAM7X-Ba #
#                       sicEmac\compil\RAM_Debug\Obj\ -z2 --no_cse           #
#                       --no_unroll --no_inline --no_code_motion --no_tbaa   #
#                       --no_clustering --no_scheduling --debug --cpu_mode   #
#                       thumb --endian little --cpu ARM7TDMI --stack_align   #
#                       4 --interwork -e --fpu None --dlib_config            #
#                       "C:\Program Files\ARM\IAR Systems\Embedded           #
#                       Workbench 4.0 Evaluation\ARM\LIB\dl4tptinl8n.h" -I   #
#                       C:\AT91SAM7X256-BasicEmac-IAR4_30A-1_21\AT91SAM7X-Ba #
#                       sicEmac\compil\srciar\ -I                            #
#                       C:\AT91SAM7X256-BasicEmac-IAR4_30A-1_21\AT91SAM7X-Ba #
#                       sicEmac\compil\..\..\ -I "C:\Program Files\ARM\IAR   #
#                       Systems\Embedded Workbench 4.0 Evaluation\ARM\INC\"  #
#    List file       =  C:\AT91SAM7X256-BasicEmac-IAR4_30A-1_21\AT91SAM7X-Ba #
#                       sicEmac\compil\RAM_Debug\List\main.lst               #
#    Object file     =  C:\AT91SAM7X256-BasicEmac-IAR4_30A-1_21\AT91SAM7X-Ba #
#                       sicEmac\compil\RAM_Debug\Obj\main.r79                #
#                                                                            #
#                                                                            #
##############################################################################

C:\AT91SAM7X256-BasicEmac-IAR4_30A-1_21\AT91SAM7X-BasicEmac\src\main.c
      1          //*----------------------------------------------------------------------------
      2          //*         ATMEL Microcontroller Software Support  -  ROUSSET  -
      3          //*----------------------------------------------------------------------------
      4          //* The software is delivered "AS IS" without warranty or condition of any
      5          //* kind, either express, implied or statutory. This includes without
      6          //* limitation any warranty or condition with respect to merchantability or
      7          //* fitness for any particular purpose, or against the infringements of
      8          //* intellectual property rights of others.
      9          //*----------------------------------------------------------------------------
     10          //* File Name           : main.c
     11          //* Object              : main application written in C
     12          //* Creation            : Hi   11/18/2002
     13          //* Modification        : JGe  07/28/2005
     14          //*----------------------------------------------------------------------------
     15          #include "board.h"

   \                                 In segment CODE, align 4, keep-with-next
   \   __??Code16?? __code __interwork __atpcs void AT91F_PIO_CfgPeriph(AT91PS_PIO, unsigned int, unsigned int)
   \                     AT91F_PIO_CfgPeriph:
   \   00000000   0167               STR      R1,[R0, #+112]
   \   00000002   4267               STR      R2,[R0, #+116]
   \   00000004   1300               MOVS     R3,R2
   \   00000006   0B43               ORRS     R3,R3,R1
   \   00000008   4360               STR      R3,[R0, #+4]
   \   0000000A   7047               BX       LR               ;; return

   \                                 In segment CODE, align 4, keep-with-next
   \   __??Code16?? __code __interwork __atpcs void AT91F_PIO_CfgOutput(AT91PS_PIO, unsigned int)
   \                     AT91F_PIO_CfgOutput:
   \   00000000   0160               STR      R1,[R0, #+0]
   \   00000002   0161               STR      R1,[R0, #+16]
   \   00000004   7047               BX       LR               ;; return

   \                                 In segment CODE, align 4, keep-with-next
   \   __??Code16?? __code __interwork __atpcs void AT91F_PIO_ClearOutput(AT91PS_PIO, unsigned int)
   \                     AT91F_PIO_ClearOutput:
   \   00000000   4163               STR      R1,[R0, #+52]
   \   00000002   7047               BX       LR               ;; return

   \                                 In segment CODE, align 4, keep-with-next
   \   __??Code16?? __code __interwork __atpcs void AT91F_PMC_EnablePeriphClock(AT91PS_PMC, unsigned int)
   \                     AT91F_PMC_EnablePeriphClock:
   \   00000000   0161               STR      R1,[R0, #+16]
   \   00000002   7047               BX       LR               ;; return
     16          
     17          #include "Emac.h"
     18          #include <stdio.h>
     19          #include <string.h>
     20          #include "mii.h"
     21          
     22          // function in appli.c
     23          extern void  Init_LED_FOR_APPLI  (void);
     24          extern void  APPLI(void);
     25          extern void LED_Toggle(unsigned int led);
     26          extern void LED_TurnOn(unsigned int led);
     27          extern void LED_TurnOff(unsigned int led);
     28          
     29          // function in dbgu.c
     30          extern void AT91F_DBGU_Printk(char *buffer);
     31          extern void Init_DBGU(void);
     32          
     33          // functions in Emac.c
     34          extern void AT91F_EMAC_HANDLER (void);
     35          extern int AT91F_EmacEntry(void);
     36          extern int AT91F_ProcessEmacPacket(AT91PS_IPheader pHeader);
     37          extern void write_phy(AT91PS_EMAC pEmac, unsigned char phy_addr, unsigned char address, unsigned int value);
     38          extern void read_phy(AT91PS_EMAC pEmac, unsigned char phy_addr, unsigned char address, unsigned int *value);
     39          
     40          extern void AT91F_Enable_Mdi(AT91PS_EMAC pEmac);
     41          extern void AT91F_Disable_Mdi(AT91PS_EMAC pEmac);
     42          
     43          // Message buffer

   \                                 In segment DATA_Z, align 4, align-sorted
     44          char MsgBuffer[256];
   \                     MsgBuffer:
   \   00000000                      DS8 256
     45          
     46          // system timer counter
     47          extern AT91PS_RxTdDescriptor RxtdList;
     48          extern AT91PS_TxTdDescriptor TxtdList;
     49          
     50          #define AT91C_ID_EMAC_B		16
     51          //#define RMII
     52          //#define EMAC_IRQ
     53          #define DISPLAY_IP_PACKET
     54          
     55          //*----------------------------------------------------------------------------
     56          //* \fn    AT91F_DisplayIpPacket
     57          //* \brief This function is invoked by main
     58          //* This function is for demonstration purpose only
     59          //*----------------------------------------------------------------------------

   \                                 In segment CODE, align 4, keep-with-next
     60          void AT91F_DisplayIpPacket(AT91PS_IPheader pIpHeader)
     61          {
   \                     AT91F_DisplayIpPacket:
   \   00000000   10B5               PUSH     {R4,LR}
   \   00000002   82B0               SUB      SP,SP,#+8
   \   00000004   0400               MOVS     R4,R0
     62          char address[6];
     63          #ifdef DISPLAY_IP_PACKET
     64            AT91F_DBGU_Printk("\n\n\r-I- ================ IP HEADER ======================\n\r");
   \   00000006   5348               LDR      R0,??AT91F_DisplayIpPacket_0  ;; `?<Constant "\\n\\n\\r-I- ==============...">`
   \   00000008   ........           _BLF     AT91F_DBGU_Printk,??AT91F_DBGU_Printk??rT
     65            sprintf(MsgBuffer, "\n\r IP Version        = v.%d",(pIpHeader->ip_hl_v & 0xF0) >> 4);
   \   0000000C   2078               LDRB     R0,[R4, #+0]
   \   0000000E   0200               MOVS     R2,R0
   \   00000010   1206               LSLS     R2,R2,#+24       ;; ZeroExtS R2,R2,#+24,#+24
   \   00000012   120E               LSRS     R2,R2,#+24
   \   00000014   1209               LSRS     R2,R2,#+4
   \   00000016   1206               LSLS     R2,R2,#+24       ;; ZeroExtS R2,R2,#+24,#+24
   \   00000018   120E               LSRS     R2,R2,#+24
   \   0000001A   4F49               LDR      R1,??AT91F_DisplayIpPacket_0+0x4  ;; `?<Constant "\\n\\r IP Version        ...">`
   \   0000001C   ....               LDR      R0,??DataTable21  ;; MsgBuffer
   \   0000001E   ........           _BLF     sprintf,??sprintf??rT
     66            AT91F_DBGU_Printk(MsgBuffer);
   \   00000022   ....               LDR      R0,??DataTable21  ;; MsgBuffer
   \   00000024   ........           _BLF     AT91F_DBGU_Printk,??AT91F_DBGU_Printk??rT
     67          
     68            sprintf(MsgBuffer, "\n\r Header Length     = %d",pIpHeader->ip_hl_v & 0x0F);
   \   00000028   2078               LDRB     R0,[R4, #+0]
   \   0000002A   0207               LSLS     R2,R0,#+28       ;; ZeroExtS R2,R0,#+28,#+28
   \   0000002C   120F               LSRS     R2,R2,#+28
   \   0000002E   4B49               LDR      R1,??AT91F_DisplayIpPacket_0+0x8  ;; `?<Constant "\\n\\r Header Length     ...">`
   \   00000030   ....               LDR      R0,??DataTable21  ;; MsgBuffer
   \   00000032   ........           _BLF     sprintf,??sprintf??rT
     69            AT91F_DBGU_Printk(MsgBuffer);
   \   00000036   ....               LDR      R0,??DataTable21  ;; MsgBuffer
   \   00000038   ........           _BLF     AT91F_DBGU_Printk,??AT91F_DBGU_Printk??rT
     70          
     71            sprintf(MsgBuffer, "\n\r Type of service   = 0x%x",pIpHeader->ip_tos);
   \   0000003C   6278               LDRB     R2,[R4, #+1]
   \   0000003E   4849               LDR      R1,??AT91F_DisplayIpPacket_0+0xC  ;; `?<Constant "\\n\\r Type of service   ...">`
   \   00000040   ....               LDR      R0,??DataTable21  ;; MsgBuffer
   \   00000042   ........           _BLF     sprintf,??sprintf??rT
     72            AT91F_DBGU_Printk(MsgBuffer);
   \   00000046   ....               LDR      R0,??DataTable21  ;; MsgBuffer
   \   00000048   ........           _BLF     AT91F_DBGU_Printk,??AT91F_DBGU_Printk??rT
     73          
     74            sprintf(MsgBuffer, "\n\r Total IP Length   = 0x%X", (((pIpHeader->ip_len)>>8)&0xff) + (((pIpHeader->ip_len)<<8)&0xff00) );
   \   0000004C   6088               LDRH     R0,[R4, #+2]
   \   0000004E   0004               LSLS     R0,R0,#+16       ;; ZeroExtS R0,R0,#+16,#+16
   \   00000050   000C               LSRS     R0,R0,#+16
   \   00000052   000A               LSRS     R0,R0,#+8
   \   00000054   0004               LSLS     R0,R0,#+16       ;; ZeroExtS R0,R0,#+16,#+16
   \   00000056   000C               LSRS     R0,R0,#+16
   \   00000058   6188               LDRH     R1,[R4, #+2]
   \   0000005A   0902               LSLS     R1,R1,#+8
   \   0000005C   FF22               MOVS     R2,#+255
   \   0000005E   1202               LSLS     R2,R2,#+8        ;; #+65280
   \   00000060   0A40               ANDS     R2,R2,R1
   \   00000062   8218               ADDS     R2,R0,R2
   \   00000064   3F49               LDR      R1,??AT91F_DisplayIpPacket_0+0x10  ;; `?<Constant "\\n\\r Total IP Length   ...">`
   \   00000066   ....               LDR      R0,??DataTable21  ;; MsgBuffer
   \   00000068   ........           _BLF     sprintf,??sprintf??rT
     75            AT91F_DBGU_Printk(MsgBuffer);
   \   0000006C   ....               LDR      R0,??DataTable21  ;; MsgBuffer
   \   0000006E   ........           _BLF     AT91F_DBGU_Printk,??AT91F_DBGU_Printk??rT
     76          
     77            sprintf(MsgBuffer, "\n\r ID                = 0x%X", (((pIpHeader->ip_id)>>8)&0xff) + (((pIpHeader->ip_id)<<8)&0xff00) );
   \   00000072   A088               LDRH     R0,[R4, #+4]
   \   00000074   0004               LSLS     R0,R0,#+16       ;; ZeroExtS R0,R0,#+16,#+16
   \   00000076   000C               LSRS     R0,R0,#+16
   \   00000078   000A               LSRS     R0,R0,#+8
   \   0000007A   0004               LSLS     R0,R0,#+16       ;; ZeroExtS R0,R0,#+16,#+16
   \   0000007C   000C               LSRS     R0,R0,#+16
   \   0000007E   A188               LDRH     R1,[R4, #+4]
   \   00000080   0902               LSLS     R1,R1,#+8
   \   00000082   FF22               MOVS     R2,#+255
   \   00000084   1202               LSLS     R2,R2,#+8        ;; #+65280
   \   00000086   0A40               ANDS     R2,R2,R1
   \   00000088   8218               ADDS     R2,R0,R2
   \   0000008A   3749               LDR      R1,??AT91F_DisplayIpPacket_0+0x14  ;; `?<Constant "\\n\\r ID                ...">`
   \   0000008C   ....               LDR      R0,??DataTable21  ;; MsgBuffer
   \   0000008E   ........           _BLF     sprintf,??sprintf??rT
     78            AT91F_DBGU_Printk(MsgBuffer);
   \   00000092   ....               LDR      R0,??DataTable21  ;; MsgBuffer
   \   00000094   ........           _BLF     AT91F_DBGU_Printk,??AT91F_DBGU_Printk??rT
     79          
     80            sprintf(MsgBuffer, "\n\r Header Checksum   = 0x%X", (((pIpHeader->ip_sum)>>8)&0xff) + (((pIpHeader->ip_sum)<<8)&0xff00) );
   \   00000098   6089               LDRH     R0,[R4, #+10]
   \   0000009A   0004               LSLS     R0,R0,#+16       ;; ZeroExtS R0,R0,#+16,#+16
   \   0000009C   000C               LSRS     R0,R0,#+16
   \   0000009E   000A               LSRS     R0,R0,#+8
   \   000000A0   0004               LSLS     R0,R0,#+16       ;; ZeroExtS R0,R0,#+16,#+16
   \   000000A2   000C               LSRS     R0,R0,#+16
   \   000000A4   6189               LDRH     R1,[R4, #+10]
   \   000000A6   0902               LSLS     R1,R1,#+8
   \   000000A8   FF22               MOVS     R2,#+255
   \   000000AA   1202               LSLS     R2,R2,#+8        ;; #+65280
   \   000000AC   0A40               ANDS     R2,R2,R1
   \   000000AE   8218               ADDS     R2,R0,R2
   \   000000B0   2E49               LDR      R1,??AT91F_DisplayIpPacket_0+0x18  ;; `?<Constant "\\n\\r Header Checksum   ...">`
   \   000000B2   ....               LDR      R0,??DataTable21  ;; MsgBuffer
   \   000000B4   ........           _BLF     sprintf,??sprintf??rT
     81            AT91F_DBGU_Printk(MsgBuffer);
   \   000000B8   ....               LDR      R0,??DataTable21  ;; MsgBuffer
   \   000000BA   ........           _BLF     AT91F_DBGU_Printk,??AT91F_DBGU_Printk??rT

⌨️ 快捷键说明

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