| USBD ROM Stack 1.0 ROM based USB device stack

mw_usbd_audio.h
1 /***********************************************************************
2 * $Id:: mw_usbd_audio.h 165 2011-04-14 17:41:11Z usb10131 $
3 *
4 * Project: USB device ROM Stack
5 *
6 * Description:
7 * USB Audio Device Class Definitions.
8 *
9 ***********************************************************************
10 * Copyright(C) 2011, NXP Semiconductor
11 * All rights reserved.
12 *
13 * Software that is described herein is for illustrative purposes only
14 * which provides customers with programming information regarding the
15 * products. This software is supplied "AS IS" without any warranties.
16 * NXP Semiconductors assumes no responsibility or liability for the
17 * use of the software, conveys no license or title under any patent,
18 * copyright, or mask work right to the product. NXP Semiconductors
19 * reserves the right to make changes in the software without
20 * notification. NXP Semiconductors also make no representation or
21 * warranty that such application will be suitable for the specified
22 * use without further testing or modification.
23 **********************************************************************/
24 #ifndef __AUDIO_H__
25 #define __AUDIO_H__
26
27 /* Audio Interface Subclass Codes */
28 #define AUDIO_SUBCLASS_UNDEFINED 0x00
29 #define AUDIO_SUBCLASS_AUDIOCONTROL 0x01
30 #define AUDIO_SUBCLASS_AUDIOSTREAMING 0x02
31 #define AUDIO_SUBCLASS_MIDISTREAMING 0x03
32
33 /* Audio Interface Protocol Codes */
34 #define AUDIO_PROTOCOL_UNDEFINED 0x00
35
36 /* Audio Descriptor Types */
37 #define AUDIO_UNDEFINED_DESCRIPTOR_TYPE 0x20
38 #define AUDIO_DEVICE_DESCRIPTOR_TYPE 0x21
39 #define AUDIO_CONFIGURATION_DESCRIPTOR_TYPE 0x22
40 #define AUDIO_STRING_DESCRIPTOR_TYPE 0x23
41 #define AUDIO_INTERFACE_DESCRIPTOR_TYPE 0x24
42 #define AUDIO_ENDPOINT_DESCRIPTOR_TYPE 0x25
43
44 /* Audio Control Interface Descriptor Subtypes */
45 #define AUDIO_CONTROL_UNDEFINED 0x00
46 #define AUDIO_CONTROL_HEADER 0x01
47 #define AUDIO_CONTROL_INPUT_TERMINAL 0x02
48 #define AUDIO_CONTROL_OUTPUT_TERMINAL 0x03
49 #define AUDIO_CONTROL_MIXER_UNIT 0x04
50 #define AUDIO_CONTROL_SELECTOR_UNIT 0x05
51 #define AUDIO_CONTROL_FEATURE_UNIT 0x06
52 #define AUDIO_CONTROL_PROCESSING_UNIT 0x07
53 #define AUDIO_CONTROL_EXTENSION_UNIT 0x08
54
55 /* Audio Streaming Interface Descriptor Subtypes */
56 #define AUDIO_STREAMING_UNDEFINED 0x00
57 #define AUDIO_STREAMING_GENERAL 0x01
58 #define AUDIO_STREAMING_FORMAT_TYPE 0x02
59 #define AUDIO_STREAMING_FORMAT_SPECIFIC 0x03
60
61 /* Audio Endpoint Descriptor Subtypes */
62 #define AUDIO_ENDPOINT_UNDEFINED 0x00
63 #define AUDIO_ENDPOINT_GENERAL 0x01
64
65 /* Audio Descriptor Sizes */
66 #define AUDIO_CONTROL_INTERFACE_DESC_SZ(n) 0x08 + n
67 #define AUDIO_STREAMING_INTERFACE_DESC_SIZE 0x07
68 #define AUDIO_INPUT_TERMINAL_DESC_SIZE 0x0C
69 #define AUDIO_OUTPUT_TERMINAL_DESC_SIZE 0x09
70 #define AUDIO_MIXER_UNIT_DESC_SZ(p, n) 0x0A + p + n
71 #define AUDIO_SELECTOR_UNIT_DESC_SZ(p) 0x06 + p
72 #define AUDIO_FEATURE_UNIT_DESC_SZ(ch, n) 0x07 + (ch + 1) * n
73 #define AUDIO_PROCESSING_UNIT_DESC_SZ(p, n, x) 0x0D + p + n + x
74 #define AUDIO_EXTENSION_UNIT_DESC_SZ(p, n) 0x0D + p + n
75 #define AUDIO_STANDARD_ENDPOINT_DESC_SIZE 0x09
76 #define AUDIO_STREAMING_ENDPOINT_DESC_SIZE 0x07
77
78 /* Audio Processing Unit Process Types */
79 #define AUDIO_UNDEFINED_PROCESS 0x00
80 #define AUDIO_UP_DOWN_MIX_PROCESS 0x01
81 #define AUDIO_DOLBY_PROLOGIC_PROCESS 0x02
82 #define AUDIO_3D_STEREO_PROCESS 0x03
83 #define AUDIO_REVERBERATION_PROCESS 0x04
84 #define AUDIO_CHORUS_PROCESS 0x05
85 #define AUDIO_DYN_RANGE_COMP_PROCESS 0x06
86
87 /* Audio Request Codes */
88 #define AUDIO_REQUEST_UNDEFINED 0x00
89 #define AUDIO_REQUEST_SET_CUR 0x01
90 #define AUDIO_REQUEST_GET_CUR 0x81
91 #define AUDIO_REQUEST_SET_MIN 0x02
92 #define AUDIO_REQUEST_GET_MIN 0x82
93 #define AUDIO_REQUEST_SET_MAX 0x03
94 #define AUDIO_REQUEST_GET_MAX 0x83
95 #define AUDIO_REQUEST_SET_RES 0x04
96 #define AUDIO_REQUEST_GET_RES 0x84
97 #define AUDIO_REQUEST_SET_MEM 0x05
98 #define AUDIO_REQUEST_GET_MEM 0x85
99 #define AUDIO_REQUEST_GET_STAT 0xFF
100
101 /* Audio Control Selector Codes */
102 #define AUDIO_CONTROL_UNDEFINED 0x00 /* Common Selector */
103
104 /* Terminal Control Selectors */
105 #define AUDIO_COPY_PROTECT_CONTROL 0x01
106
107 /* Feature Unit Control Selectors */
108 #define AUDIO_MUTE_CONTROL 0x01
109 #define AUDIO_VOLUME_CONTROL 0x02
110 #define AUDIO_BASS_CONTROL 0x03
111 #define AUDIO_MID_CONTROL 0x04
112 #define AUDIO_TREBLE_CONTROL 0x05
113 #define AUDIO_GRAPHIC_EQUALIZER_CONTROL 0x06
114 #define AUDIO_AUTOMATIC_GAIN_CONTROL 0x07
115 #define AUDIO_DELAY_CONTROL 0x08
116 #define AUDIO_BASS_BOOST_CONTROL 0x09
117 #define AUDIO_LOUDNESS_CONTROL 0x0A
118
119 /* Processing Unit Control Selectors: */
120 #define AUDIO_ENABLE_CONTROL 0x01 /* Common Selector */
121 #define AUDIO_MODE_SELECT_CONTROL 0x02 /* Common Selector */
122
123 /* - Up/Down-mix Control Selectors */
124 /* AUDIO_ENABLE_CONTROL 0x01 Common Selector */
125 /* AUDIO_MODE_SELECT_CONTROL 0x02 Common Selector */
126
127 /* - Dolby Prologic Control Selectors */
128 /* AUDIO_ENABLE_CONTROL 0x01 Common Selector */
129 /* AUDIO_MODE_SELECT_CONTROL 0x02 Common Selector */
130
131 /* - 3D Stereo Extender Control Selectors */
132 /* AUDIO_ENABLE_CONTROL 0x01 Common Selector */
133 #define AUDIO_SPACIOUSNESS_CONTROL 0x02
134
135 /* - Reverberation Control Selectors */
136 /* AUDIO_ENABLE_CONTROL 0x01 Common Selector */
137 #define AUDIO_REVERB_LEVEL_CONTROL 0x02
138 #define AUDIO_REVERB_TIME_CONTROL 0x03
139 #define AUDIO_REVERB_FEEDBACK_CONTROL 0x04
140
141 /* - Chorus Control Selectors */
142 /* AUDIO_ENABLE_CONTROL 0x01 Common Selector */
143 #define AUDIO_CHORUS_LEVEL_CONTROL 0x02
144 #define AUDIO_SHORUS_RATE_CONTROL 0x03
145 #define AUDIO_CHORUS_DEPTH_CONTROL 0x04
146
147 /* - Dynamic Range Compressor Control Selectors */
148 /* AUDIO_ENABLE_CONTROL 0x01 Common Selector */
149 #define AUDIO_COMPRESSION_RATE_CONTROL 0x02
150 #define AUDIO_MAX_AMPL_CONTROL 0x03
151 #define AUDIO_THRESHOLD_CONTROL 0x04
152 #define AUDIO_ATTACK_TIME_CONTROL 0x05
153 #define AUDIO_RELEASE_TIME_CONTROL 0x06
154
155 /* Extension Unit Control Selectors */
156 /* AUDIO_ENABLE_CONTROL 0x01 Common Selector */
157
158 /* Endpoint Control Selectors */
159 #define AUDIO_SAMPLING_FREQ_CONTROL 0x01
160 #define AUDIO_PITCH_CONTROL 0x02
161
162 /* Audio Format Specific Control Selectors */
163
164 /* MPEG Control Selectors */
165 #define AUDIO_MPEG_CONTROL_UNDEFINED 0x00
166 #define AUDIO_MPEG_DUAL_CHANNEL_CONTROL 0x01
167 #define AUDIO_MPEG_SECOND_STEREO_CONTROL 0x02
168 #define AUDIO_MPEG_MULTILINGUAL_CONTROL 0x03
169 #define AUDIO_MPEG_DYN_RANGE_CONTROL 0x04
170 #define AUDIO_MPEG_SCALING_CONTROL 0x05
171 #define AUDIO_MPEG_HILO_SCALING_CONTROL 0x06
172
173 /* AC-3 Control Selectors */
174 #define AUDIO_AC3_CONTROL_UNDEFINED 0x00
175 #define AUDIO_AC3_MODE_CONTROL 0x01
176 #define AUDIO_AC3_DYN_RANGE_CONTROL 0x02
177 #define AUDIO_AC3_SCALING_CONTROL 0x03
178 #define AUDIO_AC3_HILO_SCALING_CONTROL 0x04
179
180 /* Audio Format Types */
181 #define AUDIO_FORMAT_TYPE_UNDEFINED 0x00
182 #define AUDIO_FORMAT_TYPE_I 0x01
183 #define AUDIO_FORMAT_TYPE_II 0x02
184 #define AUDIO_FORMAT_TYPE_III 0x03
185
186 /* Audio Format Type Descriptor Sizes */
187 #define AUDIO_FORMAT_TYPE_I_DESC_SZ(n) 0x08 + (n * 3)
188 #define AUDIO_FORMAT_TYPE_II_DESC_SZ(n) 0x09 + (n * 3)
189 #define AUDIO_FORMAT_TYPE_III_DESC_SZ(n) 0x08 + (n * 3)
190 #define AUDIO_FORMAT_MPEG_DESC_SIZE 0x09
191 #define AUDIO_FORMAT_AC3_DESC_SIZE 0x0A
192
193 /* Audio Data Format Codes */
194
195 /* Audio Data Format Type I Codes */
196 #define AUDIO_FORMAT_TYPE_I_UNDEFINED 0x0000
197 #define AUDIO_FORMAT_PCM 0x0001
198 #define AUDIO_FORMAT_PCM8 0x0002
199 #define AUDIO_FORMAT_IEEE_FLOAT 0x0003
200 #define AUDIO_FORMAT_ALAW 0x0004
201 #define AUDIO_FORMAT_MULAW 0x0005
202
203 /* Audio Data Format Type II Codes */
204 #define AUDIO_FORMAT_TYPE_II_UNDEFINED 0x1000
205 #define AUDIO_FORMAT_MPEG 0x1001
206 #define AUDIO_FORMAT_AC3 0x1002
207
208 /* Audio Data Format Type III Codes */
209 #define AUDIO_FORMAT_TYPE_III_UNDEFINED 0x2000
210 #define AUDIO_FORMAT_IEC1937_AC3 0x2001
211 #define AUDIO_FORMAT_IEC1937_MPEG1_L1 0x2002
212 #define AUDIO_FORMAT_IEC1937_MPEG1_L2_3 0x2003
213 #define AUDIO_FORMAT_IEC1937_MPEG2_NOEXT 0x2003
214 #define AUDIO_FORMAT_IEC1937_MPEG2_EXT 0x2004
215 #define AUDIO_FORMAT_IEC1937_MPEG2_L1_LS 0x2005
216 #define AUDIO_FORMAT_IEC1937_MPEG2_L2_3 0x2006
217
218 /* Predefined Audio Channel Configuration Bits */
219 #define AUDIO_CHANNEL_M 0x0000 /* Mono */
220 #define AUDIO_CHANNEL_L 0x0001 /* Left Front */
221 #define AUDIO_CHANNEL_R 0x0002 /* Right Front */
222 #define AUDIO_CHANNEL_C 0x0004 /* Center Front */
223 #define AUDIO_CHANNEL_LFE 0x0008 /* Low Freq. Enhance. */
224 #define AUDIO_CHANNEL_LS 0x0010 /* Left Surround */
225 #define AUDIO_CHANNEL_RS 0x0020 /* Right Surround */
226 #define AUDIO_CHANNEL_LC 0x0040 /* Left of Center */
227 #define AUDIO_CHANNEL_RC 0x0080 /* Right of Center */
228 #define AUDIO_CHANNEL_S 0x0100 /* Surround */
229 #define AUDIO_CHANNEL_SL 0x0200 /* Side Left */
230 #define AUDIO_CHANNEL_SR 0x0400 /* Side Right */
231 #define AUDIO_CHANNEL_T 0x0800 /* Top */
232
233 /* Feature Unit Control Bits */
234 #define AUDIO_CONTROL_MUTE 0x0001
235 #define AUDIO_CONTROL_VOLUME 0x0002
236 #define AUDIO_CONTROL_BASS 0x0004
237 #define AUDIO_CONTROL_MID 0x0008
238 #define AUDIO_CONTROL_TREBLE 0x0010
239 #define AUDIO_CONTROL_GRAPHIC_EQUALIZER 0x0020
240 #define AUDIO_CONTROL_AUTOMATIC_GAIN 0x0040
241 #define AUDIO_CONTROL_DEALY 0x0080
242 #define AUDIO_CONTROL_BASS_BOOST 0x0100
243 #define AUDIO_CONTROL_LOUDNESS 0x0200
244
245 /* Processing Unit Control Bits: */
246 #define AUDIO_CONTROL_ENABLE 0x0001 /* Common Bit */
247 #define AUDIO_CONTROL_MODE_SELECT 0x0002 /* Common Bit */
248
249 /* - Up/Down-mix Control Bits */
250 /* AUDIO_CONTROL_ENABLE 0x0001 Common Bit */
251 /* AUDIO_CONTROL_MODE_SELECT 0x0002 Common Bit */
252
253 /* - Dolby Prologic Control Bits */
254 /* AUDIO_CONTROL_ENABLE 0x0001 Common Bit */
255 /* AUDIO_CONTROL_MODE_SELECT 0x0002 Common Bit */
256
257 /* - 3D Stereo Extender Control Bits */
258 /* AUDIO_CONTROL_ENABLE 0x0001 Common Bit */
259 #define AUDIO_CONTROL_SPACIOUSNESS 0x0002
260
261 /* - Reverberation Control Bits */
262 /* AUDIO_CONTROL_ENABLE 0x0001 Common Bit */
263 #define AUDIO_CONTROL_REVERB_TYPE 0x0002
264 #define AUDIO_CONTROL_REVERB_LEVEL 0x0004
265 #define AUDIO_CONTROL_REVERB_TIME 0x0008
266 #define AUDIO_CONTROL_REVERB_FEEDBACK 0x0010
267
268 /* - Chorus Control Bits */
269 /* AUDIO_CONTROL_ENABLE 0x0001 Common Bit */
270 #define AUDIO_CONTROL_CHORUS_LEVEL 0x0002
271 #define AUDIO_CONTROL_SHORUS_RATE 0x0004
272 #define AUDIO_CONTROL_CHORUS_DEPTH 0x0008
273
274 /* - Dynamic Range Compressor Control Bits */
275 /* AUDIO_CONTROL_ENABLE 0x0001 Common Bit */
276 #define AUDIO_CONTROL_COMPRESSION_RATE 0x0002
277 #define AUDIO_CONTROL_MAX_AMPL 0x0004
278 #define AUDIO_CONTROL_THRESHOLD 0x0008
279 #define AUDIO_CONTROL_ATTACK_TIME 0x0010
280 #define AUDIO_CONTROL_RELEASE_TIME 0x0020
281
282 /* Extension Unit Control Bits */
283 /* AUDIO_CONTROL_ENABLE 0x0001 Common Bit */
284
285 /* Endpoint Control Bits */
286 #define AUDIO_CONTROL_SAMPLING_FREQ 0x01
287 #define AUDIO_CONTROL_PITCH 0x02
288 #define AUDIO_MAX_PACKETS_ONLY 0x80
289
290 /* Audio Terminal Types */
291
292 /* USB Terminal Types */
293 #define AUDIO_TERMINAL_USB_UNDEFINED 0x0100
294 #define AUDIO_TERMINAL_USB_STREAMING 0x0101
295 #define AUDIO_TERMINAL_USB_VENDOR_SPECIFIC 0x01FF
296
297 /* Input Terminal Types */
298 #define AUDIO_TERMINAL_INPUT_UNDEFINED 0x0200
299 #define AUDIO_TERMINAL_MICROPHONE 0x0201
300 #define AUDIO_TERMINAL_DESKTOP_MICROPHONE 0x0202
301 #define AUDIO_TERMINAL_PERSONAL_MICROPHONE 0x0203
302 #define AUDIO_TERMINAL_OMNI_DIR_MICROPHONE 0x0204
303 #define AUDIO_TERMINAL_MICROPHONE_ARRAY 0x0205
304 #define AUDIO_TERMINAL_PROCESSING_MIC_ARRAY 0x0206
305
306 /* Output Terminal Types */
307 #define AUDIO_TERMINAL_OUTPUT_UNDEFINED 0x0300
308 #define AUDIO_TERMINAL_SPEAKER 0x0301
309 #define AUDIO_TERMINAL_HEADPHONES 0x0302
310 #define AUDIO_TERMINAL_HEAD_MOUNTED_AUDIO 0x0303
311 #define AUDIO_TERMINAL_DESKTOP_SPEAKER 0x0304
312 #define AUDIO_TERMINAL_ROOM_SPEAKER 0x0305
313 #define AUDIO_TERMINAL_COMMUNICATION_SPEAKER 0x0306
314 #define AUDIO_TERMINAL_LOW_FREQ_SPEAKER 0x0307
315
316 /* Bi-directional Terminal Types */
317 #define AUDIO_TERMINAL_BIDIRECTIONAL_UNDEFINED 0x0400
318 #define AUDIO_TERMINAL_HANDSET 0x0401
319 #define AUDIO_TERMINAL_HEAD_MOUNTED_HANDSET 0x0402
320 #define AUDIO_TERMINAL_SPEAKERPHONE 0x0403
321 #define AUDIO_TERMINAL_SPEAKERPHONE_ECHOSUPRESS 0x0404
322 #define AUDIO_TERMINAL_SPEAKERPHONE_ECHOCANCEL 0x0405
323
324 /* Telephony Terminal Types */
325 #define AUDIO_TERMINAL_TELEPHONY_UNDEFINED 0x0500
326 #define AUDIO_TERMINAL_PHONE_LINE 0x0501
327 #define AUDIO_TERMINAL_TELEPHONE 0x0502
328 #define AUDIO_TERMINAL_DOWN_LINE_PHONE 0x0503
329
330 /* External Terminal Types */
331 #define AUDIO_TERMINAL_EXTERNAL_UNDEFINED 0x0600
332 #define AUDIO_TERMINAL_ANALOG_CONNECTOR 0x0601
333 #define AUDIO_TERMINAL_DIGITAL_AUDIO_INTERFACE 0x0602
334 #define AUDIO_TERMINAL_LINE_CONNECTOR 0x0603
335 #define AUDIO_TERMINAL_LEGACY_AUDIO_CONNECTOR 0x0604
336 #define AUDIO_TERMINAL_SPDIF_INTERFACE 0x0605
337 #define AUDIO_TERMINAL_1394_DA_STREAM 0x0606
338 #define AUDIO_TERMINAL_1394_DA_STREAM_TRACK 0x0607
339
340 /* Embedded Function Terminal Types */
341 #define AUDIO_TERMINAL_EMBEDDED_UNDEFINED 0x0700
342 #define AUDIO_TERMINAL_CALIBRATION_NOISE 0x0701
343 #define AUDIO_TERMINAL_EQUALIZATION_NOISE 0x0702
344 #define AUDIO_TERMINAL_CD_PLAYER 0x0703
345 #define AUDIO_TERMINAL_DAT 0x0704
346 #define AUDIO_TERMINAL_DCC 0x0705
347 #define AUDIO_TERMINAL_MINI_DISK 0x0706
348 #define AUDIO_TERMINAL_ANALOG_TAPE 0x0707
349 #define AUDIO_TERMINAL_PHONOGRAPH 0x0708
350 #define AUDIO_TERMINAL_VCR_AUDIO 0x0709
351 #define AUDIO_TERMINAL_VIDEO_DISC_AUDIO 0x070A
352 #define AUDIO_TERMINAL_DVD_AUDIO 0x070B
353 #define AUDIO_TERMINAL_TV_TUNER_AUDIO 0x070C
354 #define AUDIO_TERMINAL_SATELLITE_RECEIVER_AUDIO 0x070D
355 #define AUDIO_TERMINAL_CABLE_TUNER_AUDIO 0x070E
356 #define AUDIO_TERMINAL_DSS_AUDIO 0x070F
357 #define AUDIO_TERMINAL_RADIO_RECEIVER 0x0710
358 #define AUDIO_TERMINAL_RADIO_TRANSMITTER 0x0711
359 #define AUDIO_TERMINAL_MULTI_TRACK_RECORDER 0x0712
360 #define AUDIO_TERMINAL_SYNTHESIZER 0x0713
361
362 #endif /* __AUDIO_H__ */