usbdev_stm32.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Koen Zandberg
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
38 #ifndef USBDEV_STM32_H
39 #define USBDEV_STM32_H
40 
41 #include <stdint.h>
42 #include <stdlib.h>
43 #include "periph_cpu.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
53 #define DWC2_USB_OTG_FS_NUM_EP STM32_USB_OTG_FS_NUM_EP
54 
59 #define DWC2_USB_OTG_HS_NUM_EP STM32_USB_OTG_HS_NUM_EP
60 
69 #ifndef DWC2_USB_OTG_FS_RX_FIFO_SIZE
70 #define DWC2_USB_OTG_FS_RX_FIFO_SIZE (128U)
71 #endif
72 
78 #ifndef DWC2_USB_OTG_HS_RX_FIFO_SIZE
79 #define DWC2_USB_OTG_HS_RX_FIFO_SIZE (512U)
80 #endif
81 
89 #ifndef USB_OTG_FS_TOTAL_FIFO_SIZE
90 #define USB_OTG_FS_TOTAL_FIFO_SIZE (1280U)
91 #endif
92 
100 #ifndef USB_OTG_HS_TOTAL_FIFO_SIZE
101 #define USB_OTG_HS_TOTAL_FIFO_SIZE (4096U)
102 #endif
103 
107 #define DWC2_USB_OTG_FS_TOTAL_FIFO_SIZE USB_OTG_FS_TOTAL_FIFO_SIZE
108 
112 #define DWC2_USB_OTG_HS_TOTAL_FIFO_SIZE USB_OTG_HS_TOTAL_FIFO_SIZE
113 
114 /* periph/usbdev.h is included after the definitions above by intention */
115 #include "periph/usbdev.h"
116 
120 typedef struct {
125  size_t used;
127 
128 #ifdef __cplusplus
129 }
130 #endif
131 #endif /* USBDEV_STM32_H */
Shared CPU specific definitions for the STM32 family.
stm32 USB device FS configuration
Definition: cpu_usbdev.h:45
stm32 USB Device FS only peripheral device context
Definition: usbdev_stm32.h:120
const stm32_usbdev_fs_config_t * config
USB peripheral config
Definition: usbdev_stm32.h:122
usbdev_t usbdev
Inherited usbdev struct.
Definition: usbdev_stm32.h:121
size_t used
Bytes used by usbdev stack.
Definition: usbdev_stm32.h:125
usbdev_ep_t * in
In endpoints.
Definition: usbdev_stm32.h:123
usbdev_ep_t * out
Out endpoints.
Definition: usbdev_stm32.h:124
usbdev endpoint descriptor
Definition: usbdev.h:259
usbdev device descriptor
Definition: usbdev.h:247
Definitions low-level USB driver interface.