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