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