1 | /* USER CODE BEGIN Header */
|
---|
2 | /**
|
---|
3 | ******************************************************************************
|
---|
4 | * @file : usbd_conf.h
|
---|
5 | * @version : v1.0_Cube
|
---|
6 | * @brief : Header for usbd_conf.c file.
|
---|
7 | ******************************************************************************
|
---|
8 | * @attention
|
---|
9 | *
|
---|
10 | * <h2><center>© Copyright (c) 2021 STMicroelectronics.
|
---|
11 | * All rights reserved.</center></h2>
|
---|
12 | *
|
---|
13 | * This software component is licensed by ST under Ultimate Liberty license
|
---|
14 | * SLA0044, the "License"; You may not use this file except in compliance with
|
---|
15 | * the License. You may obtain a copy of the License at:
|
---|
16 | * www.st.com/SLA0044
|
---|
17 | *
|
---|
18 | ******************************************************************************
|
---|
19 | */
|
---|
20 | /* USER CODE END Header */
|
---|
21 |
|
---|
22 | /* Define to prevent recursive inclusion -------------------------------------*/
|
---|
23 | #ifndef __USBD_CONF__H__
|
---|
24 | #define __USBD_CONF__H__
|
---|
25 |
|
---|
26 | #ifdef __cplusplus
|
---|
27 | extern "C" {
|
---|
28 | #endif
|
---|
29 |
|
---|
30 | /* Includes ------------------------------------------------------------------*/
|
---|
31 | #include <stdio.h>
|
---|
32 | #include <stdlib.h>
|
---|
33 | #include <string.h>
|
---|
34 | #include "main.h"
|
---|
35 | #include "stm32f4xx.h"
|
---|
36 | #include "stm32f4xx_hal.h"
|
---|
37 |
|
---|
38 | /* USER CODE BEGIN INCLUDE */
|
---|
39 |
|
---|
40 | /* USER CODE END INCLUDE */
|
---|
41 |
|
---|
42 | /** @addtogroup USBD_OTG_DRIVER
|
---|
43 | * @brief Driver for Usb device.
|
---|
44 | * @{
|
---|
45 | */
|
---|
46 |
|
---|
47 | /** @defgroup USBD_CONF USBD_CONF
|
---|
48 | * @brief Configuration file for Usb otg low level driver.
|
---|
49 | * @{
|
---|
50 | */
|
---|
51 |
|
---|
52 | /** @defgroup USBD_CONF_Exported_Variables USBD_CONF_Exported_Variables
|
---|
53 | * @brief Public variables.
|
---|
54 | * @{
|
---|
55 | */
|
---|
56 |
|
---|
57 | /**
|
---|
58 | * @}
|
---|
59 | */
|
---|
60 |
|
---|
61 | /** @defgroup USBD_CONF_Exported_Defines USBD_CONF_Exported_Defines
|
---|
62 | * @brief Defines for configuration of the Usb device.
|
---|
63 | * @{
|
---|
64 | */
|
---|
65 |
|
---|
66 | /*---------- -----------*/
|
---|
67 | #define USBD_MAX_NUM_INTERFACES 1U
|
---|
68 | /*---------- -----------*/
|
---|
69 | #define USBD_MAX_NUM_CONFIGURATION 1U
|
---|
70 | /*---------- -----------*/
|
---|
71 | #define USBD_MAX_STR_DESC_SIZ 512U
|
---|
72 | /*---------- -----------*/
|
---|
73 | #define USBD_DEBUG_LEVEL 0U
|
---|
74 | /*---------- -----------*/
|
---|
75 | #define USBD_LPM_ENABLED 0U
|
---|
76 | /*---------- -----------*/
|
---|
77 | #define USBD_SELF_POWERED 1U
|
---|
78 |
|
---|
79 | /****************************************/
|
---|
80 | /* #define for FS and HS identification */
|
---|
81 | #define DEVICE_FS 0
|
---|
82 | #define DEVICE_HS 1
|
---|
83 |
|
---|
84 | /**
|
---|
85 | * @}
|
---|
86 | */
|
---|
87 |
|
---|
88 | /** @defgroup USBD_CONF_Exported_Macros USBD_CONF_Exported_Macros
|
---|
89 | * @brief Aliases.
|
---|
90 | * @{
|
---|
91 | */
|
---|
92 | /* Memory management macros make sure to use static memory allocation */
|
---|
93 | /** Alias for memory allocation. */
|
---|
94 |
|
---|
95 | #define USBD_malloc (void *)USBD_static_malloc
|
---|
96 |
|
---|
97 | /** Alias for memory release. */
|
---|
98 | #define USBD_free USBD_static_free
|
---|
99 |
|
---|
100 | /** Alias for memory set. */
|
---|
101 | #define USBD_memset memset
|
---|
102 |
|
---|
103 | /** Alias for memory copy. */
|
---|
104 | #define USBD_memcpy memcpy
|
---|
105 |
|
---|
106 | /** Alias for delay. */
|
---|
107 | #define USBD_Delay HAL_Delay
|
---|
108 |
|
---|
109 | /* DEBUG macros */
|
---|
110 |
|
---|
111 | #if (USBD_DEBUG_LEVEL > 0)
|
---|
112 | #define USBD_UsrLog(...) printf(__VA_ARGS__);\
|
---|
113 | printf("\n");
|
---|
114 | #else
|
---|
115 | #define USBD_UsrLog(...)
|
---|
116 | #endif
|
---|
117 |
|
---|
118 | #if (USBD_DEBUG_LEVEL > 1)
|
---|
119 |
|
---|
120 | #define USBD_ErrLog(...) printf("ERROR: ") ;\
|
---|
121 | printf(__VA_ARGS__);\
|
---|
122 | printf("\n");
|
---|
123 | #else
|
---|
124 | #define USBD_ErrLog(...)
|
---|
125 | #endif
|
---|
126 |
|
---|
127 | #if (USBD_DEBUG_LEVEL > 2)
|
---|
128 | #define USBD_DbgLog(...) printf("DEBUG : ") ;\
|
---|
129 | printf(__VA_ARGS__);\
|
---|
130 | printf("\n");
|
---|
131 | #else
|
---|
132 | #define USBD_DbgLog(...)
|
---|
133 | #endif
|
---|
134 |
|
---|
135 | /**
|
---|
136 | * @}
|
---|
137 | */
|
---|
138 |
|
---|
139 | /** @defgroup USBD_CONF_Exported_Types USBD_CONF_Exported_Types
|
---|
140 | * @brief Types.
|
---|
141 | * @{
|
---|
142 | */
|
---|
143 |
|
---|
144 | /**
|
---|
145 | * @}
|
---|
146 | */
|
---|
147 |
|
---|
148 | /** @defgroup USBD_CONF_Exported_FunctionsPrototype USBD_CONF_Exported_FunctionsPrototype
|
---|
149 | * @brief Declaration of public functions for Usb device.
|
---|
150 | * @{
|
---|
151 | */
|
---|
152 |
|
---|
153 | /* Exported functions -------------------------------------------------------*/
|
---|
154 | void *USBD_static_malloc(uint32_t size);
|
---|
155 | void USBD_static_free(void *p);
|
---|
156 |
|
---|
157 | /**
|
---|
158 | * @}
|
---|
159 | */
|
---|
160 |
|
---|
161 | /**
|
---|
162 | * @}
|
---|
163 | */
|
---|
164 |
|
---|
165 | /**
|
---|
166 | * @}
|
---|
167 | */
|
---|
168 |
|
---|
169 | #ifdef __cplusplus
|
---|
170 | }
|
---|
171 | #endif
|
---|
172 |
|
---|
173 | #endif /* __USBD_CONF__H__ */
|
---|
174 |
|
---|
175 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
---|