Skip to content

Commit 19cc026

Browse files
Merge branch 'feat/usb_host_suspend_status_hal_check' into 'master'
feat(usb_host): Add hal check for the global root port suspend See merge request espressif/esp-idf!42098
2 parents f088a12 + 57d48ef commit 19cc026

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

components/hal/include/hal/usb_dwc_hal.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,20 @@ static inline void usb_dwc_hal_disable_debounce_lock(usb_dwc_hal_context_t *hal)
539539
usb_dwc_ll_gintmsk_en_intrs(hal->dev, USB_DWC_LL_INTR_CORE_PRTINT | USB_DWC_LL_INTR_CORE_DISCONNINT);
540540
}
541541

542+
/**
543+
* @brief Check if the root port is suspended
544+
*
545+
* This function checks if the root port entered suspended state, after calling usb_dwc_hal_port_suspend()
546+
*
547+
* @param hal Context of the HAL layer
548+
* @return true The root port is suspended
549+
* @return false The root port is not suspended
550+
*/
551+
static inline bool usb_dwc_hal_port_check_if_suspended(usb_dwc_hal_context_t *hal)
552+
{
553+
return usb_dwc_ll_hprt_get_port_suspend(hal->dev);
554+
}
555+
542556
// ----------------------------------------------------- Channel -------------------------------------------------------
543557

544558
// ----------------- Channel Allocation --------------------

0 commit comments

Comments
 (0)