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 #if (BOARD!=EVK1105) || (DEFAULT_DACS!=AUDIO_MIXER_DAC_AIC23B)
00228 # define IN_FORMAT_LSBYTE_SAMPLE_FREQ 0x1F40 // 0x001F40=8 kHz Sample frequency
00229 #else
00230 # define IN_FORMAT_LSBYTE_SAMPLE_FREQ 0xAC44 // 0x00AC44=44.1 kHz Sample frequency
00231 #endif
00232 #define IN_FORMAT_MSBYTE_SAMPLE_FREQ 0x00 // MsByte of 0x001F40
00233
00234 #define AUDIO_EP_IN_ATRIBUTES 0x00 // No sampling freq, no pitch, no pading
00235 #define AUDIO_EP_IN_DELAY_UNIT 0x00 // Unused
00236 #define AUDIO_EP_IN_LOCK_DELAY 0x0000 // Unused
00237
00238
00239 #define INTERFACE_NB_KBD 3 // Interface's number
00240 #define ALTERNATE_KBD 0
00241 #define NB_ENDPOINT_KBD 1
00242 #define INTERFACE_CLASS_KBD HID_CLASS // HID Class
00243 #define INTERFACE_SUB_CLASS_KBD NO_SUBCLASS
00244 #define INTERFACE_PROTOCOL_KBD KEYBOARD_PROTOCOL
00245 #define INTERFACE_INDEX_KBD 0
00246
00247
00248 #define ENDPOINT_NB_KBD (EP_KBD_IN | USB_ENDPOINT_IN)
00249 #define EP_ATTRIBUTES_KBD 0x03 // BULK = 0x02, INTERUPT = 0x03
00250 #define EP_IN_LENGTH_KBD 8
00251 #define EP_SIZE_KBD EP_IN_LENGTH_KBD
00252 #define EP_INTERVAL_KBD 0x02 // Interrupt polling interval from host
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262 #define LANG_ID 0x00
00263 #define DEVICE_STATUS BUS_POWERED
00264 #define INTERFACE_STATUS 0x00 // TBD
00265
00266
00267
00268
00269
00270
00271 #define USB_MN_LENGTH 5
00272 #define USB_MANUFACTURER_NAME \
00273 {\
00274 Usb_unicode('A'),\
00275 Usb_unicode('T'),\
00276 Usb_unicode('M'),\
00277 Usb_unicode('E'),\
00278 Usb_unicode('L') \
00279 }
00280
00281 #define USB_PN_LENGTH 20
00282 #define USB_PRODUCT_NAME \
00283 {\
00284 Usb_unicode('A')\
00285 ,Usb_unicode('V') \
00286 ,Usb_unicode('R') \
00287 , Usb_unicode('3')\
00288 , Usb_unicode('2')\
00289 ,Usb_unicode(' ') \
00290 ,Usb_unicode('U') \
00291 , Usb_unicode('C')\
00292 , Usb_unicode('3')\
00293 ,Usb_unicode(' ') \
00294 ,Usb_unicode('A') \
00295 ,Usb_unicode('U') \
00296 ,Usb_unicode('D') \
00297 ,Usb_unicode('I') \
00298 ,Usb_unicode('O') \
00299 ,Usb_unicode(' ') \
00300 ,Usb_unicode('D') \
00301 ,Usb_unicode('E') \
00302 ,Usb_unicode('M') \
00303 ,Usb_unicode('O') \
00304 }
00305
00306 #define USB_SN_LENGTH 13
00307 #define USB_SERIAL_NUMBER \
00308 {\
00309 Usb_unicode('1'),\
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('0'),\
00318 Usb_unicode('.'),\
00319 Usb_unicode('0'),\
00320 Usb_unicode('.'),\
00321 Usb_unicode('A') \
00322 }
00323
00324 #define AUDIO_CHANNEL_NAME \
00325 { Usb_unicode('A') \
00326 , Usb_unicode('T') \
00327 , Usb_unicode('M') \
00328 , Usb_unicode('E') \
00329 , Usb_unicode('L') \
00330 }
00331
00332 #define LANGUAGE_ID 0x0409
00333
00334
00336 typedef
00337 #if (defined __ICCAVR32__)
00338 #pragma pack(1)
00339 #endif
00340 struct
00341 #if (defined __GNUC__)
00342 __attribute__((__packed__))
00343 #endif
00344 {
00345 U8 bmRequestType;
00346 U8 bRequest;
00347 U16 wValue;
00348 U16 wIndex;
00349 U16 wLength;
00350 }
00351 #if (defined __ICCAVR32__)
00352 #pragma pack()
00353 #endif
00354 S_UsbRequest;
00355
00356
00358 typedef
00359 #if (defined __ICCAVR32__)
00360 #pragma pack(1)
00361 #endif
00362 struct
00363 #if (defined __GNUC__)
00364 __attribute__((__packed__))
00365 #endif
00366 {
00367 U8 bLength;
00368 U8 bDescriptorType;
00369 U16 bscUSB;
00370 U8 bDeviceClass;
00371 U8 bDeviceSubClass;
00372 U8 bDeviceProtocol;
00373 U8 bMaxPacketSize0;
00374 U16 idVendor;
00375 U16 idProduct;
00376 U16 bcdDevice;
00377 U8 iManufacturer;
00378 U8 iProduct;
00379 U8 iSerialNumber;
00380 U8 bNumConfigurations;
00381 }
00382 #if (defined __ICCAVR32__)
00383 #pragma pack()
00384 #endif
00385 S_usb_device_descriptor;
00386
00387
00389 typedef
00390 #if (defined __ICCAVR32__)
00391 #pragma pack(1)
00392 #endif
00393 struct
00394 #if (defined __GNUC__)
00395 __attribute__((__packed__))
00396 #endif
00397 {
00398 U8 bLength;
00399 U8 bDescriptorType;
00400 U16 wTotalLength;
00401 U8 bNumInterfaces;
00402 U8 bConfigurationValue;
00403 U8 iConfiguration;
00404 U8 bmAttributes;
00405 U8 MaxPower;
00406 }
00407 #if (defined __ICCAVR32__)
00408 #pragma pack()
00409 #endif
00410 S_usb_configuration_descriptor;
00411
00412
00414 typedef
00415 #if (defined __ICCAVR32__)
00416 #pragma pack(1)
00417 #endif
00418 struct
00419 #if (defined __GNUC__)
00420 __attribute__((__packed__))
00421 #endif
00422 {
00423 U8 bLength;
00424 U8 bDescriptorType;
00425 U8 bInterfaceNumber;
00426 U8 bAlternateSetting;
00427 U8 bNumEndpoints;
00428 U8 bInterfaceClass;
00429 U8 bInterfaceSubClass;
00430 U8 bInterfaceProtocol;
00431 U8 iInterface;
00432 }
00433 #if (defined __ICCAVR32__)
00434 #pragma pack()
00435 #endif
00436 S_usb_interface_descriptor;
00437
00438
00441 typedef
00442 #if (defined __ICCAVR32__)
00443 #pragma pack(1)
00444 #endif
00445 struct
00446 #if (defined __GNUC__)
00447 __attribute__((__packed__))
00448 #endif
00449 {
00450 U8 bLength;
00451 U8 bDescriptorType;
00452 U8 bDescritorSubtype;
00453 U16 bcdADC;
00454 U16 wTotalLength;
00455 U8 bInCollection;
00456 U8 baInterface1;
00457 U8 baInterface2;
00458 }
00459 #if (defined __ICCAVR32__)
00460 #pragma pack()
00461 #endif
00462 S_usb_ac_interface_descriptor;
00463
00464
00466 typedef
00467 #if (defined __ICCAVR32__)
00468 #pragma pack(1)
00469 #endif
00470 struct
00471 #if (defined __GNUC__)
00472 __attribute__((__packed__))
00473 #endif
00474 {
00475 U8 bLenght;
00476 U8 bDescriptorType;
00477 U8 bDescriptorSubType;
00478 U8 bTerminalID;
00479 U16 wTerminalType;
00480 U8 bAssocTerminal;
00481 U8 bNrChannels;
00482 U16 wChannelConfig;
00483 U8 iChannelNames;
00484 U8 iTerminal;
00485 }
00486 #if (defined __ICCAVR32__)
00487 #pragma pack()
00488 #endif
00489 S_usb_in_ter_descriptor;
00490
00491
00493 typedef
00494 #if (defined __ICCAVR32__)
00495 #pragma pack(1)
00496 #endif
00497 struct
00498 #if (defined __GNUC__)
00499 __attribute__((__packed__))
00500 #endif
00501 {
00502 U8 bLenght;
00503 U8 bDescriptorType;
00504 U8 bDescriptorSubType;
00505 U8 bUnitID;
00506 U8 bSourceID;
00507 U8 bControSize;
00508 U8 bmaControlMaster;
00509 U8 bmaControlCh1;
00510 }
00511 #if (defined __ICCAVR32__)
00512 #pragma pack()
00513 #endif
00514 S_usb_feature_unit_descriptor_speaker;
00515
00517 typedef
00518 #if (defined __ICCAVR32__)
00519 #pragma pack(1)
00520 #endif
00521 struct
00522 #if (defined __GNUC__)
00523 __attribute__((__packed__))
00524 #endif
00525 {
00526 U8 bLenght;
00527 U8 bDescriptorType;
00528 U8 bDescriptorSubType;
00529 U8 bUnitID;
00530 U8 bSourceID;
00531 U8 bControSize;
00532 U8 bmaControlMaster;
00533 U8 bmaControlCh1;
00534 }
00535 #if (defined __ICCAVR32__)
00536 #pragma pack()
00537 #endif
00538 S_usb_feature_unit_descriptor_micro;
00539
00541 typedef
00542 #if (defined __ICCAVR32__)
00543 #pragma pack(1)
00544 #endif
00545 struct
00546 #if (defined __GNUC__)
00547 __attribute__((__packed__))
00548 #endif
00549 {
00550 U8 bLenght;
00551 U8 bDescriptorType;
00552 U8 bDescriptorSubType;
00553 U8 bTerminalID;
00554 U16 wTerminalType;
00555 U8 bAssocTerminal;
00556 U8 bSourceID;
00557 U8 iTerminal;
00558 }
00559 #if (defined __ICCAVR32__)
00560 #pragma pack()
00561 #endif
00562 S_usb_out_ter_descriptor;
00563
00565 typedef
00566 #if (defined __ICCAVR32__)
00567 #pragma pack(1)
00568 #endif
00569 struct
00570 #if (defined __GNUC__)
00571 __attribute__((__packed__))
00572 #endif
00573 {
00574 U8 bLenght;
00575 U8 bDescriptorType;
00576 U8 bDescriptorSubType;
00577 U8 bTerminalLink;
00578 U8 bDelay;
00579 U16 wFormatTag;
00580 }
00581 #if (defined __ICCAVR32__)
00582 #pragma pack()
00583 #endif
00584 S_usb_as_interface_descriptor;
00585
00587 typedef
00588 #if (defined __ICCAVR32__)
00589 #pragma pack(1)
00590 #endif
00591 struct
00592 #if (defined __GNUC__)
00593 __attribute__((__packed__))
00594 #endif
00595 {
00596 U8 bLenght;
00597 U8 bDescriptorType;
00598 U8 bDescriptorSubType;
00599 U8 bFormatType;
00600 U8 bNrChannels;
00601 U8 bSubFrameSize;
00602 U8 bBitResolution;
00603 U8 bSampleFreqType;
00604 #if (defined USB_RESYNC_METHOD) && ((USB_RESYNC_METHOD == USB_RESYNC_METHOD_SOFT_ADD_DEL_SAMPLES) || (USB_RESYNC_METHOD == USB_RESYNC_METHOD_SOFT_ADAPTIF_SRC))
00605 U16 wLsbyteiSamFreq;
00606 U8 bMsbyteiSamFreq;
00607 #else // USB_RESYNC_METHOD_EXT_CLOCK_SYNTHESIZER
00608 U16 wLsbyteiSamFreq_1;
00609 U8 bMsbyteiSamFreq_1;
00610 U16 wLsbyteiSamFreq_2;
00611 U8 bMsbyteiSamFreq_2;
00612 U16 wLsbyteiSamFreq_3;
00613 U8 bMsbyteiSamFreq_3;
00614 #endif
00615 }
00616 #if (defined __ICCAVR32__)
00617 #pragma pack()
00618 #endif
00619 S_usb_format_type_speaker;
00620
00621
00622 typedef
00623 #if (defined __ICCAVR32__)
00624 #pragma pack(1)
00625 #endif
00626 struct
00627 #if (defined __GNUC__)
00628 __attribute__((__packed__))
00629 #endif
00630 {
00631 U8 bLenght;
00632 U8 bDescriptorType;
00633 U8 bDescriptorSubType;
00634 U8 bFormatType;
00635 U8 bNrChannels;
00636 U8 bSubFrameSize;
00637 U8 bBitResolution;
00638 U8 bSampleFreqType;
00639 U16 wLsbyteiSamFreq;
00640 U8 bMsbyteiSamFreq;
00641 }
00642 #if (defined __ICCAVR32__)
00643 #pragma pack()
00644 #endif
00645 S_usb_format_type_microphone;
00646
00647
00649 typedef
00650 #if (defined __ICCAVR32__)
00651 #pragma pack(1)
00652 #endif
00653 struct
00654 #if (defined __GNUC__)
00655 __attribute__((__packed__))
00656 #endif
00657 {
00658 U8 bLenght;
00659 U8 bDescriptorType;
00660 U8 bDescriptorSubType;
00661 U8 bmAttributes;
00662 U8 bLockDelayUnits;
00663 U16 wLockDelay;
00664 }
00665 #if (defined __ICCAVR32__)
00666 #pragma pack()
00667 #endif
00668 S_usb_endpoint_audio_specific;
00669
00670
00672 typedef
00673 #if (defined __ICCAVR32__)
00674 #pragma pack(1)
00675 #endif
00676 struct
00677 #if (defined __GNUC__)
00678 __attribute__((__packed__))
00679 #endif
00680 {
00681 U8 bLength;
00682 U8 bDescriptorType;
00683 U8 bEndpointAddress;
00684 U8 bmAttributes;
00685 U16 wMaxPacketSize;
00686 U8 bInterval;
00687 U8 bRefresh;
00688 U8 bSynAddress;
00689 }
00690 #if (defined __ICCAVR32__)
00691 #pragma pack()
00692 #endif
00693 S_usb_endpoint_audio_descriptor;
00694
00695
00697 typedef
00698 #if (defined __ICCAVR32__)
00699 #pragma pack(1)
00700 #endif
00701 struct
00702 #if (defined __GNUC__)
00703 __attribute__((__packed__))
00704 #endif
00705 {
00706 U8 bLength;
00707 U8 bDescriptorType;
00708 U8 bEndpointAddress;
00709 U8 bmAttributes;
00710 U16 wMaxPacketSize;
00711 U8 bInterval;
00712 }
00713 #if (defined __ICCAVR32__)
00714 #pragma pack()
00715 #endif
00716 S_usb_endpoint_descriptor;
00717
00718
00720 typedef
00721 #if (defined __ICCAVR32__)
00722 #pragma pack(1)
00723 #endif
00724 struct
00725 #if (defined __GNUC__)
00726 __attribute__((__packed__))
00727 #endif
00728 {
00729 U8 bLength;
00730 U8 bDescriptorType;
00731 U16 wlangid;
00732 }
00733 #if (defined __ICCAVR32__)
00734 #pragma pack()
00735 #endif
00736 S_usb_language_id;
00737
00738
00739
00740
00742 typedef
00743 #if (defined __ICCAVR32__)
00744 #pragma pack(1)
00745 #endif
00746 struct
00747 #if (defined __GNUC__)
00748 __attribute__((__packed__))
00749 #endif
00750 {
00751 U8 bLength;
00752 U8 bDescriptorType;
00753 U16 wstring[USB_MN_LENGTH];
00754 }
00755 #if (defined __ICCAVR32__)
00756 #pragma pack()
00757 #endif
00758 S_usb_manufacturer_string_descriptor;
00759
00760
00761
00762
00764 typedef
00765 #if (defined __ICCAVR32__)
00766 #pragma pack(1)
00767 #endif
00768 struct
00769 #if (defined __GNUC__)
00770 __attribute__((__packed__))
00771 #endif
00772 {
00773 U8 bLength;
00774 U8 bDescriptorType;
00775 U16 wstring[USB_PN_LENGTH];
00776 }
00777 #if (defined __ICCAVR32__)
00778 #pragma pack()
00779 #endif
00780 S_usb_product_string_descriptor;
00781
00782
00783
00784
00786 typedef
00787 #if (defined __ICCAVR32__)
00788 #pragma pack(1)
00789 #endif
00790 struct
00791 #if (defined __GNUC__)
00792 __attribute__((__packed__))
00793 #endif
00794 {
00795 U8 bLength;
00796 U8 bDescriptorType;
00797 U16 wstring[USB_SN_LENGTH];
00798 }
00799 #if (defined __ICCAVR32__)
00800 #pragma pack()
00801 #endif
00802 S_usb_serial_number;
00803
00804
00805
00806
00807 typedef
00808 #if (defined __ICCAVR32__)
00809 #pragma pack(1)
00810 #endif
00811 struct
00812 #if (defined __GNUC__)
00813 __attribute__((__packed__))
00814 #endif
00815 {
00816 U8 bLength;
00817 U8 bDescriptorType;
00818 U16 bscHID;
00819 U8 bCountryCode;
00820 U8 bNumDescriptors;
00821 U8 bRDescriptorType;
00822 U16 wDescriptorLength;
00823 }
00824 #if (defined __ICCAVR32__)
00825 #pragma pack()
00826 #endif
00827 S_usb_hid_descriptor;
00828
00829
00830
00831
00832 typedef
00833 #if (defined __ICCAVR32__)
00834 #pragma pack(1)
00835 #endif
00836 struct
00837 #if (defined __GNUC__)
00838 __attribute__((__packed__))
00839 #endif
00840 {
00841
00842 S_usb_configuration_descriptor cfg;
00843 S_usb_interface_descriptor ifc;
00844 S_usb_ac_interface_descriptor audioac;
00845 S_usb_in_ter_descriptor speaker_in_ter;
00846 S_usb_feature_unit_descriptor_speaker speaker_fea_unit;
00847 S_usb_out_ter_descriptor speaker_out_ter;
00848 S_usb_in_ter_descriptor mic_in_ter;
00849 S_usb_feature_unit_descriptor_micro mic_fea_unit;
00850 S_usb_out_ter_descriptor mic_out_ter;
00851
00852
00853 S_usb_interface_descriptor speaker_as_alt0;
00854 S_usb_interface_descriptor speaker_as_alt1;
00855 S_usb_as_interface_descriptor speaker_g_as;
00856 S_usb_format_type_speaker speaker_format_type;
00857 S_usb_endpoint_audio_descriptor speaker_ep1;
00858 S_usb_endpoint_audio_specific speaker_ep1_s;
00859 S_usb_interface_descriptor mic_as_alt0;
00860 S_usb_interface_descriptor mic_as_alt1;
00861 S_usb_as_interface_descriptor mic_g_as;
00862 S_usb_format_type_microphone mic_format_type;
00863 S_usb_endpoint_audio_descriptor mic_ep1;
00864 S_usb_endpoint_audio_specific mic_ep1_s;
00865
00866
00867 S_usb_interface_descriptor ifc_kbd;
00868 S_usb_hid_descriptor hid_kbd;
00869 S_usb_endpoint_descriptor ep1_kbd;
00870 }
00871 #if (defined __ICCAVR32__)
00872 #pragma pack()
00873 #endif
00874 S_usb_user_configuration_descriptor;
00875
00876
00877 #endif // _USB_DESCRIPTORS_H_