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

📄 combi.lst

📁 USB接口的鼠标驱动源程序
💻 LST
📖 第 1 页 / 共 5 页
字号:
                                   0xb4, 0x04,/* vendor ID (note reference design vendor ID) */
                                   0x70, 0x63,/* product ID (reference design USB mouse product ID) */
                                   0x01, 0x00,/* device release number */
                                   0x01,      /* index of manufacturer string (1) */
                                   0x02,      /* index of product string (2) */
                                   0x00,      /* index of serial number string (not supported = 0x00) */
                                   0x01       /* number of configurations (1) */
1744 12 01 10 01 00 00 00 08 B4   };
174D 04 70 63 01 00 01 02 00 01   
                                  const char get_interface_status_table[] =
                                  {
                                   0x00, 0x00 /* always return both bytes zero */
1742 00 00                        };
                                  
                                  /* String Descriptors */
                                  const char USBStringLanguageDescription[] =
                                  {
                                   0x04,      /* Length */
                                   0x03,      /* Type (3=string) */
                                   0x09,      /* Language: English */
                                   0x04       /* Sub-language: Default */
173E 04 03 09 04                  };
                                  
                                  const char USBStringDescription1[] =
                                  {
                                      44,3,'C',0,'y',0,'p',0,'r',0,'e',0,'s',0,'s',0,' ',0,'S',0,'e',0,'m',0,'i',0,'c',0,'o',0,'n',0,
                                      'd',0,'u',0,'c',0,'t',0,'o',0,'r',0
1712 2C 03 43 00 79 00 70 00 72   };
171B 00 65 00 73 00 73 00 20 00   
1724 53 00 65 00 6D 00 69 00 63   
172D 00 6F 00 6E 00 64 00 75 00   
1736 63 00 74 00 6F 00 72 00      
                                  
                                  const char USBStringDescription2[] =
                                  {
                                      66,3, 'C',0,'y',0,'p',0,'r',0,'e',0,'s',0,'s',0,' ',0,'C',0,'Y',0,'7',0,'C',0,
                                      '6',0,'3',0,'7',0,'x',0,'x',0,' ',0,'U',0,'S',0,'B',0,' ',0,'M',0,'o',0,'u',0,'s',0,'e',0,' ',0,'v',0,
                                      '?',0,'.',0,'?',0,'?',0
16CE 42 03 43 00 79 00 70 00 72   };
16D7 00 65 00 73 00 73 00 20 00   
16E0 43 00 59 00 37 00 43 00 36   
16E9 00 33 00 37 00 78 00 78 00   
16F2 20 00 55 00 53 00 42 00 20   
16FB 00 4D 00 6F 00 75 00 73 00   
1704 65 00 20 00 76 00 3F 00 2E   
170D 00 3F 00 3F 00               
                                  
                                  
/* NOTE: This is not implemented and is only here as a     */
/* demonstration of how to add a serial number string.   */
/* The serial number must be unique for every device or      */
                                  /* else it may not enumerate properly.                      */
                                  
