Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
116:c0f6e94411f5
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 115:87f2f5183dfb 1 /**
Kojto 115:87f2f5183dfb 2 ******************************************************************************
Kojto 115:87f2f5183dfb 3 * @file stm32f7xx_hal_uart_ex.h
Kojto 115:87f2f5183dfb 4 * @author MCD Application Team
Kojto 116:c0f6e94411f5 5 * @version V1.0.4
Kojto 116:c0f6e94411f5 6 * @date 09-December-2015
Kojto 115:87f2f5183dfb 7 * @brief Header file of UART HAL Extension module.
Kojto 115:87f2f5183dfb 8 ******************************************************************************
Kojto 115:87f2f5183dfb 9 * @attention
Kojto 115:87f2f5183dfb 10 *
Kojto 115:87f2f5183dfb 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Kojto 115:87f2f5183dfb 12 *
Kojto 115:87f2f5183dfb 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 115:87f2f5183dfb 14 * are permitted provided that the following conditions are met:
Kojto 115:87f2f5183dfb 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 115:87f2f5183dfb 16 * this list of conditions and the following disclaimer.
Kojto 115:87f2f5183dfb 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 115:87f2f5183dfb 18 * this list of conditions and the following disclaimer in the documentation
Kojto 115:87f2f5183dfb 19 * and/or other materials provided with the distribution.
Kojto 115:87f2f5183dfb 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 115:87f2f5183dfb 21 * may be used to endorse or promote products derived from this software
Kojto 115:87f2f5183dfb 22 * without specific prior written permission.
Kojto 115:87f2f5183dfb 23 *
Kojto 115:87f2f5183dfb 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 115:87f2f5183dfb 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 115:87f2f5183dfb 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 115:87f2f5183dfb 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 115:87f2f5183dfb 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 115:87f2f5183dfb 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 115:87f2f5183dfb 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 115:87f2f5183dfb 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 115:87f2f5183dfb 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 115:87f2f5183dfb 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 115:87f2f5183dfb 34 *
Kojto 115:87f2f5183dfb 35 ******************************************************************************
Kojto 115:87f2f5183dfb 36 */
Kojto 115:87f2f5183dfb 37
Kojto 115:87f2f5183dfb 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 115:87f2f5183dfb 39 #ifndef __STM32F7xx_HAL_UART_EX_H
Kojto 115:87f2f5183dfb 40 #define __STM32F7xx_HAL_UART_EX_H
Kojto 115:87f2f5183dfb 41
Kojto 115:87f2f5183dfb 42 #ifdef __cplusplus
Kojto 115:87f2f5183dfb 43 extern "C" {
Kojto 115:87f2f5183dfb 44 #endif
Kojto 115:87f2f5183dfb 45
Kojto 115:87f2f5183dfb 46 /* Includes ------------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 47 #include "stm32f7xx_hal_def.h"
Kojto 115:87f2f5183dfb 48
Kojto 115:87f2f5183dfb 49 /** @addtogroup STM32F7xx_HAL_Driver
Kojto 115:87f2f5183dfb 50 * @{
Kojto 115:87f2f5183dfb 51 */
Kojto 115:87f2f5183dfb 52
Kojto 115:87f2f5183dfb 53 /** @addtogroup UARTEx
Kojto 115:87f2f5183dfb 54 * @{
Kojto 115:87f2f5183dfb 55 */
Kojto 115:87f2f5183dfb 56
Kojto 115:87f2f5183dfb 57 /* Exported types ------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 58 /* Exported constants --------------------------------------------------------*/
Kojto 115:87f2f5183dfb 59 /** @defgroup UARTEx_Exported_Constants UARTEx Exported Constants
Kojto 115:87f2f5183dfb 60 * @{
Kojto 115:87f2f5183dfb 61 */
Kojto 115:87f2f5183dfb 62
Kojto 115:87f2f5183dfb 63 /** @defgroup UARTEx_Word_Length UARTEx Word Length
Kojto 115:87f2f5183dfb 64 * @{
Kojto 115:87f2f5183dfb 65 */
Kojto 115:87f2f5183dfb 66 #define UART_WORDLENGTH_7B ((uint32_t)USART_CR1_M_1)
Kojto 115:87f2f5183dfb 67 #define UART_WORDLENGTH_8B ((uint32_t)0x0000)
Kojto 115:87f2f5183dfb 68 #define UART_WORDLENGTH_9B ((uint32_t)USART_CR1_M_0)
Kojto 115:87f2f5183dfb 69 #define IS_UART_WORD_LENGTH(__LENGTH__) (((__LENGTH__) == UART_WORDLENGTH_7B) || \
Kojto 115:87f2f5183dfb 70 ((__LENGTH__) == UART_WORDLENGTH_8B) || \
Kojto 115:87f2f5183dfb 71 ((__LENGTH__) == UART_WORDLENGTH_9B))
Kojto 115:87f2f5183dfb 72 #define IS_LIN_WORD_LENGTH(LENGTH) (((LENGTH) == UART_WORDLENGTH_8B))
Kojto 115:87f2f5183dfb 73 /**
Kojto 115:87f2f5183dfb 74 * @}
Kojto 115:87f2f5183dfb 75 */
Kojto 115:87f2f5183dfb 76
Kojto 115:87f2f5183dfb 77
Kojto 115:87f2f5183dfb 78 /** @defgroup UARTEx_WakeUp_Address_Length UARTEx WakeUp Address Length
Kojto 115:87f2f5183dfb 79 * @{
Kojto 115:87f2f5183dfb 80 */
Kojto 115:87f2f5183dfb 81 #define UART_ADDRESS_DETECT_4B ((uint32_t)0x00000000)
Kojto 115:87f2f5183dfb 82 #define UART_ADDRESS_DETECT_7B ((uint32_t)USART_CR2_ADDM7)
Kojto 115:87f2f5183dfb 83 #define IS_UART_ADDRESSLENGTH_DETECT(__ADDRESS__) (((__ADDRESS__) == UART_ADDRESS_DETECT_4B) || \
Kojto 115:87f2f5183dfb 84 ((__ADDRESS__) == UART_ADDRESS_DETECT_7B))
Kojto 115:87f2f5183dfb 85 /**
Kojto 115:87f2f5183dfb 86 * @}
Kojto 115:87f2f5183dfb 87 */
Kojto 115:87f2f5183dfb 88
Kojto 115:87f2f5183dfb 89
Kojto 115:87f2f5183dfb 90 /**
Kojto 115:87f2f5183dfb 91 * @}
Kojto 115:87f2f5183dfb 92 */
Kojto 115:87f2f5183dfb 93
Kojto 115:87f2f5183dfb 94 /* Exported macro ------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 95
Kojto 115:87f2f5183dfb 96 /** @defgroup UARTEx_Exported_Macros UARTEx Exported Macros
Kojto 115:87f2f5183dfb 97 * @{
Kojto 115:87f2f5183dfb 98 */
Kojto 115:87f2f5183dfb 99
Kojto 115:87f2f5183dfb 100 /** @brief Reports the UART clock source.
Kojto 115:87f2f5183dfb 101 * @param __HANDLE__: specifies the UART Handle
Kojto 115:87f2f5183dfb 102 * @param __CLOCKSOURCE__: output variable
Kojto 115:87f2f5183dfb 103 * @retval UART clocking source, written in __CLOCKSOURCE__.
Kojto 115:87f2f5183dfb 104 */
Kojto 115:87f2f5183dfb 105 #define UART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \
Kojto 115:87f2f5183dfb 106 do { \
Kojto 115:87f2f5183dfb 107 if((__HANDLE__)->Instance == USART1) \
Kojto 115:87f2f5183dfb 108 { \
Kojto 115:87f2f5183dfb 109 switch(__HAL_RCC_GET_USART1_SOURCE()) \
Kojto 115:87f2f5183dfb 110 { \
Kojto 115:87f2f5183dfb 111 case RCC_USART1CLKSOURCE_PCLK2: \
Kojto 115:87f2f5183dfb 112 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK2; \
Kojto 115:87f2f5183dfb 113 break; \
Kojto 115:87f2f5183dfb 114 case RCC_USART1CLKSOURCE_HSI: \
Kojto 115:87f2f5183dfb 115 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \
Kojto 115:87f2f5183dfb 116 break; \
Kojto 115:87f2f5183dfb 117 case RCC_USART1CLKSOURCE_SYSCLK: \
Kojto 115:87f2f5183dfb 118 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \
Kojto 115:87f2f5183dfb 119 break; \
Kojto 115:87f2f5183dfb 120 case RCC_USART1CLKSOURCE_LSE: \
Kojto 115:87f2f5183dfb 121 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \
Kojto 115:87f2f5183dfb 122 break; \
Kojto 115:87f2f5183dfb 123 default: \
Kojto 115:87f2f5183dfb 124 break; \
Kojto 115:87f2f5183dfb 125 } \
Kojto 115:87f2f5183dfb 126 } \
Kojto 115:87f2f5183dfb 127 else if((__HANDLE__)->Instance == USART2) \
Kojto 115:87f2f5183dfb 128 { \
Kojto 115:87f2f5183dfb 129 switch(__HAL_RCC_GET_USART2_SOURCE()) \
Kojto 115:87f2f5183dfb 130 { \
Kojto 115:87f2f5183dfb 131 case RCC_USART2CLKSOURCE_PCLK1: \
Kojto 115:87f2f5183dfb 132 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \
Kojto 115:87f2f5183dfb 133 break; \
Kojto 115:87f2f5183dfb 134 case RCC_USART2CLKSOURCE_HSI: \
Kojto 115:87f2f5183dfb 135 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \
Kojto 115:87f2f5183dfb 136 break; \
Kojto 115:87f2f5183dfb 137 case RCC_USART2CLKSOURCE_SYSCLK: \
Kojto 115:87f2f5183dfb 138 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \
Kojto 115:87f2f5183dfb 139 break; \
Kojto 115:87f2f5183dfb 140 case RCC_USART2CLKSOURCE_LSE: \
Kojto 115:87f2f5183dfb 141 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \
Kojto 115:87f2f5183dfb 142 break; \
Kojto 115:87f2f5183dfb 143 default: \
Kojto 115:87f2f5183dfb 144 break; \
Kojto 115:87f2f5183dfb 145 } \
Kojto 115:87f2f5183dfb 146 } \
Kojto 115:87f2f5183dfb 147 else if((__HANDLE__)->Instance == USART3) \
Kojto 115:87f2f5183dfb 148 { \
Kojto 115:87f2f5183dfb 149 switch(__HAL_RCC_GET_USART3_SOURCE()) \
Kojto 115:87f2f5183dfb 150 { \
Kojto 115:87f2f5183dfb 151 case RCC_USART3CLKSOURCE_PCLK1: \
Kojto 115:87f2f5183dfb 152 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \
Kojto 115:87f2f5183dfb 153 break; \
Kojto 115:87f2f5183dfb 154 case RCC_USART3CLKSOURCE_HSI: \
Kojto 115:87f2f5183dfb 155 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \
Kojto 115:87f2f5183dfb 156 break; \
Kojto 115:87f2f5183dfb 157 case RCC_USART3CLKSOURCE_SYSCLK: \
Kojto 115:87f2f5183dfb 158 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \
Kojto 115:87f2f5183dfb 159 break; \
Kojto 115:87f2f5183dfb 160 case RCC_USART3CLKSOURCE_LSE: \
Kojto 115:87f2f5183dfb 161 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \
Kojto 115:87f2f5183dfb 162 break; \
Kojto 115:87f2f5183dfb 163 default: \
Kojto 115:87f2f5183dfb 164 break; \
Kojto 115:87f2f5183dfb 165 } \
Kojto 115:87f2f5183dfb 166 } \
Kojto 115:87f2f5183dfb 167 else if((__HANDLE__)->Instance == UART4) \
Kojto 115:87f2f5183dfb 168 { \
Kojto 115:87f2f5183dfb 169 switch(__HAL_RCC_GET_UART4_SOURCE()) \
Kojto 115:87f2f5183dfb 170 { \
Kojto 115:87f2f5183dfb 171 case RCC_UART4CLKSOURCE_PCLK1: \
Kojto 115:87f2f5183dfb 172 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \
Kojto 115:87f2f5183dfb 173 break; \
Kojto 115:87f2f5183dfb 174 case RCC_UART4CLKSOURCE_HSI: \
Kojto 115:87f2f5183dfb 175 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \
Kojto 115:87f2f5183dfb 176 break; \
Kojto 115:87f2f5183dfb 177 case RCC_UART4CLKSOURCE_SYSCLK: \
Kojto 115:87f2f5183dfb 178 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \
Kojto 115:87f2f5183dfb 179 break; \
Kojto 115:87f2f5183dfb 180 case RCC_UART4CLKSOURCE_LSE: \
Kojto 115:87f2f5183dfb 181 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \
Kojto 115:87f2f5183dfb 182 break; \
Kojto 115:87f2f5183dfb 183 default: \
Kojto 115:87f2f5183dfb 184 break; \
Kojto 115:87f2f5183dfb 185 } \
Kojto 115:87f2f5183dfb 186 } \
Kojto 115:87f2f5183dfb 187 else if ((__HANDLE__)->Instance == UART5) \
Kojto 115:87f2f5183dfb 188 { \
Kojto 115:87f2f5183dfb 189 switch(__HAL_RCC_GET_UART5_SOURCE()) \
Kojto 115:87f2f5183dfb 190 { \
Kojto 115:87f2f5183dfb 191 case RCC_UART5CLKSOURCE_PCLK1: \
Kojto 115:87f2f5183dfb 192 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \
Kojto 115:87f2f5183dfb 193 break; \
Kojto 115:87f2f5183dfb 194 case RCC_UART5CLKSOURCE_HSI: \
Kojto 115:87f2f5183dfb 195 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \
Kojto 115:87f2f5183dfb 196 break; \
Kojto 115:87f2f5183dfb 197 case RCC_UART5CLKSOURCE_SYSCLK: \
Kojto 115:87f2f5183dfb 198 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \
Kojto 115:87f2f5183dfb 199 break; \
Kojto 115:87f2f5183dfb 200 case RCC_UART5CLKSOURCE_LSE: \
Kojto 115:87f2f5183dfb 201 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \
Kojto 115:87f2f5183dfb 202 break; \
Kojto 115:87f2f5183dfb 203 default: \
Kojto 115:87f2f5183dfb 204 break; \
Kojto 115:87f2f5183dfb 205 } \
Kojto 115:87f2f5183dfb 206 } \
Kojto 115:87f2f5183dfb 207 else if((__HANDLE__)->Instance == USART6) \
Kojto 115:87f2f5183dfb 208 { \
Kojto 115:87f2f5183dfb 209 switch(__HAL_RCC_GET_USART6_SOURCE()) \
Kojto 115:87f2f5183dfb 210 { \
Kojto 115:87f2f5183dfb 211 case RCC_USART6CLKSOURCE_PCLK2: \
Kojto 115:87f2f5183dfb 212 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK2; \
Kojto 115:87f2f5183dfb 213 break; \
Kojto 115:87f2f5183dfb 214 case RCC_USART6CLKSOURCE_HSI: \
Kojto 115:87f2f5183dfb 215 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \
Kojto 115:87f2f5183dfb 216 break; \
Kojto 115:87f2f5183dfb 217 case RCC_USART6CLKSOURCE_SYSCLK: \
Kojto 115:87f2f5183dfb 218 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \
Kojto 115:87f2f5183dfb 219 break; \
Kojto 115:87f2f5183dfb 220 case RCC_USART6CLKSOURCE_LSE: \
Kojto 115:87f2f5183dfb 221 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \
Kojto 115:87f2f5183dfb 222 break; \
Kojto 115:87f2f5183dfb 223 default: \
Kojto 115:87f2f5183dfb 224 break; \
Kojto 115:87f2f5183dfb 225 } \
Kojto 115:87f2f5183dfb 226 } \
Kojto 115:87f2f5183dfb 227 else if ((__HANDLE__)->Instance == UART7) \
Kojto 115:87f2f5183dfb 228 { \
Kojto 115:87f2f5183dfb 229 switch(__HAL_RCC_GET_UART7_SOURCE()) \
Kojto 115:87f2f5183dfb 230 { \
Kojto 115:87f2f5183dfb 231 case RCC_UART7CLKSOURCE_PCLK1: \
Kojto 115:87f2f5183dfb 232 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \
Kojto 115:87f2f5183dfb 233 break; \
Kojto 115:87f2f5183dfb 234 case RCC_UART7CLKSOURCE_HSI: \
Kojto 115:87f2f5183dfb 235 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \
Kojto 115:87f2f5183dfb 236 break; \
Kojto 115:87f2f5183dfb 237 case RCC_UART7CLKSOURCE_SYSCLK: \
Kojto 115:87f2f5183dfb 238 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \
Kojto 115:87f2f5183dfb 239 break; \
Kojto 115:87f2f5183dfb 240 case RCC_UART7CLKSOURCE_LSE: \
Kojto 115:87f2f5183dfb 241 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \
Kojto 115:87f2f5183dfb 242 break; \
Kojto 115:87f2f5183dfb 243 default: \
Kojto 115:87f2f5183dfb 244 break; \
Kojto 115:87f2f5183dfb 245 } \
Kojto 115:87f2f5183dfb 246 } \
Kojto 115:87f2f5183dfb 247 else if ((__HANDLE__)->Instance == UART8) \
Kojto 115:87f2f5183dfb 248 { \
Kojto 115:87f2f5183dfb 249 switch(__HAL_RCC_GET_UART8_SOURCE()) \
Kojto 115:87f2f5183dfb 250 { \
Kojto 115:87f2f5183dfb 251 case RCC_UART8CLKSOURCE_PCLK1: \
Kojto 115:87f2f5183dfb 252 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \
Kojto 115:87f2f5183dfb 253 break; \
Kojto 115:87f2f5183dfb 254 case RCC_UART8CLKSOURCE_HSI: \
Kojto 115:87f2f5183dfb 255 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \
Kojto 115:87f2f5183dfb 256 break; \
Kojto 115:87f2f5183dfb 257 case RCC_UART8CLKSOURCE_SYSCLK: \
Kojto 115:87f2f5183dfb 258 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \
Kojto 115:87f2f5183dfb 259 break; \
Kojto 115:87f2f5183dfb 260 case RCC_UART8CLKSOURCE_LSE: \
Kojto 115:87f2f5183dfb 261 (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \
Kojto 115:87f2f5183dfb 262 break; \
Kojto 115:87f2f5183dfb 263 default: \
Kojto 115:87f2f5183dfb 264 break; \
Kojto 115:87f2f5183dfb 265 } \
Kojto 115:87f2f5183dfb 266 } \
Kojto 115:87f2f5183dfb 267 } while(0)
Kojto 115:87f2f5183dfb 268
Kojto 115:87f2f5183dfb 269 /** @brief Reports the UART mask to apply to retrieve the received data
Kojto 115:87f2f5183dfb 270 * according to the word length and to the parity bits activation.
Kojto 115:87f2f5183dfb 271 * If PCE = 1, the parity bit is not included in the data extracted
Kojto 115:87f2f5183dfb 272 * by the reception API().
Kojto 115:87f2f5183dfb 273 * This masking operation is not carried out in the case of
Kojto 115:87f2f5183dfb 274 * DMA transfers.
Kojto 115:87f2f5183dfb 275 * @param __HANDLE__: specifies the UART Handle
Kojto 115:87f2f5183dfb 276 * @retval mask to apply to UART RDR register value.
Kojto 115:87f2f5183dfb 277 */
Kojto 115:87f2f5183dfb 278 #define UART_MASK_COMPUTATION(__HANDLE__) \
Kojto 115:87f2f5183dfb 279 do { \
Kojto 115:87f2f5183dfb 280 if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_9B) \
Kojto 115:87f2f5183dfb 281 { \
Kojto 115:87f2f5183dfb 282 if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \
Kojto 115:87f2f5183dfb 283 { \
Kojto 115:87f2f5183dfb 284 (__HANDLE__)->Mask = 0x01FF ; \
Kojto 115:87f2f5183dfb 285 } \
Kojto 115:87f2f5183dfb 286 else \
Kojto 115:87f2f5183dfb 287 { \
Kojto 115:87f2f5183dfb 288 (__HANDLE__)->Mask = 0x00FF ; \
Kojto 115:87f2f5183dfb 289 } \
Kojto 115:87f2f5183dfb 290 } \
Kojto 115:87f2f5183dfb 291 else if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_8B) \
Kojto 115:87f2f5183dfb 292 { \
Kojto 115:87f2f5183dfb 293 if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \
Kojto 115:87f2f5183dfb 294 { \
Kojto 115:87f2f5183dfb 295 (__HANDLE__)->Mask = 0x00FF ; \
Kojto 115:87f2f5183dfb 296 } \
Kojto 115:87f2f5183dfb 297 else \
Kojto 115:87f2f5183dfb 298 { \
Kojto 115:87f2f5183dfb 299 (__HANDLE__)->Mask = 0x007F ; \
Kojto 115:87f2f5183dfb 300 } \
Kojto 115:87f2f5183dfb 301 } \
Kojto 115:87f2f5183dfb 302 else if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_7B) \
Kojto 115:87f2f5183dfb 303 { \
Kojto 115:87f2f5183dfb 304 if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \
Kojto 115:87f2f5183dfb 305 { \
Kojto 115:87f2f5183dfb 306 (__HANDLE__)->Mask = 0x007F ; \
Kojto 115:87f2f5183dfb 307 } \
Kojto 115:87f2f5183dfb 308 else \
Kojto 115:87f2f5183dfb 309 { \
Kojto 115:87f2f5183dfb 310 (__HANDLE__)->Mask = 0x003F ; \
Kojto 115:87f2f5183dfb 311 } \
Kojto 115:87f2f5183dfb 312 } \
Kojto 115:87f2f5183dfb 313 } while(0)
Kojto 115:87f2f5183dfb 314
Kojto 115:87f2f5183dfb 315 /**
Kojto 115:87f2f5183dfb 316 * @}
Kojto 115:87f2f5183dfb 317 */
Kojto 115:87f2f5183dfb 318
Kojto 115:87f2f5183dfb 319 /* Exported functions --------------------------------------------------------*/
Kojto 115:87f2f5183dfb 320
Kojto 115:87f2f5183dfb 321 /**
Kojto 115:87f2f5183dfb 322 * @}
Kojto 115:87f2f5183dfb 323 */
Kojto 115:87f2f5183dfb 324
Kojto 115:87f2f5183dfb 325 /**
Kojto 115:87f2f5183dfb 326 * @}
Kojto 115:87f2f5183dfb 327 */
Kojto 115:87f2f5183dfb 328
Kojto 115:87f2f5183dfb 329 #ifdef __cplusplus
Kojto 115:87f2f5183dfb 330 }
Kojto 115:87f2f5183dfb 331 #endif
Kojto 115:87f2f5183dfb 332
Kojto 115:87f2f5183dfb 333 #endif /* __STM32F7xx_HAL_UART_EX_H */
Kojto 115:87f2f5183dfb 334
Kojto 115:87f2f5183dfb 335 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/