00001
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef _USB_DESCRIPTORS_H_
00049 #define _USB_DESCRIPTORS_H_
00050
00051
00052
00053 #include "conf_usb.h"
00054
00055 #if USB_DEVICE_FEATURE == DISABLED
00056 #error usb_descriptors.h is #included although USB_DEVICE_FEATURE is disabled
00057 #endif
00058
00059
00060 #include "usb_standard_request.h"
00061 #include "usb_task.h"
00062 #include "usb_audio.h"
00063
00064
00065
00066
00067 #define Usb_unicode(c) (Usb_format_mcu_to_usb_data(16, (U16)(c)))
00068 #define Usb_get_dev_desc_pointer() (&(usb_dev_desc.bLength))
00069 #define Usb_get_dev_desc_length() (sizeof (usb_dev_desc))
00070 #define Usb_get_conf_desc_pointer() (&(usb_conf_desc.cfg.bLength))
00071 #define Usb_get_conf_desc_length() (sizeof (usb_conf_desc))
00072
00073
00074
00075
00076
00077 #define USB_SPECIFICATION 0x0200
00078 #define DEVICE_CLASS 0
00079 #define DEVICE_SUB_CLASS 0
00080 #define DEVICE_PROTOCOL 0
00081 #define EP_CONTROL_LENGTH 64
00082 #define VENDOR_ID ATMEL_VID
00083 #define PRODUCT_ID AUDIO_SPEAKER_MICRO_EXAMPLE_PID
00084 #define RELEASE_NUMBER 0x1000
00085 #define MAN_INDEX 0x01
00086 #define PROD_INDEX 0x02
00087 #define SN_INDEX 0x03
00088 #define NB_CONFIGURATION 1
00089
00090
00091
00092 #define NB_INTERFACE 4
00093 #define CONF_NB 1
00094 #define CONF_INDEX 0
00095 #define CONF_ATTRIBUTES USB_CONFIG_BUSPOWERED
00096 #define MAX_POWER 50 // 100 mA
00097
00098
00099 #define AC_INTERFACE_NB 0
00100 #define AC_ALTERNATE 0
00101 #define AC_NB_ENDPOINT 0
00102 #define AC_INTERFACE_CLASS AUDIO_CLASS
00103 #define AC_INTERFACE_SUB_CLASS AUDIOCONTROL_SUBCLASS
00104 #define AC_INTERFACE_PROTOCOL NO_PROTOCOL
00105 #define AC_INTERFACE_INDEX 0
00106
00107
00108 #define ENDPOINT_NB_OUT (EP_AUDIO_OUT | USB_ENDPOINT_OUT)
00109 #define EP_ATTRIBUTES_OUT (TYPE_ISOCHRONOUS | ( ENDPOINT_TYPE_ADAPTIVE << ENDPOINT_TYPE_OFFSET))
00110 #define EP_SIZE_OUT (256)
00111 #define EP_INTERVAL_OUT 0x01 // One packet per frame
00112
00113
00114 #define ENDPOINT_NB_IN (EP_AUDIO_IN | USB_ENDPOINT_IN)
00115 #define EP_ATTRIBUTES_IN TYPE_ISOCHRONOUS
00116 #define EP_SIZE_IN (128)
00117 #define EP_INTERVAL_IN 0x01 // One packet per frame
00118
00119
00120
00121 #define NB_OF_STREAMING_INTERFACE 0x02
00122
00123
00124
00125 #define SPEAKER_INPUT_TERMINAL_ID 0x01
00126 #define SPEAKER_INPUT_TERMINAL_TYPE AUDIO_TE_TYPE_USB_STREAMING // USB Streaming
00127 #define SPEAKER_INPUT_TERMINAL_ASSOCIATION 0x00 // No association
00128 #define SPEAKER_INPUT_TERMINAL_NB_CHANNELS 0x01 // 1 channel for input terminal
00129 #define SPEAKER_INPUT_TERMINAL_CHANNEL_CONF AUDIO_CHANNEL_NO_POSITION // Mono sets no position
00130 #define SPEAKER_INPUT_TERMINAL_CH_NAME_ID 0x00 // No channel name
00131 #define SPEAKER_INPUT_TERMINAL_NAME_ID 0x00 // No terminal name
00132
00133 #define SPEAKER_FEATURE_UNIT_ID 0x02
00134 #define SPEAKER_FEATURE_UNIT_SOURCE_ID SPEAKER_INPUT_TERMINAL_ID
00135 #define SPEAKER_FEATURE_UNIT_CTRL_CH_MASTER (AUDIO_FU_CONTROL_CS_MUTE|AUDIO_FU_CONTROL_CS_VOLUME) // Mute + Volume control on master channel
00136 #define SPEAKER_FEATURE_UNIT_CTRL_CH_1 0x00 // No control on channel 1
00137
00138 #define SPEAKER_OUTPUT_TERMINAL_ID 0x03
00139 #define SPEAKER_OUTPUT_TERMINAL_TYPE AUDIO_TE_TYPE_OUTPUT_SPEAKER // Output terminal is a speaker
00140 #define SPEAKER_OUTPUT_TERMINAL_ASSOCIATION 0x00 // No association
00141 #define SPEAKER_OUTPUT_TERMINAL_SOURCE_ID SPEAKER_FEATURE_UNIT_ID // From Feature Unit Terminal
00142 #define SPEAKER_OUTPUT_TERMINAL_NAME_ID 0x00 // No terminal name
00143
00144
00145
00146 #define MICRO_INPUT_TERMINAL_ID 0x04
00147 #define MICRO_INPUT_TERMINAL_TYPE AUDIO_TE_TYPE_INPUT_MICROPHONE // Terminal is microphone
00148 #define MICRO_INPUT_TERMINAL_ASSOCIATION 0x00 // No association
00149 #define MICRO_INPUT_TERMINAL_NB_CHANNELS 0x01 // One channel for input terminal
00150 #define MICRO_INPUT_TERMINAL_CHANNEL_CONF AUDIO_CHANNEL_NO_POSITION // Mono sets no position
00151 #define MICRO_INPUT_TERMINAL_CH_NAME_ID 0x00 // No channel name
00152 #define MICRO_INPUT_TERMINAL_NAME_ID 0x00 // No terminal name
00153
00154 #define MICRO_FEATURE_UNIT_ID 0x05
00155 #define MICRO_FEATURE_UNIT_SOURCE_ID MICRO_INPUT_TERMINAL_ID
00156 #define MICRO_FEATURE_UNIT_CTRL_CH_MASTER (AUDIO_FU_CONTROL_CS_MUTE|AUDIO_FU_CONTROL_CS_VOLUME) // Mute + Volume control on master channel
00157 #define MICRO_FEATURE_UNIT_CTRL_CH_1 0x00 // No control on channel 1
00158
00159 #define MICRO_OUTPUT_TERMINAL_ID 0x06
00160 #define MICRO_OUTPUT_TERMINAL_TYPE AUDIO_TE_TYPE_USB_STREAMING // USB Streaming
00161 #define MICRO_OUTPUT_TERMINAL_ASSOCIATION 0x00 // No association
00162 #define MICRO_OUTPUT_TERMINAL_SOURCE_ID MICRO_FEATURE_UNIT_ID // From Feature Unit Terminal
00163 #define MICRO_OUTPUT_TERMINAL_NAME_ID 0x00 // No terminal name
00164
00165
00166
00167 #define STD_AS_OUT_INTERFACE_NB 0x01 // Index of Std AS Interface
00168
00169 #define ALT0_AS_OUT_INTERFACE_INDEX 0x00 // Index of Std AS interface Alt0
00170 #define ALT0_AS_OUT_NB_ENDPOINT 0x00 // Nb od endpoints for alt0 interface
00171 #define ALT0_AS_OUT_INTERFACE_CLASS AUDIO_CLASS // Audio class
00172 #define ALT0_AS_OUT_INTERFACE_SUB_CLASS AUDIOSTREAMING_SUBCLASS // Audio streamn sub class
00173 #define ALT0_AS_OUT_INTERFACE_PROTOCOL NO_PROTOCOL // Unused
00174
00175 #define ALT1_AS_OUT_INTERFACE_INDEX 0x01 // Index of Std AS interface Alt1
00176 #define ALT1_AS_OUT_NB_ENDPOINT 0x01 // Nb od endpoints for alt1 interface
00177 #define ALT1_AS_OUT_INTERFACE_CLASS AUDIO_CLASS // Audio class
00178 #define ALT1_AS_OUT_INTERFACE_SUB_CLASS AUDIOSTREAMING_SUBCLASS // Audio streamn sub class
00179 #define ALT1_AS_OUT_INTERFACE_PROTOCOL NO_PROTOCOL // Unused
00180
00181 #define AS_OUT_TERMINAL_LINK SPEAKER_INPUT_TERMINAL_ID // Unit Id of the output terminal
00182 #define AS_OUT_DELAY 0x01 // Interface delay
00183 #define AS_OUT_FORMAT_TAG AUDIO_FORMAT_TI_PCM // PCM Format
00184
00185 #define OUT_FORMAT_TYPE AUDIO_FORMAT_TYPE_I // Format TypeI
00186 #define OUT_FORMAT_NB_CHANNELS 0x02 // Two Channels
00187 #define OUT_FORMAT_FRAME_SIZE 0x02 // Two bytes per audio sample
00188 #define OUT_FORMAT_BIT_RESOLUTION 0x10 // 16 bits per sample
00189
00190 #if (defined USB_RESYNC_METHOD) && ((USB_RESYNC_METHOD == USB_RESYNC_METHOD_SOFT_ADD_DEL_SAMPLES) || (USB_RESYNC_METHOD == USB_RESYNC_METHOD_SOFT_ADAPTIF_SRC))
00191 #define OUT_FORMAT_SAMPLE_FREQ_NB 0x01 // One frequency supported
00192 #else // USB_RESYNC_METHOD_EXT_CLOCK_SYNTHESIZER
00193 #define OUT_FORMAT_SAMPLE_FREQ_NB 0x03 // Three frequencies supported
00194 #endif
00195
00196 #define OUT_FORMAT_MSBYTE_SAMPLE_FREQ 0x00 // MsByte
00197
00198 #define AUDIO_EP_OUT_ATRIBUTES 0x01 // Sampling freq control, no pitch, no pading
00199 #define AUDIO_EP_OUT_DELAY_UNIT 0x00 // Unused
00200 #define AUDIO_EP_OUT_LOCK_DELAY 0x0000 // Unused
00201
00202
00203
00204 #define STD_AS_IN_INTERFACE_NB 0x02 // Index of Std AS Interface
00205
00206 #define ALT0_AS_IN_INTERFACE_INDEX 0x00 // Index of Std AS interface Alt0
00207 #define ALT0_AS_IN_NB_ENDPOINT 0x00 // Nb od endpoints for alt0 interface
00208 #define ALT0_AS_IN_INTERFACE_CLASS AUDIO_CLASS // Audio class
00209 #define ALT0_AS_IN_INTERFACE_SUB_CLASS AUDIOSTREAMING_SUBCLASS // Audio streamn sub class
00210 #define ALT0_AS_IN_INTERFACE_PROTOCOL NO_PROTOCOL // Unused
00211
00212 #define ALT1_AS_IN_INTERFACE_INDEX 0x01 // Index of Std AS interface Alt1
00213 #define ALT1_AS_IN_NB_ENDPOINT 0x01 // Nb od endpoints for alt1 interface
00214 #define ALT1_AS_IN_INTERFACE_CLASS AUDIO_CLASS // Audio class
00215 #define ALT1_AS_IN_INTERFACE_SUB_CLASS AUDIOSTREAMING_SUBCLASS // Audio streamn sub class
00216 #define ALT1_AS_IN_INTERFACE_PROTOCOL NO_PROTOCOL // Unused
00217
00218 #define AS_IN_TERMINAL_LINK MICRO_OUTPUT_TERMINAL_ID // Unit Id of the output terminal
00219 #define AS_IN_DELAY 0x01 // Interface delay
00220 #define AS_IN_FORMAT_TAG AUDIO_FORMAT_TI_PCM // PCM Format
00221
00222 #define IN_FORMAT_TYPE AUDIO_FORMAT_TYPE_I // Format TypeI
00223 #define IN_FORMAT_NB_CHANNELS 0x01 // One Channel
00224 #define IN_FORMAT_FRAME_SIZE 0x02 // Two bytes per audio sample
00225 #define IN_FORMAT_BIT_RESOLUTION 0x10 // 16 bits per sample
00226 #define IN_FORMAT_SAMPLE_FREQ_NB 0x01 // One frequency supported
00227 #define IN_FORMAT_LSBYTE_SAMPLE_FREQ 0xAC44 // 0x001F40=8kHz Sample frequency
00228 #define IN_FORMAT_MSBYTE_SAMPLE_FREQ 0x00 // MsByte of 0x001F40
00229
00230 #define AUDIO_EP_IN_ATRIBUTES 0x00 // No sampling freq, no pitch, no pading
00231 #define AUDIO_EP_IN_DELAY_UNIT 0x00 // Unused
00232 #define AUDIO_EP_IN_LOCK_DELAY 0x0000 // Unused
00233
00234
00235 #define INTERFACE_NB_KBD 3 // Interface's number
00236 #define ALTERNATE_KBD 0
00237 #define NB_ENDPOINT_KBD 1
00238 #define INTERFACE_CLASS_KBD HID_CLASS // HID Class
00239 #define INTERFACE_SUB_CLASS_KBD NO_SUBCLASS
00240 #define INTERFACE_PROTOCOL_KBD KEYBOARD_PROTOCOL
00241 #define INTERFACE_INDEX_KBD 0
00242
00243
00244 #define ENDPOINT_NB_KBD (EP_KBD_IN | USB_ENDPOINT_IN)
00245 #define EP_ATTRIBUTES_KBD 0x03 // BULK = 0x02, INTERUPT = 0x03
00246 #define EP_IN_LENGTH_KBD 8
00247 #define EP_SIZE_KBD EP_IN_LENGTH_KBD
00248 #define EP_INTERVAL_KBD 0x02 // Interrupt polling interval from host
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258 #define LANG_ID 0x00
00259 #define DEVICE_STATUS BUS_POWERED
00260 #define INTERFACE_STATUS 0x00 // TBD
00261
00262
00263
00264
00265
00266
00267 #define USB_MN_LENGTH 5
00268 #define USB_MANUFACTURER_NAME \
00269 {\
00270 Usb_unicode('A'),\
00271 Usb_unicode('T'),\
00272 Usb_unicode('M'),\
00273 Usb_unicode('E'),\
00274 Usb_unicode('L') \
00275 }
00276
00277 #define USB_PN_LENGTH 20
00278 #define USB_PRODUCT_NAME \
00279 {\
00280 Usb_unicode('A')\
00281 ,Usb_unicode('V') \
00282 ,Usb_unicode('R') \
00283 , Usb_unicode('3')\
00284 , Usb_unicode('2')\
00285 ,Usb_unicode(' ') \
00286 ,Usb_unicode('U') \
00287 , Usb_unicode('C')\
00288 , Usb_unicode('3')\
00289 ,Usb_unicode(' ') \
00290 ,Usb_unicode('A') \
00291 ,Usb_unicode('U') \
00292 ,Usb_unicode('D') \
00293 ,Usb_unicode('I') \
00294 ,Usb_unicode('O') \
00295 ,Usb_unicode(' ') \
00296 ,Usb_unicode('D') \
00297 ,Usb_unicode('E') \
00298 ,Usb_unicode('M') \
00299 ,Usb_unicode('O') \
00300 }
00301
00302 #define USB_SN_LENGTH 13
00303 #define USB_SERIAL_NUMBER \
00304 {\
00305 Usb_unicode('1'),\
00306 Usb_unicode('.'),\
00307 Usb_unicode('0'),\
00308 Usb_unicode('.'),\
00309 Usb_unicode('0'),\
00310 Usb_unicode('.'),\
00311 Usb_unicode('0'),\
00312 Usb_unicode('.'),\
00313 Usb_unicode('0'),\
00314 Usb_unicode('.'),\
00315 Usb_unicode('0'),\
00316 Usb_unicode('.'),\
00317 Usb_unicode('A') \
00318 }
00319
00320 #define AUDIO_CHANNEL_NAME \
00321 { Usb_unicode('A') \
00322 , Usb_unicode('T') \
00323 , Usb_unicode('M') \
00324 , Usb_unicode('E') \
00325 , Usb_unicode('L') \
00326 }
00327
00328 #define LANGUAGE_ID 0x0409
00329
00330
00332 typedef
00333 #if (defined __ICCAVR32__)
00334 #pragma pack(1)
00335 #endif
00336 struct
00337 #if (defined __GNUC__)
00338 __attribute__((__packed__))
00339 #endif
00340 {
00341 U8 bmRequestType;
00342 U8 bRequest;
00343 U16 wValue;
00344 U16 wIndex;
00345 U16 wLength;
00346 }
00347 #if (defined __ICCAVR32__)
00348 #pragma pack()
00349 #endif
00350 S_UsbRequest;
00351
00352
00354 typedef
00355 #if (defined __ICCAVR32__)
00356 #pragma pack(1)
00357 #endif
00358 struct
00359 #if (defined __GNUC__)
00360 __attribute__((__packed__))
00361 #endif
00362 {
00363 U8 bLength;
00364 U8 bDescriptorType;
00365 U16 bscUSB;
00366 U8 bDeviceClass;
00367 U8 bDeviceSubClass;
00368 U8 bDeviceProtocol;
00369 U8 bMaxPacketSize0;
00370 U16 idVendor;
00371 U16 idProduct;
00372 U16 bcdDevice;
00373 U8 iManufacturer;
00374 U8 iProduct;
00375 U8 iSerialNumber;
00376 U8 bNumConfigurations;
00377 }
00378 #if (defined __ICCAVR32__)
00379 #pragma pack()
00380 #endif
00381 S_usb_device_descriptor;
00382
00383
00385 typedef
00386 #if (defined __ICCAVR32__)
00387 #pragma pack(1)
00388 #endif
00389 struct
00390 #if (defined __GNUC__)
00391 __attribute__((__packed__))
00392 #endif
00393 {
00394 U8 bLength;
00395 U8 bDescriptorType;
00396 U16 wTotalLength;
00397 U8 bNumInterfaces;
00398 U8 bConfigurationValue;
00399 U8 iConfiguration;
00400 U8 bmAttributes;
00401 U8 MaxPower;
00402 }
00403 #if (defined __ICCAVR32__)
00404 #pragma pack()
00405 #endif
00406 S_usb_configuration_descriptor;
00407
00408
00410 typedef
00411 #if (defined __ICCAVR32__)
00412 #pragma pack(1)
00413 #endif
00414 struct
00415 #if (defined __GNUC__)
00416 __attribute__((__packed__))
00417 #endif
00418 {
00419 U8 bLength;
00420 U8 bDescriptorType;
00421 U8 bInterfaceNumber;
00422 U8 bAlternateSetting;
00423 U8 bNumEndpoints;
00424 U8 bInterfaceClass;
00425 U8 bInterfaceSubClass;
00426 U8 bInterfaceProtocol;
00427 U8 iInterface;
00428 }
00429 #if (defined __ICCAVR32__)
00430 #pragma pack()
00431 #endif
00432 S_usb_interface_descriptor;
00433
00434
00437 typedef
00438 #if (defined __ICCAVR32__)
00439 #pragma pack(1)
00440 #endif
00441 struct
00442 #if (defined __GNUC__)
00443 __attribute__((__packed__))
00444 #endif
00445 {
00446 U8 bLength;
00447 U8 bDescriptorType;
00448 U8 bDescritorSubtype;
00449 U16 bcdADC;
00450 U16 wTotalLength;
00451 U8 bInCollection;
00452 U8 baInterface1;
00453 U8 baInterface2;
00454 }
00455 #if (defined __ICCAVR32__)
00456 #pragma pack()
00457 #endif
00458 S_usb_ac_interface_descriptor;
00459
00460
00462 typedef
00463 #if (defined __ICCAVR32__)
00464 #pragma pack(1)
00465 #endif
00466 struct
00467 #if (defined __GNUC__)
00468 __attribute__((__packed__))
00469 #endif
00470 {
00471 U8 bLenght;
00472 U8 bDescriptorType;
00473 U8 bDescriptorSubType;
00474 U8 bTerminalID;
00475 U16 wTerminalType;
00476 U8 bAssocTerminal;
00477 U8 bNrChannels;
00478 U16 wChannelConfig;
00479 U8 iChannelNames;
00480 U8 iTerminal;
00481 }
00482 #if (defined __ICCAVR32__)
00483 #pragma pack()
00484 #endif
00485 S_usb_in_ter_descriptor;
00486
00487
00489 typedef
00490 #if (defined __ICCAVR32__)
00491 #pragma pack(1)
00492 #endif
00493 struct
00494 #if (defined __GNUC__)
00495 __attribute__((__packed__))
00496 #endif
00497 {
00498 U8 bLenght;
00499 U8 bDescriptorType;
00500 U8 bDescriptorSubType;
00501 U8 bUnitID;
00502 U8 bSourceID;
00503 U8 bControSize;
00504 U8 bmaControlMaster;
00505 U8 bmaControlCh1;
00506 }
00507 #if (defined __ICCAVR32__)
00508 #pragma pack()
00509 #endif
00510 S_usb_feature_unit_descriptor_speaker;
00511
00513 typedef
00514 #if (defined __ICCAVR32__)
00515 #pragma pack(1)
00516 #endif
00517 struct
00518 #if (defined __GNUC__)
00519 __attribute__((__packed__))
00520 #endif
00521 {
00522 U8 bLenght;
00523 U8 bDescriptorType;
00524 U8 bDescriptorSubType;
00525 U8 bUnitID;
00526 U8 bSourceID;
00527 U8 bControSize;
00528 U8 bmaControlMaster;
00529 U8 bmaControlCh1;
00530 }
00531 #if (defined __ICCAVR32__)
00532 #pragma pack()
00533 #endif
00534 S_usb_feature_unit_descriptor_micro;
00535
00537 typedef
00538 #if (defined __ICCAVR32__)
00539 #pragma pack(1)
00540 #endif
00541 struct
00542 #if (defined __GNUC__)
00543 __attribute__((__packed__))
00544 #endif
00545 {
00546 U8 bLenght;
00547 U8 bDescriptorType;
00548 U8 bDescriptorSubType;
00549 U8 bTerminalID;
00550 U16 wTerminalType;
00551 U8 bAssocTerminal;
00552 U8 bSourceID;
00553 U8 iTerminal;
00554 }
00555 #if (defined __ICCAVR32__)
00556 #pragma pack()
00557 #endif
00558 S_usb_out_ter_descriptor;
00559
00561 typedef
00562 #if (defined __ICCAVR32__)
00563 #pragma pack(1)
00564 #endif
00565 struct
00566 #if (defined __GNUC__)
00567 __attribute__((__packed__))
00568 #endif
00569 {
00570 U8 bLenght;
00571 U8 bDescriptorType;
00572 U8 bDescriptorSubType;
00573 U8 bTerminalLink;
00574 U8 bDelay;
00575 U16 wFormatTag;
00576 }
00577 #if (defined __ICCAVR32__)
00578 #pragma pack()
00579 #endif
00580 S_usb_as_interface_descriptor;
00581
00583 typedef
00584 #if (defined __ICCAVR32__)
00585 #pragma pack(1)
00586 #endif
00587 struct
00588 #if (defined __GNUC__)
00589 __attribute__((__packed__))
00590 #endif
00591 {
00592 U8 bLenght;
00593 U8 bDescriptorType;
00594 U8 bDescriptorSubType;
00595 U8 bFormatType;
00596 U8 bNrChannels;
00597 U8 bSubFrameSize;
00598 U8 bBitResolution;
00599 U8 bSampleFreqType;
00600 #if (defined USB_RESYNC_METHOD) && ((USB_RESYNC_METHOD == USB_RESYNC_METHOD_SOFT_ADD_DEL_SAMPLES) || (USB_RESYNC_METHOD == USB_RESYNC_METHOD_SOFT_ADAPTIF_SRC))
00601 U16 wLsbyteiSamFreq;
00602 U8 bMsbyteiSamFreq;
00603 #else // USB_RESYNC_METHOD_EXT_CLOCK_SYNTHESIZER
00604 U16 wLsbyteiSamFreq_1;
00605 U8 bMsbyteiSamFreq_1;
00606 U16 wLsbyteiSamFreq_2;
00607 U8 bMsbyteiSamFreq_2;
00608 U16 wLsbyteiSamFreq_3;
00609 U8 bMsbyteiSamFreq_3;
00610 #endif
00611 }
00612 #if (defined __ICCAVR32__)
00613 #pragma pack()
00614 #endif
00615 S_usb_format_type_speaker;
00616
00617
00618 typedef
00619 #if (defined __ICCAVR32__)
00620 #pragma pack(1)
00621 #endif
00622 struct
00623 #if (defined __GNUC__)
00624 __attribute__((__packed__))
00625 #endif
00626 {
00627 U8 bLenght;
00628 U8 bDescriptorType;
00629 U8 bDescriptorSubType;
00630 U8 bFormatType;
00631 U8 bNrChannels;
00632 U8 bSubFrameSize;
00633 U8 bBitResolution;
00634 U8 bSampleFreqType;
00635 U16 wLsbyteiSamFreq;
00636 U8 bMsbyteiSamFreq;
00637 }
00638 #if (defined __ICCAVR32__)
00639 #pragma pack()
00640 #endif
00641 S_usb_format_type_microphone;
00642
00643
00645 typedef
00646 #if (defined __ICCAVR32__)
00647 #pragma pack(1)
00648 #endif
00649 struct
00650 #if (defined __GNUC__)
00651 __attribute__((__packed__))
00652 #endif
00653 {
00654 U8 bLenght;
00655 U8 bDescriptorType;
00656 U8 bDescriptorSubType;
00657 U8 bmAttributes;
00658 U8 bLockDelayUnits;
00659 U16 wLockDelay;
00660 }
00661 #if (defined __ICCAVR32__)
00662 #pragma pack()
00663 #endif
00664 S_usb_endpoint_audio_specific;
00665
00666
00668 typedef
00669 #if (defined __ICCAVR32__)
00670 #pragma pack(1)
00671 #endif
00672 struct
00673 #if (defined __GNUC__)
00674 __attribute__((__packed__))
00675 #endif
00676 {
00677 U8 bLength;
00678 U8 bDescriptorType;
00679 U8 bEndpointAddress;
00680 U8 bmAttributes;
00681 U16 wMaxPacketSize;
00682 U8 bInterval;
00683 U8 bRefresh;
00684 U8 bSynAddress;
00685 }
00686 #if (defined __ICCAVR32__)
00687 #pragma pack()
00688 #endif
00689 S_usb_endpoint_audio_descriptor;
00690
00691
00693 typedef
00694 #if (defined __ICCAVR32__)
00695 #pragma pack(1)
00696 #endif
00697 struct
00698 #if (defined __GNUC__)
00699 __attribute__((__packed__))
00700 #endif
00701 {
00702 U8 bLength;
00703 U8 bDescriptorType;
00704 U8 bEndpointAddress;
00705 U8 bmAttributes;
00706 U16 wMaxPacketSize;
00707 U8 bInterval;
00708 }
00709 #if (defined __ICCAVR32__)
00710 #pragma pack()
00711 #endif
00712 S_usb_endpoint_descriptor;
00713
00714
00716 typedef
00717 #if (defined __ICCAVR32__)
00718 #pragma pack(1)
00719 #endif
00720 struct
00721 #if (defined __GNUC__)
00722 __attribute__((__packed__))
00723 #endif
00724 {
00725 U8 bLength;
00726 U8 bDescriptorType;
00727 U16 wlangid;
00728 }
00729 #if (defined __ICCAVR32__)
00730 #pragma pack()
00731 #endif
00732 S_usb_language_id;
00733
00734
00735
00736
00738 typedef
00739 #if (defined __ICCAVR32__)
00740 #pragma pack(1)
00741 #endif
00742 struct
00743 #if (defined __GNUC__)
00744 __attribute__((__packed__))
00745 #endif
00746 {
00747 U8 bLength;
00748 U8 bDescriptorType;
00749 U16 wstring[USB_MN_LENGTH];
00750 }
00751 #if (defined __ICCAVR32__)
00752 #pragma pack()
00753 #endif
00754 S_usb_manufacturer_string_descriptor;
00755
00756
00757
00758
00760 typedef
00761 #if (defined __ICCAVR32__)
00762 #pragma pack(1)
00763 #endif
00764 struct
00765 #if (defined __GNUC__)
00766 __attribute__((__packed__))
00767 #endif
00768 {
00769 U8 bLength;
00770 U8 bDescriptorType;
00771 U16 wstring[USB_PN_LENGTH];
00772 }
00773 #if (defined __ICCAVR32__)
00774 #pragma pack()
00775 #endif
00776 S_usb_product_string_descriptor;
00777
00778
00779
00780
00782 typedef
00783 #if (defined __ICCAVR32__)
00784 #pragma pack(1)
00785 #endif
00786 struct
00787 #if (defined __GNUC__)
00788 __attribute__((__packed__))
00789 #endif
00790 {
00791 U8 bLength;
00792 U8 bDescriptorType;
00793 U16 wstring[USB_SN_LENGTH];
00794 }
00795 #if (defined __ICCAVR32__)
00796 #pragma pack()
00797 #endif
00798 S_usb_serial_number;
00799
00800
00801
00802
00803 typedef
00804 #if (defined __ICCAVR32__)
00805 #pragma pack(1)
00806 #endif
00807 struct
00808 #if (defined __GNUC__)
00809 __attribute__((__packed__))
00810 #endif
00811 {
00812 U8 bLength;
00813 U8 bDescriptorType;
00814 U16 bscHID;
00815 U8 bCountryCode;
00816 U8 bNumDescriptors;
00817 U8 bRDescriptorType;
00818 U16 wDescriptorLength;
00819 }
00820 #if (defined __ICCAVR32__)
00821 #pragma pack()
00822 #endif
00823 S_usb_hid_descriptor;
00824
00825
00826
00827
00828 typedef
00829 #if (defined __ICCAVR32__)
00830 #pragma pack(1)
00831 #endif
00832 struct
00833 #if (defined __GNUC__)
00834 __attribute__((__packed__))
00835 #endif
00836 {
00837
00838 S_usb_configuration_descriptor cfg;
00839 S_usb_interface_descriptor ifc;
00840 S_usb_ac_interface_descriptor audioac;
00841 S_usb_in_ter_descriptor speaker_in_ter;
00842 S_usb_feature_unit_descriptor_speaker speaker_fea_unit;
00843 S_usb_out_ter_descriptor speaker_out_ter;
00844 S_usb_in_ter_descriptor mic_in_ter;
00845 S_usb_feature_unit_descriptor_micro mic_fea_unit;
00846 S_usb_out_ter_descriptor mic_out_ter;
00847
00848
00849 S_usb_interface_descriptor speaker_as_alt0;
00850 S_usb_interface_descriptor speaker_as_alt1;
00851 S_usb_as_interface_descriptor speaker_g_as;
00852 S_usb_format_type_speaker speaker_format_type;
00853 S_usb_endpoint_audio_descriptor speaker_ep1;
00854 S_usb_endpoint_audio_specific speaker_ep1_s;
00855 S_usb_interface_descriptor mic_as_alt0;
00856 S_usb_interface_descriptor mic_as_alt1;
00857 S_usb_as_interface_descriptor mic_g_as;
00858 S_usb_format_type_microphone mic_format_type;
00859 S_usb_endpoint_audio_descriptor mic_ep1;
00860 S_usb_endpoint_audio_specific mic_ep1_s;
00861
00862
00863 S_usb_interface_descriptor ifc_kbd;
00864 S_usb_hid_descriptor hid_kbd;
00865 S_usb_endpoint_descriptor ep1_kbd;
00866 }
00867 #if (defined __ICCAVR32__)
00868 #pragma pack()
00869 #endif
00870 S_usb_user_configuration_descriptor;
00871
00872
00873 #endif // _USB_DESCRIPTORS_H_