usbd_conf.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /**
  2. ******************************************************************************
  3. * @file : usbd_conf.h
  4. * @version : v1.0_Cube
  5. * @brief : Header for usbd_conf file.
  6. ******************************************************************************
  7. * COPYRIGHT(c) 2016 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 2
  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 for FS and HS identification */
  71. #define DEVICE_FS 0
  72. #define DEVICE_HS 1
  73. /** @defgroup USBD_Exported_Macros
  74. * @{
  75. */
  76. /* Memory management macros */
  77. #define USBD_malloc malloc
  78. #define USBD_free free
  79. #define USBD_memset memset
  80. #define USBD_memcpy memcpy
  81. #define USBD_Delay HAL_Delay
  82. /* DEBUG macros */
  83. #if (USBD_DEBUG_LEVEL > 0)
  84. #define USBD_UsrLog(...) printf(__VA_ARGS__);\
  85. printf("\n");
  86. #else
  87. #define USBD_UsrLog(...)
  88. #endif
  89. #if (USBD_DEBUG_LEVEL > 1)
  90. #define USBD_ErrLog(...) printf("ERROR: ") ;\
  91. printf(__VA_ARGS__);\
  92. printf("\n");
  93. #else
  94. #define USBD_ErrLog(...)
  95. #endif
  96. #if (USBD_DEBUG_LEVEL > 2)
  97. #define USBD_DbgLog(...) printf("DEBUG : ") ;\
  98. printf(__VA_ARGS__);\
  99. printf("\n");
  100. #else
  101. #define USBD_DbgLog(...)
  102. #endif
  103. /**
  104. * @}
  105. */
  106. /**
  107. * @}
  108. */
  109. /** @defgroup USBD_CONF_Exported_Types
  110. * @{
  111. */
  112. /**
  113. * @}
  114. */
  115. /** @defgroup USBD_CONF_Exported_Macros
  116. * @{
  117. */
  118. /**
  119. * @}
  120. */
  121. /** @defgroup USBD_CONF_Exported_Variables
  122. * @{
  123. */
  124. /**
  125. * @}
  126. */
  127. /** @defgroup USBD_CONF_Exported_FunctionsPrototype
  128. * @{
  129. */
  130. /**
  131. * @}
  132. */
  133. #ifdef __cplusplus
  134. }
  135. #endif
  136. #endif //__USBD_CONF__H__
  137. /**
  138. * @}
  139. */
  140. /**
  141. * @}
  142. */
  143. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/