Prusa MINI Firmware overview
usbh_conf.h
Go to the documentation of this file.
1 /**
2  ******************************************************************************
3  * @file : usbh_conf.h
4  * @version : v1.0_Cube
5  * @brief : Header for usbh_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 __USBH_CONF__H__
52  #define __USBH_CONF__H__
53  #include <stdio.h>
54  #include <stdlib.h>
55  #include <string.h>
56 
57  #ifdef __cplusplus
58 extern "C" {
59  #endif
60 
61  /* Includes ------------------------------------------------------------------*/
62  #include "stm32f4xx.h"
63  #include "stm32f4xx_hal.h"
64 
65  /* USER CODE BEGIN INCLUDE */
66 
67  /* USER CODE END INCLUDE */
68 
69  /** @addtogroup USBH_OTG_DRIVER
70  * @brief Driver for Usb host.
71  * @{
72  */
73 
74  /** @defgroup USBH_CONF USBH_CONF
75  * @brief Configuration file for Usb otg low level driver.
76  * @{
77  */
78 
79  /** @defgroup USBH_CONF_Exported_Variables USBH_CONF_Exported_Variables
80  * @brief Public variables.
81  * @{
82  */
83 
84  /**
85  * @}
86  */
87 
88  /** @defgroup USBH_CONF_Exported_Defines USBH_CONF_Exported_Defines
89  * @brief Defines for configuration of the Usb host.
90  * @{
91  */
92 
93  /*
94  MiddleWare name : USB_HOST
95  MiddleWare fileName : usbh_conf.h
96  MiddleWare version :
97 */
98  /*---------- -----------*/
99  #define USBH_MAX_NUM_ENDPOINTS 2
100 
101  /*---------- -----------*/
102  #define USBH_MAX_NUM_INTERFACES 2
103 
104  /*---------- -----------*/
105  #define USBH_MAX_NUM_CONFIGURATION 1
106 
107  /*---------- -----------*/
108  #define USBH_KEEP_CFG_DESCRIPTOR 1
109 
110  /*---------- -----------*/
111  #define USBH_MAX_NUM_SUPPORTED_CLASS 1
112 
113  /*---------- -----------*/
114  #define USBH_MAX_SIZE_CONFIGURATION 256
115 
116  /*---------- -----------*/
117  #define USBH_MAX_DATA_BUFFER 512
118 
119  /*---------- -----------*/
120  #define USBH_DEBUG_LEVEL 0
121 
122  /*---------- -----------*/
123  #define USBH_USE_OS 1
124 
125  /****************************************/
126  /* #define for FS and HS identification */
127  #define HOST_HS 0
128  #define HOST_FS 1
129 
130  #if (USBH_USE_OS == 1)
131  #include "cmsis_os.h"
132  #define USBH_PROCESS_PRIO osPriorityNormal
133  #define USBH_PROCESS_STACK_SIZE ((uint16_t)128)
134  #endif /* (USBH_USE_OS == 1) */
135 
136  /**
137  * @}
138  */
139 
140  /** @defgroup USBH_CONF_Exported_Macros USBH_CONF_Exported_Macros
141  * @brief Aliases.
142  * @{
143  */
144 
145  /* Memory management macros */
146 
147  /** Alias for memory allocation. */
148  #define USBH_malloc malloc
149 
150  /** Alias for memory release. */
151  #define USBH_free free
152 
153  /** Alias for memory set. */
154  #define USBH_memset memset
155 
156  /** Alias for memory copy. */
157  #define USBH_memcpy memcpy
158 
159 /* DEBUG macros */
160 
161  #if (USBH_DEBUG_LEVEL > 0)
162  #define USBH_UsrLog(...) \
163  printf(__VA_ARGS__); \
164  printf("\n");
165  #else
166  #define USBH_UsrLog(...)
167  #endif
168 
169  #if (USBH_DEBUG_LEVEL > 1)
170 
171  #define USBH_ErrLog(...) \
172  printf("ERROR: "); \
173  printf(__VA_ARGS__); \
174  printf("\n");
175  #else
176  #define USBH_ErrLog(...)
177  #endif
178 
179  #if (USBH_DEBUG_LEVEL > 2)
180  #define USBH_DbgLog(...) \
181  printf("DEBUG : "); \
182  printf(__VA_ARGS__); \
183  printf("\n");
184  #else
185  #define USBH_DbgLog(...)
186  #endif
187 
188 /**
189  * @}
190  */
191 
192 /** @defgroup USBH_CONF_Exported_Types USBH_CONF_Exported_Types
193  * @brief Types.
194  * @{
195  */
196 
197 /**
198  * @}
199  */
200 
201 /** @defgroup USBH_CONF_Exported_FunctionsPrototype USBH_CONF_Exported_FunctionsPrototype
202  * @brief Declaration of public functions for Usb host.
203  * @{
204  */
205 
206 /* Exported functions -------------------------------------------------------*/
207 
208 /**
209  * @}
210  */
211 
212 /**
213  * @}
214  */
215 
216 /**
217  * @}
218  */
219 
220  #ifdef __cplusplus
221 }
222  #endif
223 
224 #endif /* __USBH_CONF__H__ */
225 
226 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
stm32f4xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
cmsis_os.h
Header of cmsis_os.c A new set of APIs are added in addition to existing ones, these APIs are specifi...