2021-08-19 08:28:28 -04:00
|
|
|
/*
|
2024-03-14 14:37:26 -04:00
|
|
|
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
2021-08-19 08:28:28 -04:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2024-03-14 09:20:33 -04:00
|
|
|
#include "soc/soc_caps.h"
|
|
|
|
#include "hal/usb_wrap_ll.h"
|
|
|
|
#include "hal/usb_wrap_hal.h"
|
2021-08-19 08:28:28 -04:00
|
|
|
|
2024-04-02 09:10:35 -04:00
|
|
|
void usb_wrap_hal_init(usb_wrap_hal_context_t *hal)
|
2021-08-19 08:28:28 -04:00
|
|
|
{
|
2024-04-02 09:10:35 -04:00
|
|
|
hal->dev = &USB_WRAP;
|
2024-04-02 07:55:44 -04:00
|
|
|
#if !USB_WRAP_LL_EXT_PHY_SUPPORTED
|
2024-04-02 09:10:35 -04:00
|
|
|
usb_wrap_ll_phy_set_defaults(hal->dev);
|
2024-04-02 07:55:44 -04:00
|
|
|
#endif
|
2021-08-19 08:28:28 -04:00
|
|
|
}
|
|
|
|
|
2024-04-02 07:55:44 -04:00
|
|
|
#if USB_WRAP_LL_EXT_PHY_SUPPORTED
|
2024-04-02 09:10:35 -04:00
|
|
|
void usb_wrap_hal_phy_set_external(usb_wrap_hal_context_t *hal, bool external)
|
2021-08-19 08:28:28 -04:00
|
|
|
{
|
2024-04-02 09:10:35 -04:00
|
|
|
if (external) {
|
|
|
|
usb_wrap_ll_phy_enable_external(hal->dev, true);
|
2024-03-14 14:37:26 -04:00
|
|
|
} else {
|
2024-04-02 09:10:35 -04:00
|
|
|
usb_wrap_ll_phy_enable_external(hal->dev, false);
|
|
|
|
usb_wrap_ll_phy_enable_pad(hal->dev, true);
|
2024-03-14 14:37:26 -04:00
|
|
|
}
|
2021-08-19 08:28:28 -04:00
|
|
|
}
|
2024-04-02 09:10:35 -04:00
|
|
|
#endif // USB_WRAP_LL_EXT_PHY_SUPPORTED
|