Loading...
Searching...
No Matches
usbdev_synopsys_dwc2.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 Koen Zandberg
3 * 2022 Gunar Schorcht
4 *
5 * This file is subject to the terms and conditions of the GNU Lesser
6 * General Public License v2.1. See the file LICENSE in the top level
7 * directory for more details.
8 */
9
21#ifndef USBDEV_SYNOPSYS_DWC2_H
22#define USBDEV_SYNOPSYS_DWC2_H
23
24#include <stdint.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
36#define USBDEV_CPU_SET_ADDR_AFTER_STATUS 0
37
51
55enum {
60};
61
76
80typedef struct {
81 uintptr_t periph;
84#if defined(MODULE_PERIPH_USBDEV_HS_ULPI) || DOXYGEN
85 gpio_t ulpi_clk;
86 gpio_t ulpi_d0;
87 gpio_t ulpi_d1;
88 gpio_t ulpi_d2;
89 gpio_t ulpi_d3;
90 gpio_t ulpi_d4;
91 gpio_t ulpi_d5;
92 gpio_t ulpi_d6;
93 gpio_t ulpi_d7;
94 gpio_t ulpi_dir;
95 gpio_t ulpi_stp;
96 gpio_t ulpi_nxt;
98#endif
99#if defined(CPU_STM32) || DOXYGEN
100 uint32_t rcc_mask;
101 uint8_t irqn;
102 uint8_t ahb;
103 gpio_t dm;
104 gpio_t dp;
106#if defined(MODULE_PERIPH_USBDEV_HS_UTMI) || DOXYGEN
107 uint32_t phy_tune;
110#endif /* defined(MODULE_PERIPH_USBDEV_HS_UTMI) */
111#endif /* defined(CPU_STM32) || DOXYGEN */
112#if defined(CPU_GD32V)
113 uint32_t rcu_mask;
114 uint8_t irqn;
115 uint8_t bus;
116#endif
118
119#ifdef __cplusplus
120}
121#endif
122
123#endif /* USBDEV_SYNOPSYS_DWC2_H */
gpio_af_t
Override alternative GPIO mode options.
Definition periph_cpu.h:166
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_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_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_type_t
USB OTG peripheral type.
@ DWC2_USB_OTG_FS
Full speed peripheral.
@ DWC2_USB_OTG_HS
High speed peripheral.