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

📄 f34x_msd_scsi.lst

📁 PC机通过USB识别仪器上的SD卡!可以满足仪器存储大量数据的要求!
💻 LST
📖 第 1 页 / 共 5 页
字号:
 164      =2  // USB Routines
 165      =2  void USB_Resume(void);                       // This routine resum
             -es USB operation
 166      =2  void USB_Reset(void);                        // Called after USB b
             -us reset
 167      =2  void Handle_Setup(void);                     // Handle setup packe
             -t on Endpoint 0
 168      =2  void Handle_In1(BYTE* ptr_buf);                       // Handle in
             - packet on Endpoint 1
 169      =2  void Handle_Out2(void);                      // Handle out packet 
             -on Endpoint 2
 170      =2  void USB_Suspend(void);                      // This routine calle
             -d when suspend signalling on bus
 171      =2  void Out2_Get_Data(BYTE* ptr_buf);                               // Copies from FIFO to ptr_
             -buf, clears FIFO-full flag.
 172      =2  void Out2_Done(void);                                            // Call this when finished with the d
             -ata
 173      =2  
 174      =2  // Standard Requests
 175      =2  void Get_Status(void);                       // These are called f
             -or each specific standard request
 176      =2  void Clear_Feature(void);
 177      =2  void Set_Feature(void);
 178      =2  void Set_Address(void);
 179      =2  void Get_Descriptor(void);
 180      =2  void Get_Configuration(void);
 181      =2  void Set_Configuration(void);
 182      =2  void Get_Interface(void);
 183      =2  void Set_Interface(void);
 184      =2  
 185      =2  // MSD Specific Requests
 186      =2  // void Reset_Msd(void);
 187      =2  // void Get_MaxLUN(void);
 188      =2  
 189      =2  // Initialization Routines
 190      =2  void Sys_Clk_Init(void);                      // Initialize the sy
             -stem clock(depends on Full/Low speed)
C51 COMPILER V7.50   F34X_MSD_SCSI                 11/28/2006 10:54:24 PAGE 14  

 191      =2  void Port_Init(void);                        // Configure ports fo
             -r this specific application
 192      =2  void USB0_Init(void);                        // Configure USB core
             - for either Full/Low speed
 193      =2  void Timer_Init(void);                       // Start timer 2 for 
             -use by ADC and to check switches
 194      =2  void Adc_Init(void);                         // Configure ADC for 
             -continuous conversion, low-power mode
 195      =2  
 196      =2  // Other Routines
 197      =2  void Timer2_ISR(void);                       // Called when Timer 
             -2 overflows, see if switches are pressed
 198      =2  void Adc_ConvComple_ISR(void);               // When a conversion 
             -completes, switch ADC multiplexor
 199      =2  void USB_ISR(void);                          // Called to determin
             -e type of USB interrupt
 200      =2  void Fifo_ReadC(BYTE, unsigned int, BYTE *) ;
 201      =2  extern void Fifo_Read (BYTE, unsigned int, BYTE *) ; // Used for m
             -ultiple byte reads of Endpoint fifos
 202      =2  extern void Fifo_Write (BYTE, unsigned int, BYTE *) reentrant;// U
             -sed for multiple byte writes of Endpoint fifos
 203      =2  void Force_Stall(void);                      // Forces a procedura
             -l stall on Endpoint 0
 204      =2  void Delay(void);                            // Approximately 80 u
             -s/1 ms on Full/Low Speed
 205      =2  
 206      =2  void USB_In(BYTE* ptr_buf,unsigned count);
 207      =2  
 208      =2  void USB_Bulk_Init(void);
 209      =2  
 210      =2  extern unsigned xdata Out_Count;
 211      =2  extern BYTE xdata Out_Packet[EP2_PACKET_SIZE];
 212      =2  extern BYTE xdata In_count;
 213      =2  extern BYTE xdata In_Packet[EP1_PACKET_SIZE];
 214      =2  //extern BYTE xdata In_Overrun;
 215      =2  
 216      =2  #endif      /* _USB_MAIN_H_ */
 217      =2  
  35      =1  
  36      =1  #define SCSI_PASSED             0
  37      =1  #define SCSI_FAILED             1
  38      =1  #define SCSI_PHASE_ERROR        2
  39      =1  
  40      =1  //----------------------------------------------------------------
             --------------
  41      =1  // Function Prototypes
  42      =1  //----------------------------------------------------------------
             --------------
  43      =1  
  44      =1  void Scsi_Rx(void);
  45      =1  
  46      =1  extern BYTE xdata Scsi_Status;
  47      =1  extern DWORD xdata Scsi_Residue;
  48      =1  
  49      =1  #endif
  36          #include "F34x_MSD_Msd.h"
   1      =1  //----------------------------------------------------------------
             --------------
   2      =1  // F34x_MSD_MMC.h
   3      =1  //----------------------------------------------------------------
             --------------
   4      =1  // Copyright 2006 Silicon Laboratories, Inc.
