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

📄 combi.lst

📁 这是使用CYPRESS的7C637xx芯片完成USB鼠标的例子。
💻 LST
📖 第 1 页 / 共 5 页
字号:
                                    '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;
                                  
                                  
                                  
                                  
005B 0002                         MOUSE_STATUS  MouseStatus;   //status of mouse
005D 0004                         TRANSMIT_STRUCT  XmtBuff;    //EP0 transmit buffer parameters
                                  
0061 0007                         DEVICE_STATUS  DeviceStatus;   //device status
0042                              char    bSuspendCounter;  //counter for keeping track of suspend interval
                                  
                                  //declare the following registers global. They are used by ISRs to avoid compiler issues.
0043                              char byte_count;
0044                              char byte_count1;
0045                              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
                                  ** or a response to a command (device id, BAT response, etc).
                                  */
                                  typedef struct
                                  {
                                   char bMsgBuff[5];      //array of bytes
                                   char bMsgLen;       //initial length of message
                                   char bXmtLen;       //length of bytes remaining to send
0041                              }PS2_XMT_STRUCT;
                                  
                                  
0046                              int16 bBatDelay;       //bat delay, in msec.
                                  
004A                              char ConsecutiveSetSamples;     //keeps track of number of consecutive set-sample commands
                                             //received from the host (for enabling z-mice)
004B                              char  bIntervalCount;      //interval count, in msec, for reporting mouse packets
                                  
0068 0008                         MOUSEPARMS  MouseParms;      //mouse parameters
0070 0007                         PS2_XMT_STRUCT Ps2Xmt;      //transmit buffer
004C                              char ksc_delay;        //storage for assembly routines
004D                              char ps2_temp0;        //storage for assembly routines
                                  
                                  
                                  
                                  
                                  /*
                                  ** function prototypes for PS2 routines
                                  */
                                  
                                  void ps2BAT(void);
                                  void ps2_send(char data);
                                  char ps2_receive(void);
                                  void Reset(void);
                                  void Resend(void);
                                  void SetDefault(void);
                                  void Disable(void);
                                  void Enable(void);
                                  char SetSampleRate(char p);
                                  void ReadDeviceType(void);
                                  void SetRemoteMode(void);
                                  void SetWrapMode(void);
                                  void ReadData(void);
                                  void SetStreamMode(void);
                                  void StatusRequest(void);
                                  char SetResolution(char p);
                

⌨️ 快捷键说明

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