/TARGET_K64F/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_KPSDK_CODE/hal/adc/fsl_adc_hal.h substitute line 894 extern } by }

Fork of mbed by mbed official

Committer:
fblanc
Date:
Fri Dec 05 15:42:32 2014 +0000
Revision:
93:9dd889aeda0e
Parent:
92:4fc01daae5a5
substitute line 894 extern } by }; /TARGET_K64F/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_KPSDK_CODE/hal/adc/fsl_adc_hal.h

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 85:024bf7f99721 1 /**
bogdanm 85:024bf7f99721 2 ******************************************************************************
bogdanm 85:024bf7f99721 3 * @file stm32f0xx_hal_usart_ex.h
bogdanm 85:024bf7f99721 4 * @author MCD Application Team
bogdanm 92:4fc01daae5a5 5 * @version V1.1.0
bogdanm 92:4fc01daae5a5 6 * @date 03-Oct-2014
bogdanm 85:024bf7f99721 7 * @brief Header file of USART HAL Extension module.
bogdanm 85:024bf7f99721 8 ******************************************************************************
bogdanm 85:024bf7f99721 9 * @attention
bogdanm 85:024bf7f99721 10 *
bogdanm 85:024bf7f99721 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
bogdanm 85:024bf7f99721 12 *
bogdanm 85:024bf7f99721 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 85:024bf7f99721 14 * are permitted provided that the following conditions are met:
bogdanm 85:024bf7f99721 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 85:024bf7f99721 16 * this list of conditions and the following disclaimer.
bogdanm 85:024bf7f99721 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 85:024bf7f99721 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 85:024bf7f99721 19 * and/or other materials provided with the distribution.
bogdanm 85:024bf7f99721 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 85:024bf7f99721 21 * may be used to endorse or promote products derived from this software
bogdanm 85:024bf7f99721 22 * without specific prior written permission.
bogdanm 85:024bf7f99721 23 *
bogdanm 85:024bf7f99721 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 85:024bf7f99721 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 85:024bf7f99721 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 85:024bf7f99721 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 85:024bf7f99721 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 85:024bf7f99721 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 85:024bf7f99721 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 85:024bf7f99721 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 85:024bf7f99721 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 85:024bf7f99721 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 85:024bf7f99721 34 *
bogdanm 85:024bf7f99721 35 ******************************************************************************
bogdanm 85:024bf7f99721 36 */
bogdanm 85:024bf7f99721 37
bogdanm 85:024bf7f99721 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 85:024bf7f99721 39 #ifndef __STM32F0xx_HAL_USART_EX_H
bogdanm 85:024bf7f99721 40 #define __STM32F0xx_HAL_USART_EX_H
bogdanm 85:024bf7f99721 41
bogdanm 85:024bf7f99721 42 #ifdef __cplusplus
bogdanm 85:024bf7f99721 43 extern "C" {
bogdanm 85:024bf7f99721 44 #endif
bogdanm 85:024bf7f99721 45
bogdanm 85:024bf7f99721 46 /* Includes ------------------------------------------------------------------*/
bogdanm 85:024bf7f99721 47 #include "stm32f0xx_hal_def.h"
bogdanm 85:024bf7f99721 48
bogdanm 85:024bf7f99721 49 /** @addtogroup STM32F0xx_HAL_Driver
bogdanm 85:024bf7f99721 50 * @{
bogdanm 85:024bf7f99721 51 */
bogdanm 85:024bf7f99721 52
bogdanm 92:4fc01daae5a5 53 /** @defgroup USARTEx USARTEx Extended HAL module driver
bogdanm 85:024bf7f99721 54 * @{
bogdanm 85:024bf7f99721 55 */
bogdanm 85:024bf7f99721 56
bogdanm 85:024bf7f99721 57 /* Exported types ------------------------------------------------------------*/
bogdanm 85:024bf7f99721 58 /* Exported constants --------------------------------------------------------*/
bogdanm 92:4fc01daae5a5 59 /** @defgroup USARTEx_Exported_Constants USARTEx Exported Constants
bogdanm 85:024bf7f99721 60 * @{
bogdanm 85:024bf7f99721 61 */
bogdanm 85:024bf7f99721 62
bogdanm 92:4fc01daae5a5 63 /** @defgroup USARTEx_Word_Length USARTEx Word Length
bogdanm 85:024bf7f99721 64 * @{
bogdanm 85:024bf7f99721 65 */
bogdanm 85:024bf7f99721 66 #if defined (STM32F042x6) || defined (STM32F048xx) || \
bogdanm 92:4fc01daae5a5 67 defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx) || \
bogdanm 92:4fc01daae5a5 68 defined (STM32F091xC) || defined (STM32F098xx)
bogdanm 85:024bf7f99721 69 #define USART_WORDLENGTH_7B ((uint32_t)USART_CR1_M1)
bogdanm 85:024bf7f99721 70 #define USART_WORDLENGTH_8B ((uint32_t)0x00000000)
bogdanm 85:024bf7f99721 71 #define USART_WORDLENGTH_9B ((uint32_t)USART_CR1_M0)
bogdanm 85:024bf7f99721 72 #define IS_USART_WORD_LENGTH(LENGTH) (((LENGTH) == USART_WORDLENGTH_7B) || \
bogdanm 85:024bf7f99721 73 ((LENGTH) == USART_WORDLENGTH_8B) || \
bogdanm 85:024bf7f99721 74 ((LENGTH) == USART_WORDLENGTH_9B))
bogdanm 85:024bf7f99721 75 #else
bogdanm 85:024bf7f99721 76 #define USART_WORDLENGTH_8B ((uint32_t)0x00000000)
bogdanm 85:024bf7f99721 77 #define USART_WORDLENGTH_9B ((uint32_t)USART_CR1_M)
bogdanm 85:024bf7f99721 78 #define IS_USART_WORD_LENGTH(LENGTH) (((LENGTH) == USART_WORDLENGTH_8B) || \
bogdanm 85:024bf7f99721 79 ((LENGTH) == USART_WORDLENGTH_9B))
bogdanm 85:024bf7f99721 80 #endif /* defined (STM32F042x6) || defined (STM32F048xx) || \
bogdanm 92:4fc01daae5a5 81 defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx) || \
bogdanm 92:4fc01daae5a5 82 defined (STM32F091xC) || defined (STM32F098xx) */
bogdanm 85:024bf7f99721 83 /**
bogdanm 85:024bf7f99721 84 * @}
bogdanm 85:024bf7f99721 85 */
bogdanm 85:024bf7f99721 86
bogdanm 85:024bf7f99721 87 /**
bogdanm 85:024bf7f99721 88 * @}
bogdanm 85:024bf7f99721 89 */
bogdanm 85:024bf7f99721 90
bogdanm 85:024bf7f99721 91 /* Exported macro ------------------------------------------------------------*/
bogdanm 85:024bf7f99721 92
bogdanm 92:4fc01daae5a5 93 /** @defgroup USARTEx_Exported_Macros USARTEx Exported Macros
bogdanm 85:024bf7f99721 94 * @{
bogdanm 85:024bf7f99721 95 */
bogdanm 85:024bf7f99721 96
bogdanm 85:024bf7f99721 97 /** @brief Reports the USART clock source.
bogdanm 85:024bf7f99721 98 * @param __HANDLE__: specifies the USART Handle
bogdanm 85:024bf7f99721 99 * @param __CLOCKSOURCE__ : output variable
bogdanm 85:024bf7f99721 100 * @retval the USART clocking source, written in __CLOCKSOURCE__.
bogdanm 85:024bf7f99721 101 */
bogdanm 85:024bf7f99721 102 #if defined(STM32F030x6) || defined(STM32F031x6) || defined(STM32F038xx)
bogdanm 85:024bf7f99721 103 #define __HAL_USART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \
bogdanm 85:024bf7f99721 104 do { \
bogdanm 85:024bf7f99721 105 switch(__HAL_RCC_GET_USART1_SOURCE()) \
bogdanm 85:024bf7f99721 106 { \
bogdanm 85:024bf7f99721 107 case RCC_USART1CLKSOURCE_PCLK1: \
bogdanm 85:024bf7f99721 108 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \
bogdanm 85:024bf7f99721 109 break; \
bogdanm 85:024bf7f99721 110 case RCC_USART1CLKSOURCE_HSI: \
bogdanm 85:024bf7f99721 111 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_HSI; \
bogdanm 85:024bf7f99721 112 break; \
bogdanm 85:024bf7f99721 113 case RCC_USART1CLKSOURCE_SYSCLK: \
bogdanm 85:024bf7f99721 114 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_SYSCLK; \
bogdanm 85:024bf7f99721 115 break; \
bogdanm 85:024bf7f99721 116 case RCC_USART1CLKSOURCE_LSE: \
bogdanm 85:024bf7f99721 117 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_LSE; \
bogdanm 85:024bf7f99721 118 break; \
bogdanm 85:024bf7f99721 119 default: \
bogdanm 85:024bf7f99721 120 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \
bogdanm 85:024bf7f99721 121 break; \
bogdanm 85:024bf7f99721 122 } \
bogdanm 85:024bf7f99721 123 } while(0)
bogdanm 85:024bf7f99721 124 #elif defined (STM32F030x8) || \
bogdanm 85:024bf7f99721 125 defined (STM32F042x6) || defined (STM32F048xx) || \
bogdanm 85:024bf7f99721 126 defined (STM32F051x8) || defined (STM32F058xx)
bogdanm 85:024bf7f99721 127 #define __HAL_USART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \
bogdanm 85:024bf7f99721 128 do { \
bogdanm 85:024bf7f99721 129 if((__HANDLE__)->Instance == USART1) \
bogdanm 85:024bf7f99721 130 { \
bogdanm 85:024bf7f99721 131 switch(__HAL_RCC_GET_USART1_SOURCE()) \
bogdanm 85:024bf7f99721 132 { \
bogdanm 85:024bf7f99721 133 case RCC_USART1CLKSOURCE_PCLK1: \
bogdanm 85:024bf7f99721 134 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \
bogdanm 85:024bf7f99721 135 break; \
bogdanm 85:024bf7f99721 136 case RCC_USART1CLKSOURCE_HSI: \
bogdanm 85:024bf7f99721 137 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_HSI; \
bogdanm 85:024bf7f99721 138 break; \
bogdanm 85:024bf7f99721 139 case RCC_USART1CLKSOURCE_SYSCLK: \
bogdanm 85:024bf7f99721 140 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_SYSCLK; \
bogdanm 85:024bf7f99721 141 break; \
bogdanm 85:024bf7f99721 142 case RCC_USART1CLKSOURCE_LSE: \
bogdanm 85:024bf7f99721 143 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_LSE; \
bogdanm 85:024bf7f99721 144 break; \
bogdanm 85:024bf7f99721 145 default: \
bogdanm 85:024bf7f99721 146 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \
bogdanm 85:024bf7f99721 147 break; \
bogdanm 85:024bf7f99721 148 } \
bogdanm 85:024bf7f99721 149 } \
bogdanm 85:024bf7f99721 150 else if((__HANDLE__)->Instance == USART2) \
bogdanm 85:024bf7f99721 151 { \
bogdanm 85:024bf7f99721 152 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \
bogdanm 85:024bf7f99721 153 } \
bogdanm 85:024bf7f99721 154 else \
bogdanm 85:024bf7f99721 155 { \
bogdanm 85:024bf7f99721 156 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \
bogdanm 85:024bf7f99721 157 } \
bogdanm 85:024bf7f99721 158 } while(0)
bogdanm 85:024bf7f99721 159 #elif defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx)
bogdanm 85:024bf7f99721 160 #define __HAL_USART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \
bogdanm 85:024bf7f99721 161 do { \
bogdanm 85:024bf7f99721 162 if((__HANDLE__)->Instance == USART1) \
bogdanm 85:024bf7f99721 163 { \
bogdanm 85:024bf7f99721 164 switch(__HAL_RCC_GET_USART1_SOURCE()) \
bogdanm 85:024bf7f99721 165 { \
bogdanm 85:024bf7f99721 166 case RCC_USART1CLKSOURCE_PCLK1: \
bogdanm 85:024bf7f99721 167 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \
bogdanm 85:024bf7f99721 168 break; \
bogdanm 85:024bf7f99721 169 case RCC_USART1CLKSOURCE_HSI: \
bogdanm 85:024bf7f99721 170 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_HSI; \
bogdanm 85:024bf7f99721 171 break; \
bogdanm 85:024bf7f99721 172 case RCC_USART1CLKSOURCE_SYSCLK: \
bogdanm 85:024bf7f99721 173 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_SYSCLK; \
bogdanm 85:024bf7f99721 174 break; \
bogdanm 85:024bf7f99721 175 case RCC_USART1CLKSOURCE_LSE: \
bogdanm 85:024bf7f99721 176 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_LSE; \
bogdanm 85:024bf7f99721 177 break; \
bogdanm 85:024bf7f99721 178 default: \
bogdanm 85:024bf7f99721 179 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \
bogdanm 85:024bf7f99721 180 break; \
bogdanm 85:024bf7f99721 181 } \
bogdanm 85:024bf7f99721 182 } \
bogdanm 85:024bf7f99721 183 else if((__HANDLE__)->Instance == USART2) \
bogdanm 85:024bf7f99721 184 { \
bogdanm 85:024bf7f99721 185 switch(__HAL_RCC_GET_USART2_SOURCE()) \
bogdanm 85:024bf7f99721 186 { \
bogdanm 85:024bf7f99721 187 case RCC_USART2CLKSOURCE_PCLK1: \
bogdanm 85:024bf7f99721 188 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \
bogdanm 85:024bf7f99721 189 break; \
bogdanm 85:024bf7f99721 190 case RCC_USART2CLKSOURCE_HSI: \
bogdanm 85:024bf7f99721 191 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_HSI; \
bogdanm 85:024bf7f99721 192 break; \
bogdanm 85:024bf7f99721 193 case RCC_USART2CLKSOURCE_SYSCLK: \
bogdanm 85:024bf7f99721 194 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_SYSCLK; \
bogdanm 85:024bf7f99721 195 break; \
bogdanm 85:024bf7f99721 196 case RCC_USART2CLKSOURCE_LSE: \
bogdanm 85:024bf7f99721 197 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_LSE; \
bogdanm 85:024bf7f99721 198 break; \
bogdanm 85:024bf7f99721 199 default: \
bogdanm 85:024bf7f99721 200 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \
bogdanm 85:024bf7f99721 201 break; \
bogdanm 85:024bf7f99721 202 } \
bogdanm 85:024bf7f99721 203 } \
bogdanm 85:024bf7f99721 204 else if((__HANDLE__)->Instance == USART3) \
bogdanm 85:024bf7f99721 205 { \
bogdanm 85:024bf7f99721 206 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \
bogdanm 85:024bf7f99721 207 } \
bogdanm 85:024bf7f99721 208 else if((__HANDLE__)->Instance == USART4) \
bogdanm 85:024bf7f99721 209 { \
bogdanm 85:024bf7f99721 210 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \
bogdanm 85:024bf7f99721 211 } \
bogdanm 85:024bf7f99721 212 else \
bogdanm 85:024bf7f99721 213 { \
bogdanm 85:024bf7f99721 214 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \
bogdanm 85:024bf7f99721 215 } \
bogdanm 85:024bf7f99721 216 } while(0)
bogdanm 92:4fc01daae5a5 217 #elif defined(STM32F091xC) || defined (STM32F098xx)
bogdanm 92:4fc01daae5a5 218 #define __HAL_USART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \
bogdanm 92:4fc01daae5a5 219 do { \
bogdanm 92:4fc01daae5a5 220 if((__HANDLE__)->Instance == USART1) \
bogdanm 92:4fc01daae5a5 221 { \
bogdanm 92:4fc01daae5a5 222 switch(__HAL_RCC_GET_USART1_SOURCE()) \
bogdanm 92:4fc01daae5a5 223 { \
bogdanm 92:4fc01daae5a5 224 case RCC_USART1CLKSOURCE_PCLK1: \
bogdanm 92:4fc01daae5a5 225 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \
bogdanm 92:4fc01daae5a5 226 break; \
bogdanm 92:4fc01daae5a5 227 case RCC_USART1CLKSOURCE_HSI: \
bogdanm 92:4fc01daae5a5 228 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_HSI; \
bogdanm 92:4fc01daae5a5 229 break; \
bogdanm 92:4fc01daae5a5 230 case RCC_USART1CLKSOURCE_SYSCLK: \
bogdanm 92:4fc01daae5a5 231 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_SYSCLK; \
bogdanm 92:4fc01daae5a5 232 break; \
bogdanm 92:4fc01daae5a5 233 case RCC_USART1CLKSOURCE_LSE: \
bogdanm 92:4fc01daae5a5 234 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_LSE; \
bogdanm 92:4fc01daae5a5 235 break; \
bogdanm 92:4fc01daae5a5 236 default: \
bogdanm 92:4fc01daae5a5 237 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \
bogdanm 92:4fc01daae5a5 238 break; \
bogdanm 92:4fc01daae5a5 239 } \
bogdanm 92:4fc01daae5a5 240 } \
bogdanm 92:4fc01daae5a5 241 else if((__HANDLE__)->Instance == USART2) \
bogdanm 92:4fc01daae5a5 242 { \
bogdanm 92:4fc01daae5a5 243 switch(__HAL_RCC_GET_USART2_SOURCE()) \
bogdanm 92:4fc01daae5a5 244 { \
bogdanm 92:4fc01daae5a5 245 case RCC_USART2CLKSOURCE_PCLK1: \
bogdanm 92:4fc01daae5a5 246 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \
bogdanm 92:4fc01daae5a5 247 break; \
bogdanm 92:4fc01daae5a5 248 case RCC_USART2CLKSOURCE_HSI: \
bogdanm 92:4fc01daae5a5 249 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_HSI; \
bogdanm 92:4fc01daae5a5 250 break; \
bogdanm 92:4fc01daae5a5 251 case RCC_USART2CLKSOURCE_SYSCLK: \
bogdanm 92:4fc01daae5a5 252 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_SYSCLK; \
bogdanm 92:4fc01daae5a5 253 break; \
bogdanm 92:4fc01daae5a5 254 case RCC_USART2CLKSOURCE_LSE: \
bogdanm 92:4fc01daae5a5 255 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_LSE; \
bogdanm 92:4fc01daae5a5 256 break; \
bogdanm 92:4fc01daae5a5 257 default: \
bogdanm 92:4fc01daae5a5 258 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \
bogdanm 92:4fc01daae5a5 259 break; \
bogdanm 92:4fc01daae5a5 260 } \
bogdanm 92:4fc01daae5a5 261 } \
bogdanm 92:4fc01daae5a5 262 else if((__HANDLE__)->Instance == USART3) \
bogdanm 92:4fc01daae5a5 263 { \
bogdanm 92:4fc01daae5a5 264 switch(__HAL_RCC_GET_USART3_SOURCE()) \
bogdanm 92:4fc01daae5a5 265 { \
bogdanm 92:4fc01daae5a5 266 case RCC_USART3CLKSOURCE_PCLK1: \
bogdanm 92:4fc01daae5a5 267 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \
bogdanm 92:4fc01daae5a5 268 break; \
bogdanm 92:4fc01daae5a5 269 case RCC_USART3CLKSOURCE_HSI: \
bogdanm 92:4fc01daae5a5 270 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_HSI; \
bogdanm 92:4fc01daae5a5 271 break; \
bogdanm 92:4fc01daae5a5 272 case RCC_USART3CLKSOURCE_SYSCLK: \
bogdanm 92:4fc01daae5a5 273 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_SYSCLK; \
bogdanm 92:4fc01daae5a5 274 break; \
bogdanm 92:4fc01daae5a5 275 case RCC_USART3CLKSOURCE_LSE: \
bogdanm 92:4fc01daae5a5 276 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_LSE; \
bogdanm 92:4fc01daae5a5 277 break; \
bogdanm 92:4fc01daae5a5 278 default: \
bogdanm 92:4fc01daae5a5 279 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \
bogdanm 92:4fc01daae5a5 280 break; \
bogdanm 92:4fc01daae5a5 281 } \
bogdanm 92:4fc01daae5a5 282 } \
bogdanm 92:4fc01daae5a5 283 else if((__HANDLE__)->Instance == USART4) \
bogdanm 92:4fc01daae5a5 284 { \
bogdanm 92:4fc01daae5a5 285 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \
bogdanm 92:4fc01daae5a5 286 } \
bogdanm 92:4fc01daae5a5 287 else if((__HANDLE__)->Instance == USART5) \
bogdanm 92:4fc01daae5a5 288 { \
bogdanm 92:4fc01daae5a5 289 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \
bogdanm 92:4fc01daae5a5 290 } \
bogdanm 92:4fc01daae5a5 291 else if((__HANDLE__)->Instance == USART6) \
bogdanm 92:4fc01daae5a5 292 { \
bogdanm 92:4fc01daae5a5 293 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \
bogdanm 92:4fc01daae5a5 294 } \
bogdanm 92:4fc01daae5a5 295 else if((__HANDLE__)->Instance == USART7) \
bogdanm 92:4fc01daae5a5 296 { \
bogdanm 92:4fc01daae5a5 297 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \
bogdanm 92:4fc01daae5a5 298 } \
bogdanm 92:4fc01daae5a5 299 else if((__HANDLE__)->Instance == USART8) \
bogdanm 92:4fc01daae5a5 300 { \
bogdanm 92:4fc01daae5a5 301 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_PCLK1; \
bogdanm 92:4fc01daae5a5 302 } \
bogdanm 92:4fc01daae5a5 303 else \
bogdanm 92:4fc01daae5a5 304 { \
bogdanm 92:4fc01daae5a5 305 (__CLOCKSOURCE__) = USART_CLOCKSOURCE_UNDEFINED; \
bogdanm 92:4fc01daae5a5 306 } \
bogdanm 92:4fc01daae5a5 307 } while(0)
bogdanm 85:024bf7f99721 308 #endif /* defined(STM32F030x6) || defined(STM32F031x6) || defined(STM32F038xx) */
bogdanm 85:024bf7f99721 309
bogdanm 85:024bf7f99721 310
bogdanm 85:024bf7f99721 311 /** @brief Reports the USART mask to apply to retrieve the received data
bogdanm 85:024bf7f99721 312 * according to the word length and to the parity bits activation.
bogdanm 85:024bf7f99721 313 * If PCE = 1, the parity bit is not included in the data extracted
bogdanm 85:024bf7f99721 314 * by the reception API().
bogdanm 85:024bf7f99721 315 * This masking operation is not carried out in the case of
bogdanm 85:024bf7f99721 316 * DMA transfers.
bogdanm 85:024bf7f99721 317 * @param __HANDLE__: specifies the USART Handle
bogdanm 85:024bf7f99721 318 * @retval none
bogdanm 85:024bf7f99721 319 */
bogdanm 85:024bf7f99721 320 #if defined (STM32F042x6) || defined (STM32F048xx) || \
bogdanm 92:4fc01daae5a5 321 defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx) || \
bogdanm 92:4fc01daae5a5 322 defined (STM32F091xC) || defined (STM32F098xx)
bogdanm 85:024bf7f99721 323 #define __HAL_USART_MASK_COMPUTATION(__HANDLE__) \
bogdanm 85:024bf7f99721 324 do { \
bogdanm 85:024bf7f99721 325 if ((__HANDLE__)->Init.WordLength == USART_WORDLENGTH_9B) \
bogdanm 85:024bf7f99721 326 { \
bogdanm 85:024bf7f99721 327 if ((__HANDLE__)->Init.Parity == USART_PARITY_NONE) \
bogdanm 85:024bf7f99721 328 { \
bogdanm 85:024bf7f99721 329 (__HANDLE__)->Mask = 0x01FF ; \
bogdanm 85:024bf7f99721 330 } \
bogdanm 85:024bf7f99721 331 else \
bogdanm 85:024bf7f99721 332 { \
bogdanm 85:024bf7f99721 333 (__HANDLE__)->Mask = 0x00FF ; \
bogdanm 85:024bf7f99721 334 } \
bogdanm 85:024bf7f99721 335 } \
bogdanm 85:024bf7f99721 336 else if ((__HANDLE__)->Init.WordLength == USART_WORDLENGTH_8B) \
bogdanm 85:024bf7f99721 337 { \
bogdanm 85:024bf7f99721 338 if ((__HANDLE__)->Init.Parity == USART_PARITY_NONE) \
bogdanm 85:024bf7f99721 339 { \
bogdanm 85:024bf7f99721 340 (__HANDLE__)->Mask = 0x00FF ; \
bogdanm 85:024bf7f99721 341 } \
bogdanm 85:024bf7f99721 342 else \
bogdanm 85:024bf7f99721 343 { \
bogdanm 85:024bf7f99721 344 (__HANDLE__)->Mask = 0x007F ; \
bogdanm 85:024bf7f99721 345 } \
bogdanm 85:024bf7f99721 346 } \
bogdanm 85:024bf7f99721 347 else if ((__HANDLE__)->Init.WordLength == USART_WORDLENGTH_7B) \
bogdanm 85:024bf7f99721 348 { \
bogdanm 85:024bf7f99721 349 if ((__HANDLE__)->Init.Parity == USART_PARITY_NONE) \
bogdanm 85:024bf7f99721 350 { \
bogdanm 85:024bf7f99721 351 (__HANDLE__)->Mask = 0x007F ; \
bogdanm 85:024bf7f99721 352 } \
bogdanm 85:024bf7f99721 353 else \
bogdanm 85:024bf7f99721 354 { \
bogdanm 85:024bf7f99721 355 (__HANDLE__)->Mask = 0x003F ; \
bogdanm 85:024bf7f99721 356 } \
bogdanm 85:024bf7f99721 357 } \
bogdanm 85:024bf7f99721 358 } while(0)
bogdanm 85:024bf7f99721 359 #else
bogdanm 85:024bf7f99721 360 #define __HAL_USART_MASK_COMPUTATION(__HANDLE__) \
bogdanm 85:024bf7f99721 361 do { \
bogdanm 85:024bf7f99721 362 if ((__HANDLE__)->Init.WordLength == USART_WORDLENGTH_9B) \
bogdanm 85:024bf7f99721 363 { \
bogdanm 85:024bf7f99721 364 if ((__HANDLE__)->Init.Parity == USART_PARITY_NONE) \
bogdanm 85:024bf7f99721 365 { \
bogdanm 85:024bf7f99721 366 (__HANDLE__)->Mask = 0x01FF ; \
bogdanm 85:024bf7f99721 367 } \
bogdanm 85:024bf7f99721 368 else \
bogdanm 85:024bf7f99721 369 { \
bogdanm 85:024bf7f99721 370 (__HANDLE__)->Mask = 0x00FF ; \
bogdanm 85:024bf7f99721 371 } \
bogdanm 85:024bf7f99721 372 } \
bogdanm 85:024bf7f99721 373 else if ((__HANDLE__)->Init.WordLength == USART_WORDLENGTH_8B) \
bogdanm 85:024bf7f99721 374 { \
bogdanm 85:024bf7f99721 375 if ((__HANDLE__)->Init.Parity == USART_PARITY_NONE) \
bogdanm 85:024bf7f99721 376 { \
bogdanm 85:024bf7f99721 377 (__HANDLE__)->Mask = 0x00FF ; \
bogdanm 85:024bf7f99721 378 } \
bogdanm 85:024bf7f99721 379 else \
bogdanm 85:024bf7f99721 380 { \
bogdanm 85:024bf7f99721 381 (__HANDLE__)->Mask = 0x007F ; \
bogdanm 85:024bf7f99721 382 } \
bogdanm 85:024bf7f99721 383 } \
bogdanm 85:024bf7f99721 384 } while(0)
bogdanm 85:024bf7f99721 385 #endif /* defined (STM32F042x6) || defined (STM32F048xx) || \
bogdanm 92:4fc01daae5a5 386 defined (STM32F071xB) || defined (STM32F072xB) || defined (STM32F078xx) || \
bogdanm 92:4fc01daae5a5 387 defined (STM32F091xC) || defined (STM32F098xx) */
bogdanm 85:024bf7f99721 388 /**
bogdanm 85:024bf7f99721 389 * @}
bogdanm 85:024bf7f99721 390 */
bogdanm 85:024bf7f99721 391
bogdanm 85:024bf7f99721 392 /* Exported functions --------------------------------------------------------*/
bogdanm 85:024bf7f99721 393 /* Initialization and de-initialization functions ****************************/
bogdanm 85:024bf7f99721 394 /* I/O operation functions ***************************************************/
bogdanm 85:024bf7f99721 395 /* Peripheral Control functions **********************************************/
bogdanm 85:024bf7f99721 396 /* Peripheral State functions ************************************************/
bogdanm 85:024bf7f99721 397
bogdanm 85:024bf7f99721 398 /**
bogdanm 85:024bf7f99721 399 * @}
bogdanm 85:024bf7f99721 400 */
bogdanm 85:024bf7f99721 401
bogdanm 85:024bf7f99721 402 /**
bogdanm 85:024bf7f99721 403 * @}
bogdanm 85:024bf7f99721 404 */
bogdanm 85:024bf7f99721 405
bogdanm 85:024bf7f99721 406 #ifdef __cplusplus
bogdanm 85:024bf7f99721 407 }
bogdanm 85:024bf7f99721 408 #endif
bogdanm 85:024bf7f99721 409
bogdanm 85:024bf7f99721 410 #endif /* __STM32F0xx_HAL_USART_EX_H */
bogdanm 85:024bf7f99721 411
bogdanm 85:024bf7f99721 412 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
bogdanm 92:4fc01daae5a5 413