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

📄 usbuser.lst

📁 LPC2142 虚拟U盘源程序 KEIL工程 This is a USB Memory Device demonstration for the Keil MCB2140 Board with
💻 LST
📖 第 1 页 / 共 2 页
字号:
ARM COMPILER V2.53,  usbuser                                                               12/06/06  10:18:25  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 software is supplied "AS IS" without any warranties, express,
    9           *      implied or statutory, including but not limited to the implied
   10           *      warranties of fitness for purpose, satisfactory quality and
   11           *      noninfringement. Keil extends you a royalty-free right to reproduce
   12           *      and distribute executable files created using this software for use
   13           *      on Philips LPC2xxx microcontroller devices only. Nothing else gives
   14           *      you the right to use this software.
   15           *
   16           *      Copyright (c) 2005-2006 Keil Software.
   17           *---------------------------------------------------------------------------*/
   18          
   19          #include <LPC214X.H>                        /* LPC214x definitions */
   20          
   21          #include "type.h"
   22          
   23          #include "usb.h"
   24          #include "usbcfg.h"
   25          #include "usbhw.h"
   26          #include "usbcore.h"
   27          #include "usbuser.h"
   28          #include "mscuser.h"
   29          
   30          #include "memory.h"
   31          
   32          
   33          /*
   34           *  USB Power Event Callback
   35           *   Called automatically on USB Power Event
   36           *    Parameter:       power: On(TRUE)/Off(FALSE)
   37           */
   38          
   39          #if USB_POWER_EVENT
               void USB_Power_Event (BOOL  power) {
                 power;
               }
               #endif
   44          
   45          
   46          /*
   47           *  USB Reset Event Callback
   48           *   Called automatically on USB Reset Event
   49           */
   50          
   51          #if USB_RESET_EVENT
   52          void USB_Reset_Event (void) {
   53   1        USB_ResetCore();
   54   1        IOCLR1 = LED_CFG;                         /* Turn Off Cfg LED */
   55   1      }
   56          #endif
   57          
   58          
ARM COMPILER V2.53,  usbuser                                                               12/06/06  10:18:25  PAGE 2   

   59          /*
   60           *  USB Suspend Event Callback
   61           *   Called automatically on USB Suspend Event
   62           */
   63          
   64          #if USB_SUSPEND_EVENT
   65          void USB_Suspend_Event (void) {
   66   1        IOSET1 = LED_SUSP;                        /* Turn On Suspend LED */
   67   1      }
   68          #endif
   69          
   70          
   71          /*
   72           *  USB Resume Event Callback
   73           *   Called automatically on USB Resume Event
   74           */
   75          
   76          #if USB_RESUME_EVENT
   77          void USB_Resume_Event (void) {
   78   1        IOCLR1 = LED_SUSP;                        /* Turn Off Suspend LED */
   79   1      }
   80          #endif
   81          
   82          
   83          /*
   84           *  USB Remote Wakeup Event Callback
   85           *   Called automatically on USB Remote Wakeup Event
   86           */
   87          
   88          #if USB_WAKEUP_EVENT
               void USB_WakeUp_Event (void) {
               }
               #endif
   92          
   93          
   94          /*
   95           *  USB Start of Frame Event Callback
   96           *   Called automatically on USB Start of Frame Event
   97           */
   98          
   99          #if USB_SOF_EVENT
               void USB_SOF_Event (void) {
               }
               #endif
  103          
  104          
  105          /*
  106           *  USB Error Event Callback
  107           *   Called automatically on USB Error Event
  108           *    Parameter:       error: Error Code
  109           */
  110          
  111          #if USB_ERROR_EVENT
               void USB_Error_Event (DWORD error) {
                 error;
               }
               #endif
  116          
  117          
  118          /*
  119           *  USB Set Configuration Event Callback
  120           *   Called automatically on USB Set Configuration Request
  121           */
  122          
  123          #if USB_CONFIGURE_EVENT
  124          void USB_Configure_Event (void) {
ARM COMPILER V2.53,  usbuser                                                               12/06/06  10:18:25  PAGE 3   

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

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

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

⌨️ 快捷键说明

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