📄 f34x_msd_mmc.lst
字号:
11 =1 //
12 =1 // FID: 34X000063
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
C51 COMPILER V7.50 F34X_MSD_MMC 11/28/2006 10:54:17 PAGE 17
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 // 11/22/02 - DM: 1. Updated function prototypes and added constan
-ts
27 =1 // to F34x_USB_Main.h with sample interrupt firmwar
-e.
28 =1
29 =1 //----------------------------------------------------------------
--------------
30 =1 // Header File Preprocessor Directive
31 =1 //----------------------------------------------------------------
--------------
32 =1
33 =1 #ifndef _USB_MAIN_H_
34 =1 #define _USB_MAIN_H_
35 =1
36 =1 #include "F34x_MSD_Definitions.h"
1 =2 //----------------------------------------------------------------
--------------
2 =2 // F34x_MSD_Definitions.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 // Header file with all definitions.
10 =2 //
11 =2 //
12 =2 // FID: 34X000032
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 // -Replaced SFR definitions file "c8051f320.h" with "c8051f340
-.h"
22 =2 //
23 =2 // Release 1.0
24 =2 // -Initial Release
25 =2 //
26 =2
27 =2 //----------------------------------------------------------------
--------------
28 =2 // Header File Preprocessor Directive
29 =2 //----------------------------------------------------------------
--------------
30 =2
31 =2 #ifndef __DEFINITIONS_H__
=2 #define __DEFINITIONS_H__
=2
=2 #define DEBUG_TIMEOUTS
C51 COMPILER V7.50 F34X_MSD_MMC 11/28/2006 10:54:17 PAGE 18
=2 #include "c8051f340.h"
=2 #ifdef DEBUG_TIMEOUTS
=2 sbit START_STOP_SPI = P3^0 ;
=2 sbit START_STOP_READ_TO = P3^1;
=2 sbit START_STOP_WRITE_TO = P3^2;
=2
=2 #define START_SPI_TIMEOUT (START_STOP_SPI = 1)
=2 #define STOP_SPI_TIME_OUT (START_STOP_SPI = 0)
=2 #define START_READ_COPY (START_STOP_READ_TO = 1)
=2 #define STOP_READ_COPY (START_STOP_READ_TO = 0)
=2 #define START_WRITE_COPY (START_STOP_WRITE_TO = 1)
=2 #define STOP_WRITE_COPY (START_STOP_WRITE_TO = 0)
=2 #else
=2
=2 #define START_SPI_TIMEOUT /\
=2 /
=2 #define STOP_SPI_TIME_OUT /\
=2 /
=2 #define START_READ_COPY /\
=2 /
=2 #define STOP_READ_COPY /\
=2 /
=2 #define START_WRITE_COPY /\
=2 /
=2 #define STOP_WRITE_COPY /\
=2 /
=2
=2 #endif
=2
=2 #define ENDLINE "\r\n"
=2 #define ENDLINE_SGN '\r'
=2
=2 #endif
37 =1 //#define _USB_LOW_SPEED_ // Change this comm
-ent to make Full/Low speed
38 =1
39 =1 #define SYSCLK 12000000 // SYSCLK frequency i
-n Hz
40 =1
41 =1 // USB clock selections (SFR CLKSEL)
42 =1 #define USB_4X_CLOCK 0x00 // Select 4x clock mu
-ltiplier, for USB Full Speed
43 =1 #define USB_INT_OSC_DIV_2 0x10 // See Data Sheet sec
-tion 13. Oscillators
44 =1 #define USB_EXT_OSC 0x20
45 =1 #define USB_EXT_OSC_DIV_2 0x30
46 =1 #define USB_EXT_OSC_DIV_3 0x40
47 =1 #define USB_EXT_OSC_DIV_4 0x50
48 =1
49 =1 // System clock selections (SFR CLKSEL)
50 =1 #define SYS_INT_OSC 0x00 // Select to use inte
-rnal oscillator
51 =1 #define SYS_4X_MUL 0x03 // Select to use inte
-rnal oscillator
52 =1 #define SYS_EXT_OSC 0x01 // Select to use an e
-xternal oscillator
53 =1 #define SYS_4X_DIV_2 0x02
54 =1
55 =1 // BYTE type definition
56 =1 #ifndef _BYTE_DEF_
57 =1 #define _BYTE_DEF_
58 =1 typedef unsigned char BYTE;
C51 COMPILER V7.50 F34X_MSD_MMC 11/28/2006 10:54:17 PAGE 19
59 =1 #endif /* _BYTE_DEF_ */
60 =1
61 =1 // WORD type definition, for KEIL Compiler
62 =1 #ifndef _WORD_DEF_ // Compiler Specific,
- written for Little Endian
63 =1 #define _WORD_DEF_
64 =1 typedef union {unsigned int i; unsigned char c[2];} WORD;
65 =1 #define LSB 1 // All words sent to
-and received from the host are
66 =1 #define MSB 0 // little endian, thi
-s is switched by software when
67 =1 // neccessary. These
- sections of code have been marked
68 =1 // with "Compiler Specific" as above for easier modifi
-cation
69 =1 #endif /* _WORD_DEF_ */
70 =1
71 =1 // DWORD type definition
72 =1 #ifndef _DWORD_DEF_
73 =1 #define _DWORD_DEF_
74 =1 typedef unsigned long DWORD;
75 =1 #endif /* _DWORD_DEF_ */
76 =1
77 =1 extern volatile DWORD xdata tickcount;
78 =1
79 =1 // Define Endpoint Packet Sizes
80 =1 #ifdef _USB_LOW_SPEED_
=1 #define EP0_PACKET_SIZE 0x40 // This value can be
-8,16,32,64 depending on device speed, see USB spec
=1 #else
83 =1 #define EP0_PACKET_SIZE 0x40
84 =1 #endif /* _USB_LOW_SPEED_ */
85 =1
86 =1 #define EP1_PACKET_SIZE 0x0040 // Can range 0 - 1024
- depending on data and transfer type
87 =1 #define EP1_PACKET_SIZE_LE 0x4000 // IMPORTANT- this sh
-ould be Little-Endian version of EP1_PACKET_SIZE
88 =1 #define EP2_PACKET_SIZE 0x0040 // Can range 0 - 1024
- depending on data and transfer type
89 =1 #define EP2_PACKET_SIZE_LE 0x4000 // IMPORTANT- this sh
-ould be Little-Endian version of EP2_PACKET_SIZE
90 =1
91 =1 // Standard Descriptor Types
92 =1 #define DSC_DEVICE 0x01 // Device Descriptor
93 =1 #define DSC_CONFIG 0x02 // Configuration Desc
-riptor
94 =1 #define DSC_STRING 0x03 // String Descriptor
95 =1 #define DSC_INTERFACE 0x04 // Interface Descript
-or
96 =1 #define DSC_ENDPOINT 0x05 // Endpoint Descripto
-r
97 =1
98 =1 // HID Descriptor Types
99 =1 #define DSC_HID 0x21 // HID Class Descriptor
100 =1 #define DSC_HID_REPORT 0x22 // HID Report Descriptor
101 =1
102 =1 // Standard Request Codes
103 =1 #define GET_STATUS 0x00 // Code for Get Status
104 =1 #define CLEAR_FEATURE 0x01 // Code for Clear Feat
-ure
105 =1 #define SET_FEATURE 0x03 // Code for Set Featur
-e
C51 COMPILER V7.50 F34X_MSD_MMC 11/28/2006 10:54:17 PAGE 20
106 =1 #define SET_ADDRESS 0x05 // Code for Set Addres
-s
107 =1 #define GET_DESCRIPTOR 0x06 // Code for Get Descri
-ptor
108 =1 #define SET_DESCRIPTOR 0x07 // Code for Set Descri
-ptor(not used)
109 =1 #define GET_CONFIGURATION 0x08 // Code for Get Config
-uration
110 =1 #define SET_CONFIGURATION 0x09 // Code for Set Config
-uration
111 =1 #define GET_INTERFACE 0x0A // Code for Get Interf
-ace
112 =1 #define SET_INTERFACE 0x0B // Code for Set Interf
-ace
113 =1 #define SYNCH_FRAME 0x0C // Code for Synch Fram
-e(not used)
114 =1 #define MSD_RESET 0xFF // Mass-storage device Reset
115 =1 #define MSD_GET_MAX_LUN 0xFE // Mass-storage device Get Max LU
-N
116 =1
117 =1 // HID Request Codes
118 =1 #define GET_REPORT 0x01 // Code for Get Report
119 =1 #define GET_IDLE 0x02 // Code for Get Idle
120 =1 #define GET_PROTOCOL 0x03 // Code for Get Protocol
121 =1 #define SET_REPORT 0x09 // Code for Set Report
122 =1 #define SET_IDLE 0x0A // Code for Set Idle
123 =1 #define SET_PROTOCOL 0x0B // Code for Set Protocol
124 =1
125 =1 // Define device states
126 =1 #define DEV_ATTACHED 0x00 // Device is in Attac
-hed State
127 =1 #define DEV_POWERED 0x01 // Device is in Power
-ed State
128 =1 #define DEV_DEFAULT 0x02 // Device is in Defau
-lt State
129 =1 #define DEV_ADDRESS 0x03 // Device is in Addre
-ssed State
130 =1 #define DEV_CONFIGURED 0x04 // Device is in Confi
-gured State
131 =1 #define DEV_SUSPENDED 0x05 // Device is in Suspe
-nded State
132 =1
133 =1 // Define bmRequestType bitmaps
134 =1 #define IN_DEVICE 0x00 // Request made to de
-vice, direction is IN
135 =1 #define OUT_DEVICE 0x80 // Request made to de
-vice, direction is OUT
136 =1 #d
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -