From 57d48ef2346ee2aa1567eed4d05e65da7bd1f6c4 Mon Sep 17 00:00:00 2001 From: "peter.marcisovsky" Date: Mon, 22 Sep 2025 17:56:20 +0200 Subject: [PATCH] feat(usb_host): Add hal check for the global root port suspend --- components/hal/include/hal/usb_dwc_hal.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/components/hal/include/hal/usb_dwc_hal.h b/components/hal/include/hal/usb_dwc_hal.h index 9314bfdce6..d6eab59222 100644 --- a/components/hal/include/hal/usb_dwc_hal.h +++ b/components/hal/include/hal/usb_dwc_hal.h @@ -539,6 +539,20 @@ static inline void usb_dwc_hal_disable_debounce_lock(usb_dwc_hal_context_t *hal) usb_dwc_ll_gintmsk_en_intrs(hal->dev, USB_DWC_LL_INTR_CORE_PRTINT | USB_DWC_LL_INTR_CORE_DISCONNINT); } +/** + * @brief Check if the root port is suspended + * + * This function checks if the root port entered suspended state, after calling usb_dwc_hal_port_suspend() + * + * @param hal Context of the HAL layer + * @return true The root port is suspended + * @return false The root port is not suspended + */ +static inline bool usb_dwc_hal_port_check_if_suspended(usb_dwc_hal_context_t *hal) +{ + return usb_dwc_ll_hprt_get_port_suspend(hal->dev); +} + // ----------------------------------------------------- Channel ------------------------------------------------------- // ----------------- Channel Allocation --------------------