12
12
* This software component is licensed by ST under Ultimate Liberty license
13
13
* SLA0044, the "License"; You may not use this file except in compliance with
14
14
* the License. You may obtain a copy of the License at:
15
- * http:// www.st.com/SLA0044
15
+ * www.st.com/SLA0044
16
16
*
17
17
******************************************************************************
18
18
*/
@@ -51,7 +51,8 @@ extern "C" {
51
51
*/
52
52
53
53
/* States for AUDIO State Machine */
54
- typedef enum {
54
+ typedef enum
55
+ {
55
56
AUDIO_INIT = 0 ,
56
57
AUDIO_IDLE ,
57
58
AUDIO_CS_REQUESTS ,
@@ -76,7 +77,8 @@ typedef enum {
76
77
}
77
78
AUDIO_StateTypeDef ;
78
79
79
- typedef enum {
80
+ typedef enum
81
+ {
80
82
AUDIO_REQ_INIT = 1 ,
81
83
AUDIO_REQ_IDLE ,
82
84
AUDIO_REQ_SET_DEFAULT_IN_INTERFACE ,
@@ -87,7 +89,8 @@ typedef enum {
87
89
}
88
90
AUDIO_ReqStateTypeDef ;
89
91
90
- typedef enum {
92
+ typedef enum
93
+ {
91
94
AUDIO_REQ_SET_VOLUME = 1 ,
92
95
AUDIO_REQ_SET_MUTE ,
93
96
AUDIO_REQ_GET_CURR_VOLUME ,
@@ -99,7 +102,8 @@ typedef enum {
99
102
}
100
103
AUDIO_CSReqStateTypeDef ;
101
104
102
- typedef enum {
105
+ typedef enum
106
+ {
103
107
AUDIO_PLAYBACK_INIT = 1 ,
104
108
AUDIO_PLAYBACK_SET_EP ,
105
109
AUDIO_PLAYBACK_SET_EP_FREQ ,
@@ -108,13 +112,15 @@ typedef enum {
108
112
}
109
113
AUDIO_PlayStateTypeDef ;
110
114
111
- typedef enum {
115
+ typedef enum
116
+ {
112
117
VOLUME_UP = 1 ,
113
118
VOLUME_DOWN = 2 ,
114
119
}
115
120
AUDIO_VolumeCtrlTypeDef ;
116
121
117
- typedef enum {
122
+ typedef enum
123
+ {
118
124
AUDIO_CONTROL_INIT = 1 ,
119
125
AUDIO_CONTROL_CHANGE ,
120
126
AUDIO_CONTROL_IDLE ,
@@ -124,21 +130,24 @@ typedef enum {
124
130
AUDIO_ControlStateTypeDef ;
125
131
126
132
127
- typedef enum {
133
+ typedef enum
134
+ {
128
135
AUDIO_DATA_START_OUT = 1 ,
129
136
AUDIO_DATA_OUT ,
130
137
}
131
138
AUDIO_ProcessingTypeDef ;
132
139
133
140
/* Structure for AUDIO process */
134
- typedef struct {
141
+ typedef struct
142
+ {
135
143
uint8_t Channels ;
136
144
uint8_t Bits ;
137
145
uint32_t SampleRate ;
138
146
}
139
147
AUDIO_FormatTypeDef ;
140
148
141
- typedef struct {
149
+ typedef struct
150
+ {
142
151
uint8_t Ep ;
143
152
uint16_t EpSize ;
144
153
uint8_t AltSettings ;
@@ -148,7 +157,8 @@ typedef struct {
148
157
}
149
158
AUDIO_STREAMING_IN_HandleTypeDef ;
150
159
151
- typedef struct {
160
+ typedef struct
161
+ {
152
162
uint8_t Ep ;
153
163
uint16_t EpSize ;
154
164
uint8_t AltSettings ;
@@ -159,7 +169,8 @@ typedef struct {
159
169
AUDIO_STREAMING_OUT_HandleTypeDef ;
160
170
161
171
162
- typedef struct {
172
+ typedef struct
173
+ {
163
174
uint8_t mute ;
164
175
uint32_t volumeMin ;
165
176
uint32_t volumeMax ;
@@ -168,7 +179,8 @@ typedef struct {
168
179
}
169
180
AUDIO_ControlAttributeTypeDef ;
170
181
171
- typedef struct {
182
+ typedef struct
183
+ {
172
184
173
185
uint8_t Ep ;
174
186
uint16_t EpSize ;
@@ -200,7 +212,8 @@ typedef struct {
200
212
}
201
213
AUDIO_InterfaceStreamPropTypeDef ;
202
214
203
- typedef struct {
215
+ typedef struct
216
+ {
204
217
205
218
uint8_t Ep ;
206
219
uint16_t EpSize ;
@@ -214,25 +227,26 @@ typedef struct {
214
227
AUDIO_InterfaceControlPropTypeDef ;
215
228
216
229
217
- #define AUDIO_MAX_AUDIO_STD_INTERFACE 0x05U
218
- #define AUDIO_MAX_FREQ_SUPPORTED 0x05U
219
- #define AUDIO_MAX_STREAMING_INTERFACE 0x05U
220
- #define AUDIO_MAX_NUM_IN_TERMINAL 0x04U
221
- #define AUDIO_MAX_NUM_OUT_TERMINAL 0x04U
222
- #define AUDIO_MAX_NUM_FEATURE_UNIT 0x04U
223
- #define AUDIO_MAX_NUM_MIXER_UNIT 0x04U
224
- #define AUDIO_MAX_NUM_SELECTOR_UNIT 0x04U
230
+ #define AUDIO_MAX_AUDIO_STD_INTERFACE 5U
231
+ #define AUDIO_MAX_FREQ_SUPPORTED 5U
232
+ #define AUDIO_MAX_STREAMING_INTERFACE 5U
233
+ #define AUDIO_MAX_NUM_IN_TERMINAL 4U
234
+ #define AUDIO_MAX_NUM_OUT_TERMINAL 4U
235
+ #define AUDIO_MAX_NUM_FEATURE_UNIT 4U
236
+ #define AUDIO_MAX_NUM_MIXER_UNIT 4U
237
+ #define AUDIO_MAX_NUM_SELECTOR_UNIT 4U
225
238
226
- #define HEADPHONE_SUPPORTED 0x01U
227
- #define MICROPHONE_SUPPORTED 0x02U
228
- #define HEADSET_SUPPORTED 0x03U
239
+ #define HEADPHONE_SUPPORTED 1U
240
+ #define MICROPHONE_SUPPORTED 2U
241
+ #define HEADSET_SUPPORTED 3U
229
242
230
243
#define AUDIO_MAX_SAMFREQ_NBR 5U
231
244
#define AUDIO_MAX_INTERFACE_NBR 5U
232
245
#define AUDIO_MAX_CONTROLS_NBR 5U
233
246
234
247
/*Class-Specific AS(Audio Streaming) Interface Descriptor*/
235
- typedef struct {
248
+ typedef struct
249
+ {
236
250
uint8_t bLength ;
237
251
uint8_t bDescriptorType ;
238
252
uint8_t bDescriptorSubtype ;
@@ -243,7 +257,8 @@ typedef struct {
243
257
AUDIO_ASGeneralDescTypeDef ;
244
258
245
259
/*Class-Specific AS(Audio Streaming) Format Type Descriptor*/
246
- typedef struct {
260
+ typedef struct
261
+ {
247
262
uint8_t bLength ;
248
263
uint8_t bDescriptorType ;
249
264
uint8_t bDescriptorSubtype ;
@@ -257,15 +272,17 @@ typedef struct {
257
272
AUDIO_ASFormatTypeDescTypeDef ;
258
273
259
274
/*Class-Specific AS(Audio Streaming) Interface Descriptor*/
260
- typedef struct {
275
+ typedef struct
276
+ {
261
277
AUDIO_ASGeneralDescTypeDef * GeneralDesc ;
262
278
AUDIO_ASFormatTypeDescTypeDef * FormatTypeDesc ;
263
279
}
264
280
AUDIO_ASDescTypeDef ;
265
281
266
282
/* 4.3.2 Class-Specific AC Interface Descriptor */
267
283
268
- typedef struct {
284
+ typedef struct
285
+ {
269
286
uint8_t bLength ;
270
287
uint8_t bDescriptorType ;
271
288
uint8_t bDescriptorSubtype ;
@@ -277,7 +294,8 @@ typedef struct {
277
294
AUDIO_HeaderDescTypeDef ;
278
295
279
296
/* 4.3.2.1 Input Terminal Descriptor */
280
- typedef struct {
297
+ typedef struct
298
+ {
281
299
uint8_t bLength ;
282
300
uint8_t bDescriptorType ;
283
301
uint8_t bDescriptorSubtype ;
@@ -292,7 +310,8 @@ typedef struct {
292
310
AUDIO_ITDescTypeDef ;
293
311
294
312
/* 4.3.2.2 Output Terminal Descriptor */
295
- typedef struct {
313
+ typedef struct
314
+ {
296
315
uint8_t bLength ;
297
316
uint8_t bDescriptorType ;
298
317
uint8_t bDescriptorSubtype ;
@@ -305,7 +324,8 @@ typedef struct {
305
324
AUDIO_OTDescTypeDef ;
306
325
307
326
/* 4.3.2.3 Feature Descriptor */
308
- typedef struct {
327
+ typedef struct
328
+ {
309
329
uint8_t bLength ;
310
330
uint8_t bDescriptorType ;
311
331
uint8_t bDescriptorSubtype ;
@@ -318,7 +338,8 @@ AUDIO_FeatureDescTypeDef;
318
338
319
339
320
340
/* 4.3.2.3 Feature Descriptor */
321
- typedef struct {
341
+ typedef struct
342
+ {
322
343
uint8_t bLength ;
323
344
uint8_t bDescriptorType ;
324
345
uint8_t bDescriptorSubtype ;
@@ -337,7 +358,8 @@ AUDIO_MixerDescTypeDef;
337
358
338
359
339
360
/* 4.3.2.3 Feature Descriptor */
340
- typedef struct {
361
+ typedef struct
362
+ {
341
363
uint8_t bLength ;
342
364
uint8_t bDescriptorType ;
343
365
uint8_t bDescriptorSubtype ;
@@ -349,7 +371,8 @@ typedef struct {
349
371
AUDIO_SelectorDescTypeDef ;
350
372
351
373
/*Class-Specific AC(Audio Control) Interface Descriptor*/
352
- typedef struct {
374
+ typedef struct
375
+ {
353
376
AUDIO_HeaderDescTypeDef * HeaderDesc ;
354
377
AUDIO_ITDescTypeDef * InputTerminalDesc [AUDIO_MAX_NUM_IN_TERMINAL ];
355
378
AUDIO_OTDescTypeDef * OutputTerminalDesc [AUDIO_MAX_NUM_OUT_TERMINAL ];
@@ -361,7 +384,8 @@ AUDIO_ACDescTypeDef;
361
384
362
385
/*Class-Specific AC : Global descriptor*/
363
386
364
- typedef struct {
387
+ typedef struct
388
+ {
365
389
AUDIO_ACDescTypeDef cs_desc ; /* Only one control descriptor*/
366
390
AUDIO_ASDescTypeDef as_desc [AUDIO_MAX_STREAMING_INTERFACE ];
367
391
@@ -375,7 +399,8 @@ typedef struct {
375
399
AUDIO_ClassSpecificDescTypedef ;
376
400
377
401
378
- typedef struct _AUDIO_Process {
402
+ typedef struct _AUDIO_Process
403
+ {
379
404
AUDIO_ReqStateTypeDef req_state ;
380
405
AUDIO_CSReqStateTypeDef cs_req_state ;
381
406
AUDIO_PlayStateTypeDef play_state ;
0 commit comments