Skip to content

Commit 43a7c3e

Browse files
committed
usb: G0: add support (USB_DRD_FS)
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent b01f7a5 commit 43a7c3e

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

cores/arduino/stm32/stm32_def.h

Lines changed: 6 additions & 0 deletions
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
*/

cores/arduino/stm32/usb/usbd_conf.h

Lines changed: 3 additions & 0 deletions
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

libraries/SrcWrapper/src/stm32/hw_config.c

Lines changed: 4 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy