File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 28
28
#else
29
29
/* Private typedef -----------------------------------------------------------*/
30
30
/* Private define ------------------------------------------------------------*/
31
+ #if !defined(USBD_VBUS_DETECTION_ENABLE )
32
+ #define VBUS_SENSING DISABLE
33
+ #else
34
+ #define VBUS_SENSING ENABLE
35
+ #endif
31
36
32
37
/* Private macro -------------------------------------------------------------*/
33
38
/* Private variables ---------------------------------------------------------*/
@@ -479,14 +484,14 @@ USBD_StatusTypeDef USBD_LL_Init(USBD_HandleTypeDef *pdev)
479
484
g_hpcd .Init .phy_itface = PCD_PHY_ULPI ;
480
485
#endif
481
486
g_hpcd .Init .speed = PCD_SPEED_HIGH ;
482
- g_hpcd .Init .vbus_sensing_enable = ENABLE ;
487
+ g_hpcd .Init .vbus_sensing_enable = VBUS_SENSING ;
483
488
g_hpcd .Init .use_external_vbus = DISABLE ;
484
489
#else /* USE_USB_FS */
485
490
#ifdef USB_OTG_FS
486
491
g_hpcd .Instance = USB_OTG_FS ;
487
492
g_hpcd .Init .use_dedicated_ep1 = DISABLE ;
488
493
g_hpcd .Init .dma_enable = DISABLE ;
489
- g_hpcd .Init .vbus_sensing_enable = DISABLE ;
494
+ g_hpcd .Init .vbus_sensing_enable = VBUS_SENSING ;
490
495
g_hpcd .Init .use_external_vbus = DISABLE ;
491
496
#else
492
497
g_hpcd .Instance = USB ;
Original file line number Diff line number Diff line change @@ -157,6 +157,11 @@ extern "C" {
157
157
// SD Read/Write timeout, default value defined in STM32SD library
158
158
//#define SD_DATATIMEOUT x
159
159
160
+ // USB Vbus sensing. Require to have Vbus pin connected to Vbus signal.
161
+ // Warning, pin is different depending on FullSpeed or High Speed mode used
162
+ // See AN4879 https://www.st.com/content/st_com/en/search.html#q=AN4879-t=resources-page=1
163
+ //#define USBD_VBUS_DETECTION_ENABLE
164
+
160
165
#ifdef __cplusplus
161
166
} // extern "C"
162
167
#endif
You can’t perform that action at this time.
0 commit comments