1 /*
2  * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #pragma once
8 
9 #include <stdbool.h>
10 #include "soc/soc_caps.h"
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 #if SOC_USB_OTG_SUPPORTED
17 
18 /**
19  * @brief USB WRAP pull up/down resistor override values
20  *
21  * Specifies whether each pull up/down resistor should be enabled/disabled when
22  * overriding connected USB PHY's pull resistors.
23  */
24 typedef struct {
25     bool dp_pu;     /**< D+ pull-up resistor enable/disable */
26     bool dm_pu;     /**< D- pull-up resistor enable/disable */
27     bool dp_pd;     /**< D+ pull-down resistor enable/disable */
28     bool dm_pd;     /**< D- pull-down resistor enable/disable */
29 } usb_wrap_pull_override_vals_t;
30 
31 /**
32  * @brief USB WRAP test mode values
33  *
34  * Specifies the logic values of each of the USB FSLS Serial PHY interface
35  * signals when in test mode.
36  *
37  * @note See section "2.2.1.13 FsLsSerialMode" of UTMI+ specification for more
38  * details of each signal.
39  */
40 typedef struct {
41     bool tx_enable_n;   /**< Active low output enable signal */
42     bool tx_dp;         /**< Single-ended D+ line driver */
43     bool tx_dm;         /**< Single-ended D- line driver */
44     bool rx_dp;         /**< Single-ended D+ signal from the transceiver */
45     bool rx_dm;         /**< Single-ended D- signal from the transceiver */
46     bool rx_rcv;        /**< Differential receive data from D+ and D- lines */
47 } usb_wrap_test_mode_vals_t;
48 
49 #endif // SOC_USB_OTG_SUPPORTED
50 
51 #ifdef __cplusplus
52 }
53 #endif
54