Skip to content

Commit b3b80ed

Browse files
committed
[USB] Update STM32 USB Device library to v2.5.3
Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 09efc81 commit b3b80ed

Some content is hidden

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

42 files changed

+389
-350
lines changed

system/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Inc/usbd_audio.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
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
*/
@@ -182,7 +182,7 @@ extern USBD_ClassTypeDef USBD_AUDIO;
182182
/** @defgroup USB_CORE_Exported_Functions
183183
* @{
184184
*/
185-
uint8_t USBD_AUDIO_RegisterInterface(USBD_HandleTypeDef *pdev,
185+
uint8_t USBD_AUDIO_RegisterInterface(USBD_HandleTypeDef *pdev,
186186
USBD_AUDIO_ItfTypeDef *fops);
187187

188188
void USBD_AUDIO_Sync(USBD_HandleTypeDef *pdev, AUDIO_OffsetTypeDef offset);

system/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Inc/usbd_audio_if_template.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
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
*/

system/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Src/usbd_audio.c

+28-48
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* ===================================================================
1010
* AUDIO Class Description
1111
* ===================================================================
12-
* This driver manages the Audio Class 1.0 following the "USB Device Class Definition for
12+
* This driver manages the Audio Class 1.0 following the "USB Device Class Definition for
1313
* Audio Devices V1.0 Mar 18, 98".
1414
* This driver implements the following aspects of the specification:
1515
* - Device descriptor management
@@ -48,7 +48,7 @@
4848
* This software component is licensed by ST under Ultimate Liberty license
4949
* SLA0044, the "License"; You may not use this file except in compliance with
5050
* the License. You may obtain a copy of the License at:
51-
* http://www.st.com/SLA0044
51+
* www.st.com/SLA0044
5252
*
5353
******************************************************************************
5454
*/
@@ -93,7 +93,7 @@ EndBSPDependencies */
9393
/** @defgroup USBD_AUDIO_Private_Macros
9494
* @{
9595
*/
96-
#define AUDIO_SAMPLE_FREQ(frq) (uint8_t)(frq), (uint8_t)((frq >> 8)), (uint8_t)((frq >> 16))
96+
#define AUDIO_SAMPLE_FREQ(frq) (uint8_t)(frq), (uint8_t)((frq >> 8)), (uint8_t)((frq >> 16))
9797

9898
#define AUDIO_PACKET_SZE(frq) (uint8_t)(((frq * 2U * 2U)/1000U) & 0xFFU), \
9999
(uint8_t)((((frq * 2U * 2U)/1000U) >> 8) & 0xFFU)
@@ -103,42 +103,26 @@ EndBSPDependencies */
103103
*/
104104

105105

106-
107-
108106
/** @defgroup USBD_AUDIO_Private_FunctionPrototypes
109107
* @{
110108
*/
111-
112-
113-
static uint8_t USBD_AUDIO_Init(USBD_HandleTypeDef *pdev,
114-
uint8_t cfgidx);
115-
116-
static uint8_t USBD_AUDIO_DeInit(USBD_HandleTypeDef *pdev,
117-
uint8_t cfgidx);
118-
119-
static uint8_t USBD_AUDIO_Setup(USBD_HandleTypeDef *pdev,
120-
USBD_SetupReqTypedef *req);
121-
122-
static uint8_t *USBD_AUDIO_GetCfgDesc(uint16_t *length);
123-
124-
static uint8_t *USBD_AUDIO_GetDeviceQualifierDesc(uint16_t *length);
125-
126-
static uint8_t USBD_AUDIO_DataIn(USBD_HandleTypeDef *pdev, uint8_t epnum);
127-
128-
static uint8_t USBD_AUDIO_DataOut(USBD_HandleTypeDef *pdev, uint8_t epnum);
129-
130-
static uint8_t USBD_AUDIO_EP0_RxReady(USBD_HandleTypeDef *pdev);
131-
132-
static uint8_t USBD_AUDIO_EP0_TxReady(USBD_HandleTypeDef *pdev);
133-
134-
static uint8_t USBD_AUDIO_SOF(USBD_HandleTypeDef *pdev);
135-
136-
static uint8_t USBD_AUDIO_IsoINIncomplete(USBD_HandleTypeDef *pdev, uint8_t epnum);
137-
138-
static uint8_t USBD_AUDIO_IsoOutIncomplete(USBD_HandleTypeDef *pdev, uint8_t epnum);
139-
109+
static uint8_t USBD_AUDIO_Init(USBD_HandleTypeDef *pdev, uint8_t cfgidx);
110+
static uint8_t USBD_AUDIO_DeInit(USBD_HandleTypeDef *pdev, uint8_t cfgidx);
111+
112+
static uint8_t USBD_AUDIO_Setup(USBD_HandleTypeDef *pdev,
113+
USBD_SetupReqTypedef *req);
114+
115+
static uint8_t *USBD_AUDIO_GetCfgDesc(uint16_t *length);
116+
static uint8_t *USBD_AUDIO_GetDeviceQualifierDesc(uint16_t *length);
117+
static uint8_t USBD_AUDIO_DataIn(USBD_HandleTypeDef *pdev, uint8_t epnum);
118+
static uint8_t USBD_AUDIO_DataOut(USBD_HandleTypeDef *pdev, uint8_t epnum);
119+
static uint8_t USBD_AUDIO_EP0_RxReady(USBD_HandleTypeDef *pdev);
120+
static uint8_t USBD_AUDIO_EP0_TxReady(USBD_HandleTypeDef *pdev);
121+
static uint8_t USBD_AUDIO_SOF(USBD_HandleTypeDef *pdev);
122+
123+
static uint8_t USBD_AUDIO_IsoINIncomplete(USBD_HandleTypeDef *pdev, uint8_t epnum);
124+
static uint8_t USBD_AUDIO_IsoOutIncomplete(USBD_HandleTypeDef *pdev, uint8_t epnum);
140125
static void AUDIO_REQ_GetCurrent(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req);
141-
142126
static void AUDIO_REQ_SetCurrent(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req);
143127

144128
/**
@@ -374,6 +358,7 @@ static uint8_t USBD_AUDIO_Init(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
374358
USBD_LL_PrepareReceive(pdev, AUDIO_OUT_EP, haudio->buffer,
375359
AUDIO_OUT_PACKET);
376360
}
361+
377362
return USBD_OK;
378363
}
379364

@@ -387,7 +372,6 @@ static uint8_t USBD_AUDIO_Init(USBD_HandleTypeDef *pdev, uint8_t cfgidx)
387372
static uint8_t USBD_AUDIO_DeInit(USBD_HandleTypeDef *pdev,
388373
uint8_t cfgidx)
389374
{
390-
391375
/* Open EP OUT */
392376
USBD_LL_CloseEP(pdev, AUDIO_OUT_EP);
393377
pdev->ep_out[AUDIO_OUT_EP & 0xFU].is_used = 0U;
@@ -418,7 +402,7 @@ static uint8_t USBD_AUDIO_Setup(USBD_HandleTypeDef *pdev,
418402
uint16_t status_info = 0U;
419403
uint8_t ret = USBD_OK;
420404

421-
haudio = (USBD_AUDIO_HandleTypeDef *) pdev->pClassData;
405+
haudio = (USBD_AUDIO_HandleTypeDef *)pdev->pClassData;
422406

423407
switch (req->bmRequest & USB_REQ_TYPE_MASK) {
424408
case USB_REQ_TYPE_CLASS :
@@ -508,6 +492,7 @@ static uint8_t USBD_AUDIO_Setup(USBD_HandleTypeDef *pdev,
508492
static uint8_t *USBD_AUDIO_GetCfgDesc(uint16_t *length)
509493
{
510494
*length = sizeof(USBD_AUDIO_CfgDesc);
495+
511496
return USBD_AUDIO_CfgDesc;
512497
}
513498

@@ -518,10 +503,8 @@ static uint8_t *USBD_AUDIO_GetCfgDesc(uint16_t *length)
518503
* @param epnum: endpoint index
519504
* @retval status
520505
*/
521-
static uint8_t USBD_AUDIO_DataIn(USBD_HandleTypeDef *pdev,
522-
uint8_t epnum)
506+
static uint8_t USBD_AUDIO_DataIn(USBD_HandleTypeDef *pdev, uint8_t epnum)
523507
{
524-
525508
/* Only OUT data are processed */
526509
return USBD_OK;
527510
}
@@ -629,7 +612,6 @@ void USBD_AUDIO_Sync(USBD_HandleTypeDef *pdev, AUDIO_OffsetTypeDef offset)
629612
*/
630613
static uint8_t USBD_AUDIO_IsoINIncomplete(USBD_HandleTypeDef *pdev, uint8_t epnum)
631614
{
632-
633615
return USBD_OK;
634616
}
635617
/**
@@ -641,7 +623,6 @@ static uint8_t USBD_AUDIO_IsoINIncomplete(USBD_HandleTypeDef *pdev, uint8_t epn
641623
*/
642624
static uint8_t USBD_AUDIO_IsoOutIncomplete(USBD_HandleTypeDef *pdev, uint8_t epnum)
643625
{
644-
645626
return USBD_OK;
646627
}
647628
/**
@@ -651,8 +632,7 @@ static uint8_t USBD_AUDIO_IsoOutIncomplete(USBD_HandleTypeDef *pdev, uint8_t ep
651632
* @param epnum: endpoint index
652633
* @retval status
653634
*/
654-
static uint8_t USBD_AUDIO_DataOut(USBD_HandleTypeDef *pdev,
655-
uint8_t epnum)
635+
static uint8_t USBD_AUDIO_DataOut(USBD_HandleTypeDef *pdev, uint8_t epnum)
656636
{
657637
USBD_AUDIO_HandleTypeDef *haudio;
658638
haudio = (USBD_AUDIO_HandleTypeDef *) pdev->pClassData;
@@ -720,9 +700,7 @@ static void AUDIO_REQ_SetCurrent(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef
720700

721701
if (req->wLength) {
722702
/* Prepare the reception of the buffer over EP0 */
723-
USBD_CtlPrepareRx(pdev,
724-
haudio->control.data,
725-
req->wLength);
703+
USBD_CtlPrepareRx(pdev, haudio->control.data, req->wLength);
726704

727705
haudio->control.cmd = AUDIO_REQ_SET_CUR; /* Set the request value */
728706
haudio->control.len = (uint8_t)req->wLength; /* Set the request data length */
@@ -740,6 +718,7 @@ static void AUDIO_REQ_SetCurrent(USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef
740718
static uint8_t *USBD_AUDIO_GetDeviceQualifierDesc(uint16_t *length)
741719
{
742720
*length = sizeof(USBD_AUDIO_DeviceQualifierDesc);
721+
743722
return USBD_AUDIO_DeviceQualifierDesc;
744723
}
745724

@@ -748,12 +727,13 @@ static uint8_t *USBD_AUDIO_GetDeviceQualifierDesc(uint16_t *length)
748727
* @param fops: Audio interface callback
749728
* @retval status
750729
*/
751-
uint8_t USBD_AUDIO_RegisterInterface(USBD_HandleTypeDef *pdev,
730+
uint8_t USBD_AUDIO_RegisterInterface(USBD_HandleTypeDef *pdev,
752731
USBD_AUDIO_ItfTypeDef *fops)
753732
{
754733
if (fops != NULL) {
755734
pdev->pUserData = fops;
756735
}
736+
757737
return USBD_OK;
758738
}
759739
/**

system/Middlewares/ST/STM32_USB_Device_Library/Class/AUDIO/Src/usbd_audio_if_template.c

+1-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
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
*/
@@ -124,7 +124,6 @@ static int8_t TEMPLATE_DeInit(uint32_t options)
124124
*/
125125
static int8_t TEMPLATE_AudioCmd(uint8_t *pbuf, uint32_t size, uint8_t cmd)
126126
{
127-
128127
return (0);
129128
}
130129

@@ -135,7 +134,6 @@ static int8_t TEMPLATE_AudioCmd(uint8_t *pbuf, uint32_t size, uint8_t cmd)
135134
*/
136135
static int8_t TEMPLATE_VolumeCtl(uint8_t vol)
137136
{
138-
139137
return (0);
140138
}
141139

@@ -146,7 +144,6 @@ static int8_t TEMPLATE_VolumeCtl(uint8_t vol)
146144
*/
147145
static int8_t TEMPLATE_MuteCtl(uint8_t cmd)
148146
{
149-
150147
return (0);
151148
}
152149

@@ -157,7 +154,6 @@ static int8_t TEMPLATE_MuteCtl(uint8_t cmd)
157154
*/
158155
static int8_t TEMPLATE_PeriodicTC(uint8_t cmd)
159156
{
160-
161157
return (0);
162158
}
163159

@@ -168,7 +164,6 @@ static int8_t TEMPLATE_PeriodicTC(uint8_t cmd)
168164
*/
169165
static int8_t TEMPLATE_GetState(void)
170166
{
171-
172167
return (0);
173168
}
174169
/**

system/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/usbd_cdc.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
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
*/
@@ -154,7 +154,6 @@ uint8_t USBD_CDC_SetRxBuffer(USBD_HandleTypeDef *pdev,
154154
uint8_t *pbuff);
155155

156156
uint8_t USBD_CDC_ReceivePacket(USBD_HandleTypeDef *pdev);
157-
uint8_t USBD_CDC_ClearBuffer(USBD_HandleTypeDef *pdev);
158157

159158
uint8_t USBD_CDC_TransmitPacket(USBD_HandleTypeDef *pdev);
160159
/**

system/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/usbd_cdc_if_template.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
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
*/

system/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc.c

+1-20
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* This software component is licensed by ST under Ultimate Liberty license
4646
* SLA0044, the "License"; You may not use this file except in compliance with
4747
* the License. You may obtain a copy of the License at:
48-
* http://www.st.com/SLA0044
48+
* www.st.com/SLA0044
4949
*
5050
******************************************************************************
5151
*/
@@ -877,25 +877,6 @@ uint8_t USBD_CDC_ReceivePacket(USBD_HandleTypeDef *pdev)
877877
return USBD_FAIL;
878878
}
879879
}
880-
881-
uint8_t USBD_CDC_ClearBuffer(USBD_HandleTypeDef *pdev)
882-
{
883-
USBD_CDC_HandleTypeDef *hcdc = (USBD_CDC_HandleTypeDef *) pdev->pClassData;
884-
885-
/* Suspend or Resume USB Out process */
886-
if (pdev->pClassData != NULL) {
887-
if (pdev->dev_speed == USBD_SPEED_HIGH) {
888-
/* Prepare Out endpoint to receive next packet */
889-
USBD_LL_PrepareReceive(pdev, CDC_OUT_EP, 0, 0);
890-
} else {
891-
/* Prepare Out endpoint to receive next packet */
892-
USBD_LL_PrepareReceive(pdev, CDC_OUT_EP, 0, 0);
893-
}
894-
return USBD_OK;
895-
} else {
896-
return USBD_FAIL;
897-
}
898-
}
899880
/**
900881
* @}
901882
*/

system/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Src/usbd_cdc_if_template.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
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
*/

system/Middlewares/ST/STM32_USB_Device_Library/Class/CustomHID/Inc/usbd_customhid.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
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
*/

system/Middlewares/ST/STM32_USB_Device_Library/Class/CustomHID/Inc/usbd_customhid_if_template.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
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
*/

system/Middlewares/ST/STM32_USB_Device_Library/Class/CustomHID/Src/usbd_customhid.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* This software component is licensed by ST under Ultimate Liberty license
3333
* SLA0044, the "License"; You may not use this file except in compliance with
3434
* the License. You may obtain a copy of the License at:
35-
* http://www.st.com/SLA0044
35+
* www.st.com/SLA0044
3636
*
3737
******************************************************************************
3838
*/

system/Middlewares/ST/STM32_USB_Device_Library/Class/CustomHID/Src/usbd_customhid_if_template.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* This software component is licensed by ST under Ultimate Liberty license
1515
* SLA0044, the "License"; You may not use this file except in compliance with
1616
* the License. You may obtain a copy of the License at:
17-
* http://www.st.com/SLA0044
17+
* www.st.com/SLA0044
1818
*
1919
******************************************************************************
2020
*/

system/Middlewares/ST/STM32_USB_Device_Library/Class/DFU/Inc/usbd_dfu.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
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
*/
@@ -143,9 +143,9 @@ typedef void (*pFunction)(void);
143143
USBD_IDX_INTERFACE_STR + (n) + 1U /* iInterface: Index of string descriptor */ \
144144

145145
#define TRANSFER_SIZE_BYTES(size) ((uint8_t)(size)), /* XFERSIZEB0 */\
146-
((uint8_t)(size >> 8)) /* XFERSIZEB1 */
146+
((uint8_t)((size) >> 8)) /* XFERSIZEB1 */
147147

148-
#define IS_PROTECTED_AREA(add) (uint8_t)(((add >= 0x08000000) && (add < (APP_DEFAULT_ADD)))? 1:0)
148+
#define IS_PROTECTED_AREA(add) (uint8_t)((((add) >= 0x08000000) && ((add) < (APP_DEFAULT_ADD)))? 1:0)
149149

150150
/**
151151
* @}

0 commit comments

Comments
 (0)