📄 usb_desc.lst
字号:
204 const uchar code hidClassDesc[] =
205 {
206 9, // Descriptor length
207 0x21, // Descriptor type (HID)
208 0x10,0x01, //changed on April 30, 2004 // HID release (1.10)
209 0, // Country code (none)
210 1, // Number of HID class descriptors to follow
211 0x22, // Report descriptor type (HID)
212 REPORT_DESC_LEN, 0 // Byte length of report descriptor
213 }
214 ;
215
216 const uchar code hidClassDescSize = sizeof(hidClassDesc);
217
218
219
220
221
222 const uchar code configDesc[] =
223 {
224 9, // Configuration descriptor length
225 2, // Descriptor type (configuration)
226 34, 0, // Total length of this descriptor
227 1, // Number of interfaces
228 1, // Configuration value
229 0, // Index of string descriptor (none)
230 0xC0, // Self powered, no remote wakeup
231 25, // <100 mA max power consumption, 2mA steps
232
233
234
235 /*===== Interface =====*/
236
237 9, // Descriptor length
238 4, // Descriptor type (interface)
239 0, // Number of interface
240 0, // Alternate setting
241 1, // Number of endpoints (except EP0)
C51 COMPILER V7.10 USB_DESC 04/30/2004 12:57:59 PAGE 5
242
243 // if you would like to disable EP1, easily write 0 (and 1 back for EP1/display copy refresh enable)
244 3, // Class code (HID)
245 0, // Subclass (none)
246 0, // Protocol (none)
247 0, // Index of string descriptor (none)
248
249
250
251
252 /*===== HID class descriptor (copy of hidClassDesc) =====*/
253
254 9, // Descriptor length
255 0x21, // Descriptor type (HID)
256 0x10,0x01, //changed on April 30, 2004 // HID release (1.10)
257 0, // Country code (none)
258 1, // Number of HID class descriptors to follow
259 0x22, // Report descriptor type (HID)
260 REPORT_DESC_LEN, 0, // Byte length of report descriptor
261
262
263
264
265 /*===== Endpoint descriptor =====*/
266
267 7, // Descriptor length (7 bytes)
268 5, // Descriptor type (endpoint)
269 0x81, // Address (IN1)
270 3, // Attributes (interrupt)
271 8, 0, // Maximum packet size (8 bytes)
272 100 // Polling interval (in msec)
273 }
274 ;
275
276
277
278
279
280
281
282
283
284 // Language IDs
285 #define SD0LEN 4
286 const uchar code string0Desc[] =
287 {
288 SD0LEN, DT_STRING , // Size, Type
289 0x09, 0x04 // LangID Codes
290 }
291 ;
292
293
294
295
296
297 // Manufacturer String
298 #define SD1LEN sizeof("ST Microelectronics")*2
299 const uchar code string1Desc[] =
300 {
301 SD1LEN, DT_STRING, // Size, Type
302 'S', 0, // Unicode String
303 'T', 0,
C51 COMPILER V7.10 USB_DESC 04/30/2004 12:57:59 PAGE 6
304 ' ', 0,
305 'M', 0,
306 'i', 0,
307 'c', 0,
308 'r', 0,
309 'o', 0,
310 'e', 0,
311 'l', 0,
312 'e', 0,
313 'c', 0,
314 't', 0,
315 'r', 0,
316 'o', 0,
317 'n', 0,
318 'i', 0,
319 'c', 0,
320 's', 0
321 }
322 ;
323
324 // Product String
325 #define SD2LEN sizeof("DK3200 Evaluation Board")*2
326 const uchar code string2Desc[] =
327 {
328 SD2LEN, DT_STRING, // Size, Type
329 'D', 0, // Unicode String
330 'K', 0,
331 '3', 0,
332 '2', 0,
333 '0', 0,
334 '0', 0,
335 ' ', 0,
336 'E', 0,
337 'v', 0,
338 'a', 0,
339 'l', 0,
340 'u', 0,
341 'a', 0,
342 't', 0,
343 'i', 0,
344 'o', 0,
345 'n', 0,
346 ' ', 0,
347 'B', 0,
348 'o', 0,
349 'a', 0,
350 'r', 0,
351 'd', 0
352 }
353 ;
354
355 // Serial Number String
356 #define SD3LEN sizeof("S/N:001/2004")*2
357 const uchar code string3Desc[] =
358 {
359 SD3LEN, DT_STRING, // Size, Type
360 'S', 0, // Unicode String
361 '/', 0,
362 'N', 0,
363 ':', 0,
364 '0', 0,
365 '0', 0,
C51 COMPILER V7.10 USB_DESC 04/30/2004 12:57:59 PAGE 7
366 '1', 0,
367 '/', 0,
368 '2', 0,
369 '0', 0,
370 '0', 0,
371 '4', 0,
372 }
373 ;
374
375
376 const uchar code stringXDesc[2] =
377 {
378 2, 0, // Size, Type
379 }
380 ;
381
382
383 // Table of String Descriptors
384 const uchar * const code stringDescTable[] =
385 {
386 string0Desc,
387 string1Desc,
388 string2Desc,
389 string3Desc,
390 stringXDesc //no string
391 }
392 ;
393
394
395
396 /* *************************************************************************
397 *** ***
398 ** *** End of File *** **
399 *** ***
400 ************************************************************************* */
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = ---- ----
CONSTANT SIZE = 248 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
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 + -