2022-07-12 13:02:47 +00:00
|
|
|
/*
|
2023-12-13 09:37:06 +00:00
|
|
|
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
2022-07-12 13:02:47 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "soc/usb_serial_jtag_struct.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Configures the internal PHY for USB_Serial_JTAG
|
|
|
|
*
|
|
|
|
* @param hw Start address of the USB Serial_JTAG registers
|
|
|
|
*/
|
2023-12-26 17:32:06 +00:00
|
|
|
static inline void usb_fsls_phy_ll_int_jtag_enable(usb_serial_jtag_dev_t *hw)
|
2022-07-12 13:02:47 +00:00
|
|
|
{
|
|
|
|
// USB_Serial_JTAG use internal PHY
|
|
|
|
hw->conf0.phy_sel = 0;
|
|
|
|
// Disable software control USB D+ D- pullup pulldown (Device FS: dp_pullup = 1)
|
|
|
|
hw->conf0.pad_pull_override = 0;
|
|
|
|
// Enable USB D+ pullup
|
|
|
|
hw->conf0.dp_pullup = 1;
|
|
|
|
// Enable USB pad function
|
|
|
|
hw->conf0.usb_pad_enable = 1;
|
|
|
|
}
|
|
|
|
|
2023-12-13 09:37:06 +00:00
|
|
|
/**
|
|
|
|
* @brief Disable the internal PHY for USB_Serial_JTAG
|
|
|
|
*
|
|
|
|
* @param hw Start address of the USB Serial_JTAG registers
|
|
|
|
*/
|
|
|
|
static inline void usb_fsls_phy_ll_int_jtag_disable(usb_serial_jtag_dev_t *hw)
|
|
|
|
{
|
|
|
|
// Disable USB D+ pullup
|
|
|
|
hw->conf0.dp_pullup = 0;
|
|
|
|
// Disable USB pad function
|
|
|
|
hw->conf0.usb_pad_enable = 0;
|
|
|
|
}
|
|
|
|
|
2022-07-12 13:02:47 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|