Subversion Repositories DashDisplay

Rev

Blame | Last modification | View Log | Download | RSS feed

  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 "stm32f1xx.h"
  44. #include "stm32f1xx_hal.h"
  45. #include "usbd_def.h"
  46.  
  47. /** @addtogroup USBD_OTG_DRIVER
  48.   * @{
  49.   */
  50.  
  51. /** @defgroup USBD_CONF
  52.   * @brief usb otg low level driver configuration file
  53.   * @{
  54.   */
  55.  
  56. /** @defgroup USBD_CONF_Exported_Defines
  57.   * @{
  58.   */
  59.  
  60. /*---------- -----------*/
  61. #define USBD_MAX_NUM_INTERFACES     1
  62. /*---------- -----------*/
  63. #define USBD_MAX_NUM_CONFIGURATION     1
  64. /*---------- -----------*/
  65. #define USBD_MAX_STR_DESC_SIZ     512
  66. /*---------- -----------*/
  67. #define USBD_SUPPORT_USER_STRING     0
  68. /*---------- -----------*/
  69. #define USBD_DEBUG_LEVEL     0
  70. /*---------- -----------*/
  71. #define USBD_SELF_POWERED     1
  72. /*---------- -----------*/
  73. #define USBD_CDC_INTERVAL     1000
  74. /*---------- -----------*/
  75. #define MAX_STATIC_ALLOC_SIZE     512
  76. /****************************************/
  77. /* #define for FS and HS identification */
  78. #define DEVICE_FS               0
  79.  
  80. /** @defgroup USBD_Exported_Macros
  81.   * @{
  82.   */
  83.  
  84. /* Memory management macros */  
  85. #define USBD_malloc               (uint32_t *)USBD_static_malloc
  86. #define USBD_free                 USBD_static_free
  87. #define USBD_memset               /* Not used */
  88. #define USBD_memcpy               /* Not used */
  89.  
  90. #define USBD_Delay   HAL_Delay
  91.  
  92. /* For footprint reasons and since only one allocation is handled in the HID class
  93.    driver, the malloc/free is changed into a static allocation method */
  94. void *USBD_static_malloc(uint32_t size);
  95. void USBD_static_free(void *p);    
  96.  
  97. /* DEBUG macros */    
  98. #if (USBD_DEBUG_LEVEL > 0)
  99. #define  USBD_UsrLog(...)   printf(__VA_ARGS__);\
  100.                             printf("\n");
  101. #else
  102. #define USBD_UsrLog(...)  
  103. #endif
  104.                            
  105.                            
  106. #if (USBD_DEBUG_LEVEL > 1)
  107.  
  108. #define  USBD_ErrLog(...)   printf("ERROR: ") ;\
  109.                             printf(__VA_ARGS__);\
  110.                             printf("\n");
  111. #else
  112. #define USBD_ErrLog(...)  
  113. #endif
  114.                            
  115.                            
  116. #if (USBD_DEBUG_LEVEL > 2)                        
  117. #define  USBD_DbgLog(...)   printf("DEBUG : ") ;\
  118.                             printf(__VA_ARGS__);\
  119.                             printf("\n");
  120. #else
  121. #define USBD_DbgLog(...)                        
  122. #endif
  123.                            
  124. /**
  125.   * @}
  126.   */
  127.  
  128.    
  129.    
  130. /**
  131.   * @}
  132.   */
  133.  
  134. /** @defgroup USBD_CONF_Exported_Types
  135.   * @{
  136.   */
  137. /**
  138.   * @}
  139.   */
  140.  
  141. /** @defgroup USBD_CONF_Exported_Macros
  142.   * @{
  143.   */
  144. /**
  145.   * @}
  146.   */
  147.  
  148. /** @defgroup USBD_CONF_Exported_Variables
  149.   * @{
  150.   */
  151. /**
  152.   * @}
  153.   */
  154.  
  155. /** @defgroup USBD_CONF_Exported_FunctionsPrototype
  156.   * @{
  157.   */
  158. /**
  159.   * @}
  160.   */
  161. #ifdef __cplusplus
  162. }
  163. #endif
  164.  
  165. #endif //__USBD_CONF__H__
  166.  
  167. /**
  168.   * @}
  169.   */
  170.  
  171. /**
  172.   * @}
  173.   */
  174. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
  175.  
  176.