Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | mjames | 1 | /* USER CODE BEGIN Header */ |
2 | /** |
||
3 | ****************************************************************************** |
||
4 | * @file : usbd_conf.h |
||
5 | * @version : v2.0_Cube |
||
6 | * @brief : Header for usbd_conf.c file. |
||
7 | ****************************************************************************** |
||
8 | * @attention |
||
9 | * |
||
10 | * <h2><center>© Copyright (c) 2019 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 "stm32f1xx.h" |
||
36 | #include "stm32f1xx_hal.h" |
||
37 | |||
38 | /* USER CODE BEGIN INCLUDE */ |
||
39 | |||
40 | /* USER CODE END INCLUDE */ |
||
41 | |||
42 | /** @addtogroup USBD_OTG_DRIVER |
||
43 | * @{ |
||
44 | */ |
||
45 | |||
46 | /** @defgroup USBD_CONF USBD_CONF |
||
47 | * @brief Configuration file for Usb otg low level driver. |
||
48 | * @{ |
||
49 | */ |
||
50 | |||
51 | /** @defgroup USBD_CONF_Exported_Variables USBD_CONF_Exported_Variables |
||
52 | * @brief Public variables. |
||
53 | * @{ |
||
54 | */ |
||
55 | |||
56 | /** |
||
57 | * @} |
||
58 | */ |
||
59 | |||
60 | /** @defgroup USBD_CONF_Exported_Defines USBD_CONF_Exported_Defines |
||
61 | * @brief Defines for configuration of the Usb device. |
||
62 | * @{ |
||
63 | */ |
||
64 | |||
65 | /*---------- -----------*/ |
||
66 | #define USBD_MAX_NUM_INTERFACES 1 |
||
67 | /*---------- -----------*/ |
||
68 | #define USBD_MAX_NUM_CONFIGURATION 1 |
||
69 | /*---------- -----------*/ |
||
70 | #define USBD_MAX_STR_DESC_SIZ 64 |
||
71 | /*---------- -----------*/ |
||
72 | #define USBD_SUPPORT_USER_STRING 0 |
||
73 | /*---------- -----------*/ |
||
74 | #define USBD_DEBUG_LEVEL 0 |
||
75 | /*---------- -----------*/ |
||
76 | #define USBD_SELF_POWERED 1 |
||
77 | /*---------- -----------*/ |
||
78 | #define MAX_STATIC_ALLOC_SIZE 512 |
||
79 | |||
80 | /****************************************/ |
||
81 | /* #define for FS and HS identification */ |
||
82 | #define DEVICE_FS 0 |
||
83 | |||
84 | /** |
||
85 | * @} |
||
86 | */ |
||
87 | |||
88 | /** @defgroup USBD_CONF_Exported_Macros USBD_CONF_Exported_Macros |
||
89 | * @brief Aliases. |
||
90 | * @{ |
||
91 | */ |
||
92 | |||
93 | /* Memory management macros */ |
||
94 | |||
95 | /** Alias for memory allocation. */ |
||
96 | #define USBD_malloc (uint32_t *)USBD_static_malloc |
||
97 | |||
98 | /** Alias for memory release. */ |
||
99 | #define USBD_free USBD_static_free |
||
100 | |||
101 | /** Alias for memory set. */ |
||
102 | #define USBD_memset /* Not used */ |
||
103 | |||
104 | /** Alias for memory copy. */ |
||
105 | #define USBD_memcpy /* Not used */ |
||
106 | |||
107 | /** Alias for delay. */ |
||
108 | #define USBD_Delay HAL_Delay |
||
109 | |||
110 | /* For footprint reasons and since only one allocation is handled in the HID class |
||
111 | driver, the malloc/free is changed into a static allocation method */ |
||
112 | void *USBD_static_malloc(uint32_t size); |
||
113 | void USBD_static_free(void *p); |
||
114 | |||
115 | /* DEBUG macros */ |
||
116 | |||
117 | #if (USBD_DEBUG_LEVEL > 0) |
||
118 | #define USBD_UsrLog(...) printf(__VA_ARGS__);\ |
||
119 | printf("\n"); |
||
120 | #else |
||
121 | #define USBD_UsrLog(...) |
||
122 | #endif |
||
123 | |||
124 | #if (USBD_DEBUG_LEVEL > 1) |
||
125 | |||
126 | #define USBD_ErrLog(...) printf("ERROR: ") ;\ |
||
127 | printf(__VA_ARGS__);\ |
||
128 | printf("\n"); |
||
129 | #else |
||
130 | #define USBD_ErrLog(...) |
||
131 | #endif |
||
132 | |||
133 | #if (USBD_DEBUG_LEVEL > 2) |
||
134 | #define USBD_DbgLog(...) printf("DEBUG : ") ;\ |
||
135 | printf(__VA_ARGS__);\ |
||
136 | printf("\n"); |
||
137 | #else |
||
138 | #define USBD_DbgLog(...) |
||
139 | #endif |
||
140 | |||
141 | /** |
||
142 | * @} |
||
143 | */ |
||
144 | |||
145 | /** @defgroup USBD_CONF_Exported_Types USBD_CONF_Exported_Types |
||
146 | * @brief Types. |
||
147 | * @{ |
||
148 | */ |
||
149 | |||
150 | /** |
||
151 | * @} |
||
152 | */ |
||
153 | |||
154 | /** @defgroup USBD_CONF_Exported_FunctionsPrototype USBD_CONF_Exported_FunctionsPrototype |
||
155 | * @brief Declaration of public functions for Usb device. |
||
156 | * @{ |
||
157 | */ |
||
158 | |||
159 | /* Exported functions -------------------------------------------------------*/ |
||
160 | |||
161 | /** |
||
162 | * @} |
||
163 | */ |
||
164 | |||
165 | /** |
||
166 | * @} |
||
167 | */ |
||
168 | |||
169 | /** |
||
170 | * @} |
||
171 | */ |
||
172 | |||
173 | #ifdef __cplusplus |
||
174 | } |
||
175 | #endif |
||
176 | |||
177 | #endif /* __USBD_CONF__H__ */ |
||
178 | |||
179 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |