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

📄 f34x_msd_file_system.lst

📁 USB读写SD卡例程
💻 LST
📖 第 1 页 / 共 5 页
字号:
 148      =1  #endif
  37          #include "F34x_MSD_Sect_Serv.h"
   1      =1  //----------------------------------------------------------------
             --------------
   2      =1  // F34x_MSD_Sect_Serv.h
   3      =1  //----------------------------------------------------------------
             --------------
   4      =1  // Copyright 2006 Silicon Laboratories, Inc.
   5      =1  // http://www.silabs.com
   6      =1  //
   7      =1  // Program Description:
   8      =1  //
C51 COMPILER V7.50   F34X_MSD_FILE_SYSTEM          11/28/2006 10:54:06 PAGE 18  

   9      =1  // Header file with function prototypes relevant to F34x_Sect_Serv
             -.c
  10      =1  //
  11      =1  //
  12      =1  // FID:            34X000054
  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 _SECT_SERV_H_
  32      =1  #define _SECT_SERV_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  //
  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
C51 COMPILER V7.50   F34X_MSD_FILE_SYSTEM          11/28/2006 10:54:06 PAGE 19  

             -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
           =2 #ifndef _DWORD_DEF_
           =2 #define _DWORD_DEF_
           =2 typedef unsigned long DWORD;
C51 COMPILER V7.50   F34X_MSD_FILE_SYSTEM          11/28/2006 10:54:06 PAGE 20  

           =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 
           =2 // HID Descriptor Types
           =2 #define DSC_HID                                 0x21            // HID Class Descriptor
           =2 #define DSC_HID_REPORT                  0x22            // HID Report Descriptor
           =2 
           =2 // Standard Request Codes
           =2 #define  GET_STATUS             0x00        // Code for Get Status
           =2 #define  CLEAR_FEATURE          0x01        // Code for Clear Feat
             -ure
           =2 #define  SET_FEATURE            0x03        // Code for Set Featur
             -e
           =2 #define  SET_ADDRESS            0x05        // Code for Set Addres
             -s
           =2 #define  GET_DESCRIPTOR         0x06        // Code for Get Descri
             -ptor
           =2 #define  SET_DESCRIPTOR         0x07        // Code for Set Descri
             -ptor(not used)
           =2 #define  GET_CONFIGURATION      0x08        // Code for Get Config
             -uration
           =2 #define  SET_CONFIGURATION      0x09        // Code for Set Config
             -uration
           =2 #define  GET_INTERFACE          0x0A        // Code for Get Interf
             -ace
           =2 #define  SET_INTERFACE          0x0B        // Code for Set Interf
             -ace
           =2 #define  SYNCH_FRAME            0x0C        // Code for Synch Fram
             -e(not used)
           =2 #define  MSD_RESET                              0xFF            // Mass-storage device Reset
           =2 #define  MSD_GET_MAX_LUN                0xFE            // Mass-storage device Get Max LU
             -N
           =2 
           =2 // HID Request Codes
C51 COMPILER V7.50   F34X_MSD_FILE_SYSTEM          11/28/2006 10:54:06 PAGE 21  

           =2 #define GET_REPORT                              0x01            // Code for Get Report
           =2 #define GET_IDLE                                0x02            // Code for Get Idle
           =2 #define GET_PROTOCOL                    0x03            // Code for Get Protocol
           =2 #define SET_REPORT                              0x09            // Code for Set Report
           =2 #define SET_IDLE                                0x0A            // Code for Set Idle
           =2 #define SET_PROTOCOL                    0x0B            // Code for Set Protocol
           =2 
           =2 // Define device states
           =2 #define  DEV_ATTACHED            0x00        // Device is in Attac
             -hed State
           =2 #define  DEV_POWERED             0x01        // Device is in Power
             -ed State
           =2 #define  DEV_DEFAULT             0x02        // Device is in Defau
             -lt State
           =2 #define  DEV_ADDRESS             0x03        // Device is in Addre
             -ssed State
           =2 #define  DEV_CONFIGURED          0x04        // Device is in Confi
             -gured State
           =2 #define  DEV_SUSPENDED           0x05        // Device is in Suspe
             -nded State
           =2 
           =2 // Define bmRequestType bitmaps
           =2 #define  IN_DEVICE               0x00        // Request made to de
             -vice, direction is IN 
           =2 #define  OUT_DEVICE              0x80        // Request made to de
             -vice, direction is OUT
           =2 #define  IN_INTERFACE            0x01        // Request made to in
             -terface, direction is IN
           =2 #define  OUT_INTERFACE           0x81        // Request made to in
             -terface, direction is OUT
           =2 #define  IN_ENDPOINT             0x02        // Request made to en
             -dpoint, direction is IN
           =2 #define  OUT_ENDPOINT            0x82        // Request made to en
             -dpoint, direction is OUT
           =2 
           =2 // Define wIndex bitmaps
           =2 #define  IN_EP1                  0x81        // Index values used 
             -by Set and Clear feature
           =2 #define  OUT_EP1                 0x01        // commands for Endpo
             -int_Halt
           =2 #define  IN_EP2                  0x82
           =2 #ifdef __F326_VER__
           =2 #define  OUT_EP2                                 0x01           
           =2 #else
           =2 #define  OUT_EP2                                 0x01           
           =2 #endif
           =2 
           =2 // Define wValue bitmaps for Standard Feature Selectors
           =2 #define  DEVICE_REMOTE_WAKEUP    0x01        // Remote wakeup feat
             -ure(not used)
           =2 #define  ENDPOINT_HALT           0x00        // Endpoint_Halt feat
             -ure selector
           =2 
           =2 // Define Endpoint States
           =2 #define  EP_IDLE                 0x00        // This signifies End
             -point Idle State
           =2 #define  EP_TX                   0x01        // Endpoint Transmit 
             -State
           =2 #define  EP_RX                   0x02        // Endpoint Receive S
             -tate
           =2 #define  EP_HALT                 0x03        // En

⌨️ 快捷键说明

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