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