Skip to content

Commit 6bbf5b4

Browse files
committed
[USB] Update STM32 USB Device library to v2.6.0
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 26041d3 commit 6bbf5b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+8554
-2903
lines changed

Diff for: system/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Inc/usbd_audio.h

+27-20
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ extern "C" {
5050
#define USBD_MAX_NUM_INTERFACES 1U
5151
#endif /* USBD_AUDIO_FREQ */
5252

53+
#ifndef AUDIO_HS_BINTERVAL
54+
#define AUDIO_HS_BINTERVAL 0x01U
55+
#endif /* AUDIO_HS_BINTERVAL */
56+
57+
#ifndef AUDIO_FS_BINTERVAL
58+
#define AUDIO_FS_BINTERVAL 0x01U
59+
#endif /* AUDIO_FS_BINTERVAL */
60+
5361
#define AUDIO_OUT_EP 0x01U
5462
#define USB_AUDIO_CONFIG_DESC_SIZ 0x6DU
5563
#define AUDIO_INTERFACE_DESC_SIZE 0x09U
@@ -91,6 +99,9 @@ extern "C" {
9199

92100
#define AUDIO_OUT_STREAMING_CTRL 0x02U
93101

102+
#define AUDIO_OUT_TC 0x01U
103+
#define AUDIO_IN_TC 0x02U
104+
94105

95106
#define AUDIO_OUT_PACKET (uint16_t)(((USBD_AUDIO_FREQ * 2U * 2U) / 1000U))
96107
#define AUDIO_DEFAULT_VOLUME 70U
@@ -116,8 +127,7 @@ typedef enum
116127
AUDIO_OFFSET_HALF,
117128
AUDIO_OFFSET_FULL,
118129
AUDIO_OFFSET_UNKNOWN,
119-
}
120-
AUDIO_OffsetTypeDef;
130+
} AUDIO_OffsetTypeDef;
121131
/**
122132
* @}
123133
*/
@@ -132,32 +142,29 @@ typedef struct
132142
uint8_t data[USB_MAX_EP0_SIZE];
133143
uint8_t len;
134144
uint8_t unit;
135-
}
136-
USBD_AUDIO_ControlTypeDef;
137-
145+
} USBD_AUDIO_ControlTypeDef;
138146

139147

140148
typedef struct
141149
{
142-
uint32_t alt_setting;
143-
uint8_t buffer[AUDIO_TOTAL_BUF_SIZE];
144-
AUDIO_OffsetTypeDef offset;
145-
uint8_t rd_enable;
146-
uint16_t rd_ptr;
147-
uint16_t wr_ptr;
150+
uint32_t alt_setting;
151+
uint8_t buffer[AUDIO_TOTAL_BUF_SIZE];
152+
AUDIO_OffsetTypeDef offset;
153+
uint8_t rd_enable;
154+
uint16_t rd_ptr;
155+
uint16_t wr_ptr;
148156
USBD_AUDIO_ControlTypeDef control;
149-
}
150-
USBD_AUDIO_HandleTypeDef;
157+
} USBD_AUDIO_HandleTypeDef;
151158

152159

153160
typedef struct
154161
{
155-
int8_t (*Init)(uint32_t AudioFreq, uint32_t Volume, uint32_t options);
162+
int8_t (*Init)(uint32_t AudioFreq, uint32_t Volume, uint32_t options);
156163
int8_t (*DeInit)(uint32_t options);
157164
int8_t (*AudioCmd)(uint8_t *pbuf, uint32_t size, uint8_t cmd);
158165
int8_t (*VolumeCtl)(uint8_t vol);
159166
int8_t (*MuteCtl)(uint8_t cmd);
160-
int8_t (*PeriodicTC)(uint8_t cmd);
167+
int8_t (*PeriodicTC)(uint8_t *pbuf, uint32_t size, uint8_t cmd);
161168
int8_t (*GetState)(void);
162169
} USBD_AUDIO_ItfTypeDef;
163170
/**
@@ -178,19 +185,19 @@ typedef struct
178185
* @{
179186
*/
180187

181-
extern USBD_ClassTypeDef USBD_AUDIO;
182-
#define USBD_AUDIO_CLASS &USBD_AUDIO
188+
extern USBD_ClassTypeDef USBD_AUDIO;
189+
#define USBD_AUDIO_CLASS &USBD_AUDIO
183190
/**
184191
* @}
185192
*/
186193

187194
/** @defgroup USB_CORE_Exported_Functions
188195
* @{
189196
*/
190-
uint8_t USBD_AUDIO_RegisterInterface(USBD_HandleTypeDef *pdev,
191-
USBD_AUDIO_ItfTypeDef *fops);
197+
uint8_t USBD_AUDIO_RegisterInterface(USBD_HandleTypeDef *pdev,
198+
USBD_AUDIO_ItfTypeDef *fops);
192199

193-
void USBD_AUDIO_Sync(USBD_HandleTypeDef *pdev, AUDIO_OffsetTypeDef offset);
200+
void USBD_AUDIO_Sync(USBD_HandleTypeDef *pdev, AUDIO_OffsetTypeDef offset);
194201
/**
195202
* @}
196203
*/

0 commit comments

Comments
 (0)