usbd_conf.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __USBD_CONF__H__
  23. #define __USBD_CONF__H__
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include <stdio.h>
  29. #include <stdlib.h>
  30. #include <string.h>
  31. #include "main.h"
  32. #include "stm32f4xx.h"
  33. #include "stm32f4xx_hal.h"
  34. /* USER CODE BEGIN INCLUDE */
  35. /* USER CODE END INCLUDE */
  36. /** @addtogroup USBD_OTG_DRIVER
  37. * @brief Driver for Usb device.
  38. * @{
  39. */
  40. /** @defgroup USBD_CONF USBD_CONF
  41. * @brief Configuration file for Usb otg low level driver.
  42. * @{
  43. */
  44. /** @defgroup USBD_CONF_Exported_Variables USBD_CONF_Exported_Variables
  45. * @brief Public variables.
  46. * @{
  47. */
  48. /**
  49. * @}
  50. */
  51. /** @defgroup USBD_CONF_Exported_Defines USBD_CONF_Exported_Defines
  52. * @brief Defines for configuration of the Usb device.
  53. * @{
  54. */
  55. /*---------- -----------*/
  56. #define USBD_MAX_NUM_INTERFACES 1U
  57. /*---------- -----------*/
  58. #define USBD_MAX_NUM_CONFIGURATION 1U
  59. /*---------- -----------*/
  60. #define USBD_MAX_STR_DESC_SIZ 512U
  61. /*---------- -----------*/
  62. #define USBD_DEBUG_LEVEL 0U
  63. /*---------- -----------*/
  64. #define USBD_LPM_ENABLED 1U
  65. /*---------- -----------*/
  66. #define USBD_SELF_POWERED 1U
  67. /*---------- -----------*/
  68. #define MSC_MEDIA_PACKET 512U
  69. /****************************************/
  70. /* #define for FS and HS identification */
  71. #define DEVICE_FS 0
  72. #define DEVICE_HS 1
  73. /**
  74. * @}
  75. */
  76. /** @defgroup USBD_CONF_Exported_Macros USBD_CONF_Exported_Macros
  77. * @brief Aliases.
  78. * @{
  79. */
  80. /* Memory management macros */
  81. /** Alias for memory allocation. */
  82. #define USBD_malloc malloc
  83. /** Alias for memory release. */
  84. #define USBD_free free
  85. /** Alias for memory set. */
  86. #define USBD_memset memset
  87. /** Alias for memory copy. */
  88. #define USBD_memcpy memcpy
  89. /** Alias for delay. */
  90. #define USBD_Delay HAL_Delay
  91. /* DEBUG macros */
  92. #if (USBD_DEBUG_LEVEL > 0)
  93. #define USBD_UsrLog(...) printf(__VA_ARGS__);\
  94. printf("\n");
  95. #else
  96. #define USBD_UsrLog(...)
  97. #endif
  98. #if (USBD_DEBUG_LEVEL > 1)
  99. #define USBD_ErrLog(...) printf("ERROR: ") ;\
  100. printf(__VA_ARGS__);\
  101. printf("\n");
  102. #else
  103. #define USBD_ErrLog(...)
  104. #endif
  105. #if (USBD_DEBUG_LEVEL > 2)
  106. #define USBD_DbgLog(...) printf("DEBUG : ") ;\
  107. printf(__VA_ARGS__);\
  108. printf("\n");
  109. #else
  110. #define USBD_DbgLog(...)
  111. #endif
  112. /**
  113. * @}
  114. */
  115. /** @defgroup USBD_CONF_Exported_Types USBD_CONF_Exported_Types
  116. * @brief Types.
  117. * @{
  118. */
  119. /**
  120. * @}
  121. */
  122. /** @defgroup USBD_CONF_Exported_FunctionsPrototype USBD_CONF_Exported_FunctionsPrototype
  123. * @brief Declaration of public functions for Usb device.
  124. * @{
  125. */
  126. /* Exported functions -------------------------------------------------------*/
  127. /**
  128. * @}
  129. */
  130. /**
  131. * @}
  132. */
  133. /**
  134. * @}
  135. */
  136. #ifdef __cplusplus
  137. }
  138. #endif
  139. #endif /* __USBD_CONF__H__ */
  140. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/