6
6
******************************************************************************
7
7
* @attention
8
8
*
9
- * <h2><center>© Copyright (c) 2015 STMicroelectronics.
10
- * All rights reserved.</center></h2>
9
+ * Copyright (c) 2015 STMicroelectronics.
10
+ * All rights reserved.
11
11
*
12
- * This software component is licensed by ST under Ultimate Liberty license
13
- * SLA0044, the "License"; You may not use this file except in compliance with
14
- * the License. You may obtain a copy of the License at:
15
- * www.st.com/SLA0044
12
+ * This software is licensed under terms that can be found in the LICENSE file
13
+ * in the root directory of this software component.
14
+ * If no LICENSE file comes with this software, it is provided AS-IS.
16
15
*
17
16
******************************************************************************
18
17
*/
@@ -58,7 +57,10 @@ extern "C" {
58
57
#define AUDIO_FS_BINTERVAL 0x01U
59
58
#endif /* AUDIO_FS_BINTERVAL */
60
59
60
+ #ifndef AUDIO_OUT_EP
61
61
#define AUDIO_OUT_EP 0x01U
62
+ #endif /* AUDIO_OUT_EP */
63
+
62
64
#define USB_AUDIO_CONFIG_DESC_SIZ 0x6DU
63
65
#define AUDIO_INTERFACE_DESC_SIZE 0x09U
64
66
#define USB_AUDIO_DESC_SIZ 0x09U
@@ -167,6 +169,115 @@ typedef struct
167
169
int8_t (* PeriodicTC )(uint8_t * pbuf , uint32_t size , uint8_t cmd );
168
170
int8_t (* GetState )(void );
169
171
} USBD_AUDIO_ItfTypeDef ;
172
+
173
+ /*
174
+ * Audio Class specification release 1.0
175
+ */
176
+
177
+ /* Table 4-2: Class-Specific AC Interface Header Descriptor */
178
+ typedef struct
179
+ {
180
+ uint8_t bLength ;
181
+ uint8_t bDescriptorType ;
182
+ uint8_t bDescriptorSubtype ;
183
+ uint16_t bcdADC ;
184
+ uint16_t wTotalLength ;
185
+ uint8_t bInCollection ;
186
+ uint8_t baInterfaceNr ;
187
+ } __PACKED USBD_SpeakerIfDescTypeDef ;
188
+
189
+ /* Table 4-3: Input Terminal Descriptor */
190
+ typedef struct
191
+ {
192
+ uint8_t bLength ;
193
+ uint8_t bDescriptorType ;
194
+ uint8_t bDescriptorSubtype ;
195
+ uint8_t bTerminalID ;
196
+ uint16_t wTerminalType ;
197
+ uint8_t bAssocTerminal ;
198
+ uint8_t bNrChannels ;
199
+ uint16_t wChannelConfig ;
200
+ uint8_t iChannelNames ;
201
+ uint8_t iTerminal ;
202
+ } __PACKED USBD_SpeakerInDescTypeDef ;
203
+
204
+ /* USB Speaker Audio Feature Unit Descriptor */
205
+ typedef struct
206
+ {
207
+ uint8_t bLength ;
208
+ uint8_t bDescriptorType ;
209
+ uint8_t bDescriptorSubtype ;
210
+ uint8_t bUnitID ;
211
+ uint8_t bSourceID ;
212
+ uint8_t bControlSize ;
213
+ uint16_t bmaControls ;
214
+ uint8_t iTerminal ;
215
+ } __PACKED USBD_SpeakerFeatureDescTypeDef ;
216
+
217
+ /* Table 4-4: Output Terminal Descriptor */
218
+ typedef struct
219
+ {
220
+ uint8_t bLength ;
221
+ uint8_t bDescriptorType ;
222
+ uint8_t bDescriptorSubtype ;
223
+ uint8_t bTerminalID ;
224
+ uint16_t wTerminalType ;
225
+ uint8_t bAssocTerminal ;
226
+ uint8_t bSourceID ;
227
+ uint8_t iTerminal ;
228
+ } __PACKED USBD_SpeakerOutDescTypeDef ;
229
+
230
+ /* Table 4-19: Class-Specific AS Interface Descriptor */
231
+ typedef struct
232
+ {
233
+ uint8_t bLength ;
234
+ uint8_t bDescriptorType ;
235
+ uint8_t bDescriptorSubtype ;
236
+ uint8_t bTerminalLink ;
237
+ uint8_t bDelay ;
238
+ uint16_t wFormatTag ;
239
+ } __PACKED USBD_SpeakerStreamIfDescTypeDef ;
240
+
241
+ /* USB Speaker Audio Type III Format Interface Descriptor */
242
+ typedef struct
243
+ {
244
+ uint8_t bLength ;
245
+ uint8_t bDescriptorType ;
246
+ uint8_t bDescriptorSubtype ;
247
+ uint8_t bFormatType ;
248
+ uint8_t bNrChannels ;
249
+ uint8_t bSubFrameSize ;
250
+ uint8_t bBitResolution ;
251
+ uint8_t bSamFreqType ;
252
+ uint8_t tSamFreq2 ;
253
+ uint8_t tSamFreq1 ;
254
+ uint8_t tSamFreq0 ;
255
+ } USBD_SpeakerIIIFormatIfDescTypeDef ;
256
+
257
+ /* Table 4-17: Standard AC Interrupt Endpoint Descriptor */
258
+ typedef struct
259
+ {
260
+ uint8_t bLength ;
261
+ uint8_t bDescriptorType ;
262
+ uint8_t bEndpointAddress ;
263
+ uint8_t bmAttributes ;
264
+ uint16_t wMaxPacketSize ;
265
+ uint8_t bInterval ;
266
+ uint8_t bRefresh ;
267
+ uint8_t bSynchAddress ;
268
+ } __PACKED USBD_SpeakerEndDescTypeDef ;
269
+
270
+ /* Table 4-21: Class-Specific AS Isochronous Audio Data Endpoint Descriptor */
271
+ typedef struct
272
+ {
273
+ uint8_t bLength ;
274
+ uint8_t bDescriptorType ;
275
+ uint8_t bDescriptor ;
276
+ uint8_t bmAttributes ;
277
+ uint8_t bLockDelayUnits ;
278
+ uint16_t wLockDelay ;
279
+ } __PACKED USBD_SpeakerEndStDescTypeDef ;
280
+
170
281
/**
171
282
* @}
172
283
*/
@@ -198,6 +309,11 @@ uint8_t USBD_AUDIO_RegisterInterface(USBD_HandleTypeDef *pdev,
198
309
USBD_AUDIO_ItfTypeDef * fops );
199
310
200
311
void USBD_AUDIO_Sync (USBD_HandleTypeDef * pdev , AUDIO_OffsetTypeDef offset );
312
+
313
+ #ifdef USE_USBD_COMPOSITE
314
+ uint32_t USBD_AUDIO_GetEpPcktSze (USBD_HandleTypeDef * pdev , uint8_t If , uint8_t Ep );
315
+ #endif /* USE_USBD_COMPOSITE */
316
+
201
317
/**
202
318
* @}
203
319
*/
@@ -214,5 +330,3 @@ void USBD_AUDIO_Sync(USBD_HandleTypeDef *pdev, AUDIO_OffsetTypeDef offset);
214
330
/**
215
331
* @}
216
332
*/
217
-
218
- /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
0 commit comments