const char USBStringDescription3[] =
                                  {
                                   0x10,0x03,'0',0,'1',0,'2',0,'3',0,'4',0,'5',0,'6',0
16BE 10 03 30 00 31 00 32 00 33   };
16C7 00 34 00 35 00 36 00         
                                  
                                  
                                  const char USBStringDescription4[] =
                                  {
                                   0x14,
                                   0x03,
                                    'H',0,'I',0,'D',0,' ',0,'M',0,'o',0,'u',0,'s',0,'e',0
16AA 14 03 48 00 49 00 44 00 20   };
16B3 00 4D 00 6F 00 75 00 73 00   
16BC 65 00                        
                                  
                                  const char USBStringDescription5[] =
                                  {
                                   0x32,
                                   0x03,
                                    'E',0,'n',0,'d',0,'P',0,'o',0,'i',0,'n',0,'t',0,'1',0,' ',0,'I',0,
                                    'n',0,'t',0,'e',0,'r',0,'r',0,'u',0,'p',0,'t',0,'P',0,'i',0,'p',0,'e',0
167A 32 03 45 00 6E 00 64 00 50   };
1683 00 6F 00 69 00 6E 00 74 00   
168C 31 00 20 00 49 00 6E 00 74   
1695 00 65 00 72 00 72 00 75 00   
169E 70 00 74 00 50 00 69 00 70   
16A7 00 65 00                     
                                  
                                  
                                  
                                  
003C                              #define SET_EP0_MODE(x) EP_A0_MODE = x      //set mode register for EP0
                                  
                                  
                                  /*
                                  ** define a structure that will maintain the parameters of multibyte data that is returned
                                  ** to the host in response to successive IN commands on endpoint 0 (descriptors, status, reports, etc).
                                  */
                                  typedef struct
                                  {
                                      char bLength;                           //length of data remaining to be returned       
                                      far char *p;                            //pointer to the data
                                      char dummy;                             //padding -- compiler bug doesn't allocate enough space for a far *
003D                              }TRANSMIT_STRUCT;
                                  
                                  
                                  /*
                                  ** define a structure that contains the current USB device status
                                  */
                                  typedef struct
                                  {
                                      char bConfiguration;                    //configured or not
                                      char bRemoteWakeup;                     //remote wakeup enabled or not
                                      char bDeviceStatus;                     //spare, do not remove! this byte is a placeholder
                                                                              //for the 2nd byte of device status.
                                      char bEP1Stall;                         //endpoint 1 stalled or not
                                      char bEPStatus;                         //spare, do not remove! this byte is a placeholder
                                                                              //for the 2nd byte of device status
                                      char bAddress;                          //current address
                                      char bProtocol;                         //boot protocol or report protocol
003E                              }DEVICE_STATUS;
                                  
                                  
                                  /*
                                  ** define a structure for mouse transmit status
                                  */
                                  
                                  typedef struct
                                  {
                                      char bIdlePeriod;                       //current idle period setting
                                      char bIdleCounter;                      //counter for idle period
                                  }
003F                              MOUSE_STATUS;
                                  
                                  
                                  
                                  
004F 0002                         MOUSE_STATUS        MouseStatus;            //status of mouse
0051 0004                         TRANSMIT_STRUCT     XmtBuff;                //EP0 transmit buffer parameters
                                  
0055 0007                         DEVICE_STATUS       DeviceStatus;           //device status
005C                              char                bSuspendCounter;        //counter for keeping track of suspend interval
                                  
                                  //declare the following registers global. They are used by ISRs to avoid compiler issues.
005D                              char byte_count;
005E                              char byte_count1;
005F                              char bWakeupCount;
                                  
                                  
                                  /*
                                  ** USB function prototypes
                                  */
                                  void UsbReInitialize(void);
                                  void MouseTask(void);
                                  void Suspend(void);
                                  void usbmain(void);
                                  void HandleSetup(void);
                                  void HandleIn(void);
                                  void USB_control_read(void);
                                  char LoadEP0Fifo(void);
                                  void ClearRemoteWakeup(void);
                                  void SetRemoteWakeup(void);
                                  void SetConfiguration(void);
                                  void SetAddress(void);
                                  void ClearEndpointStall(void);
                                  void SetEndpointStall(void);
                                  void GetDeviceStatus(void);
                                  void GetDescriptor(void);
                                  void GetInterfaceStatus(void);
                                  void GetEndpointStatus(void);
                                  void SetIdle(void);
                                  void SetProtocol(void);
                                  void GetReport(void);
                                  void GetIdle(void);
                                  void GetProtocol(void);
                                  void GetConfiguration(void);
                                  void USB_Stall_In_Out(void);
                                  char BusInactive(void);
                                  
                                  
                                  
                                  //*************************************************************************************************
                                  //PS2 DECLARATIONS
                                  
                                  
                                  /*
                                  ** define a structure that contains all mouse parameters that can be set via host commands
                                  */
                                  typedef struct
                                  {
                                      char bReportRate;                               
                                      char bReportInterval;                           
                                      char bScale;
                                      char bStream;
                                      char bResolution;
                                      char bEnabled;
                                      char bZmouse;
                                      char bWrap;
0040                              }MOUSEPARMS;
                                  
                                  /*
                                  ** define a structure to hold messages to be sent back to the host.  This can be either a mouse packet
                     

⌨️ 快捷键说明

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