usbdev_stm32.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2019 Koen Zandberg
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
37 #include <stdint.h>
38 #include <stdlib.h>
39 #include "periph_cpu.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
49 #define DWC2_USB_OTG_FS_NUM_EP STM32_USB_OTG_FS_NUM_EP
50 
55 #define DWC2_USB_OTG_HS_NUM_EP STM32_USB_OTG_HS_NUM_EP
56 
65 #ifndef DWC2_USB_OTG_FS_RX_FIFO_SIZE
66 #define DWC2_USB_OTG_FS_RX_FIFO_SIZE (128U)
67 #endif
68 
74 #ifndef DWC2_USB_OTG_HS_RX_FIFO_SIZE
75 #define DWC2_USB_OTG_HS_RX_FIFO_SIZE (512U)
76 #endif
77 
85 #ifndef USB_OTG_FS_TOTAL_FIFO_SIZE
86 #define USB_OTG_FS_TOTAL_FIFO_SIZE (1280U)
87 #endif
88 
96 #ifndef USB_OTG_HS_TOTAL_FIFO_SIZE
97 #define USB_OTG_HS_TOTAL_FIFO_SIZE (4096U)
98 #endif
99 
103 #define DWC2_USB_OTG_FS_TOTAL_FIFO_SIZE USB_OTG_FS_TOTAL_FIFO_SIZE
104 
108 #define DWC2_USB_OTG_HS_TOTAL_FIFO_SIZE USB_OTG_HS_TOTAL_FIFO_SIZE
109 
110 /* periph/usbdev.h is included after the definitions above by intention */
111 #include "periph/usbdev.h"
112 
116 typedef struct {
121  size_t used;
123 
124 #ifdef __cplusplus
125 }
126 #endif
Shared CPU specific definitions for the STM32 family.
stm32 USB device FS configuration
Definition: cpu_usbdev.h:41
stm32 USB Device FS only peripheral device context
Definition: usbdev_stm32.h:116
const stm32_usbdev_fs_config_t * config
USB peripheral config
Definition: usbdev_stm32.h:118
usbdev_t usbdev
Inherited usbdev struct.
Definition: usbdev_stm32.h:117
size_t used
Bytes used by usbdev stack.
Definition: usbdev_stm32.h:121
usbdev_ep_t * in
In endpoints.
Definition: usbdev_stm32.h:119
usbdev_ep_t * out
Out endpoints.
Definition: usbdev_stm32.h:120
usbdev endpoint descriptor
Definition: usbdev.h:259
usbdev device descriptor
Definition: usbdev.h:247
Definitions low-level USB driver interface.