Prusa MINI Firmware overview
usbd_conf.h
Go to the documentation of this file.
1 /**
2  ******************************************************************************
3  * @file : usbd_conf.h
4  * @version : v1.0_Cube
5  * @brief : Header for usbd_conf.c file.
6  ******************************************************************************
7  * This notice applies to any and all portions of this file
8  * that are not between comment pairs USER CODE BEGIN and
9  * USER CODE END. Other portions of this file, whether
10  * inserted by the user or by software development tools
11  * are owned by their respective copyright owners.
12  *
13  * Copyright (c) 2019 STMicroelectronics International N.V.
14  * All rights reserved.
15  *
16  * Redistribution and use in source and binary forms, with or without
17  * modification, are permitted, provided that the following conditions are met:
18  *
19  * 1. Redistribution of source code must retain the above copyright notice,
20  * this list of conditions and the following disclaimer.
21  * 2. Redistributions in binary form must reproduce the above copyright notice,
22  * this list of conditions and the following disclaimer in the documentation
23  * and/or other materials provided with the distribution.
24  * 3. Neither the name of STMicroelectronics nor the names of other
25  * contributors to this software may be used to endorse or promote products
26  * derived from this software without specific written permission.
27  * 4. This software, including modifications and/or derivative works of this
28  * software, must execute solely and exclusively on microcontroller or
29  * microprocessor devices manufactured by or for STMicroelectronics.
30  * 5. Redistribution and use of this software other than as permitted under
31  * this license is void and will automatically terminate your rights under
32  * this license.
33  *
34  * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS"
35  * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT
36  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
37  * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
38  * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT
39  * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
40  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
42  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
43  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
44  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
45  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46  *
47  ******************************************************************************
48  */
49 
50 /* Define to prevent recursive inclusion -------------------------------------*/
51 #ifndef __USBD_CONF__H__
52  #define __USBD_CONF__H__
53 
54  #ifdef __cplusplus
55 extern "C" {
56  #endif
57 
58  /* Includes ------------------------------------------------------------------*/
59  #include <stdio.h>
60  #include <stdlib.h>
61  #include <string.h>
62  #include "main.h"
63  #include "stm32f4xx.h"
64  #include "stm32f4xx_hal.h"
65 
66  /* USER CODE BEGIN INCLUDE */
67 
68  /* USER CODE END INCLUDE */
69 
70  /** @addtogroup USBD_OTG_DRIVER
71  * @brief Driver for Usb device.
72  * @{
73  */
74 
75  /** @defgroup USBD_CONF USBD_CONF
76  * @brief Configuration file for Usb otg low level driver.
77  * @{
78  */
79 
80  /** @defgroup USBD_CONF_Exported_Variables USBD_CONF_Exported_Variables
81  * @brief Public variables.
82  * @{
83  */
84 
85  /**
86  * @}
87  */
88 
89  /** @defgroup USBD_CONF_Exported_Defines USBD_CONF_Exported_Defines
90  * @brief Defines for configuration of the Usb device.
91  * @{
92  */
93 
94  /*---------- -----------*/
95  #define USBD_MAX_NUM_INTERFACES 1
96  /*---------- -----------*/
97  #define USBD_MAX_NUM_CONFIGURATION 1
98  /*---------- -----------*/
99  #define USBD_MAX_STR_DESC_SIZ 512
100  /*---------- -----------*/
101  #define USBD_SUPPORT_USER_STRING 0
102  /*---------- -----------*/
103  #define USBD_DEBUG_LEVEL 0
104  /*---------- -----------*/
105  #define USBD_LPM_ENABLED 0
106  /*---------- -----------*/
107  #define USBD_SELF_POWERED 1
108 
109  /****************************************/
110  /* #define for FS and HS identification */
111  #define DEVICE_FS 0
112  #define DEVICE_HS 1
113 
114  /**
115  * @}
116  */
117 
118  /** @defgroup USBD_CONF_Exported_Macros USBD_CONF_Exported_Macros
119  * @brief Aliases.
120  * @{
121  */
122 
123  /* Memory management macros */
124 
125  /** Alias for memory allocation. */
126  #define USBD_malloc malloc
127 
128  /** Alias for memory release. */
129  #define USBD_free free
130 
131  /** Alias for memory set. */
132  #define USBD_memset memset
133 
134  /** Alias for memory copy. */
135  #define USBD_memcpy memcpy
136 
137  /** Alias for delay. */
138  #define USBD_Delay HAL_Delay
139 
140 /* DEBUG macros */
141 
142  #if (USBD_DEBUG_LEVEL > 0)
143  #define USBD_UsrLog(...) \
144  printf(__VA_ARGS__); \
145  printf("\n");
146  #else
147  #define USBD_UsrLog(...)
148  #endif
149 
150  #if (USBD_DEBUG_LEVEL > 1)
151 
152  #define USBD_ErrLog(...) \
153  printf("ERROR: "); \
154  printf(__VA_ARGS__); \
155  printf("\n");
156  #else
157  #define USBD_ErrLog(...)
158  #endif
159 
160  #if (USBD_DEBUG_LEVEL > 2)
161  #define USBD_DbgLog(...) \
162  printf("DEBUG : "); \
163  printf(__VA_ARGS__); \
164  printf("\n");
165  #else
166  #define USBD_DbgLog(...)
167  #endif
168 
169 /**
170  * @}
171  */
172 
173 /** @defgroup USBD_CONF_Exported_Types USBD_CONF_Exported_Types
174  * @brief Types.
175  * @{
176  */
177 
178 /**
179  * @}
180  */
181 
182 /** @defgroup USBD_CONF_Exported_FunctionsPrototype USBD_CONF_Exported_FunctionsPrototype
183  * @brief Declaration of public functions for Usb device.
184  * @{
185  */
186 
187 /* Exported functions -------------------------------------------------------*/
188 
189 /**
190  * @}
191  */
192 
193 /**
194  * @}
195  */
196 
197 /**
198  * @}
199  */
200 
201  #ifdef __cplusplus
202 }
203  #endif
204 
205 #endif /* __USBD_CONF__H__ */
206 
207 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
main.h
: Header for main.c file. This file contains the common defines of the application.
stm32f4xx_hal.h
This file contains all the functions prototypes for the HAL module driver.