C51 COMPILER V7.50   F34X_MSD_SCSI                 11/28/2006 10:54:24 PAGE 15  

   5      =1  // http://www.silabs.com
   6      =1  //
   7      =1  // Program Description:
   8      =1  //
   9      =1  // Header file with function prototypes relevant to F34x_MMC.c
  10      =1  //
  11      =1  //
  12      =1  // FID:            34X000047
  13      =1  // Target:         C8051F34x
  14      =1  // Tool chain:     Keil
  15      =1  // Command Line:   See Readme.txt
  16      =1  // Project Name:   F34x_USB_MSD
  17      =1  //
  18      =1  // Release 1.1
  19      =1  //    -All changes by PKC
  20      =1  //    -09 JUN 2006
  21      =1  //    -No changes; incremented revision number to match project re
             -vision
  22      =1  //
  23      =1  // Release 1.0
  24      =1  //    -Initial Release
  25      =1  //
  26      =1  
  27      =1  //----------------------------------------------------------------
             --------------
  28      =1  // Header File Preprocessor Directive
  29      =1  //----------------------------------------------------------------
             --------------
  30      =1  
  31      =1  #ifndef _MSD_H_
  32      =1  #define _MSD_H_
  33      =1  
  34      =1  #include "F34x_MSD_USB_Main.h"
   1      =2  //----------------------------------------------------------------
             --------------
   2      =2  // F34x_MSD_USB_Main.h
   3      =2  //----------------------------------------------------------------
             --------------
   4      =2  // Copyright 2006 Silicon Laboratories, Inc.
   5      =2  // http://www.silabs.com
   6      =2  //
   7      =2  // Program Description:
   8      =2  //
   9      =2  // Main header file for USB firmware. Includes function prototypes
             -,
  10      =2  // standard constants, and configuration constants.//
  11      =2  //
  12      =2  // FID:            34X000063
  13      =2  // Target:         C8051F34x
  14      =2  // Tool chain:     Keil
  15      =2  // Command Line:   See Readme.txt
  16      =2  // Project Name:   F34x_USB_MSD
  17      =2  //
  18      =2  // Release 1.1
  19      =2  //    -All changes by PKC
  20      =2  //    -09 JUN 2006
  21      =2  //    -No changes; incremented revision number to match project re
             -vision
  22      =2  //
  23      =2  // Release 1.0
  24      =2  //    -Initial Release
  25      =2  //
