STAR
Cal STAR — firmware, DAQ server, and engine design
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 * Copyright (c) 2026 STMicroelectronics.
11 * All rights reserved.
12 *
13 * This software is licensed under terms that can be found in the LICENSE file
14 * in the root directory of this software component.
15 * If no LICENSE file comes with this software, it is provided AS-IS.
16 *
17 ******************************************************************************
18 */
19/* USER CODE END Header */
20
21/* Define to prevent recursive inclusion -------------------------------------*/
22#ifndef __USBD_CONF__H__
23#define __USBD_CONF__H__
24
25#ifdef __cplusplus
26 extern "C" {
27#endif
28
29/* Includes ------------------------------------------------------------------*/
30#include <stdio.h>
31#include <stdlib.h>
32#include <string.h>
33#include "main.h"
34#include "stm32h7xx.h"
35#include "stm32h7xx_hal.h"
36
37/* USER CODE BEGIN INCLUDE */
38
39/* USER CODE END INCLUDE */
40
41/** @addtogroup USBD_OTG_DRIVER
42 * @brief Driver for Usb device.
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 1U
67/*---------- -----------*/
68#define USBD_MAX_NUM_CONFIGURATION 1U
69/*---------- -----------*/
70#define USBD_MAX_STR_DESC_SIZ 512U
71/*---------- -----------*/
72#define USBD_DEBUG_LEVEL 0U
73/*---------- -----------*/
74#define USBD_LPM_ENABLED 1U
75/*---------- -----------*/
76#define USBD_SELF_POWERED 1U
77
78/****************************************/
79/* #define for FS and HS identification */
80#define DEVICE_FS 0
81#define DEVICE_HS 1
82
83/**
84 * @}
85 */
86
87/** @defgroup USBD_CONF_Exported_Macros USBD_CONF_Exported_Macros
88 * @brief Aliases.
89 * @{
90 */
91/* Memory management macros make sure to use static memory allocation */
92/** Alias for memory allocation. */
93
94#define USBD_malloc (void *)USBD_static_malloc
95
96/** Alias for memory release. */
97#define USBD_free USBD_static_free
98
99/** Alias for memory set. */
100#define USBD_memset memset
101
102/** Alias for memory copy. */
103#define USBD_memcpy memcpy
104
105/** Alias for delay. */
106#define USBD_Delay HAL_Delay
107
108/* DEBUG macros */
109
110#if (USBD_DEBUG_LEVEL > 0)
111#define USBD_UsrLog(...) printf(__VA_ARGS__);\
112 printf("\n");
113#else
114#define USBD_UsrLog(...)
115#endif /* (USBD_DEBUG_LEVEL > 0U) */
116
117#if (USBD_DEBUG_LEVEL > 1)
118
119#define USBD_ErrLog(...) printf("ERROR: ");\
120 printf(__VA_ARGS__);\
121 printf("\n");
122#else
123#define USBD_ErrLog(...)
124#endif /* (USBD_DEBUG_LEVEL > 1U) */
125
126#if (USBD_DEBUG_LEVEL > 2)
127#define USBD_DbgLog(...) printf("DEBUG : ");\
128 printf(__VA_ARGS__);\
129 printf("\n");
130#else
131#define USBD_DbgLog(...)
132#endif /* (USBD_DEBUG_LEVEL > 2U) */
133
134/**
135 * @}
136 */
137
138/** @defgroup USBD_CONF_Exported_Types USBD_CONF_Exported_Types
139 * @brief Types.
140 * @{
141 */
142
143/**
144 * @}
145 */
146
147/** @defgroup USBD_CONF_Exported_FunctionsPrototype USBD_CONF_Exported_FunctionsPrototype
148 * @brief Declaration of public functions for Usb device.
149 * @{
150 */
151
152/* Exported functions -------------------------------------------------------*/
153void *USBD_static_malloc(uint32_t size);
154void USBD_static_free(void *p);
155
156/**
157 * @}
158 */
159
160/**
161 * @}
162 */
163
164/**
165 * @}
166 */
167
168#ifdef __cplusplus
169}
170#endif
171
172#endif /* __USBD_CONF__H__ */
173
int32_t p
Definition flight_e2e.c:78
void USBD_static_free(void *p)
Dummy memory free.
Definition usbd_conf.c:635
void * USBD_static_malloc(uint32_t size)
Static single allocation.
Definition usbd_conf.c:623
CMSIS STM32H7xx Device Peripheral Access Layer Header File.
This file contains all the functions prototypes for the HAL module driver.