📄 f34x_msd_scsi.lst
字号:
=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
C51 COMPILER V7.50 F34X_MSD_SCSI 11/28/2006 10:54:24 PAGE 18
-N
=2
=2 // HID Request Codes
=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
C51 COMPILER V7.50 F34X_MSD_SCSI 11/28/2006 10:54:24 PAGE 19
-tate
=2 #define EP_HALT 0x03 // Endpoint Halt Stat
-e (return stalls)
=2 #define EP_STALL 0x04 // Endpoint Stall (se
-nd procedural stall next status phase)
=2 #define EP_ADDRESS 0x05 // Endpoint Address (
-change FADDR during next status phase)
=2
=2 // Function prototypes
=2 // USB Routines
=2 void USB_Resume(void); // This routine resum
-es USB operation
=2 void USB_Reset(void); // Called after USB b
-us reset
=2 void Handle_Setup(void); // Handle setup packe
-t on Endpoint 0
=2 void Handle_In1(BYTE* ptr_buf); // Handle in
- packet on Endpoint 1
=2 void Handle_Out2(void); // Handle out packet
-on Endpoint 2
=2 void USB_Suspend(void); // This routine calle
-d when suspend signalling on bus
=2 void Out2_Get_Data(BYTE* ptr_buf); // Copies from FIFO to ptr_
-buf, clears FIFO-full flag.
=2 void Out2_Done(void); // Call this when finished with the d
-ata
=2
=2 // Standard Requests
=2 void Get_Status(void); // These are called f
-or each specific standard request
=2 void Clear_Feature(void);
=2 void Set_Feature(void);
=2 void Set_Address(void);
=2 void Get_Descriptor(void);
=2 void Get_Configuration(void);
=2 void Set_Configuration(void);
=2 void Get_Interface(void);
=2 void Set_Interface(void);
=2
=2 // MSD Specific Requests
=2 // void Reset_Msd(void);
=2 // void Get_MaxLUN(void);
=2
=2 // Initialization Routines
=2 void Sys_Clk_Init(void); // Initialize the sy
-stem clock(depends on Full/Low speed)
=2 void Port_Init(void); // Configure ports fo
-r this specific application
=2 void USB0_Init(void); // Configure USB core
- for either Full/Low speed
=2 void Timer_Init(void); // Start timer 2 for
-use by ADC and to check switches
=2 void Adc_Init(void); // Configure ADC for
-continuous conversion, low-power mode
=2
=2 // Other Routines
=2 void Timer2_ISR(void); // Called when Timer
-2 overflows, see if switches are pressed
=2 void Adc_ConvComple_ISR(void); // When a conversion
-completes, switch ADC multiplexor
=2 void USB_ISR(void); // Called to determin
-e type of USB interrupt
C51 COMPILER V7.50 F34X_MSD_SCSI 11/28/2006 10:54:24 PAGE 20
=2 void Fifo_ReadC(BYTE, unsigned int, BYTE *) ;
=2 extern void Fifo_Read (BYTE, unsigned int, BYTE *) ; // Used for m
-ultiple byte reads of Endpoint fifos
=2 extern void Fifo_Write (BYTE, unsigned int, BYTE *) reentrant;// U
-sed for multiple byte writes of Endpoint fifos
=2 void Force_Stall(void); // Forces a procedura
-l stall on Endpoint 0
=2 void Delay(void); // Approximately 80 u
-s/1 ms on Full/Low Speed
=2
=2 void USB_In(BYTE* ptr_buf,unsigned count);
=2
=2 void USB_Bulk_Init(void);
=2
=2 extern unsigned xdata Out_Count;
=2 extern BYTE xdata Out_Packet[EP2_PACKET_SIZE];
=2 extern BYTE xdata In_count;
=2 extern BYTE xdata In_Packet[EP1_PACKET_SIZE];
=2 //extern BYTE xdata In_Overrun;
=2
=2 #endif /* _USB_MAIN_H_ */
217 =2
35 =1
36 =1 //----------------------------------------------------------------
--------------
37 =1 // Structure Prototypes
38 =1 //----------------------------------------------------------------
--------------
39 =1
40 =1 typedef struct _CBW {
41 =1 DWORD dCBWSignature;
42 =1 DWORD dCBWTag;
43 =1 DWORD dCBWDataTransferLength;
44 =1 BYTE bmCBWFlags;
45 =1 BYTE bCBWLUN;
46 =1 BYTE bCBWCBLength;
47 =1 BYTE CBWCB[16];
48 =1 } CBW;
49 =1
50 =1 typedef struct _CSW {
51 =1 DWORD dCSWSignature;
52 =1 DWORD dCSWTag;
53 =1 DWORD dCSWDataResidue;
54 =1 BYTE bCSWStatus;
55 =1 } CSW;
56 =1
57 =1 extern CBW xdata cbw;
58 =1 extern CSW xdata csw;
59 =1
60 =1 //----------------------------------------------------------------
--------------
61 =1 // Function Prototypes
62 =1 //----------------------------------------------------------------
--------------
63 =1
64 =1 void Msd_Step(void);
65 =1
66 =1 #endif
37 #include "F34x_MSD_Util.h"
1 =1 //----------------------------------------------------------------
--------------
2 =1 // F34x_MSD_Util.h
C51 COMPILER V7.50 F34X_MSD_SCSI 11/28/2006 10:54:24 PAGE 21
3 =1 //----------------------------------------------------------------
--------------
4 =1 // Copyright 2006 Silicon Laboratories, Inc.
5 =1 // http://www.silabs.com
6 =1 //
7 =1 // Program Description:
8 =1 //
9 =1 // Header file for F34x_Util.h. It contains functions and variable
-s
10 =1 // prototypes.
11 =1 //
12 =1 //
13 =1 // FID: 34X000068
14 =1 // Target: C8051F34x
15 =1 // Tool chain: Keil
16 =1 // Command Line: See Readme.txt
17 =1 // Project Name: F34x_USB_MSD
18 =1 //
19 =1 // Release 1.1
20 =1 // -All changes by PKC
21 =1 // -09 JUN 2006
22 =1 // -No changes; incremented revision number to match project re
-vision
23 =1 //
24 =1 // Release 1.0
25 =1 // -Initial Release
26 =1 //
27 =1
28 =1 //----------------------------------------------------------------
--------------
29 =1 // Header File Preprocessor Directive
30 =1 //----------------------------------------------------------------
--------------
31 =1
32 =1 #ifndef _UTIL_H_
33 =1 #define _UTIL_H_
34 =1
35 =1 #include "F34x_MSD_USB_Main.h"
1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -