usbd_conf.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /**
  2. ******************************************************************************
  3. * @file : usbd_conf.h
  4. * @version : v1.0_Cube
  5. * @brief : Header for usbd_conf file.
  6. ******************************************************************************
  7. * COPYRIGHT(c) 2019 STMicroelectronics
  8. *
  9. * Redistribution and use in source and binary forms, with or without modification,
  10. * are permitted provided that the following conditions are met:
  11. * 1. Redistributions of source code must retain the above copyright notice,
  12. * this list of conditions and the following disclaimer.
  13. * 2. Redistributions in binary form must reproduce the above copyright notice,
  14. * this list of conditions and the following disclaimer in the documentation
  15. * and/or other materials provided with the distribution.
  16. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  17. * may be used to endorse or promote products derived from this software
  18. * without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  21. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  23. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  24. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  25. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  26. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  27. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  29. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. *
  31. ******************************************************************************
  32. */
  33. /* Define to prevent recursive inclusion -------------------------------------*/
  34. #ifndef __USBD_CONF__H__
  35. #define __USBD_CONF__H__
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39. /* Includes ------------------------------------------------------------------*/
  40. #include <stdio.h>
  41. #include <stdlib.h>
  42. #include <string.h>
  43. #include "stm32f2xx.h"
  44. #include "stm32f2xx_hal.h"
  45. /** @addtogroup USBD_OTG_DRIVER
  46. * @{
  47. */
  48. /** @defgroup USBD_CONF
  49. * @brief usb otg low level driver configuration file
  50. * @{
  51. */
  52. /** @defgroup USBD_CONF_Exported_Defines
  53. * @{
  54. */
  55. /*---------- -----------*/
  56. #define USBD_MAX_NUM_INTERFACES 1
  57. /*---------- -----------*/
  58. #define USBD_MAX_NUM_CONFIGURATION 1
  59. /*---------- -----------*/
  60. #define USBD_MAX_STR_DESC_SIZ 512
  61. /*---------- -----------*/
  62. #define USBD_SUPPORT_USER_STRING 0
  63. /*---------- -----------*/
  64. #define USBD_DEBUG_LEVEL 0
  65. /*---------- -----------*/
  66. #define USBD_LPM_ENABLED 0
  67. /*---------- -----------*/
  68. #define USBD_SELF_POWERED 1
  69. /*---------- -----------*/
  70. #define MSC_MEDIA_PACKET 512
  71. /****************************************/
  72. /* #define for FS and HS identification */
  73. #define DEVICE_FS 0
  74. #define DEVICE_HS 1
  75. /** @defgroup USBD_Exported_Macros
  76. * @{
  77. */
  78. /* Memory management macros */
  79. #define USBD_malloc malloc
  80. #define USBD_free free
  81. #define USBD_memset memset
  82. #define USBD_memcpy memcpy
  83. #define USBD_Delay HAL_Delay
  84. /* DEBUG macros */
  85. #if (USBD_DEBUG_LEVEL > 0)
  86. #define USBD_UsrLog(...) printf(__VA_ARGS__);\
  87. printf("\n");
  88. #else
  89. #define USBD_UsrLog(...)
  90. #endif
  91. #if (USBD_DEBUG_LEVEL > 1)
  92. #define USBD_ErrLog(...) printf("ERROR: ") ;\
  93. printf(__VA_ARGS__);\
  94. printf("\n");
  95. #else
  96. #define USBD_ErrLog(...)
  97. #endif
  98. #if (USBD_DEBUG_LEVEL > 2)
  99. #define USBD_DbgLog(...) printf("DEBUG : ") ;\
  100. printf(__VA_ARGS__);\
  101. printf("\n");
  102. #else
  103. #define USBD_DbgLog(...)
  104. #endif
  105. /**
  106. * @}
  107. */
  108. /**
  109. * @}
  110. */
  111. /** @defgroup USBD_CONF_Exported_Types
  112. * @{
  113. */
  114. /**
  115. * @}
  116. */
  117. /** @defgroup USBD_CONF_Exported_Macros
  118. * @{
  119. */
  120. /**
  121. * @}
  122. */
  123. /** @defgroup USBD_CONF_Exported_Variables
  124. * @{
  125. */
  126. /**
  127. * @}
  128. */
  129. /** @defgroup USBD_CONF_Exported_FunctionsPrototype
  130. * @{
  131. */
  132. /**
  133. * @}
  134. */
  135. #ifdef __cplusplus
  136. }
  137. #endif
  138. #endif //__USBD_CONF__H__
  139. /**
  140. * @}
  141. */
  142. /**
  143. * @}
  144. */
  145. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/