Skip to content

Commit c800522

Browse files
committed
usb: G0: add support (USB_DRD_FS)
Signed-off-by: Frederic Pillon <[email protected]>
1 parent b754bcf commit c800522

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

Diff for: cores/arduino/stm32/stm32_def.h

+6
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
#define CAN1 CAN
6666
#endif
6767

68+
/* STM32G0xx defined USB_DRD_FS */
69+
#if !defined(USB ) && defined(USB_DRD_FS)
70+
#define USB USB_DRD_FS
71+
#define PinMap_USB PinMap_USB_DRD_FS
72+
#endif
73+
6874
/**
6975
* Libc porting layers
7076
*/

Diff for: cores/arduino/stm32/usb/usbd_conf.h

+3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ extern "C" {
6767
#define USB_WKUP_IRQHandler USB_FS_WKUP_IRQHandler
6868
#endif
6969
#endif
70+
#elif defined(STM32G0xx)
71+
#define USB_IRQn USB_UCPD1_2_IRQn
72+
#define USB_IRQHandler USB_UCPD1_2_IRQHandler
7073
#elif defined(STM32L5xx)
7174
#define USB_IRQn USB_FS_IRQn
7275
#define USB_IRQHandler USB_FS_IRQHandler

Diff for: libraries/SrcWrapper/src/stm32/hw_config.c

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ void hw_config_init(void)
3232
/* Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral */
3333
HAL_PWREx_DisableUCPDDeadBattery();
3434
#endif
35+
#if defined (SYSCFG_CFGR1_UCPD1_STROBE) || defined (SYSCFG_CFGR1_UCPD2_STROBE)
36+
/* Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral */
37+
HAL_SYSCFG_StrobeDBattpinsConfig(SYSCFG_CFGR1_UCPD1_STROBE | SYSCFG_CFGR1_UCPD2_STROBE);
38+
#endif /* SYSCFG_CFGR1_UCPD1_STROBE || SYSCFG_CFGR1_UCPD2_STROBE */
3539

3640
/* Init DWT if present */
3741
#ifdef DWT_BASE

0 commit comments

Comments
 (0)