?? usb_parameter.lst
字號:
C51 COMPILER V7.00 USB_PARAMETER 03/24/2005 20:28:24 PAGE 1
C51 COMPILER V7.00, COMPILATION OF MODULE USB_PARAMETER
OBJECT MODULE PLACED IN Usb_Parameter.OBJ
COMPILER INVOKED BY: C:\keil\C51\BIN\c51.exe Usb_Parameter.h DB OE
stmt level source
1 #ifndef _USB_PARAMETER_H_
2 #define _USB_PARAMETER_H_
3 //標準描述符的類型
4 #define DSC_DEVICE 0x01 // Device Descriptor
5 #define DSC_CONFIG 0x02 // Configuration Descriptor
6 #define DSC_STRING 0x03 // String Descriptor
7 #define DSC_INTERFACE 0x04 // Interface Descriptor
8 #define DSC_ENDPOINT 0x05 // Endpoint Descriptor
9
10 //HID 設備描述符類型
11 #define DSC_HID 0x21 // HID Class Descriptor
12 #define DSC_HID_REPORT 0x22 // HID Report Descriptor
13 //端點的大小
14 #define EP0_PACKET_SIZE 0x40
15 #define EP1_PACKET_SIZE 0x80
16 #define EP2_PACKET_SIZE 0x80
17
18 //設備的狀態
19 #define DEV_ATTACHED 0x00 // Device is in Attached State
20 #define DEV_POWERED 0x01 // Device is in Powered State
21 #define DEV_DEFAULT 0x02 // Device is in Default State
22 #define DEV_ADDRESS 0x03 // Device is in Addressed State
23 #define DEV_CONFIGURED 0x04 // Device is in Configured State
24 #define DEV_SUSPENDED 0x05 // Device is in Suspended State
25
26 //端點的狀態
27 #define EP_IDLE 0x00 // This signifies Endpoint Idle State
28 #define EP_TX 0x01 // Endpoint Transmit State
29 #define EP_RX 0x02 // Endpoint Receive State
30 #define EP_HALT 0x03 // Endpoint Halt State (return stalls)
31 #define EP_STALL 0x04 // Endpoint Stall (send procedural stall next status phase)
32 #define EP_ADDRESS 0x05 // Endpoint Address (change FADDR during next status phase)
33
34 //BULK_ONLY端點的狀態
35 #define BULK_IDLE 0x00
36 #define BULK_TX 0x01
37 #define BULK_RX 0x02
38 #define BULK_DATA_END 0x03
39 /////////////////////////////////////////////////////////////////////////////////////////////////////
40 // 設置階段的命令數據包
41 // Define bmRequestType bitmaps
42 #define IN_DEVICE 0x00 // Request made to device, direction is IN
43 #define OUT_DEVICE 0x80 // Request made to device, direction is OUT
44 #define IN_INTERFACE 0x01 // Request made to interface, direction is IN
45 #define OUT_INTERFACE 0x81 // Request made to interface, direction is OUT
46 #define IN_ENDPOINT 0x02 // Request made to endpoint, direction is IN
47 #define OUT_ENDPOINT 0x82 // Request made to endpoint, direction is OUT
48
49 // Define wIndex bitmaps
50 #define IN_EP1 0x81 // Index values used by Set and Clear feature
51 #define OUT_EP1 0x01 // commands for Endpoint_Halt
52 #define IN_EP2 0x82
53 #define OUT_EP2 0x02
54
55 // Define wValue bitmaps for Standard Feature Selectors
C51 COMPILER V7.00 USB_PARAMETER 03/24/2005 20:28:24 PAGE 2
56 #define DEVICE_REMOTE_WAKEUP 0x01 // Remote wakeup feature(not used)
57 #define ENDPOINT_HALT 0x00 // Endpoint_Halt feature selector
58
59 /////////////////////////////////////////////////////////////////////////////////////////////////////
60 //全局變量
61 unsigned int DataSize; // 需要發送的數據大小
62 unsigned int DataSent; // 已經發送的數據大小
63 unsigned char *DataPtr; // 發送數據的指針
64 unsigned char ONES_PACKET[2] = {0x01, 0x00}; // These are response packets used for
65 unsigned char ZERO_PACKET[2] = {0x00, 0x00}; // communication with host
66
67 unsigned char Ep_Status[3]={EP_IDLE,EP_STALL,EP_STALL}; //端點的狀態
68 unsigned char USB_State=DEV_ATTACHED; //設備的狀態
69
70 /*
71 unsigned char Bulk_Status = BULK_IDLE;
72
73 xdata unsigned char OUT_PACKET[512]; //輸出數據緩沖區
74 xdata unsigned char IN_PACKET[128]; //輸入數據緩沖區
75
76 xdata unsigned long LBA=0;
77 xdata unsigned Transfer_Length; //要傳送的扇區數
78 xdata unsigned int Block=0; //塊地址
79 xdata unsigned char Page=0; //塊內頁地址
80 xdata unsigned int Packet_Flag=0;*/
81
82 #endif
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = ---- ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 15 ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -