1212 * This software component is licensed by ST under Ultimate Liberty license
1313 * SLA0044, the "License"; You may not use this file except in compliance with
1414 * the License. You may obtain a copy of the License at:
15- * http:// www.st.com/SLA0044
15+ * www.st.com/SLA0044
1616 *
1717 ******************************************************************************
1818 */
@@ -51,7 +51,8 @@ extern "C" {
5151 */
5252
5353/* States for AUDIO State Machine */
54- typedef enum {
54+ typedef enum
55+ {
5556 AUDIO_INIT = 0 ,
5657 AUDIO_IDLE ,
5758 AUDIO_CS_REQUESTS ,
@@ -76,7 +77,8 @@ typedef enum {
7677}
7778AUDIO_StateTypeDef ;
7879
79- typedef enum {
80+ typedef enum
81+ {
8082 AUDIO_REQ_INIT = 1 ,
8183 AUDIO_REQ_IDLE ,
8284 AUDIO_REQ_SET_DEFAULT_IN_INTERFACE ,
@@ -87,7 +89,8 @@ typedef enum {
8789}
8890AUDIO_ReqStateTypeDef ;
8991
90- typedef enum {
92+ typedef enum
93+ {
9194 AUDIO_REQ_SET_VOLUME = 1 ,
9295 AUDIO_REQ_SET_MUTE ,
9396 AUDIO_REQ_GET_CURR_VOLUME ,
@@ -99,7 +102,8 @@ typedef enum {
99102}
100103AUDIO_CSReqStateTypeDef ;
101104
102- typedef enum {
105+ typedef enum
106+ {
103107 AUDIO_PLAYBACK_INIT = 1 ,
104108 AUDIO_PLAYBACK_SET_EP ,
105109 AUDIO_PLAYBACK_SET_EP_FREQ ,
@@ -108,13 +112,15 @@ typedef enum {
108112}
109113AUDIO_PlayStateTypeDef ;
110114
111- typedef enum {
115+ typedef enum
116+ {
112117 VOLUME_UP = 1 ,
113118 VOLUME_DOWN = 2 ,
114119}
115120AUDIO_VolumeCtrlTypeDef ;
116121
117- typedef enum {
122+ typedef enum
123+ {
118124 AUDIO_CONTROL_INIT = 1 ,
119125 AUDIO_CONTROL_CHANGE ,
120126 AUDIO_CONTROL_IDLE ,
@@ -124,21 +130,24 @@ typedef enum {
124130AUDIO_ControlStateTypeDef ;
125131
126132
127- typedef enum {
133+ typedef enum
134+ {
128135 AUDIO_DATA_START_OUT = 1 ,
129136 AUDIO_DATA_OUT ,
130137}
131138AUDIO_ProcessingTypeDef ;
132139
133140/* Structure for AUDIO process */
134- typedef struct {
141+ typedef struct
142+ {
135143 uint8_t Channels ;
136144 uint8_t Bits ;
137145 uint32_t SampleRate ;
138146}
139147AUDIO_FormatTypeDef ;
140148
141- typedef struct {
149+ typedef struct
150+ {
142151 uint8_t Ep ;
143152 uint16_t EpSize ;
144153 uint8_t AltSettings ;
@@ -148,7 +157,8 @@ typedef struct {
148157}
149158AUDIO_STREAMING_IN_HandleTypeDef ;
150159
151- typedef struct {
160+ typedef struct
161+ {
152162 uint8_t Ep ;
153163 uint16_t EpSize ;
154164 uint8_t AltSettings ;
@@ -159,7 +169,8 @@ typedef struct {
159169AUDIO_STREAMING_OUT_HandleTypeDef ;
160170
161171
162- typedef struct {
172+ typedef struct
173+ {
163174 uint8_t mute ;
164175 uint32_t volumeMin ;
165176 uint32_t volumeMax ;
@@ -168,7 +179,8 @@ typedef struct {
168179}
169180AUDIO_ControlAttributeTypeDef ;
170181
171- typedef struct {
182+ typedef struct
183+ {
172184
173185 uint8_t Ep ;
174186 uint16_t EpSize ;
@@ -200,7 +212,8 @@ typedef struct {
200212}
201213AUDIO_InterfaceStreamPropTypeDef ;
202214
203- typedef struct {
215+ typedef struct
216+ {
204217
205218 uint8_t Ep ;
206219 uint16_t EpSize ;
@@ -214,25 +227,26 @@ typedef struct {
214227AUDIO_InterfaceControlPropTypeDef ;
215228
216229
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
225238
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
229242
230243#define AUDIO_MAX_SAMFREQ_NBR 5U
231244#define AUDIO_MAX_INTERFACE_NBR 5U
232245#define AUDIO_MAX_CONTROLS_NBR 5U
233246
234247/*Class-Specific AS(Audio Streaming) Interface Descriptor*/
235- typedef struct {
248+ typedef struct
249+ {
236250 uint8_t bLength ;
237251 uint8_t bDescriptorType ;
238252 uint8_t bDescriptorSubtype ;
@@ -243,7 +257,8 @@ typedef struct {
243257AUDIO_ASGeneralDescTypeDef ;
244258
245259/*Class-Specific AS(Audio Streaming) Format Type Descriptor*/
246- typedef struct {
260+ typedef struct
261+ {
247262 uint8_t bLength ;
248263 uint8_t bDescriptorType ;
249264 uint8_t bDescriptorSubtype ;
@@ -257,15 +272,17 @@ typedef struct {
257272AUDIO_ASFormatTypeDescTypeDef ;
258273
259274/*Class-Specific AS(Audio Streaming) Interface Descriptor*/
260- typedef struct {
275+ typedef struct
276+ {
261277 AUDIO_ASGeneralDescTypeDef * GeneralDesc ;
262278 AUDIO_ASFormatTypeDescTypeDef * FormatTypeDesc ;
263279}
264280AUDIO_ASDescTypeDef ;
265281
266282/* 4.3.2 Class-Specific AC Interface Descriptor */
267283
268- typedef struct {
284+ typedef struct
285+ {
269286 uint8_t bLength ;
270287 uint8_t bDescriptorType ;
271288 uint8_t bDescriptorSubtype ;
@@ -277,7 +294,8 @@ typedef struct {
277294AUDIO_HeaderDescTypeDef ;
278295
279296/* 4.3.2.1 Input Terminal Descriptor */
280- typedef struct {
297+ typedef struct
298+ {
281299 uint8_t bLength ;
282300 uint8_t bDescriptorType ;
283301 uint8_t bDescriptorSubtype ;
@@ -292,7 +310,8 @@ typedef struct {
292310AUDIO_ITDescTypeDef ;
293311
294312/* 4.3.2.2 Output Terminal Descriptor */
295- typedef struct {
313+ typedef struct
314+ {
296315 uint8_t bLength ;
297316 uint8_t bDescriptorType ;
298317 uint8_t bDescriptorSubtype ;
@@ -305,7 +324,8 @@ typedef struct {
305324AUDIO_OTDescTypeDef ;
306325
307326/* 4.3.2.3 Feature Descriptor */
308- typedef struct {
327+ typedef struct
328+ {
309329 uint8_t bLength ;
310330 uint8_t bDescriptorType ;
311331 uint8_t bDescriptorSubtype ;
@@ -318,7 +338,8 @@ AUDIO_FeatureDescTypeDef;
318338
319339
320340/* 4.3.2.3 Feature Descriptor */
321- typedef struct {
341+ typedef struct
342+ {
322343 uint8_t bLength ;
323344 uint8_t bDescriptorType ;
324345 uint8_t bDescriptorSubtype ;
@@ -337,7 +358,8 @@ AUDIO_MixerDescTypeDef;
337358
338359
339360/* 4.3.2.3 Feature Descriptor */
340- typedef struct {
361+ typedef struct
362+ {
341363 uint8_t bLength ;
342364 uint8_t bDescriptorType ;
343365 uint8_t bDescriptorSubtype ;
@@ -349,7 +371,8 @@ typedef struct {
349371AUDIO_SelectorDescTypeDef ;
350372
351373/*Class-Specific AC(Audio Control) Interface Descriptor*/
352- typedef struct {
374+ typedef struct
375+ {
353376 AUDIO_HeaderDescTypeDef * HeaderDesc ;
354377 AUDIO_ITDescTypeDef * InputTerminalDesc [AUDIO_MAX_NUM_IN_TERMINAL ];
355378 AUDIO_OTDescTypeDef * OutputTerminalDesc [AUDIO_MAX_NUM_OUT_TERMINAL ];
@@ -361,7 +384,8 @@ AUDIO_ACDescTypeDef;
361384
362385/*Class-Specific AC : Global descriptor*/
363386
364- typedef struct {
387+ typedef struct
388+ {
365389 AUDIO_ACDescTypeDef cs_desc ; /* Only one control descriptor*/
366390 AUDIO_ASDescTypeDef as_desc [AUDIO_MAX_STREAMING_INTERFACE ];
367391
@@ -375,7 +399,8 @@ typedef struct {
375399AUDIO_ClassSpecificDescTypedef ;
376400
377401
378- typedef struct _AUDIO_Process {
402+ typedef struct _AUDIO_Process
403+ {
379404 AUDIO_ReqStateTypeDef req_state ;
380405 AUDIO_CSReqStateTypeDef cs_req_state ;
381406 AUDIO_PlayStateTypeDef play_state ;
0 commit comments