summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-02-13 22:29:14 +0700
committerhathach <[email protected]>2026-02-13 22:29:14 +0700
commitf0b44ec6154237a4bd65a5a9d8f8bf944669af64 (patch)
treea19e77e93d1e9b690dd0ac27cf1f22682f142c86 /hw
parent8f14cf4bfa061690084c7c32b3f8b70301f5e0ff (diff)
use CFG_TUD_CONFIGURE_DWC2_DEFAULT to make it easier to add more value
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/stm32f2/family.c6
-rw-r--r--hw/bsp/stm32f4/family.c6
-rw-r--r--hw/bsp/stm32f7/family.c12
-rw-r--r--hw/bsp/stm32h7/family.c12
-rw-r--r--hw/bsp/stm32h7rs/family.c12
-rw-r--r--hw/bsp/stm32l4/family.c6
-rw-r--r--hw/bsp/stm32u5/family.c12
7 files changed, 22 insertions, 44 deletions
diff --git a/hw/bsp/stm32f2/family.c b/hw/bsp/stm32f2/family.c
index f863a59f0..f95128040 100644
--- a/hw/bsp/stm32f2/family.c
+++ b/hw/bsp/stm32f2/family.c
@@ -106,10 +106,8 @@ void board_init(void) {
#if CFG_TUD_ENABLED
// Enable VBUS sense (B device) via pin PA9
- tud_configure_dwc2_t cfg = {
- .bm_double_buffered = 0,
- .vbus_sensing = true
- };
+ tud_configure_dwc2_t cfg = CFG_TUD_CONFIGURE_DWC2_DEFAULT;
+ cfg.vbus_sensing = true;
tud_configure(0, TUD_CFGID_DWC2, &cfg);
#endif
}
diff --git a/hw/bsp/stm32f4/family.c b/hw/bsp/stm32f4/family.c
index 2170faca7..f0e9620f2 100644
--- a/hw/bsp/stm32f4/family.c
+++ b/hw/bsp/stm32f4/family.c
@@ -180,10 +180,8 @@ void board_init(void) {
#endif
#if CFG_TUD_ENABLED
- tud_configure_dwc2_t cfg = {
- .bm_double_buffered = 0,
- .vbus_sensing = VBUS_SENSE_EN
- };
+ tud_configure_dwc2_t cfg = CFG_TUD_CONFIGURE_DWC2_DEFAULT;
+ cfg.vbus_sensing = VBUS_SENSE_EN;
tud_configure(BOARD_TUD_RHPORT, TUD_CFGID_DWC2, &cfg);
board_vbus_set(BOARD_TUD_RHPORT, false);
#endif
diff --git a/hw/bsp/stm32f7/family.c b/hw/bsp/stm32f7/family.c
index fc1c0bd13..d8f0da201 100644
--- a/hw/bsp/stm32f7/family.c
+++ b/hw/bsp/stm32f7/family.c
@@ -157,10 +157,8 @@ void board_init(void) {
#endif // vbus sense
#if CFG_TUD_ENABLED && BOARD_TUD_RHPORT == 0
- tud_configure_dwc2_t cfg = {
- .bm_double_buffered = 0,
- .vbus_sensing = OTG_FS_VBUS_SENSE
- };
+ tud_configure_dwc2_t cfg = CFG_TUD_CONFIGURE_DWC2_DEFAULT;
+ cfg.vbus_sensing = OTG_FS_VBUS_SENSE;
tud_configure(0, TUD_CFGID_DWC2, &cfg);
#endif
@@ -239,10 +237,8 @@ void board_init(void) {
__HAL_RCC_USB_OTG_HS_CLK_ENABLE();
#if CFG_TUD_ENABLED && BOARD_TUD_RHPORT == 1
- tud_configure_dwc2_t cfg = {
- .bm_double_buffered = 0,
- .vbus_sensing = OTG_HS_VBUS_SENSE
- };
+ tud_configure_dwc2_t cfg = CFG_TUD_CONFIGURE_DWC2_DEFAULT;
+ cfg.vbus_sensing = OTG_HS_VBUS_SENSE;
tud_configure(1, TUD_CFGID_DWC2, &cfg);
#endif
diff --git a/hw/bsp/stm32h7/family.c b/hw/bsp/stm32h7/family.c
index 920f222d7..a320a7e72 100644
--- a/hw/bsp/stm32h7/family.c
+++ b/hw/bsp/stm32h7/family.c
@@ -183,10 +183,8 @@ void board_init(void) {
#endif // vbus sense
#if CFG_TUD_ENABLED && BOARD_TUD_RHPORT == 0
- tud_configure_dwc2_t cfg = {
- .bm_double_buffered = 0,
- .vbus_sensing = OTG_FS_VBUS_SENSE
- };
+ tud_configure_dwc2_t cfg = CFG_TUD_CONFIGURE_DWC2_DEFAULT;
+ cfg.vbus_sensing = OTG_FS_VBUS_SENSE;
tud_configure(0, TUD_CFGID_DWC2, &cfg);
#endif
@@ -215,10 +213,8 @@ void board_init(void) {
__HAL_RCC_USB1_OTG_HS_CLK_ENABLE();
#if CFG_TUD_ENABLED && BOARD_TUD_RHPORT == 1
- tud_configure_dwc2_t cfg = {
- .bm_double_buffered = 0,
- .vbus_sensing = OTG_HS_VBUS_SENSE
- };
+ tud_configure_dwc2_t cfg = CFG_TUD_CONFIGURE_DWC2_DEFAULT;
+ cfg.vbus_sensing = OTG_HS_VBUS_SENSE;
tud_configure(1, TUD_CFGID_DWC2, &cfg);
#endif
#endif
diff --git a/hw/bsp/stm32h7rs/family.c b/hw/bsp/stm32h7rs/family.c
index b1980f2ed..2cc39b7ac 100644
--- a/hw/bsp/stm32h7rs/family.c
+++ b/hw/bsp/stm32h7rs/family.c
@@ -359,10 +359,8 @@ void board_init(void) {
#endif // vbus sense
#if CFG_TUD_ENABLED && BOARD_TUD_RHPORT == 0
- tud_configure_dwc2_t cfg = {
- .bm_double_buffered = 0,
- .vbus_sensing = OTG_FS_VBUS_SENSE
- };
+ tud_configure_dwc2_t cfg = CFG_TUD_CONFIGURE_DWC2_DEFAULT;
+ cfg.vbus_sensing = OTG_FS_VBUS_SENSE;
tud_configure(0, TUD_CFGID_DWC2, &cfg);
#endif
@@ -390,10 +388,8 @@ void board_init(void) {
#endif
#if CFG_TUD_ENABLED && BOARD_TUD_RHPORT == 1
- tud_configure_dwc2_t cfg = {
- .bm_double_buffered = 0,
- .vbus_sensing = OTG_HS_VBUS_SENSE
- };
+ tud_configure_dwc2_t cfg = CFG_TUD_CONFIGURE_DWC2_DEFAULT;
+ cfg.vbus_sensing = OTG_HS_VBUS_SENSE;
tud_configure(1, TUD_CFGID_DWC2, &cfg);
#endif
diff --git a/hw/bsp/stm32l4/family.c b/hw/bsp/stm32l4/family.c
index b51a9fc8f..65f6b9ab3 100644
--- a/hw/bsp/stm32l4/family.c
+++ b/hw/bsp/stm32l4/family.c
@@ -176,10 +176,8 @@ void board_init(void) {
#if CFG_TUD_ENABLED
/* Set Vbus sense */
- tud_configure_dwc2_t cfg = {
- .bm_double_buffered = 0,
- .vbus_sensing = VBUS_SENSE_EN
- };
+ tud_configure_dwc2_t cfg = CFG_TUD_CONFIGURE_DWC2_DEFAULT;
+ cfg.vbus_sensing = VBUS_SENSE_EN;
tud_configure(0, TUD_CFGID_DWC2, &cfg);
#endif
#else
diff --git a/hw/bsp/stm32u5/family.c b/hw/bsp/stm32u5/family.c
index c2ea270df..dfcf5c537 100644
--- a/hw/bsp/stm32u5/family.c
+++ b/hw/bsp/stm32u5/family.c
@@ -182,10 +182,8 @@ void board_init(void) {
#endif // vbus sense
#if CFG_TUD_ENABLED
- tud_configure_dwc2_t cfg = {
- .bm_double_buffered = 0,
- .vbus_sensing = VBUS_SENSE_EN
- };
+ tud_configure_dwc2_t cfg = CFG_TUD_CONFIGURE_DWC2_DEFAULT;
+ cfg.vbus_sensing = VBUS_SENSE_EN;
tud_configure(0, TUD_CFGID_DWC2, &cfg);
#endif
@@ -217,10 +215,8 @@ void board_init(void) {
HAL_SYSCFG_EnableOTGPHY(SYSCFG_OTG_HS_PHY_ENABLE);
#if CFG_TUD_ENABLED
- tud_configure_dwc2_t cfg = {
- .bm_double_buffered = 0,
- .vbus_sensing = VBUS_SENSE_EN
- };
+ tud_configure_dwc2_t cfg = CFG_TUD_CONFIGURE_DWC2_DEFAULT;
+ cfg.vbus_sensing = VBUS_SENSE_EN;
tud_configure(0, TUD_CFGID_DWC2, &cfg);
#endif
#endif // USB_OTG_FS