C51 COMPILER V7.50   F34X_MSD_SCSI                 11/28/2006 10:54:24 PAGE 16  

  26      =2  // 11/22/02 - DM: 1. Updated function prototypes and added constan
             -ts
  27      =2  //                to F34x_USB_Main.h with sample interrupt firmwar
             -e.
  28      =2  
  29      =2  //----------------------------------------------------------------
             --------------
  30      =2  // Header File Preprocessor Directive
  31      =2  //----------------------------------------------------------------
             --------------
  32      =2  
  33      =2  #ifndef _USB_MAIN_H_
           =2 #define _USB_MAIN_H_
           =2 
           =2 #include "F34x_MSD_Definitions.h"
           =2 //#define _USB_LOW_SPEED_                      // Change this comm
             -ent to make Full/Low speed
           =2 
           =2 #define SYSCLK                   12000000    // SYSCLK frequency i
             -n Hz
           =2 
           =2 // USB clock selections (SFR CLKSEL)
           =2 #define USB_4X_CLOCK             0x00        // Select 4x clock mu
             -ltiplier, for USB Full Speed
           =2 #define USB_INT_OSC_DIV_2        0x10        // See Data Sheet sec
             -tion 13. Oscillators
           =2 #define USB_EXT_OSC              0x20
           =2 #define USB_EXT_OSC_DIV_2        0x30
           =2 #define USB_EXT_OSC_DIV_3        0x40
           =2 #define USB_EXT_OSC_DIV_4        0x50
           =2 
           =2 // System clock selections (SFR CLKSEL)
           =2 #define SYS_INT_OSC              0x00        // Select to use inte
             -rnal oscillator
           =2 #define SYS_4X_MUL               0x03        // Select to use inte
             -rnal oscillator
           =2 #define SYS_EXT_OSC              0x01        // Select to use an e
             -xternal oscillator
           =2 #define SYS_4X_DIV_2             0x02
           =2 
           =2 // BYTE type definition
           =2 #ifndef _BYTE_DEF_
           =2 #define _BYTE_DEF_
           =2 typedef unsigned char BYTE;
           =2 #endif   /* _BYTE_DEF_ */
           =2 
           =2 // WORD type definition, for KEIL Compiler
           =2 #ifndef _WORD_DEF_                           // Compiler Specific,
             - written for Little Endian
           =2 #define _WORD_DEF_
           =2 typedef union {unsigned int i; unsigned char c[2];} WORD;
           =2 #define LSB 1                                // All words sent to 
             -and received from the host are
           =2 #define MSB 0                                // little endian, thi
             -s is switched by software when
           =2                                              // neccessary.  These
             - sections of code have been marked
           =2                                                                                          // with "Compiler Specific" as above for easier modifi
             -cation
           =2 #endif   /* _WORD_DEF_ */
           =2 
           =2 // DWORD type definition
C51 COMPILER V7.50   F34X_MSD_SCSI                 11/28/2006 10:54:24 PAGE 17  

           =2 #ifndef _DWORD_DEF_
           =2 #define _DWORD_DEF_
           =2 typedef unsigned long DWORD;
           =2 #endif /* _DWORD_DEF_ */
           =2 
           =2 extern volatile DWORD xdata tickcount;
           =2 
           =2 // Define Endpoint Packet Sizes
           =2 #ifdef _USB_LOW_SPEED_
           =2 #define  EP0_PACKET_SIZE         0x40        // This value can be 
             -8,16,32,64 depending on device speed, see USB spec
           =2 #else
           =2 #define  EP0_PACKET_SIZE         0x40
           =2 #endif /* _USB_LOW_SPEED_ */ 
           =2 
           =2 #define  EP1_PACKET_SIZE         0x0040      // Can range 0 - 1024
             - depending on data and transfer type  
           =2 #define  EP1_PACKET_SIZE_LE      0x4000      // IMPORTANT- this sh
             -ould be Little-Endian version of EP1_PACKET_SIZE
           =2 #define  EP2_PACKET_SIZE         0x0040      // Can range 0 - 1024
             - depending on data and transfer type
           =2 #define  EP2_PACKET_SIZE_LE      0x4000      // IMPORTANT- this sh
             -ould be Little-Endian version of EP2_PACKET_SIZE
           =2 
           =2 // Standard Descriptor Types
           =2 #define  DSC_DEVICE              0x01        // Device Descriptor
           =2 #define  DSC_CONFIG              0x02        // Configuration Desc
             -riptor
           =2 #define  DSC_STRING              0x03        // String Descriptor
           =2 #define  DSC_INTERFACE           0x04        // Interface Descript
             -or
           =2 #define  DSC_ENDPOINT            0x05        // Endpoint Descripto
             -r
           =2 

⌨️ 快捷键说明

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