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 
9 #pragma once
10 
40 #include <stdint.h>
41 #include <stdlib.h>
42 #include "periph_cpu.h"
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
52 #define DWC2_USB_OTG_FS_NUM_EP STM32_USB_OTG_FS_NUM_EP
53 
58 #define DWC2_USB_OTG_HS_NUM_EP STM32_USB_OTG_HS_NUM_EP
59 
68 #ifndef DWC2_USB_OTG_FS_RX_FIFO_SIZE
69 #define DWC2_USB_OTG_FS_RX_FIFO_SIZE (128U)
70 #endif
71 
77 #ifndef DWC2_USB_OTG_HS_RX_FIFO_SIZE
78 #define DWC2_USB_OTG_HS_RX_FIFO_SIZE (512U)
79 #endif
80 
88 #ifndef USB_OTG_FS_TOTAL_FIFO_SIZE
89 #define USB_OTG_FS_TOTAL_FIFO_SIZE (1280U)
90 #endif
91 
99 #ifndef USB_OTG_HS_TOTAL_FIFO_SIZE
100 #define USB_OTG_HS_TOTAL_FIFO_SIZE (4096U)
101 #endif
102 
106 #define DWC2_USB_OTG_FS_TOTAL_FIFO_SIZE USB_OTG_FS_TOTAL_FIFO_SIZE
107 
111 #define DWC2_USB_OTG_HS_TOTAL_FIFO_SIZE USB_OTG_HS_TOTAL_FIFO_SIZE
112 
113 /* periph/usbdev.h is included after the definitions above by intention */
114 #include "periph/usbdev.h"
115 
119 typedef struct {
124  size_t used;
126 
127 #ifdef __cplusplus
128 }
129 #endif
Shared CPU specific definitions for the STM32 family.
stm32 USB device FS configuration
Definition: cpu_usbdev.h:44
stm32 USB Device FS only peripheral device context
Definition: usbdev_stm32.h:119
const stm32_usbdev_fs_config_t * config
USB peripheral config
Definition: usbdev_stm32.h:121
usbdev_t usbdev
Inherited usbdev struct.
Definition: usbdev_stm32.h:120
size_t used
Bytes used by usbdev stack.
Definition: usbdev_stm32.h:124
usbdev_ep_t * in
In endpoints.
Definition: usbdev_stm32.h:122
usbdev_ep_t * out
Out endpoints.
Definition: usbdev_stm32.h:123
usbdev endpoint descriptor
Definition: usbdev.h:259
usbdev device descriptor
Definition: usbdev.h:247
Definitions low-level USB driver interface.