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

📄 usbuser.lst

📁 基于AT91SAM7A3的usb鼠标源代码。在keil for arm 3.1上运行通过。希望对需要的同行有所帮助。
💻 LST
📖 第 1 页 / 共 2 页
字号:
ARM COMPILER V2.53,  usbuser                                                               27/04/07  16:47:01  PAGE 1   


ARM COMPILER V2.53, COMPILATION OF MODULE usbuser
OBJECT MODULE PLACED IN .\Obj\usbuser.obj
COMPILER INVOKED BY: C:\Keil\ARM\BIN\CA.exe usbuser.c THUMB DEBUG PRINT(.\LST\USBUSER.LST) TABS(4) OBJECT(.\Obj\usbuser.
                    -obj) 

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 <AT91SAM7A3.H>                     /* AT91SAM7SA3 definitions */
   16          
   17          #include "..\..\Board.h"
   18          
   19          #include "type.h"
   20          
   21          #include "usb.h"
   22          #include "usbcfg.h"
   23          #include "usbhw.h"
   24          #include "usbcore.h"
   25          #include "usbuser.h"
   26          
   27          #include "mouse.h"
   28          
   29          
   30          /*
   31           *  USB Power Event Callback
   32           *   Called automatically on USB Power Event
   33           *    Parameter:       power: On(TRUE)/Off(FALSE)
   34           */
   35          
   36          #if USB_POWER_EVENT
               void USB_Power_Event (BOOL  power) {
                 power;
               }
               #endif
   41          
   42          
   43          /*
   44           *  USB Reset Event Callback
   45           *   Called automatically on USB Reset Event
   46           */
   47          
   48          #if USB_RESET_EVENT
   49          void USB_Reset_Event (void) {
   50   1        USB_ResetCore();
   51   1        AT91C_BASE_PIOA->PIO_SODR = LED3;         /* Turn Off LED3 */
   52   1      }
   53          #endif
   54          
   55          
   56          /*
   57           *  USB Suspend Event Callback
   58           *   Called automatically on USB Suspend Event
ARM COMPILER V2.53,  usbuser                                                               27/04/07  16:47:01  PAGE 2   

   59           */
   60          
   61          #if USB_SUSPEND_EVENT
   62          void USB_Suspend_Event (void) {
   63   1        AT91C_BASE_PIOA->PIO_CODR = LED4;         /* Turn On LED4 */
   64   1      }
   65          #endif
   66          
   67          
   68          /*
   69           *  USB Resume Event Callback
   70           *   Called automatically on USB Resume Event
   71           */
   72          
   73          #if USB_RESUME_EVENT
   74          void USB_Resume_Event (void) {
   75   1        AT91C_BASE_PIOA->PIO_SODR = LED4;         /* Turn Off LED4 */
   76   1      }
   77          #endif
   78          
   79          
   80          /*
   81           *  USB Remote Wakeup Event Callback
   82           *   Called automatically on USB Remote Wakeup Event
   83           */
   84          
   85          #if USB_WAKEUP_EVENT
               void USB_WakeUp_Event (void) {
               }
               #endif
   89          
   90          
   91          /*
   92           *  USB Start of Frame Event Callback
   93           *   Called automatically on USB Start of Frame Event
   94           */
   95          
   96          #if USB_SOF_EVENT
               void USB_SOF_Event (void) {
               }
               #endif
  100          
  101          
  102          /*
  103           *  USB Error Event Callback
  104           *   Called automatically on USB Error Event
  105           *    Parameter:       error: Error Code
  106           */
  107          
  108          #if USB_ERROR_EVENT
               void USB_Error_Event (DWORD error) {
                 error;
               }
               #endif
  113          
  114          
  115          /*
  116           *  USB Set Configuration Event Callback
  117           *   Called automatically on USB Set Configuration Request
  118           */
  119          
  120          #if USB_CONFIGURE_EVENT
  121          void USB_Configure_Event (void) {
  122   1      
  123   1        if (USB_Configuration) {                  /* Check if USB is configured */
  124   2          GetMouseInReport();
ARM COMPILER V2.53,  usbuser                                                               27/04/07  16:47:01  PAGE 3   

  125   2          USB_WriteEP(0x83, MouseInReport, sizeof(MouseInReport));
  126   2          AT91C_BASE_PIOA->PIO_CODR = LED3;       /* Turn On LED3 */
  127   2        } else {
  128   2          AT91C_BASE_PIOA->PIO_SODR = LED3;       /* Turn Off LED3 */
  129   2        }
  130   1      }
  131          #endif
  132          
  133          
  134          /*
  135           *  USB Set Interface Event Callback
  136           *   Called automatically on USB Set Interface Request
  137           */
  138          
  139          #if USB_INTERFACE_EVENT
               void USB_Interface_Event (void) {
               }
               #endif
  143          
  144          
  145          /*
  146           *  USB Set/Clear Feature Event Callback
  147           *   Called automatically on USB Set/Clear Feature Request
  148           */
  149          
  150          #if USB_FEATURE_EVENT
               void USB_Feature_Event (void) {
               }
               #endif
  154          
  155          
  156          #define P_EP(n) ((USB_EP_EVENT & (1 << (n))) ? USB_EndPoint##n : NULL)
  157          
  158          /* USB Endpoint Events Callback Pointers */
  159          void (* const USB_P_EP[16]) (DWORD event) = {
  160            P_EP(0),
  161            P_EP(1),
  162            P_EP(2),
  163            P_EP(3),
  164            P_EP(4),
  165            P_EP(5),
  166            P_EP(6),
  167            P_EP(7),
  168            P_EP(8),
  169            P_EP(9),
  170            P_EP(10),
  171            P_EP(11),
  172            P_EP(12),
  173            P_EP(13),
  174            P_EP(14),
  175            P_EP(15),
  176          };
  177          
  178          
  179          /*
  180           *  USB Endpoint 1 Event Callback
  181           *   Called automatically on USB Endpoint 1 Event
  182           *    Parameter:       event
  183           */
  184          
  185          void USB_EndPoint1 (DWORD event) {
  186   1        event;
  187   1      }
  188          
  189          
  190          /*
ARM COMPILER V2.53,  usbuser                                                               27/04/07  16:47:01  PAGE 4   

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

  257          
  258          
  259          /*
  260           *  USB Endpoint 8 Event Callback
  261           *   Called automatically on USB Endpoint 8 Event
  262           *    Parameter:       event
  263           */
  264          
  265          void USB_EndPoint8 (DWORD event) {
  266   1        event;
  267   1      }
  268          
  269          
  270          /*
  271           *  USB Endpoint 9 Event Callback
  272           *   Called automatically on USB Endpoint 9 Event
  273           *    Parameter:       event
  274           */
  275          
  276          void USB_EndPoint9 (DWORD event) {
  277   1        event;
  278   1      }
  279          
  280          
  281          /*
  282           *  USB Endpoint 10 Event Callback
  283           *   Called automatically on USB Endpoint 10 Event
  284           *    Parameter:       event
  285           */
  286          
  287          void USB_EndPoint10 (DWORD event) {
  288   1        event;
  289   1      }
  290          

⌨️ 快捷键说明

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