usb: USB Host stack uses USB PHY driver

This commit updates the USB Host stack to use the USB PHY driver. The
USB PHY and the OTG Controller should now both be setup/deleted using
usb_new_phy() and usb_del_phy() respectively.

- The hcd_install() now expects the USB PHY and OTG Contorller to be
    already setup before it is called
- usb_host_install() now has an option to skip calling usb_del_phy() if
    the user wants to setup their own USB PHY (e.g., in the case of using
    and external PHY).
- CDC-ACM and MSC examples/test updated to use internal PHY

Closes https://github.com/espressif/esp-idf/issues/8061
This commit is contained in:
Darian Leung
2021-11-18 02:07:53 +08:00
parent 5a2ef15565
commit 854127a57c
23 changed files with 180 additions and 127 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -63,6 +63,8 @@ typedef struct phy_context_t *usb_phy_handle_t; /**< USB PHY context handle *
* @brief Initialize a new USB PHY
* Configure at least PHY source.
*
* This function will enable the OTG Controller
*
* @param[in] config USB PHY configurtion struct
* @param[out] handle_ret USB PHY context handle
*