📄 chap_9.lst
字号:
C51 COMPILER V7.01 CHAP_9 03/28/2003 14:38:29 PAGE 1
C51 COMPILER V7.01, COMPILATION OF MODULE CHAP_9
OBJECT MODULE PLACED IN chap_9.OBJ
COMPILER INVOKED BY: d:\Keil\C51\BIN\C51.EXE chap_9.c OPTIMIZE(2,SPEED) BROWSE DEBUG OBJECTEXTEND
stmt level source
1 //***********************************************************************
2 // *
3 // P H I L I P S P R O P R I E T A R Y *
4 // *
5 // COPYRIGHT (c) 1999 BY PHILIPS SINGAPORE (APIC). *
6 // -- ALL RIGHTS RESERVED -- *
7 // *
8 // File Name : USBDebug.c *
9 // Author : Albert Goh *
10 // Created : 3 March 2000 *
11 // *
12 //***********************************************************************
13 //***********************************************************************
14 // *
15 // USBDebug has the ability to test the USB core in Bus enumeration or *
16 // in CBI/bulk mode. *
17 // *
18 //***********************************************************************
19 //***********************************************************************
20 // *
21 // Module History *
22 // ************** *
23 // *
24 // Date Version Author Changes *
25 // ==== ======= ====== ======= *
26 // 030300 0.1 Albert Created *
27 // *
28 //***********************************************************************
29
30 //***********************************************************************
31 //* *
32 //* Include Files Definition *
33 //* *
34 //***********************************************************************
35
36 #include "standard.h"
37 #include "Kernel.h"
38 #include "D14.h"
39 #include "usb.h"
40
41 extern volatile D14_CNTRL_REG xdata D14_Cntrl_Reg;
42 extern void Init_D14(void);
43 extern UC code Standard_Device_Descriptor[];
44 extern UC code Bulk_Interface_Descriptor[];
45 extern UC code Iso_Interface_Descriptor[];
46 extern UC code Standard_Config_Descriptor[];
47 extern UC code Standard_Manufacturer_String[];
48 extern UC code Standard_Product_String[];
49 extern UC code Standard_String_ID[];
50 extern UC code Bulk_In_Descriptor[];
51 extern UC code Bulk_Out_Descriptor[];
52 extern UC code Int_In_Descriptor[];
53 extern UC code Int_Out_Descriptor[];
54 extern UC code Iso_In_Descriptor[];
55 extern UC code Iso_Out_Descriptor[];
C51 COMPILER V7.01 CHAP_9 03/28/2003 14:38:29 PAGE 2
56 extern UC code Iso_In_Zero_Descriptor[];
57 extern UC code Iso_Out_Zero_Descriptor[];
58 extern UC code HS_Device_Descriptor[];
59 extern UC code HS_Device_Qualifier[];
60 extern UC code HS_Bulk_Interface_Descriptor[];
61 extern UC code HS_Bulk_In_Descriptor[];
62 extern UC code HS_Bulk_Out_Descriptor[];
63 extern UC code HS_Int_In_Descriptor[];
64 extern UC code HS_Int_Out_Descriptor[];
65 extern UC code Other_Speed_Config_Descriptor[];
66 extern UI count;
67 extern void Start_mSEC_Timer(Data);
68 extern void Start_SEC_Timer(Data);
69 extern void Check_Busy(void);
70 extern void TaskFile_Update(void);
71 extern UI Temp;
72 extern UC Device_Config_Value;
73 extern KERNEL Kernel_Flag;
74 extern DMA_INT_FLAG DMA_Int_Flag;
75 extern USB_INT_FLAG USB_Int_Flag;
76 extern USBCBW USB_CBW;
77 extern void Init_Device(void);
78 extern UC code Test_Packet[];
79 extern void Init_Endpoint(void);
80 extern void Init_Device(void);
81 extern void Set_USB(void);
82
83 //***********************************************************************
84 //* *
85 //* Prototype Routine Definition *
86 //* *
87 //***********************************************************************
88
89 void USB_Setup(void);
90 void reserved(void);
91 void Send_Device_Status(void);
92 void Send_Interface_Status(void);
93 void Send_Endpoint_Status(void);
94
95 void Vendor_Specific_Command(void);
96 void Send_Status(unsigned char tran_status);
97
98 void Set_Interface_Value(void);
99 void Get_Interface_Value(void);
100 void Process_Synch_Frame(void);
101
102 void get_status(void);
103 void clear_feature(void);
104 void set_feature(void);
105 void set_address(void);
106 void get_descriptor(void);
107 void get_config(void);
108 void set_config(void);
109 void get_interface(void);
110 void set_interface(void);
111
112 void Set_Descriptor(void);
113 void reserved(void);
114
115 void ep0in_ack(void);
116 void ep0out_ack(void);
117 void wait_ep0tx(void);
C51 COMPILER V7.01 CHAP_9 03/28/2003 14:38:29 PAGE 3
118 void wait_ep0rx(void);
119
120 //***********************************************************************
121 //* *
122 //* Variable Definition *
123 //* *
124 //***********************************************************************
125
126 USB_INT_FLAG USB_Int_Flag;
127 USB_DEVICE_REQ idata USB_Device_Request;
128 USB_DEVICE USB_Device;
129
130 UC code *Descriptor_Ptr;
131
132 UC idata Endpt_FIFO[MAX_BUF];
133 UI FIFO_Count;
134 UC VID[2],PID[2];
135 FILESIZE FileSize;
136 UI PIO_Count;
137 UC File_Number;
138 UC Current_File;
139 ULI bytecount;
140
141 //USB标准请求
142 code void (*StandardDeviceRequest[])(void) =
143 {
144 get_status,
145 clear_feature,
146 reserved,
147 set_feature,
148 reserved,
149 set_address,
150 get_descriptor,
151 reserved,
152 get_config,
153 set_config,
154 get_interface,
155 set_interface,
156 reserved,
157 reserved,
158 reserved,
159 reserved
160 };
161
162
163
164 //***********************************************************************
165 //* *
166 //* Routine Definition *
167 //* *
168 //***********************************************************************
169
170 //***********************************************************************
171 //* *
172 //* Routine : USB Debug Mode *
173 //* Input : USB Interrupt Register *
174 //* Output : None *
175 //* Function : Branch to respective ISR *
176 //* *
177 //***********************************************************************
178
179 void USB_Debug_Mode(void)
C51 COMPILER V7.01 CHAP_9 03/28/2003 14:38:29 PAGE 4
180 {
181 1 //端点0接收到setup包处理
182 1 if(USB_Int_Flag.BITS.EP0SETUP)
183 1 {
184 2 EA_DISABLE;
185 2 USB_Setup();
186 2 EA_ENABLE;
187 2 }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -