Damian Gabino / picoGW_mcu
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers usbd_conf.h Source File

usbd_conf.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file           : usbd_conf.h
00004   * @version        : v1.0_Cube
00005   * @brief          : Header for usbd_conf file.
00006   ******************************************************************************
00007   * COPYRIGHT(c) 2016 STMicroelectronics
00008   *
00009   * Redistribution and use in source and binary forms, with or without modification,
00010   * are permitted provided that the following conditions are met:
00011   * 1. Redistributions of source code must retain the above copyright notice,
00012   * this list of conditions and the following disclaimer.
00013   * 2. Redistributions in binary form must reproduce the above copyright notice,
00014   * this list of conditions and the following disclaimer in the documentation
00015   * and/or other materials provided with the distribution.
00016   * 3. Neither the name of STMicroelectronics nor the names of its contributors
00017   * may be used to endorse or promote products derived from this software
00018   * without specific prior written permission.
00019   *
00020   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00021   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00022   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00023   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00024   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00025   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00026   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00027   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00028   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00029   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00030   *
00031   ******************************************************************************
00032 */
00033 /* Define to prevent recursive inclusion -------------------------------------*/
00034 #ifndef __USBD_CONF__H__
00035 #define __USBD_CONF__H__
00036 #ifdef __cplusplus
00037  extern "C" {
00038 #endif
00039 /* Includes ------------------------------------------------------------------*/
00040 #include <stdio.h>
00041 #include <stdlib.h>
00042 #include <string.h>
00043 #include "stm32f4xx.h"
00044 #include "stm32f4xx_hal.h"
00045 
00046 /** @addtogroup USBD_OTG_DRIVER
00047   * @{
00048   */
00049   
00050 /** @defgroup USBD_CONF
00051   * @brief usb otg low level driver configuration file
00052   * @{
00053   */ 
00054 
00055 /** @defgroup USBD_CONF_Exported_Defines
00056   * @{
00057   */ 
00058 
00059 /*---------- -----------*/
00060 #define USBD_MAX_NUM_INTERFACES     1
00061 /*---------- -----------*/
00062 #define USBD_MAX_NUM_CONFIGURATION     1
00063 /*---------- -----------*/
00064 #define USBD_MAX_STR_DESC_SIZ     512
00065 /*---------- -----------*/
00066 #define USBD_SUPPORT_USER_STRING     0
00067 /*---------- -----------*/
00068 #define USBD_DEBUG_LEVEL     0
00069 /*---------- -----------*/
00070 #define USBD_LPM_ENABLED     0
00071 /*---------- -----------*/
00072 #define USBD_SELF_POWERED     1
00073 /*---------- -----------*/
00074 #define USBD_CDC_INTERVAL     1000
00075 
00076 /****************************************/
00077 /* #define for FS and HS identification */
00078 #define DEVICE_FS       0
00079 #define DEVICE_HS       1
00080 
00081 /** @defgroup USBD_Exported_Macros
00082   * @{
00083   */ 
00084 
00085  /* Memory management macros */   
00086 #define USBD_malloc               malloc
00087 #define USBD_free                 free
00088 #define USBD_memset               memset
00089 #define USBD_memcpy               memcpy
00090 
00091 #define USBD_Delay   HAL_Delay
00092     
00093  /* DEBUG macros */  
00094 
00095 #if (USBD_DEBUG_LEVEL > 0)
00096 #define  USBD_UsrLog(...)   printf(__VA_ARGS__);\
00097                             printf("\n");
00098 #else
00099 #define USBD_UsrLog(...)   
00100 #endif 
00101                             
00102                             
00103 #if (USBD_DEBUG_LEVEL > 1)
00104 
00105 #define  USBD_ErrLog(...)   printf("ERROR: ") ;\
00106                             printf(__VA_ARGS__);\
00107                             printf("\n");
00108 #else
00109 #define USBD_ErrLog(...)   
00110 #endif 
00111                             
00112                             
00113 #if (USBD_DEBUG_LEVEL > 2)                         
00114 #define  USBD_DbgLog(...)   printf("DEBUG : ") ;\
00115                             printf(__VA_ARGS__);\
00116                             printf("\n");
00117 #else
00118 #define USBD_DbgLog(...)                         
00119 #endif
00120                             
00121 /**
00122   * @}
00123   */ 
00124  
00125     
00126     
00127 /**
00128   * @}
00129   */ 
00130 
00131 /** @defgroup USBD_CONF_Exported_Types
00132   * @{
00133   */ 
00134 /**
00135   * @}
00136   */ 
00137 
00138 /** @defgroup USBD_CONF_Exported_Macros
00139   * @{
00140   */ 
00141 /**
00142   * @}
00143   */ 
00144 
00145 /** @defgroup USBD_CONF_Exported_Variables
00146   * @{
00147   */ 
00148 /**
00149   * @}
00150   */ 
00151 
00152 /** @defgroup USBD_CONF_Exported_FunctionsPrototype
00153   * @{
00154   */ 
00155 /**
00156   * @}
00157   */ 
00158 #ifdef __cplusplus
00159 }
00160 #endif
00161 
00162 #endif /* __USBD_CONF__H__ */
00163 
00164 /**
00165   * @}
00166   */ 
00167 
00168 /**
00169   * @}
00170   */ 
00171 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
00172