usbd_conf.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /* Define to prevent recursive inclusion -------------------------------------*/
  2. #ifndef __USBD_CONF__H__
  3. #define __USBD_CONF__H__
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /* Includes ------------------------------------------------------------------*/
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #include "core/main.h"
  12. #include "stm32l1xx.h"
  13. #include "stm32l1xx_hal.h"
  14. #define USBD_CONSTCLASS_IFACE 1
  15. #define USBD_CONSTSUBCLASS_IFACE 1
  16. /*---------- -----------*/
  17. #define USBD_MAX_NUM_INTERFACES 1
  18. /*---------- -----------*/
  19. #define USBD_MAX_NUM_CONFIGURATION 1
  20. /*---------- -----------*/
  21. #define USBD_MAX_STR_DESC_SIZ 512
  22. /*---------- -----------*/
  23. #define USBD_SUPPORT_USER_STRING 0
  24. /*---------- -----------*/
  25. #define USBD_DEBUG_LEVEL 0
  26. /*---------- -----------*/
  27. #define USBD_SELF_POWERED 1
  28. /*---------- -----------*/
  29. #define USBD_GETDESCRIPTORS_ALTMETHOD 1
  30. /****************************************/
  31. /* #define for FS and HS identification */
  32. #define DEVICE_FS 0
  33. /**
  34. * @}
  35. */
  36. /** @defgroup USBD_CONF_Exported_Macros USBD_CONF_Exported_Macros
  37. * @brief Aliases.
  38. * @{
  39. */
  40. /* Memory management macros */
  41. /** Alias for memory allocation. */
  42. #define USBD_malloc (uint32_t *)USBD_static_malloc
  43. /** Alias for memory release. */
  44. #define USBD_free USBD_static_free
  45. /** Alias for memory set. */
  46. #define USBD_memset /* Not used */
  47. /** Alias for memory copy. */
  48. #define USBD_memcpy /* Not used */
  49. /** Alias for delay. */
  50. #define USBD_Delay HAL_Delay
  51. /* For footprint reasons and since only one allocation is handled in the HID class
  52. driver, the malloc/free is changed into a static allocation method */
  53. void *USBD_static_malloc(uint32_t size);
  54. void USBD_static_free(void *p);
  55. /* DEBUG macros */
  56. #if (USBD_DEBUG_LEVEL > 0)
  57. #define USBD_UsrLog(...) printf(__VA_ARGS__);\
  58. printf("\n");
  59. #else
  60. #define USBD_UsrLog(...)
  61. #endif
  62. #if (USBD_DEBUG_LEVEL > 1)
  63. #define USBD_ErrLog(...) printf("ERROR: ") ;\
  64. printf(__VA_ARGS__);\
  65. printf("\n");
  66. #else
  67. #define USBD_ErrLog(...)
  68. #endif
  69. #if (USBD_DEBUG_LEVEL > 2)
  70. #define USBD_DbgLog(...) printf("DEBUG : ") ;\
  71. printf(__VA_ARGS__);\
  72. printf("\n");
  73. #else
  74. #define USBD_DbgLog(...)
  75. #endif
  76. /**
  77. * @}
  78. */
  79. /** @defgroup USBD_CONF_Exported_Types USBD_CONF_Exported_Types
  80. * @brief Types.
  81. * @{
  82. */
  83. /**
  84. * @}
  85. */
  86. /** @defgroup USBD_CONF_Exported_FunctionsPrototype USBD_CONF_Exported_FunctionsPrototype
  87. * @brief Declaration of public functions for Usb device.
  88. * @{
  89. */
  90. /* Exported functions -------------------------------------------------------*/
  91. /**
  92. * @}
  93. */
  94. /**
  95. * @}
  96. */
  97. /**
  98. * @}
  99. */
  100. #ifdef __cplusplus
  101. }
  102. #endif
  103. #endif /* __USBD_CONF__H__ */
  104. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/