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

📄 usbuser.lst

📁 在ATMEL芯片下的USB底层程序的开发
💻 LST
📖 第 1 页 / 共 2 页
字号:
ARM COMPILER V2.53,  usbuser                                                               31/10/07  09:22:45  PAGE 1   


ARM COMPILER V2.53, COMPILATION OF MODULE usbuser
OBJECT MODULE PLACED IN usbuser.OBJ
COMPILER INVOKED BY: D:\学习\ARM\BIN\CA.exe usbuser.c THUMB DEBUG PRINT(.\LST\USBUSER.LST) TABS(4) 

stmt  level    source

    1                               /*----------------------------------------------------------------------------
    2           *      U S B  -  K e r n e l
    3           *----------------------------------------------------------------------------
    4           *      Name:    USBUSER.C
    5           *      Purpose: USB Custom User Module
    6           *      Version: V1.10
    7           *----------------------------------------------------------------------------
    8           *      This file is part of the uVision/ARM development tools.
    9           *      Copyright (c) 2005-2006 Keil Software. All rights reserved.
   10           *      This software may only be used under the terms of a valid, current,
   11           *      end user licence from KEIL for a compatible version of KEIL software
   12           *      development tools. Nothing else gives you the right to use it.
   13           *---------------------------------------------------------------------------*/
   14          
   15          #include <AT91SAM7S64.H>                    /* AT91SAM7S64 definitions */
   16          #include "Board.h"
   17          #include "type.h"
   18          #include "usb.h"
   19          #include "usbcfg.h"
   20          #include "usbhw.h"
   21          #include "usbcore.h"
   22          #include "usbuser.h"
   23          extern BYTE data;
   24          /*
   25           *  USB Power Event Callback
   26           *   Called automatically on USB Power Event
   27           *    Parameter:       power: On(TRUE)/Off(FALSE)
   28           */
   29          
   30          #if USB_POWER_EVENT
               void USB_Power_Event (BOOL  power) {
                 power;
               }
               #endif
   35          
   36          
   37          /*
   38           *  USB Reset Event Callback
   39           *   Called automatically on USB Reset Event
   40           */
   41          
   42          #if USB_RESET_EVENT
   43          void USB_Reset_Event (void) {
   44   1        USB_ResetCore();
   45   1        AT91C_BASE_PIOA->PIO_SODR = LED3;         /* Turn Off LED3 */
   46   1      }
   47          #endif
   48          /*
   49           *  USB Suspend Event Callback
   50           *   Called automatically on USB Suspend Event
   51           */
   52          
   53          #if USB_SUSPEND_EVENT
   54          void USB_Suspend_Event (void) {
   55   1        AT91C_BASE_PIOA->PIO_CODR = LED4;         /* Turn On LED4 */
   56   1      }
   57          #endif
   58          
   59          /*
ARM COMPILER V2.53,  usbuser                                                               31/10/07  09:22:45  PAGE 2   

   60           *  USB Resume Event Callback
   61           *   Called automatically on USB Resume Event
   62           */
   63          
   64          #if USB_RESUME_EVENT
   65          void USB_Resume_Event (void) {
   66   1        AT91C_BASE_PIOA->PIO_SODR = LED4;         /* Turn Off LED4 */
   67   1      }
   68          #endif
   69          /*
   70           *  USB Remote Wakeup Event Callback
   71           *   Called automatically on USB Remote Wakeup Event
   72           */
   73          
   74          #if USB_WAKEUP_EVENT
               void USB_WakeUp_Event (void) {
               }
               #endif
   78          /*
   79           *  USB Start of Frame Event Callback
   80           *   Called automatically on USB Start of Frame Event
   81           */
   82          #if USB_SOF_EVENT
               void USB_SOF_Event (void) {
               }
               #endif
   86          
   87          /*
   88           *  USB Error Event Callback
   89           *   Called automatically on USB Error Event
   90           *    Parameter:       error: Error Code
   91           */
   92          #if USB_ERROR_EVENT
               void USB_Error_Event (DWORD error) {
                 error;
               }
               #endif
   97          /*
   98           *  USB Set Configuration Event Callback
   99           *   Called automatically on USB Set Configuration Request
  100           */
  101          #if USB_CONFIGURE_EVENT
  102          void USB_Configure_Event (void) {
  103   1        if (USB_Configuration) {                  /* Check if USB is configured */
  104   2          AT91C_BASE_PIOA->PIO_CODR = LED3;       /* Turn On LED3 */
  105   2        } else {
  106   2          AT91C_BASE_PIOA->PIO_SODR = LED3;       /* Turn Off LED3 */
  107   2        }
  108   1      }
  109          #endif
  110          /*
  111           *  USB Set Interface Event Callback
  112           *   Called automatically on USB Set Interface Request
  113           */
  114          
  115          #if USB_INTERFACE_EVENT
               void USB_Interface_Event (void) {
               }
               #endif
  119          /*
  120           *  USB Set/Clear Feature Event Callback
  121           *   Called automatically on USB Set/Clear Feature Request
  122           */
  123          
  124          #if USB_FEATURE_EVENT
               void USB_Feature_Event (void) {
ARM COMPILER V2.53,  usbuser                                                               31/10/07  09:22:45  PAGE 3   

               }
               #endif
  128          
  129          #define P_EP(n) ((USB_EP_EVENT & (1 << (n))) ? USB_EndPoint##n : NULL)
  130          /* USB Endpoint Events Callback Pointers */
  131          void (* const USB_P_EP[16]) (DWORD event) = {
  132            P_EP(0),
  133            P_EP(1),
  134            P_EP(2),
  135            P_EP(3),
  136            P_EP(4),
  137            P_EP(5),
  138            P_EP(6),
  139            P_EP(7),
  140            P_EP(8),
  141            P_EP(9),
  142            P_EP(10),
  143            P_EP(11),
  144            P_EP(12),
  145            P_EP(13),
  146            P_EP(14),
  147            P_EP(15),
  148          };
  149          
  150          /*
  151           *  USB Endpoint 1 Event Callback
  152           *   Called automatically on USB Endpoint 1 Event
  153           *    Parameter:       event
  154           */
  155          
  156          void USB_EndPoint1 (DWORD event) {
  157   1       event;
  158   1      
  159   1      }
  160          /*
  161           *  USB Endpoint 2 Event Callback
  162           *   Called automatically on USB Endpoint 2 Event
  163           *    Parameter:       event
  164           */
  165          
  166          void USB_EndPoint2 (DWORD event) {
  167   1       DWORD HH=event;    
  168   1       BYTE RXDATA[4];
  169   1       USB_ReadEP (2, RXDATA);
  170   1       data=RXDATA[3];
  171   1      
  172   1      /*  if(RXDATA[3]==49)
  173   1          {   
  174   1              *AT91C_PIOA_CODR=0x00000001;  //PIOA0输出低电平
  175   1              for(h=0;h<6000000;h++);
  176   1              *AT91C_PIOA_SODR=0x00000001; //PIOA0输出高电平
  177   1              USB_WriteEP (1, &RXDATA[3], 1);
  178   1          }
  179   1          if(RXDATA[3]==50)
  180   1          {
  181   1              *AT91C_PIOA_CODR=0x00000002;
  182   1              for(h=0;h<6000000;h++);
  183   1              *AT91C_PIOA_SODR=0x00000002;
  184   1              USB_WriteEP (1, &RXDATA[3], 1);
  185   1          } */
  186   1      }
  187          
  188          /*
  189           *  USB Endpoint 3 Event Callback
  190           *   Called automatically on USB Endpoint 3 Event
  191           *    Parameter:       event
ARM COMPILER V2.53,  usbuser                                                               31/10/07  09:22:45  PAGE 4   

  192           */
  193          
  194          void USB_EndPoint3 (DWORD event) {
  195   1        event;
  196   1      }
  197          
  198          
  199          /*
  200           *  USB Endpoint 4 Event Callback
  201           *   Called automatically on USB Endpoint 4 Event
  202           *    Parameter:       event
  203           */
  204          
  205          void USB_EndPoint4 (DWORD event) {
  206   1        event;
  207   1      }
  208          
  209          
  210          /*
  211           *  USB Endpoint 5 Event Callback
  212           *   Called automatically on USB Endpoint 5 Event
  213           *    Parameter:       event
  214           */
  215          
  216          void USB_EndPoint5 (DWORD event) {
  217   1        event;
  218   1      }
  219          
  220          
  221          /*
  222           *  USB Endpoint 6 Event Callback
  223           *   Called automatically on USB Endpoint 6 Event
  224           *    Parameter:       event
  225           */
  226          
  227          void USB_EndPoint6 (DWORD event) {
  228   1        event;
  229   1      }
  230          
  231          
  232          /*
  233           *  USB Endpoint 7 Event Callback
  234           *   Called automatically on USB Endpoint 7 Event
  235           *    Parameter:       event
  236           */
  237          
  238          void USB_EndPoint7 (DWORD event) {
  239   1        event;
  240   1      }
  241          
  242          
  243          /*
  244           *  USB Endpoint 8 Event Callback
  245           *   Called automatically on USB Endpoint 8 Event
  246           *    Parameter:       event
  247           */
  248          
  249          void USB_EndPoint8 (DWORD event) {
  250   1        event;
  251   1      }
  252          
  253          
  254          /*
  255           *  USB Endpoint 9 Event Callback
  256           *   Called automatically on USB Endpoint 9 Event
  257           *    Parameter:       event
ARM COMPILER V2.53,  usbuser                                                               31/10/07  09:22:45  PAGE 5   

  258           */
  259          
  260          void USB_EndPoint9 (DWORD event) {
  261   1        event;
  262   1      }
  263          
  264          
  265          /*
  266           *  USB Endpoint 10 Event Callback
  267           *   Called automatically on USB Endpoint 10 Event
  268           *    Parameter:       event
  269           */
  270          
  271          void USB_EndPoint10 (DWORD event) {
  272   1        event;
  273   1      }
  274          
  275          
  276          /*
  277           *  USB Endpoint 11 Event Callback
  278           *   Called automatically on USB Endpoint 11 Event
  279           *    Parameter:       event

⌨️ 快捷键说明

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