| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,171 @@ |
| 1 |
+/** |
|
| 2 |
+ ****************************************************************************** |
|
| 3 |
+ * @file usbd_conf_template.h |
|
| 4 |
+ * @author MCD Application Team |
|
| 5 |
+ * @brief Header file for the usbd_conf_template.c file |
|
| 6 |
+ ****************************************************************************** |
|
| 7 |
+ * @attention |
|
| 8 |
+ * |
|
| 9 |
+ * Copyright (c) 2015 STMicroelectronics. |
|
| 10 |
+ * All rights reserved. |
|
| 11 |
+ * |
|
| 12 |
+ * This software is licensed under terms that can be found in the LICENSE file |
|
| 13 |
+ * in the root directory of this software component. |
|
| 14 |
+ * If no LICENSE file comes with this software, it is provided AS-IS. |
|
| 15 |
+ * |
|
| 16 |
+ ****************************************************************************** |
|
| 17 |
+ */ |
|
| 18 |
+ |
|
| 19 |
+/* Define to prevent recursive inclusion -------------------------------------*/ |
|
| 20 |
+#ifndef __USBD_CONF_TEMPLATE_H |
|
| 21 |
+#define __USBD_CONF_TEMPLATE_H |
|
| 22 |
+ |
|
| 23 |
+#ifdef __cplusplus |
|
| 24 |
+extern "C" {
|
|
| 25 |
+#endif |
|
| 26 |
+ |
|
| 27 |
+/* Includes ------------------------------------------------------------------*/ |
|
| 28 |
+#include "stm32f0xx.h" /* replace 'stm32xxx' with your HAL driver header filename, ex: stm32f4xx.h */ |
|
| 29 |
+ |
|
| 30 |
+#include <stdio.h> |
|
| 31 |
+#include <stdlib.h> |
|
| 32 |
+#include <string.h> |
|
| 33 |
+ |
|
| 34 |
+/** @addtogroup STM32_USB_DEVICE_LIBRARY |
|
| 35 |
+ * @{
|
|
| 36 |
+ */ |
|
| 37 |
+ |
|
| 38 |
+/** @defgroup USBD_CONF |
|
| 39 |
+ * @brief USB device low level driver configuration file |
|
| 40 |
+ * @{
|
|
| 41 |
+ */ |
|
| 42 |
+ |
|
| 43 |
+/** @defgroup USBD_CONF_Exported_Defines |
|
| 44 |
+ * @{
|
|
| 45 |
+ */ |
|
| 46 |
+ |
|
| 47 |
+#define USBD_MAX_NUM_INTERFACES 1U |
|
| 48 |
+#define USBD_MAX_NUM_CONFIGURATION 1U |
|
| 49 |
+#define USBD_MAX_STR_DESC_SIZ 0x100U |
|
| 50 |
+#define USBD_SELF_POWERED 1U |
|
| 51 |
+#define USBD_DEBUG_LEVEL 0U |
|
| 52 |
+ |
|
| 53 |
+/* ECM, RNDIS, DFU Class Config */ |
|
| 54 |
+#define USBD_SUPPORT_USER_STRING_DESC 0U |
|
| 55 |
+ |
|
| 56 |
+/* BillBoard Class Config */ |
|
| 57 |
+#define USBD_CLASS_USER_STRING_DESC 0U |
|
| 58 |
+#define USBD_CLASS_BOS_ENABLED 0U |
|
| 59 |
+#define USB_BB_MAX_NUM_ALT_MODE 0x2U |
|
| 60 |
+ |
|
| 61 |
+/* MSC Class Config */ |
|
| 62 |
+#define MSC_MEDIA_PACKET 512U |
|
| 63 |
+ |
|
| 64 |
+/** @defgroup USBD_Exported_Macros |
|
| 65 |
+ * @{
|
|
| 66 |
+ */ |
|
| 67 |
+ |
|
| 68 |
+/* Memory management macros make sure to use static memory allocation */ |
|
| 69 |
+/** Alias for memory allocation. */ |
|
| 70 |
+#define USBD_malloc (void *)USBD_static_malloc |
|
| 71 |
+ |
|
| 72 |
+/** Alias for memory release. */ |
|
| 73 |
+#define USBD_free USBD_static_free |
|
| 74 |
+ |
|
| 75 |
+/** Alias for memory set. */ |
|
| 76 |
+#define USBD_memset memset |
|
| 77 |
+ |
|
| 78 |
+/** Alias for memory copy. */ |
|
| 79 |
+#define USBD_memcpy memcpy |
|
| 80 |
+ |
|
| 81 |
+/** Alias for delay. */ |
|
| 82 |
+#define USBD_Delay HAL_Delay |
|
| 83 |
+ |
|
| 84 |
+/* DEBUG macros */ |
|
| 85 |
+#if (USBD_DEBUG_LEVEL > 0U) |
|
| 86 |
+#define USBD_UsrLog(...) do { \
|
|
| 87 |
+ printf(__VA_ARGS__); \ |
|
| 88 |
+ printf("\n"); \
|
|
| 89 |
+ } while (0) |
|
| 90 |
+#else |
|
| 91 |
+#define USBD_UsrLog(...) do {} while (0)
|
|
| 92 |
+#endif /* (USBD_DEBUG_LEVEL > 0U) */ |
|
| 93 |
+ |
|
| 94 |
+#if (USBD_DEBUG_LEVEL > 1U) |
|
| 95 |
+ |
|
| 96 |
+#define USBD_ErrLog(...) do { \
|
|
| 97 |
+ printf("ERROR: ") ; \
|
|
| 98 |
+ printf(__VA_ARGS__); \ |
|
| 99 |
+ printf("\n"); \
|
|
| 100 |
+ } while (0) |
|
| 101 |
+#else |
|
| 102 |
+#define USBD_ErrLog(...) do {} while (0)
|
|
| 103 |
+#endif /* (USBD_DEBUG_LEVEL > 1U) */ |
|
| 104 |
+ |
|
| 105 |
+#if (USBD_DEBUG_LEVEL > 2U) |
|
| 106 |
+#define USBD_DbgLog(...) do { \
|
|
| 107 |
+ printf("DEBUG : ") ; \
|
|
| 108 |
+ printf(__VA_ARGS__); \ |
|
| 109 |
+ printf("\n"); \
|
|
| 110 |
+ } while (0) |
|
| 111 |
+#else |
|
| 112 |
+#define USBD_DbgLog(...) do {} while (0)
|
|
| 113 |
+#endif /* (USBD_DEBUG_LEVEL > 2U) */ |
|
| 114 |
+ |
|
| 115 |
+/** |
|
| 116 |
+ * @} |
|
| 117 |
+ */ |
|
| 118 |
+ |
|
| 119 |
+ |
|
| 120 |
+ |
|
| 121 |
+/** |
|
| 122 |
+ * @} |
|
| 123 |
+ */ |
|
| 124 |
+ |
|
| 125 |
+ |
|
| 126 |
+/** @defgroup USBD_CONF_Exported_Types |
|
| 127 |
+ * @{
|
|
| 128 |
+ */ |
|
| 129 |
+/** |
|
| 130 |
+ * @} |
|
| 131 |
+ */ |
|
| 132 |
+ |
|
| 133 |
+ |
|
| 134 |
+/** @defgroup USBD_CONF_Exported_Macros |
|
| 135 |
+ * @{
|
|
| 136 |
+ */ |
|
| 137 |
+/** |
|
| 138 |
+ * @} |
|
| 139 |
+ */ |
|
| 140 |
+ |
|
| 141 |
+/** @defgroup USBD_CONF_Exported_Variables |
|
| 142 |
+ * @{
|
|
| 143 |
+ */ |
|
| 144 |
+/** |
|
| 145 |
+ * @} |
|
| 146 |
+ */ |
|
| 147 |
+ |
|
| 148 |
+/** @defgroup USBD_CONF_Exported_FunctionsPrototype |
|
| 149 |
+ * @{
|
|
| 150 |
+ */ |
|
| 151 |
+/* Exported functions -------------------------------------------------------*/ |
|
| 152 |
+void *USBD_static_malloc(uint32_t size); |
|
| 153 |
+void USBD_static_free(void *p); |
|
| 154 |
+/** |
|
| 155 |
+ * @} |
|
| 156 |
+ */ |
|
| 157 |
+ |
|
| 158 |
+#ifdef __cplusplus |
|
| 159 |
+} |
|
| 160 |
+#endif |
|
| 161 |
+ |
|
| 162 |
+#endif /* __USBD_CONF_TEMPLATE_H */ |
|
| 163 |
+ |
|
| 164 |
+ |
|
| 165 |
+/** |
|
| 166 |
+ * @} |
|
| 167 |
+ */ |
|
| 168 |
+ |
|
| 169 |
+/** |
|
| 170 |
+ * @} |
|
| 171 |
+ */ |