rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
usbd_conf.h
Go to the documentation of this file.
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>&copy; 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#ifdef STM32F429xx
35#include "stm32f4xx.h" /* STM32 CPU and HAL header */
36#endif
37#ifdef STM32F767xx
38#include "stm32f7xx.h" /* STM32 CPU and HAL header */
39#endif
40#ifdef STM32H743xx
41#include "stm32h7xx.h" /* STM32 CPU and HAL header */
42#endif
43
44/* USER CODE BEGIN INCLUDE */
45
46/* USER CODE END INCLUDE */
47
48/** @addtogroup USBD_OTG_DRIVER
49 * @brief Driver for Usb device.
50 * @{
51 */
52
53/** @defgroup USBD_CONF USBD_CONF
54 * @brief Configuration file for Usb otg low level driver.
55 * @{
56 */
57
58/** @defgroup USBD_CONF_Exported_Variables USBD_CONF_Exported_Variables
59 * @brief Public variables.
60 * @{
61 */
62
63/**
64 * @}
65 */
66
67/** @defgroup USBD_CONF_Exported_Defines USBD_CONF_Exported_Defines
68 * @brief Defines for configuration of the Usb device.
69 * @{
70 */
71
72/*---------- -----------*/
73#define USBD_MAX_NUM_INTERFACES 1U
74/*---------- -----------*/
75#define USBD_MAX_NUM_CONFIGURATION 1U
76/*---------- -----------*/
77#define USBD_MAX_STR_DESC_SIZ 512U
78/*---------- -----------*/
79#define USBD_DEBUG_LEVEL 0U
80/*---------- -----------*/
81#define USBD_LPM_ENABLED 0U
82/*---------- -----------*/
83#define USBD_SELF_POWERED 1U
84
85/****************************************/
86/* #define for FS and HS identification */
87#define DEVICE_FS 0
88#define DEVICE_HS 1
89
90/* Inform USB core that a full speed device is used. */
91#define USE_USB_FS
92
93/**
94 * @}
95 */
96
97/** @defgroup USBD_CONF_Exported_Macros USBD_CONF_Exported_Macros
98 * @brief Aliases.
99 * @{
100 */
101
102/* Memory management macros */
103
104/** Alias for memory allocation. */
105#define USBD_malloc malloc
106
107/** Alias for memory release. */
108#define USBD_free free
109
110/** Alias for memory set. */
111#define USBD_memset memset
112
113/** Alias for memory copy. */
114#define USBD_memcpy memcpy
115
116/** Alias for delay. */
117#define USBD_Delay HAL_Delay
118
119/* DEBUG macros */
120
121#if (USBD_DEBUG_LEVEL > 0)
122#define USBD_UsrLog(...) printf(__VA_ARGS__);\
123 printf("\n");
124#else
125#define USBD_UsrLog(...)
126#endif
127
128#if (USBD_DEBUG_LEVEL > 1)
129
130#define USBD_ErrLog(...) printf("ERROR: ") ;\
131 printf(__VA_ARGS__);\
132 printf("\n");
133#else
134#define USBD_ErrLog(...)
135#endif
136
137#if (USBD_DEBUG_LEVEL > 2)
138#define USBD_DbgLog(...) printf("DEBUG : ") ;\
139 printf(__VA_ARGS__);\
140 printf("\n");
141#else
142#define USBD_DbgLog(...)
143#endif
144
145/**
146 * @}
147 */
148
149/** @defgroup USBD_CONF_Exported_Types USBD_CONF_Exported_Types
150 * @brief Types.
151 * @{
152 */
153
154/**
155 * @}
156 */
157
158/** @defgroup USBD_CONF_Exported_FunctionsPrototype USBD_CONF_Exported_FunctionsPrototype
159 * @brief Declaration of public functions for Usb device.
160 * @{
161 */
162
163/* Exported functions -------------------------------------------------------*/
164
165/**
166 * @}
167 */
168
169/**
170 * @}
171 */
172
173/**
174 * @}
175 */
176
177#ifdef __cplusplus
178}
179#endif
180
181#endif /* __USBD_CONF__H__ */
182
183/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/