Loading...
Searching...
No Matches
usbdev_synopsys_dwc2.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 Koen Zandberg
3 * SPDX-FileCopyrightText: 2022 Gunar Schorcht
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#pragma once
8
19
20#include <stdint.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
32#define USBDEV_CPU_SET_ADDR_AFTER_STATUS 0
33
47
51enum {
56};
57
72
76typedef struct {
77 uintptr_t periph;
80#if defined(MODULE_PERIPH_USBDEV_HS_ULPI) || DOXYGEN
81 gpio_t ulpi_clk;
82 gpio_t ulpi_d0;
83 gpio_t ulpi_d1;
84 gpio_t ulpi_d2;
85 gpio_t ulpi_d3;
86 gpio_t ulpi_d4;
87 gpio_t ulpi_d5;
88 gpio_t ulpi_d6;
89 gpio_t ulpi_d7;
90 gpio_t ulpi_dir;
91 gpio_t ulpi_stp;
92 gpio_t ulpi_nxt;
94#endif
95#if defined(CPU_STM32) || DOXYGEN
96 uint32_t rcc_mask;
97 uint8_t irqn;
98 uint8_t ahb;
99 gpio_t dm;
100 gpio_t dp;
102#if defined(MODULE_PERIPH_USBDEV_HS_UTMI) || DOXYGEN
103 uint32_t phy_tune;
106#endif /* defined(MODULE_PERIPH_USBDEV_HS_UTMI) */
107#endif /* defined(CPU_STM32) || DOXYGEN */
108#if defined(CPU_GD32V)
109 uint32_t rcu_mask;
110 uint8_t irqn;
111 uint8_t bus;
112#endif
114
115#ifdef __cplusplus
116}
117#endif
118
gpio_af_t
Override alternative GPIO mode options.
Definition periph_cpu.h:162
gpio_af_t af
Alternative function.
uintptr_t periph
USB peripheral base address.
dwc2_usb_otg_fshs_type_t type
FS or HS type.
uint32_t rcc_mask
bit in clock enable register
dwc2_usb_otg_fshs_phy_t phy
on-chip FS, ULPI HS or UTMI HS PHY
uint32_t phy_tune
USB HS PHY controller tuning register value (STM32-specific), see USBPHYC_TUNE register in STM32 Refe...
gpio_af_t ulpi_af
Alternative function for ULPI.
@ DWC2_USB_OTG_DSPD_HS
High speed.
@ DWC2_USB_OTG_DSPD_LS
Low speed.
@ DWC2_USB_OTG_DSPD_FS
Full speed.
@ DWC2_USB_OTG_DSPD_FS_PHY_HS
Full speed on HS PHY.
dwc2_usb_otg_fshs_phy_t
Type of USB OTG peripheral PHY.
@ DWC2_USB_OTG_PHY_ULPI
ULPI for external HS PHY.
@ DWC2_USB_OTG_PHY_UTMI
UTMI for internal HS PHY.
@ DWC2_USB_OTG_PHY_BUILTIN
on-chip FS PHY
dwc2_usb_otg_fshs_type_t
USB OTG peripheral type.
@ DWC2_USB_OTG_FS
Full speed peripheral.
@ DWC2_USB_OTG_HS
High speed peripheral.