📄 periph.lst
字号:
C51 COMPILER V7.02b PERIPH 06/04/2004 16:10:48 PAGE 1
C51 COMPILER V7.02b, COMPILATION OF MODULE PERIPH
OBJECT MODULE PLACED IN periph.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE periph.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #pragma NOIV // Do not generate interrupt vectors
2 //-----------------------------------------------------------------------------
3 // File: periph.c
4 // Contents: Hooks required to implement USB peripheral function.
5 //
6 // Copyright (c) 1997 AnchorChips, Inc. All rights reserved
7 //-----------------------------------------------------------------------------
8 #include "fx2.h"
9 #include "fx2regs.h"
10
11 extern BOOL GotSUD; // Received setup data flag
12 extern BOOL Sleep;
13 extern BOOL Rwuen;
14 extern BOOL Selfpwr;
15
16 BYTE Configuration; // Current configuration
17 BYTE AlternateSetting; // Alternate settings
18
19 //-----------------------------------------------------------------------------
20 // Task Dispatcher hooks
21 // The following hooks are called by the task dispatcher.
22 //-----------------------------------------------------------------------------
23
24 void TD_Init(void) // Called once at startup
25 {
26 1 BREAKPT &= ~bmBPEN; // to see BKPT LED go out TGE
27 1 Rwuen = TRUE; // Enable remote-wakeup
28 1 }
29
30 void TD_Poll(void) // Called repeatedly while the device is idle
31 {
32 1 }
33
34 BOOL TD_Suspend(void) // Called before the device goes into suspend mode
35 {
36 1 return(TRUE);
37 1 }
38
39 BOOL TD_Resume(void) // Called after the device resumes
40 {
41 1 return(TRUE);
42 1 }
43
44 //-----------------------------------------------------------------------------
45 // Device Request hooks
46 // The following hooks are called by the end point 0 device request parser.
47 //-----------------------------------------------------------------------------
48
49 BOOL DR_GetDescriptor(void)
50 {
51 1 return(TRUE);
52 1 }
53
54 BOOL DR_SetConfiguration(void) // Called when a Set Configuration command is received
55 {
C51 COMPILER V7.02b PERIPH 06/04/2004 16:10:48 PAGE 2
56 1 Configuration = SETUPDAT[2];
57 1 return(TRUE); // Handled by user code
58 1 }
59
60 BOOL DR_GetConfiguration(void) // Called when a Get Configuration command is received
61 {
62 1 EP0BUF[0] = Configuration;
63 1 EP0BCH = 0;
64 1 EP0BCL = 1;
65 1 return(TRUE); // Handled by user code
66 1 }
67
68 BOOL DR_SetInterface(void) // Called when a Set Interface command is received
69 {
70 1 AlternateSetting = SETUPDAT[2];
71 1 return(TRUE); // Handled by user code
72 1 }
73
74 BOOL DR_GetInterface(void) // Called when a Set Interface command is received
75 {
76 1 EP0BUF[0] = AlternateSetting;
77 1 EP0BCH = 0;
78 1 EP0BCL = 1;
79 1 return(TRUE); // Handled by user code
80 1 }
81
82 BOOL DR_GetStatus(void)
83 {
84 1 return(TRUE);
85 1 }
86
87 BOOL DR_ClearFeature(void)
88 {
89 1 return(TRUE);
90 1 }
91
92 BOOL DR_SetFeature(void)
93 {
94 1 return(TRUE);
95 1 }
96
97 BOOL DR_VendorCmnd(void)
98 {
99 1 return(TRUE);
100 1 }
101
102 //-----------------------------------------------------------------------------
103 // USB Interrupt Handlers
104 // The following functions are called by the USB interrupt jump table.
105 //-----------------------------------------------------------------------------
106
107 // Setup Data Available Interrupt Handler
108 void ISR_Sudav(void) interrupt 0
109 {
110 1 GotSUD = TRUE; // Set flag
111 1 EZUSB_IRQ_CLEAR();
112 1 USBIRQ = bmSUDAV; // Clear SUDAV IRQ
113 1 }
114
115 // Setup Token Interrupt Handler
116 void ISR_Sutok(void) interrupt 0
117 {
C51 COMPILER V7.02b PERIPH 06/04/2004 16:10:48 PAGE 3
118 1 EZUSB_IRQ_CLEAR();
119 1 USBIRQ = bmSUTOK; // Clear SUTOK IRQ
120 1 }
121
122 void ISR_Sof(void) interrupt 0
123 {
124 1 EZUSB_IRQ_CLEAR();
125 1 USBIRQ = bmSOF; // Clear SOF IRQ
126 1 }
127
128 void ISR_Ures(void) interrupt 0
129 {
130 1 // whenever we get a USB reset, we should revert to full speed mode
131 1 pConfigDscr = pFullSpeedConfigDscr;
132 1 ((CONFIGDSCR xdata *) pConfigDscr)->type = CONFIG_DSCR;
133 1 pOtherConfigDscr = pHighSpeedConfigDscr;
134 1 ((CONFIGDSCR xdata *) pOtherConfigDscr)->type = OTHERSPEED_DSCR;
135 1
136 1 EZUSB_IRQ_CLEAR();
137 1 USBIRQ = bmURES; // Clear URES IRQ
138 1 }
139
140 void ISR_Susp(void) interrupt 0
141 {
142 1 Sleep = TRUE;
143 1 EZUSB_IRQ_CLEAR();
144 1 USBIRQ = bmSUSP;
145 1 }
146
147 void ISR_Highspeed(void) interrupt 0
148 {
149 1 if (EZUSB_HIGHSPEED())
150 1 {
151 2 pConfigDscr = pHighSpeedConfigDscr;
152 2 ((CONFIGDSCR xdata *) pConfigDscr)->type = CONFIG_DSCR;
153 2 pOtherConfigDscr = pFullSpeedConfigDscr;
154 2 ((CONFIGDSCR xdata *) pOtherConfigDscr)->type = OTHERSPEED_DSCR;
155 2 }
156 1
157 1 EZUSB_IRQ_CLEAR();
158 1 USBIRQ = bmHSGRANT;
159 1 }
160 void ISR_Ep0ack(void) interrupt 0
161 {
162 1 }
163 void ISR_Stub(void) interrupt 0
164 {
165 1 }
166 void ISR_Ep0in(void) interrupt 0
167 {
168 1 }
169 void ISR_Ep0out(void) interrupt 0
170 {
171 1 }
172 void ISR_Ep1in(void) interrupt 0
173 {
174 1 }
175 void ISR_Ep1out(void) interrupt 0
176 {
177 1 }
178 void ISR_Ep2inout(void) interrupt 0
179 {
C51 COMPILER V7.02b PERIPH 06/04/2004 16:10:48 PAGE 4
180 1 }
181 void ISR_Ep4inout(void) interrupt 0
182 {
183 1 }
184 void ISR_Ep6inout(void) interrupt 0
185 {
186 1 }
187 void ISR_Ep8inout(void) interrupt 0
188 {
189 1 }
190 void ISR_Ibn(void) interrupt 0
191 {
192 1 }
193 void ISR_Ep0pingnak(void) interrupt 0
194 {
195 1 }
196 void ISR_Ep1pingnak(void) interrupt 0
197 {
198 1 }
199 void ISR_Ep2pingnak(void) interrupt 0
200 {
201 1 }
202 void ISR_Ep4pingnak(void) interrupt 0
203 {
204 1 }
205 void ISR_Ep6pingnak(void) interrupt 0
206 {
207 1 }
208 void ISR_Ep8pingnak(void) interrupt 0
209 {
210 1 }
211 void ISR_Errorlimit(void) interrupt 0
212 {
213 1 }
214 void ISR_Ep2piderror(void) interrupt 0
215 {
216 1 }
217 void ISR_Ep4piderror(void) interrupt 0
218 {
219 1 }
220 void ISR_Ep6piderror(void) interrupt 0
221 {
222 1 }
223 void ISR_Ep8piderror(void) interrupt 0
224 {
225 1 }
226 void ISR_Ep2pflag(void) interrupt 0
227 {
228 1 }
229 void ISR_Ep4pflag(void) interrupt 0
230 {
231 1 }
232 void ISR_Ep6pflag(void) interrupt 0
233 {
234 1 }
235 void ISR_Ep8pflag(void) interrupt 0
236 {
237 1 }
238 void ISR_Ep2eflag(void) interrupt 0
239 {
240 1 }
241 void ISR_Ep4eflag(void) interrupt 0
C51 COMPILER V7.02b PERIPH 06/04/2004 16:10:48 PAGE 5
242 {
243 1 }
244 void ISR_Ep6eflag(void) interrupt 0
245 {
246 1 }
247 void ISR_Ep8eflag(void) interrupt 0
248 {
249 1 }
250 void ISR_Ep2fflag(void) interrupt 0
251 {
252 1 }
253 void ISR_Ep4fflag(void) interrupt 0
254 {
255 1 }
256 void ISR_Ep6fflag(void) interrupt 0
257 {
258 1 }
259 void ISR_Ep8fflag(void) interrupt 0
260 {
261 1 }
262 void ISR_GpifComplete(void) interrupt 0
263 {
264 1 }
265 void ISR_GpifWaveform(void) interrupt 0
266 {
267 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 320 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 2 ----
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 + -