adding hcd dwc2

This commit is contained in:
hathach
2024-10-15 13:03:12 +07:00
parent 933ac29d77
commit 10a3aa3cc8
10 changed files with 447 additions and 196 deletions

View File

@@ -151,7 +151,7 @@ void board_init(void) {
HAL_UART_Init(&UartHandle);
#endif
#if BOARD_TUD_RHPORT == 0
//------------- USB FS -------------//
// Despite being call USB2_OTG
// OTG_FS is marked as RHPort0 by TinyUSB to be consistent across stm32 port
// PA9 VUSB, PA10 ID, PA11 DM, PA12 DP
@@ -195,10 +195,9 @@ void board_init(void) {
USB_OTG_FS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOVAL;
#endif // vbus sense
#elif BOARD_TUD_RHPORT == 1
//------------- USB HS -------------//
// Despite being call USB2_OTG
// OTG_HS is marked as RHPort1 by TinyUSB to be consistent across stm32 port
struct {
GPIO_TypeDef* port;
uint32_t pin;
@@ -238,8 +237,6 @@ void board_init(void) {
// For waveshare openh743 ULPI PHY reset walkaround
board_stm32h7_post_init();
#endif // rhport = 1
}
//--------------------------------------------------------------------+

View File

@@ -106,6 +106,8 @@ function(family_configure_example TARGET RTOS)
family_add_tinyusb(${TARGET} OPT_MCU_STM32H7 ${RTOS})
target_sources(${TARGET}-tinyusb PUBLIC
${TOP}/src/portable/synopsys/dwc2/dcd_dwc2.c
${TOP}/src/portable/synopsys/dwc2/hcd_dwc2.c
${TOP}/src/portable/synopsys/dwc2/dwc2_common.c
)
target_link_libraries(${TARGET}-tinyusb PUBLIC board_${BOARD})