stm32f7xx_hal_usart_ex.h
Go to the documentation of this file.
1 
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef STM32F7xx_HAL_USART_EX_H
22 #define STM32F7xx_HAL_USART_EX_H
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32f7xx_hal_def.h"
30 
39 /* Exported types ------------------------------------------------------------*/
40 /* Exported constants --------------------------------------------------------*/
48 #define USART_WORDLENGTH_7B ((uint32_t)USART_CR1_M1)
49 #define USART_WORDLENGTH_8B (0x00000000U)
50 #define USART_WORDLENGTH_9B ((uint32_t)USART_CR1_M0)
60 /* Private macros ------------------------------------------------------------*/
61 
74 #define USART_MASK_COMPUTATION(__HANDLE__) \
75  do { \
76  if ((__HANDLE__)->Init.WordLength == USART_WORDLENGTH_9B) \
77  { \
78  if ((__HANDLE__)->Init.Parity == USART_PARITY_NONE) \
79  { \
80  (__HANDLE__)->Mask = 0x01FFU; \
81  } \
82  else \
83  { \
84  (__HANDLE__)->Mask = 0x00FFU; \
85  } \
86  } \
87  else if ((__HANDLE__)->Init.WordLength == USART_WORDLENGTH_8B) \
88  { \
89  if ((__HANDLE__)->Init.Parity == USART_PARITY_NONE) \
90  { \
91  (__HANDLE__)->Mask = 0x00FFU; \
92  } \
93  else \
94  { \
95  (__HANDLE__)->Mask = 0x007FU; \
96  } \
97  } \
98  else if ((__HANDLE__)->Init.WordLength == USART_WORDLENGTH_7B) \
99  { \
100  if ((__HANDLE__)->Init.Parity == USART_PARITY_NONE) \
101  { \
102  (__HANDLE__)->Mask = 0x007FU; \
103  } \
104  else \
105  { \
106  (__HANDLE__)->Mask = 0x003FU; \
107  } \
108  } \
109  else \
110  { \
111  (__HANDLE__)->Mask = 0x0000U; \
112  } \
113  } while(0U)
114 
120 #define IS_USART_WORD_LENGTH(__LENGTH__) (((__LENGTH__) == USART_WORDLENGTH_7B) || \
121  ((__LENGTH__) == USART_WORDLENGTH_8B) || \
122  ((__LENGTH__) == USART_WORDLENGTH_9B))
123 
124 
129 /* Exported functions --------------------------------------------------------*/
138 /* IO operation functions *****************************************************/
139 
148 /* Peripheral Control functions ***********************************************/
149 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif /* STM32F7xx_HAL_USART_EX_H */
171 
172 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
stm32f7xx_hal_def.h
This file contains HAL common defines, enumeration, macros and structures definitions.


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:53