mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Thu Oct 29 08:40:18 2015 +0000
Revision:
109:9296ab0bfc11
Child:
122:f9eeca106725
Release 109  of the mbed library

Changes:
- new platforms - NUCLEO_F042K6, WIZNWIKI_W7500ECO
- MTS targets - bootloaders update to 0.1.1
- STM F7 - RTC enable fixes
- STM F4 - i2c pending stop before start fix
- STM all targets - analogout normalization fix

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 109:9296ab0bfc11 1 /**
Kojto 109:9296ab0bfc11 2 ******************************************************************************
Kojto 109:9296ab0bfc11 3 * @file stm32f3xx_hal_uart.h
Kojto 109:9296ab0bfc11 4 * @author MCD Application Team
Kojto 109:9296ab0bfc11 5 * @version V1.1.0
Kojto 109:9296ab0bfc11 6 * @date 12-Sept-2014
Kojto 109:9296ab0bfc11 7 * @brief Header file of UART HAL module.
Kojto 109:9296ab0bfc11 8 ******************************************************************************
Kojto 109:9296ab0bfc11 9 * @attention
Kojto 109:9296ab0bfc11 10 *
Kojto 109:9296ab0bfc11 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Kojto 109:9296ab0bfc11 12 *
Kojto 109:9296ab0bfc11 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 109:9296ab0bfc11 14 * are permitted provided that the following conditions are met:
Kojto 109:9296ab0bfc11 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 109:9296ab0bfc11 16 * this list of conditions and the following disclaimer.
Kojto 109:9296ab0bfc11 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 109:9296ab0bfc11 18 * this list of conditions and the following disclaimer in the documentation
Kojto 109:9296ab0bfc11 19 * and/or other materials provided with the distribution.
Kojto 109:9296ab0bfc11 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 109:9296ab0bfc11 21 * may be used to endorse or promote products derived from this software
Kojto 109:9296ab0bfc11 22 * without specific prior written permission.
Kojto 109:9296ab0bfc11 23 *
Kojto 109:9296ab0bfc11 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 109:9296ab0bfc11 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 109:9296ab0bfc11 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 109:9296ab0bfc11 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 109:9296ab0bfc11 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 109:9296ab0bfc11 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 109:9296ab0bfc11 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 109:9296ab0bfc11 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 109:9296ab0bfc11 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 109:9296ab0bfc11 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 109:9296ab0bfc11 34 *
Kojto 109:9296ab0bfc11 35 ******************************************************************************
Kojto 109:9296ab0bfc11 36 */
Kojto 109:9296ab0bfc11 37
Kojto 109:9296ab0bfc11 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 109:9296ab0bfc11 39 #ifndef __STM32F3xx_HAL_UART_H
Kojto 109:9296ab0bfc11 40 #define __STM32F3xx_HAL_UART_H
Kojto 109:9296ab0bfc11 41
Kojto 109:9296ab0bfc11 42 #ifdef __cplusplus
Kojto 109:9296ab0bfc11 43 extern "C" {
Kojto 109:9296ab0bfc11 44 #endif
Kojto 109:9296ab0bfc11 45
Kojto 109:9296ab0bfc11 46 /* Includes ------------------------------------------------------------------*/
Kojto 109:9296ab0bfc11 47 #include "stm32f3xx_hal_def.h"
Kojto 109:9296ab0bfc11 48
Kojto 109:9296ab0bfc11 49 /** @addtogroup STM32F3xx_HAL_Driver
Kojto 109:9296ab0bfc11 50 * @{
Kojto 109:9296ab0bfc11 51 */
Kojto 109:9296ab0bfc11 52
Kojto 109:9296ab0bfc11 53 /** @addtogroup UART
Kojto 109:9296ab0bfc11 54 * @{
Kojto 109:9296ab0bfc11 55 */
Kojto 109:9296ab0bfc11 56
Kojto 109:9296ab0bfc11 57 /* Exported types ------------------------------------------------------------*/
Kojto 109:9296ab0bfc11 58 /** @defgroup UART_Exported_Types UART Exported Types
Kojto 109:9296ab0bfc11 59 * @{
Kojto 109:9296ab0bfc11 60 */
Kojto 109:9296ab0bfc11 61
Kojto 109:9296ab0bfc11 62 /**
Kojto 109:9296ab0bfc11 63 * @brief UART Init Structure definition
Kojto 109:9296ab0bfc11 64 */
Kojto 109:9296ab0bfc11 65 typedef struct
Kojto 109:9296ab0bfc11 66 {
Kojto 109:9296ab0bfc11 67 uint32_t BaudRate; /*!< This member configures the UART communication baud rate.
Kojto 109:9296ab0bfc11 68 The baud rate register is computed using the following formula:
Kojto 109:9296ab0bfc11 69 - If oversampling is 16 or in LIN mode,
Kojto 109:9296ab0bfc11 70 Baud Rate Register = ((PCLKx) / ((huart->Init.BaudRate)))
Kojto 109:9296ab0bfc11 71 - If oversampling is 8,
Kojto 109:9296ab0bfc11 72 Baud Rate Register[15:4] = ((2 * PCLKx) / ((huart->Init.BaudRate)))[15:4]
Kojto 109:9296ab0bfc11 73 Baud Rate Register[3] = 0
Kojto 109:9296ab0bfc11 74 Baud Rate Register[2:0] = (((2 * PCLKx) / ((huart->Init.BaudRate)))[3:0]) >> 1 */
Kojto 109:9296ab0bfc11 75
Kojto 109:9296ab0bfc11 76 uint32_t WordLength; /*!< Specifies the number of data bits transmitted or received in a frame.
Kojto 109:9296ab0bfc11 77 This parameter can be a value of @ref UARTEx_Word_Length */
Kojto 109:9296ab0bfc11 78
Kojto 109:9296ab0bfc11 79 uint32_t StopBits; /*!< Specifies the number of stop bits transmitted.
Kojto 109:9296ab0bfc11 80 This parameter can be a value of @ref UART_Stop_Bits */
Kojto 109:9296ab0bfc11 81
Kojto 109:9296ab0bfc11 82 uint32_t Parity; /*!< Specifies the parity mode.
Kojto 109:9296ab0bfc11 83 This parameter can be a value of @ref UART_Parity
Kojto 109:9296ab0bfc11 84 @note When parity is enabled, the computed parity is inserted
Kojto 109:9296ab0bfc11 85 at the MSB position of the transmitted data (9th bit when
Kojto 109:9296ab0bfc11 86 the word length is set to 9 data bits; 8th bit when the
Kojto 109:9296ab0bfc11 87 word length is set to 8 data bits). */
Kojto 109:9296ab0bfc11 88
Kojto 109:9296ab0bfc11 89 uint32_t Mode; /*!< Specifies whether the Receive or Transmit mode is enabled or disabled.
Kojto 109:9296ab0bfc11 90 This parameter can be a value of @ref UART_Mode */
Kojto 109:9296ab0bfc11 91
Kojto 109:9296ab0bfc11 92 uint32_t HwFlowCtl; /*!< Specifies whether the hardware flow control mode is enabled
Kojto 109:9296ab0bfc11 93 or disabled.
Kojto 109:9296ab0bfc11 94 This parameter can be a value of @ref UART_Hardware_Flow_Control */
Kojto 109:9296ab0bfc11 95
Kojto 109:9296ab0bfc11 96 uint32_t OverSampling; /*!< Specifies whether the Over sampling 8 is enabled or disabled, to achieve higher speed (up to fPCLK/8).
Kojto 109:9296ab0bfc11 97 This parameter can be a value of @ref UART_Over_Sampling */
Kojto 109:9296ab0bfc11 98
Kojto 109:9296ab0bfc11 99 uint32_t OneBitSampling; /*!< Specifies whether a single sample or three samples' majority vote is selected.
Kojto 109:9296ab0bfc11 100 Selecting the single sample method increases the receiver tolerance to clock
Kojto 109:9296ab0bfc11 101 deviations. This parameter can be a value of @ref UART_OneBit_Sampling. */
Kojto 109:9296ab0bfc11 102 }UART_InitTypeDef;
Kojto 109:9296ab0bfc11 103
Kojto 109:9296ab0bfc11 104 /**
Kojto 109:9296ab0bfc11 105 * @brief UART Advanced Features initalization structure definition
Kojto 109:9296ab0bfc11 106 */
Kojto 109:9296ab0bfc11 107 typedef struct
Kojto 109:9296ab0bfc11 108 {
Kojto 109:9296ab0bfc11 109 uint32_t AdvFeatureInit; /*!< Specifies which advanced UART features is initialized. Several
Kojto 109:9296ab0bfc11 110 Advanced Features may be initialized at the same time .
Kojto 109:9296ab0bfc11 111 This parameter can be a value of @ref UART_Advanced_Features_Initialization_Type */
Kojto 109:9296ab0bfc11 112
Kojto 109:9296ab0bfc11 113 uint32_t TxPinLevelInvert; /*!< Specifies whether the TX pin active level is inverted.
Kojto 109:9296ab0bfc11 114 This parameter can be a value of @ref UART_Tx_Inv */
Kojto 109:9296ab0bfc11 115
Kojto 109:9296ab0bfc11 116 uint32_t RxPinLevelInvert; /*!< Specifies whether the RX pin active level is inverted.
Kojto 109:9296ab0bfc11 117 This parameter can be a value of @ref UART_Rx_Inv */
Kojto 109:9296ab0bfc11 118
Kojto 109:9296ab0bfc11 119 uint32_t DataInvert; /*!< Specifies whether data are inverted (positive/direct logic
Kojto 109:9296ab0bfc11 120 vs negative/inverted logic).
Kojto 109:9296ab0bfc11 121 This parameter can be a value of @ref UART_Data_Inv */
Kojto 109:9296ab0bfc11 122
Kojto 109:9296ab0bfc11 123 uint32_t Swap; /*!< Specifies whether TX and RX pins are swapped.
Kojto 109:9296ab0bfc11 124 This parameter can be a value of @ref UART_Rx_Tx_Swap */
Kojto 109:9296ab0bfc11 125
Kojto 109:9296ab0bfc11 126 uint32_t OverrunDisable; /*!< Specifies whether the reception overrun detection is disabled.
Kojto 109:9296ab0bfc11 127 This parameter can be a value of @ref UART_Overrun_Disable */
Kojto 109:9296ab0bfc11 128
Kojto 109:9296ab0bfc11 129 uint32_t DMADisableonRxError; /*!< Specifies whether the DMA is disabled in case of reception error.
Kojto 109:9296ab0bfc11 130 This parameter can be a value of @ref UART_DMA_Disable_on_Rx_Error */
Kojto 109:9296ab0bfc11 131
Kojto 109:9296ab0bfc11 132 uint32_t AutoBaudRateEnable; /*!< Specifies whether auto Baud rate detection is enabled.
Kojto 109:9296ab0bfc11 133 This parameter can be a value of @ref UART_AutoBaudRate_Enable */
Kojto 109:9296ab0bfc11 134
Kojto 109:9296ab0bfc11 135 uint32_t AutoBaudRateMode; /*!< If auto Baud rate detection is enabled, specifies how the rate
Kojto 109:9296ab0bfc11 136 detection is carried out.
Kojto 109:9296ab0bfc11 137 This parameter can be a value of @ref UART_AutoBaud_Rate_Mode */
Kojto 109:9296ab0bfc11 138
Kojto 109:9296ab0bfc11 139 uint32_t MSBFirst; /*!< Specifies whether MSB is sent first on UART line.
Kojto 109:9296ab0bfc11 140 This parameter can be a value of @ref UART_MSB_First */
Kojto 109:9296ab0bfc11 141 } UART_AdvFeatureInitTypeDef;
Kojto 109:9296ab0bfc11 142
Kojto 109:9296ab0bfc11 143 /**
Kojto 109:9296ab0bfc11 144 * @brief UART wake up from stop mode parameters
Kojto 109:9296ab0bfc11 145 */
Kojto 109:9296ab0bfc11 146 typedef struct
Kojto 109:9296ab0bfc11 147 {
Kojto 109:9296ab0bfc11 148 uint32_t WakeUpEvent; /*!< Specifies which event will activat the Wakeup from Stop mode flag (WUF).
Kojto 109:9296ab0bfc11 149 This parameter can be a value of @ref UART_WakeUp_from_Stop_Selection.
Kojto 109:9296ab0bfc11 150 If set to UART_WAKEUP_ON_ADDRESS, the two other fields below must
Kojto 109:9296ab0bfc11 151 be filled up. */
Kojto 109:9296ab0bfc11 152
Kojto 109:9296ab0bfc11 153 uint16_t AddressLength; /*!< Specifies whether the address is 4 or 7-bit long.
Kojto 109:9296ab0bfc11 154 This parameter can be a value of @ref UART_WakeUp_Address_Length */
Kojto 109:9296ab0bfc11 155
Kojto 109:9296ab0bfc11 156 uint8_t Address; /*!< UART/USART node address (7-bit long max) */
Kojto 109:9296ab0bfc11 157 } UART_WakeUpTypeDef;
Kojto 109:9296ab0bfc11 158
Kojto 109:9296ab0bfc11 159 /**
Kojto 109:9296ab0bfc11 160 * @brief HAL UART State structures definition
Kojto 109:9296ab0bfc11 161 */
Kojto 109:9296ab0bfc11 162 typedef enum
Kojto 109:9296ab0bfc11 163 {
Kojto 109:9296ab0bfc11 164 HAL_UART_STATE_RESET = 0x00, /*!< Peripheral is not initialized */
Kojto 109:9296ab0bfc11 165 HAL_UART_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */
Kojto 109:9296ab0bfc11 166 HAL_UART_STATE_BUSY = 0x02, /*!< an internal process is ongoing */
Kojto 109:9296ab0bfc11 167 HAL_UART_STATE_BUSY_TX = 0x12, /*!< Data Transmission process is ongoing */
Kojto 109:9296ab0bfc11 168 HAL_UART_STATE_BUSY_RX = 0x22, /*!< Data Reception process is ongoing */
Kojto 109:9296ab0bfc11 169 HAL_UART_STATE_BUSY_TX_RX = 0x32, /*!< Data Transmission and Reception process is ongoing */
Kojto 109:9296ab0bfc11 170 HAL_UART_STATE_TIMEOUT = 0x03, /*!< Timeout state */
Kojto 109:9296ab0bfc11 171 HAL_UART_STATE_ERROR = 0x04 /*!< Error */
Kojto 109:9296ab0bfc11 172 }HAL_UART_StateTypeDef;
Kojto 109:9296ab0bfc11 173
Kojto 109:9296ab0bfc11 174 /**
Kojto 109:9296ab0bfc11 175 * @brief HAL UART Error Code structure definition
Kojto 109:9296ab0bfc11 176 */
Kojto 109:9296ab0bfc11 177 typedef enum
Kojto 109:9296ab0bfc11 178 {
Kojto 109:9296ab0bfc11 179 HAL_UART_ERROR_NONE = 0x00, /*!< No error */
Kojto 109:9296ab0bfc11 180 HAL_UART_ERROR_PE = 0x01, /*!< Parity error */
Kojto 109:9296ab0bfc11 181 HAL_UART_ERROR_NE = 0x02, /*!< Noise error */
Kojto 109:9296ab0bfc11 182 HAL_UART_ERROR_FE = 0x04, /*!< frame error */
Kojto 109:9296ab0bfc11 183 HAL_UART_ERROR_ORE = 0x08, /*!< Overrun error */
Kojto 109:9296ab0bfc11 184 HAL_UART_ERROR_DMA = 0x10 /*!< DMA transfer error */
Kojto 109:9296ab0bfc11 185 }HAL_UART_ErrorTypeDef;
Kojto 109:9296ab0bfc11 186
Kojto 109:9296ab0bfc11 187 /**
Kojto 109:9296ab0bfc11 188 * @brief UART clock sources definition
Kojto 109:9296ab0bfc11 189 */
Kojto 109:9296ab0bfc11 190 typedef enum
Kojto 109:9296ab0bfc11 191 {
Kojto 109:9296ab0bfc11 192 UART_CLOCKSOURCE_PCLK1 = 0x00, /*!< PCLK1 clock source */
Kojto 109:9296ab0bfc11 193 UART_CLOCKSOURCE_PCLK2 = 0x01, /*!< PCLK2 clock source */
Kojto 109:9296ab0bfc11 194 UART_CLOCKSOURCE_HSI = 0x02, /*!< HSI clock source */
Kojto 109:9296ab0bfc11 195 UART_CLOCKSOURCE_SYSCLK = 0x04, /*!< SYSCLK clock source */
Kojto 109:9296ab0bfc11 196 UART_CLOCKSOURCE_LSE = 0x08, /*!< LSE clock source */
Kojto 109:9296ab0bfc11 197 UART_CLOCKSOURCE_UNDEFINED = 0x10 /*!< Undefined clock source */
Kojto 109:9296ab0bfc11 198 }UART_ClockSourceTypeDef;
Kojto 109:9296ab0bfc11 199
Kojto 109:9296ab0bfc11 200 /**
Kojto 109:9296ab0bfc11 201 * @brief UART handle Structure definition
Kojto 109:9296ab0bfc11 202 */
Kojto 109:9296ab0bfc11 203 typedef struct
Kojto 109:9296ab0bfc11 204 {
Kojto 109:9296ab0bfc11 205 USART_TypeDef *Instance; /* UART registers base address */
Kojto 109:9296ab0bfc11 206
Kojto 109:9296ab0bfc11 207 UART_InitTypeDef Init; /* UART communication parameters */
Kojto 109:9296ab0bfc11 208
Kojto 109:9296ab0bfc11 209 UART_AdvFeatureInitTypeDef AdvancedInit; /* UART Advanced Features initialization parameters */
Kojto 109:9296ab0bfc11 210
Kojto 109:9296ab0bfc11 211 uint8_t *pTxBuffPtr; /* Pointer to UART Tx transfer Buffer */
Kojto 109:9296ab0bfc11 212
Kojto 109:9296ab0bfc11 213 uint16_t TxXferSize; /* UART Tx Transfer size */
Kojto 109:9296ab0bfc11 214
Kojto 109:9296ab0bfc11 215 uint16_t TxXferCount; /* UART Tx Transfer Counter */
Kojto 109:9296ab0bfc11 216
Kojto 109:9296ab0bfc11 217 uint8_t *pRxBuffPtr; /* Pointer to UART Rx transfer Buffer */
Kojto 109:9296ab0bfc11 218
Kojto 109:9296ab0bfc11 219 uint16_t RxXferSize; /* UART Rx Transfer size */
Kojto 109:9296ab0bfc11 220
Kojto 109:9296ab0bfc11 221 uint16_t RxXferCount; /* UART Rx Transfer Counter */
Kojto 109:9296ab0bfc11 222
Kojto 109:9296ab0bfc11 223 uint16_t Mask; /* UART Rx RDR register mask */
Kojto 109:9296ab0bfc11 224
Kojto 109:9296ab0bfc11 225 DMA_HandleTypeDef *hdmatx; /* UART Tx DMA Handle parameters */
Kojto 109:9296ab0bfc11 226
Kojto 109:9296ab0bfc11 227 DMA_HandleTypeDef *hdmarx; /* UART Rx DMA Handle parameters */
Kojto 109:9296ab0bfc11 228
Kojto 109:9296ab0bfc11 229 HAL_LockTypeDef Lock; /* Locking object */
Kojto 109:9296ab0bfc11 230
Kojto 109:9296ab0bfc11 231 HAL_UART_StateTypeDef State; /* UART communication state */
Kojto 109:9296ab0bfc11 232
Kojto 109:9296ab0bfc11 233 HAL_UART_ErrorTypeDef ErrorCode; /* UART Error code */
Kojto 109:9296ab0bfc11 234
Kojto 109:9296ab0bfc11 235 }UART_HandleTypeDef;
Kojto 109:9296ab0bfc11 236
Kojto 109:9296ab0bfc11 237 /**
Kojto 109:9296ab0bfc11 238 * @}
Kojto 109:9296ab0bfc11 239 */
Kojto 109:9296ab0bfc11 240
Kojto 109:9296ab0bfc11 241 /* Exported constants --------------------------------------------------------*/
Kojto 109:9296ab0bfc11 242 /** @defgroup UART_Exported_Constants UART Exported Constants
Kojto 109:9296ab0bfc11 243 * @{
Kojto 109:9296ab0bfc11 244 */
Kojto 109:9296ab0bfc11 245
Kojto 109:9296ab0bfc11 246 /** @defgroup UART_Stop_Bits UART Number of Stop Bits
Kojto 109:9296ab0bfc11 247 * @{
Kojto 109:9296ab0bfc11 248 */
Kojto 109:9296ab0bfc11 249 #define UART_STOPBITS_1 ((uint32_t)0x0000)
Kojto 109:9296ab0bfc11 250 #define UART_STOPBITS_2 ((uint32_t)USART_CR2_STOP_1)
Kojto 109:9296ab0bfc11 251 #define IS_UART_STOPBITS(STOPBITS) (((STOPBITS) == UART_STOPBITS_1) || \
Kojto 109:9296ab0bfc11 252 ((STOPBITS) == UART_STOPBITS_2))
Kojto 109:9296ab0bfc11 253 /**
Kojto 109:9296ab0bfc11 254 * @}
Kojto 109:9296ab0bfc11 255 */
Kojto 109:9296ab0bfc11 256
Kojto 109:9296ab0bfc11 257 /** @defgroup UART_Parity UART Parity
Kojto 109:9296ab0bfc11 258 * @{
Kojto 109:9296ab0bfc11 259 */
Kojto 109:9296ab0bfc11 260 #define UART_PARITY_NONE ((uint32_t)0x0000)
Kojto 109:9296ab0bfc11 261 #define UART_PARITY_EVEN ((uint32_t)USART_CR1_PCE)
Kojto 109:9296ab0bfc11 262 #define UART_PARITY_ODD ((uint32_t)(USART_CR1_PCE | USART_CR1_PS))
Kojto 109:9296ab0bfc11 263 #define IS_UART_PARITY(PARITY) (((PARITY) == UART_PARITY_NONE) || \
Kojto 109:9296ab0bfc11 264 ((PARITY) == UART_PARITY_EVEN) || \
Kojto 109:9296ab0bfc11 265 ((PARITY) == UART_PARITY_ODD))
Kojto 109:9296ab0bfc11 266 /**
Kojto 109:9296ab0bfc11 267 * @}
Kojto 109:9296ab0bfc11 268 */
Kojto 109:9296ab0bfc11 269
Kojto 109:9296ab0bfc11 270 /** @defgroup UART_Hardware_Flow_Control UART Hardware Flow Control
Kojto 109:9296ab0bfc11 271 * @{
Kojto 109:9296ab0bfc11 272 */
Kojto 109:9296ab0bfc11 273 #define UART_HWCONTROL_NONE ((uint32_t)0x0000)
Kojto 109:9296ab0bfc11 274 #define UART_HWCONTROL_RTS ((uint32_t)USART_CR3_RTSE)
Kojto 109:9296ab0bfc11 275 #define UART_HWCONTROL_CTS ((uint32_t)USART_CR3_CTSE)
Kojto 109:9296ab0bfc11 276 #define UART_HWCONTROL_RTS_CTS ((uint32_t)(USART_CR3_RTSE | USART_CR3_CTSE))
Kojto 109:9296ab0bfc11 277 #define IS_UART_HARDWARE_FLOW_CONTROL(CONTROL)\
Kojto 109:9296ab0bfc11 278 (((CONTROL) == UART_HWCONTROL_NONE) || \
Kojto 109:9296ab0bfc11 279 ((CONTROL) == UART_HWCONTROL_RTS) || \
Kojto 109:9296ab0bfc11 280 ((CONTROL) == UART_HWCONTROL_CTS) || \
Kojto 109:9296ab0bfc11 281 ((CONTROL) == UART_HWCONTROL_RTS_CTS))
Kojto 109:9296ab0bfc11 282 /**
Kojto 109:9296ab0bfc11 283 * @}
Kojto 109:9296ab0bfc11 284 */
Kojto 109:9296ab0bfc11 285
Kojto 109:9296ab0bfc11 286 /** @defgroup UART_Mode UART Transfer Mode
Kojto 109:9296ab0bfc11 287 * @{
Kojto 109:9296ab0bfc11 288 */
Kojto 109:9296ab0bfc11 289 #define UART_MODE_RX ((uint32_t)USART_CR1_RE)
Kojto 109:9296ab0bfc11 290 #define UART_MODE_TX ((uint32_t)USART_CR1_TE)
Kojto 109:9296ab0bfc11 291 #define UART_MODE_TX_RX ((uint32_t)(USART_CR1_TE |USART_CR1_RE))
Kojto 109:9296ab0bfc11 292 #define IS_UART_MODE(MODE) ((((MODE) & (~((uint32_t)(UART_MODE_TX_RX)))) == (uint32_t)0x00) && ((MODE) != (uint32_t)0x00))
Kojto 109:9296ab0bfc11 293 /**
Kojto 109:9296ab0bfc11 294 * @}
Kojto 109:9296ab0bfc11 295 */
Kojto 109:9296ab0bfc11 296
Kojto 109:9296ab0bfc11 297 /** @defgroup UART_State UART State
Kojto 109:9296ab0bfc11 298 * @{
Kojto 109:9296ab0bfc11 299 */
Kojto 109:9296ab0bfc11 300 #define UART_STATE_DISABLE ((uint32_t)0x0000)
Kojto 109:9296ab0bfc11 301 #define UART_STATE_ENABLE ((uint32_t)USART_CR1_UE)
Kojto 109:9296ab0bfc11 302 #define IS_UART_STATE(STATE) (((STATE) == UART_STATE_DISABLE) || \
Kojto 109:9296ab0bfc11 303 ((STATE) == UART_STATE_ENABLE))
Kojto 109:9296ab0bfc11 304 /**
Kojto 109:9296ab0bfc11 305 * @}
Kojto 109:9296ab0bfc11 306 */
Kojto 109:9296ab0bfc11 307
Kojto 109:9296ab0bfc11 308 /** @defgroup UART_Over_Sampling UART Over Sampling
Kojto 109:9296ab0bfc11 309 * @{
Kojto 109:9296ab0bfc11 310 */
Kojto 109:9296ab0bfc11 311 #define UART_OVERSAMPLING_16 ((uint32_t)0x0000)
Kojto 109:9296ab0bfc11 312 #define UART_OVERSAMPLING_8 ((uint32_t)USART_CR1_OVER8)
Kojto 109:9296ab0bfc11 313 #define IS_UART_OVERSAMPLING(SAMPLING) (((SAMPLING) == UART_OVERSAMPLING_16) || \
Kojto 109:9296ab0bfc11 314 ((SAMPLING) == UART_OVERSAMPLING_8))
Kojto 109:9296ab0bfc11 315 /**
Kojto 109:9296ab0bfc11 316 * @}
Kojto 109:9296ab0bfc11 317 */
Kojto 109:9296ab0bfc11 318
Kojto 109:9296ab0bfc11 319 /** @defgroup UART_OneBit_Sampling UART One Bit Sampling Method
Kojto 109:9296ab0bfc11 320 * @{
Kojto 109:9296ab0bfc11 321 */
Kojto 109:9296ab0bfc11 322 #define UART_ONEBIT_SAMPLING_DISABLED ((uint32_t)0x0000)
Kojto 109:9296ab0bfc11 323 #define UART_ONEBIT_SAMPLING_ENABLED ((uint32_t)USART_CR3_ONEBIT)
Kojto 109:9296ab0bfc11 324 #define IS_UART_ONEBIT_SAMPLING(ONEBIT) (((ONEBIT) == UART_ONEBIT_SAMPLING_DISABLED) || \
Kojto 109:9296ab0bfc11 325 ((ONEBIT) == UART_ONEBIT_SAMPLING_ENABLED))
Kojto 109:9296ab0bfc11 326 /**
Kojto 109:9296ab0bfc11 327 * @}
Kojto 109:9296ab0bfc11 328 */
Kojto 109:9296ab0bfc11 329
Kojto 109:9296ab0bfc11 330 /** @defgroup UART_AutoBaud_Rate_Mode UART Advanced Feature AutoBaud Rate Mode
Kojto 109:9296ab0bfc11 331 * @{
Kojto 109:9296ab0bfc11 332 */
Kojto 109:9296ab0bfc11 333 #define UART_ADVFEATURE_AUTOBAUDRATE_ONSTARTBIT ((uint32_t)0x0000)
Kojto 109:9296ab0bfc11 334 #define UART_ADVFEATURE_AUTOBAUDRATE_ONFALLINGEDGE ((uint32_t)USART_CR2_ABRMODE_0)
Kojto 109:9296ab0bfc11 335 #define UART_ADVFEATURE_AUTOBAUDRATE_ON0X7FFRAME ((uint32_t)USART_CR2_ABRMODE_1)
Kojto 109:9296ab0bfc11 336 #define UART_ADVFEATURE_AUTOBAUDRATE_ON0X55FRAME ((uint32_t)USART_CR2_ABRMODE)
Kojto 109:9296ab0bfc11 337 #define IS_UART_ADVFEATURE_AUTOBAUDRATEMODE(MODE) (((MODE) == UART_ADVFEATURE_AUTOBAUDRATE_ONSTARTBIT) || \
Kojto 109:9296ab0bfc11 338 ((MODE) == UART_ADVFEATURE_AUTOBAUDRATE_ONFALLINGEDGE) || \
Kojto 109:9296ab0bfc11 339 ((MODE) == UART_ADVFEATURE_AUTOBAUDRATE_ON0X7FFRAME) || \
Kojto 109:9296ab0bfc11 340 ((MODE) == UART_ADVFEATURE_AUTOBAUDRATE_ON0X55FRAME))
Kojto 109:9296ab0bfc11 341 /**
Kojto 109:9296ab0bfc11 342 * @}
Kojto 109:9296ab0bfc11 343 */
Kojto 109:9296ab0bfc11 344
Kojto 109:9296ab0bfc11 345 /** @defgroup UART_Receiver_TimeOut UART Receiver TimeOut
Kojto 109:9296ab0bfc11 346 * @{
Kojto 109:9296ab0bfc11 347 */
Kojto 109:9296ab0bfc11 348 #define UART_RECEIVER_TIMEOUT_DISABLE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 349 #define UART_RECEIVER_TIMEOUT_ENABLE ((uint32_t)USART_CR2_RTOEN)
Kojto 109:9296ab0bfc11 350 #define IS_UART_RECEIVER_TIMEOUT(TIMEOUT) (((TIMEOUT) == UART_RECEIVER_TIMEOUT_DISABLE) || \
Kojto 109:9296ab0bfc11 351 ((TIMEOUT) == UART_RECEIVER_TIMEOUT_ENABLE))
Kojto 109:9296ab0bfc11 352 /**
Kojto 109:9296ab0bfc11 353 * @}
Kojto 109:9296ab0bfc11 354 */
Kojto 109:9296ab0bfc11 355
Kojto 109:9296ab0bfc11 356 /** @defgroup UART_LIN UART Local Interconnection Network mode
Kojto 109:9296ab0bfc11 357 * @{
Kojto 109:9296ab0bfc11 358 */
Kojto 109:9296ab0bfc11 359 #define UART_LIN_DISABLE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 360 #define UART_LIN_ENABLE ((uint32_t)USART_CR2_LINEN)
Kojto 109:9296ab0bfc11 361 #define IS_UART_LIN(LIN) (((LIN) == UART_LIN_DISABLE) || \
Kojto 109:9296ab0bfc11 362 ((LIN) == UART_LIN_ENABLE))
Kojto 109:9296ab0bfc11 363 /**
Kojto 109:9296ab0bfc11 364 * @}
Kojto 109:9296ab0bfc11 365 */
Kojto 109:9296ab0bfc11 366
Kojto 109:9296ab0bfc11 367 /** @defgroup UART_LIN_Break_Detection UART LIN Break Detection
Kojto 109:9296ab0bfc11 368 * @{
Kojto 109:9296ab0bfc11 369 */
Kojto 109:9296ab0bfc11 370 #define UART_LINBREAKDETECTLENGTH_10B ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 371 #define UART_LINBREAKDETECTLENGTH_11B ((uint32_t)USART_CR2_LBDL)
Kojto 109:9296ab0bfc11 372 #define IS_UART_LIN_BREAK_DETECT_LENGTH(LENGTH) (((LENGTH) == UART_LINBREAKDETECTLENGTH_10B) || \
Kojto 109:9296ab0bfc11 373 ((LENGTH) == UART_LINBREAKDETECTLENGTH_11B))
Kojto 109:9296ab0bfc11 374 /**
Kojto 109:9296ab0bfc11 375 * @}
Kojto 109:9296ab0bfc11 376 */
Kojto 109:9296ab0bfc11 377
Kojto 109:9296ab0bfc11 378
Kojto 109:9296ab0bfc11 379
Kojto 109:9296ab0bfc11 380 /** @defgroup UART_One_Bit UART One Bit sampling
Kojto 109:9296ab0bfc11 381 * @{
Kojto 109:9296ab0bfc11 382 */
Kojto 109:9296ab0bfc11 383 #define UART_ONE_BIT_SAMPLE_DISABLED ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 384 #define UART_ONE_BIT_SAMPLE_ENABLED ((uint32_t)USART_CR3_ONEBIT)
Kojto 109:9296ab0bfc11 385 #define IS_UART_ONEBIT_SAMPLE(ONEBIT) (((ONEBIT) == UART_ONE_BIT_SAMPLE_DISABLED) || \
Kojto 109:9296ab0bfc11 386 ((ONEBIT) == UART_ONE_BIT_SAMPLE_ENABLED))
Kojto 109:9296ab0bfc11 387 /**
Kojto 109:9296ab0bfc11 388 * @}
Kojto 109:9296ab0bfc11 389 */
Kojto 109:9296ab0bfc11 390
Kojto 109:9296ab0bfc11 391 /** @defgroup UART_DMA_Tx UART DMA Tx
Kojto 109:9296ab0bfc11 392 * @{
Kojto 109:9296ab0bfc11 393 */
Kojto 109:9296ab0bfc11 394 #define UART_DMA_TX_DISABLE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 395 #define UART_DMA_TX_ENABLE ((uint32_t)USART_CR3_DMAT)
Kojto 109:9296ab0bfc11 396 #define IS_UART_DMA_TX(DMATX) (((DMATX) == UART_DMA_TX_DISABLE) || \
Kojto 109:9296ab0bfc11 397 ((DMATX) == UART_DMA_TX_ENABLE))
Kojto 109:9296ab0bfc11 398 /**
Kojto 109:9296ab0bfc11 399 * @}
Kojto 109:9296ab0bfc11 400 */
Kojto 109:9296ab0bfc11 401
Kojto 109:9296ab0bfc11 402 /** @defgroup UART_DMA_Rx UART DMA Rx
Kojto 109:9296ab0bfc11 403 * @{
Kojto 109:9296ab0bfc11 404 */
Kojto 109:9296ab0bfc11 405 #define UART_DMA_RX_DISABLE ((uint32_t)0x0000)
Kojto 109:9296ab0bfc11 406 #define UART_DMA_RX_ENABLE ((uint32_t)USART_CR3_DMAR)
Kojto 109:9296ab0bfc11 407 #define IS_UART_DMA_RX(DMARX) (((DMARX) == UART_DMA_RX_DISABLE) || \
Kojto 109:9296ab0bfc11 408 ((DMARX) == UART_DMA_RX_ENABLE))
Kojto 109:9296ab0bfc11 409 /**
Kojto 109:9296ab0bfc11 410 * @}
Kojto 109:9296ab0bfc11 411 */
Kojto 109:9296ab0bfc11 412
Kojto 109:9296ab0bfc11 413 /** @defgroup UART_Half_Duplex_Selection UART Half Duplex Selection
Kojto 109:9296ab0bfc11 414 * @{
Kojto 109:9296ab0bfc11 415 */
Kojto 109:9296ab0bfc11 416 #define UART_HALF_DUPLEX_DISABLE ((uint32_t)0x0000)
Kojto 109:9296ab0bfc11 417 #define UART_HALF_DUPLEX_ENABLE ((uint32_t)USART_CR3_HDSEL)
Kojto 109:9296ab0bfc11 418 #define IS_UART_HALF_DUPLEX(HDSEL) (((HDSEL) == UART_HALF_DUPLEX_DISABLE) || \
Kojto 109:9296ab0bfc11 419 ((HDSEL) == UART_HALF_DUPLEX_ENABLE))
Kojto 109:9296ab0bfc11 420 /**
Kojto 109:9296ab0bfc11 421 * @}
Kojto 109:9296ab0bfc11 422 */
Kojto 109:9296ab0bfc11 423
Kojto 109:9296ab0bfc11 424 /** @defgroup UART_WakeUp_Methods UART WakeUp Methods
Kojto 109:9296ab0bfc11 425 * @{
Kojto 109:9296ab0bfc11 426 */
Kojto 109:9296ab0bfc11 427 #define UART_WAKEUPMETHOD_IDLELINE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 428 #define UART_WAKEUPMETHOD_ADDRESSMARK ((uint32_t)USART_CR1_WAKE)
Kojto 109:9296ab0bfc11 429 #define IS_UART_WAKEUPMETHOD(WAKEUP) (((WAKEUP) == UART_WAKEUPMETHOD_IDLELINE) || \
Kojto 109:9296ab0bfc11 430 ((WAKEUP) == UART_WAKEUPMETHOD_ADDRESSMARK))
Kojto 109:9296ab0bfc11 431 /**
Kojto 109:9296ab0bfc11 432 * @}
Kojto 109:9296ab0bfc11 433 */
Kojto 109:9296ab0bfc11 434
Kojto 109:9296ab0bfc11 435 /** @defgroup UART_Flags UART Status Flags
Kojto 109:9296ab0bfc11 436 * Elements values convention: 0xXXXX
Kojto 109:9296ab0bfc11 437 * - 0xXXXX : Flag mask in the ISR register
Kojto 109:9296ab0bfc11 438 * @{
Kojto 109:9296ab0bfc11 439 */
Kojto 109:9296ab0bfc11 440 #define UART_FLAG_REACK ((uint32_t)0x00400000)
Kojto 109:9296ab0bfc11 441 #define UART_FLAG_TEACK ((uint32_t)0x00200000)
Kojto 109:9296ab0bfc11 442 #define UART_FLAG_WUF ((uint32_t)0x00100000)
Kojto 109:9296ab0bfc11 443 #define UART_FLAG_RWU ((uint32_t)0x00080000)
Kojto 109:9296ab0bfc11 444 #define UART_FLAG_SBKF ((uint32_t)0x00040000
Kojto 109:9296ab0bfc11 445 #define UART_FLAG_CMF ((uint32_t)0x00020000)
Kojto 109:9296ab0bfc11 446 #define UART_FLAG_BUSY ((uint32_t)0x00010000)
Kojto 109:9296ab0bfc11 447 #define UART_FLAG_ABRF ((uint32_t)0x00008000)
Kojto 109:9296ab0bfc11 448 #define UART_FLAG_ABRE ((uint32_t)0x00004000)
Kojto 109:9296ab0bfc11 449 #define UART_FLAG_EOBF ((uint32_t)0x00001000)
Kojto 109:9296ab0bfc11 450 #define UART_FLAG_RTOF ((uint32_t)0x00000800)
Kojto 109:9296ab0bfc11 451 #define UART_FLAG_CTS ((uint32_t)0x00000400)
Kojto 109:9296ab0bfc11 452 #define UART_FLAG_CTSIF ((uint32_t)0x00000200)
Kojto 109:9296ab0bfc11 453 #define UART_FLAG_LBDF ((uint32_t)0x00000100)
Kojto 109:9296ab0bfc11 454 #define UART_FLAG_TXE ((uint32_t)0x00000080)
Kojto 109:9296ab0bfc11 455 #define UART_FLAG_TC ((uint32_t)0x00000040)
Kojto 109:9296ab0bfc11 456 #define UART_FLAG_RXNE ((uint32_t)0x00000020)
Kojto 109:9296ab0bfc11 457 #define UART_FLAG_IDLE ((uint32_t)0x00000010)
Kojto 109:9296ab0bfc11 458 #define UART_FLAG_ORE ((uint32_t)0x00000008)
Kojto 109:9296ab0bfc11 459 #define UART_FLAG_NE ((uint32_t)0x00000004)
Kojto 109:9296ab0bfc11 460 #define UART_FLAG_FE ((uint32_t)0x00000002)
Kojto 109:9296ab0bfc11 461 #define UART_FLAG_PE ((uint32_t)0x00000001)
Kojto 109:9296ab0bfc11 462 /**
Kojto 109:9296ab0bfc11 463 * @}
Kojto 109:9296ab0bfc11 464 */
Kojto 109:9296ab0bfc11 465
Kojto 109:9296ab0bfc11 466 /** @defgroup UART_Interrupt_definition UART Interrupts Definition
Kojto 109:9296ab0bfc11 467 * Elements values convention: 0000ZZZZ0XXYYYYYb
Kojto 109:9296ab0bfc11 468 * - YYYYY : Interrupt source position in the XX register (5bits)
Kojto 109:9296ab0bfc11 469 * - XX : Interrupt source register (2bits)
Kojto 109:9296ab0bfc11 470 * - 01: CR1 register
Kojto 109:9296ab0bfc11 471 * - 10: CR2 register
Kojto 109:9296ab0bfc11 472 * - 11: CR3 register
Kojto 109:9296ab0bfc11 473 * - ZZZZ : Flag position in the ISR register(4bits)
Kojto 109:9296ab0bfc11 474 * @{
Kojto 109:9296ab0bfc11 475 */
Kojto 109:9296ab0bfc11 476 #define UART_IT_PE ((uint16_t)0x0028)
Kojto 109:9296ab0bfc11 477 #define UART_IT_TXE ((uint16_t)0x0727)
Kojto 109:9296ab0bfc11 478 #define UART_IT_TC ((uint16_t)0x0626)
Kojto 109:9296ab0bfc11 479 #define UART_IT_RXNE ((uint16_t)0x0525)
Kojto 109:9296ab0bfc11 480 #define UART_IT_IDLE ((uint16_t)0x0424)
Kojto 109:9296ab0bfc11 481 #define UART_IT_LBD ((uint16_t)0x0846)
Kojto 109:9296ab0bfc11 482 #define UART_IT_CTS ((uint16_t)0x096A)
Kojto 109:9296ab0bfc11 483 #define UART_IT_CM ((uint16_t)0x142E)
Kojto 109:9296ab0bfc11 484 #define UART_IT_WUF ((uint16_t)0x1476)
Kojto 109:9296ab0bfc11 485
Kojto 109:9296ab0bfc11 486 /** Elements values convention: 000000000XXYYYYYb
Kojto 109:9296ab0bfc11 487 * - YYYYY : Interrupt source position in the XX register (5bits)
Kojto 109:9296ab0bfc11 488 * - XX : Interrupt source register (2bits)
Kojto 109:9296ab0bfc11 489 * - 01: CR1 register
Kojto 109:9296ab0bfc11 490 * - 10: CR2 register
Kojto 109:9296ab0bfc11 491 * - 11: CR3 register
Kojto 109:9296ab0bfc11 492 */
Kojto 109:9296ab0bfc11 493 #define UART_IT_ERR ((uint16_t)0x0060)
Kojto 109:9296ab0bfc11 494
Kojto 109:9296ab0bfc11 495 /** Elements values convention: 0000ZZZZ00000000b
Kojto 109:9296ab0bfc11 496 * - ZZZZ : Flag position in the ISR register(4bits)
Kojto 109:9296ab0bfc11 497 */
Kojto 109:9296ab0bfc11 498 #define UART_IT_ORE ((uint16_t)0x0300)
Kojto 109:9296ab0bfc11 499 #define UART_IT_NE ((uint16_t)0x0200)
Kojto 109:9296ab0bfc11 500 #define UART_IT_FE ((uint16_t)0x0100)
Kojto 109:9296ab0bfc11 501 /**
Kojto 109:9296ab0bfc11 502 * @}
Kojto 109:9296ab0bfc11 503 */
Kojto 109:9296ab0bfc11 504
Kojto 109:9296ab0bfc11 505 /** @defgroup UART_IT_CLEAR_Flags UART Interruption Clear Flags
Kojto 109:9296ab0bfc11 506 * @{
Kojto 109:9296ab0bfc11 507 */
Kojto 109:9296ab0bfc11 508 #define UART_CLEAR_PEF USART_ICR_PECF /*!< Parity Error Clear Flag */
Kojto 109:9296ab0bfc11 509 #define UART_CLEAR_FEF USART_ICR_FECF /*!< Framing Error Clear Flag */
Kojto 109:9296ab0bfc11 510 #define UART_CLEAR_NEF USART_ICR_NCF /*!< Noise detected Clear Flag */
Kojto 109:9296ab0bfc11 511 #define UART_CLEAR_OREF USART_ICR_ORECF /*!< OverRun Error Clear Flag */
Kojto 109:9296ab0bfc11 512 #define UART_CLEAR_IDLEF USART_ICR_IDLECF /*!< IDLE line detected Clear Flag */
Kojto 109:9296ab0bfc11 513 #define UART_CLEAR_TCF USART_ICR_TCCF /*!< Transmission Complete Clear Flag */
Kojto 109:9296ab0bfc11 514 #define UART_CLEAR_LBDF USART_ICR_LBDCF /*!< LIN Break Detection Clear Flag */
Kojto 109:9296ab0bfc11 515 #define UART_CLEAR_CTSF USART_ICR_CTSCF /*!< CTS Interrupt Clear Flag */
Kojto 109:9296ab0bfc11 516 #define UART_CLEAR_RTOF USART_ICR_RTOCF /*!< Receiver Time Out Clear Flag */
Kojto 109:9296ab0bfc11 517 #define UART_CLEAR_EOBF USART_ICR_EOBCF /*!< End Of Block Clear Flag */
Kojto 109:9296ab0bfc11 518 #define UART_CLEAR_CMF USART_ICR_CMCF /*!< Character Match Clear Flag */
Kojto 109:9296ab0bfc11 519 #define UART_CLEAR_WUF USART_ICR_WUCF /*!< Wake Up from stop mode Clear Flag */
Kojto 109:9296ab0bfc11 520 /**
Kojto 109:9296ab0bfc11 521 * @}
Kojto 109:9296ab0bfc11 522 */
Kojto 109:9296ab0bfc11 523
Kojto 109:9296ab0bfc11 524 /** @defgroup UART_Request_Parameters UART Request Parameters
Kojto 109:9296ab0bfc11 525 * @{
Kojto 109:9296ab0bfc11 526 */
Kojto 109:9296ab0bfc11 527 #define UART_AUTOBAUD_REQUEST ((uint32_t)USART_RQR_ABRRQ) /*!< Auto-Baud Rate Request */
Kojto 109:9296ab0bfc11 528 #define UART_SENDBREAK_REQUEST ((uint32_t)USART_RQR_SBKRQ) /*!< Send Break Request */
Kojto 109:9296ab0bfc11 529 #define UART_MUTE_MODE_REQUEST ((uint32_t)USART_RQR_MMRQ) /*!< Mute Mode Request */
Kojto 109:9296ab0bfc11 530 #define UART_RXDATA_FLUSH_REQUEST ((uint32_t)USART_RQR_RXFRQ) /*!< Receive Data flush Request */
Kojto 109:9296ab0bfc11 531 #define UART_TXDATA_FLUSH_REQUEST ((uint32_t)USART_RQR_TXFRQ) /*!< Transmit data flush Request */
Kojto 109:9296ab0bfc11 532 #define IS_UART_REQUEST_PARAMETER(PARAM) (((PARAM) == UART_AUTOBAUD_REQUEST) || \
Kojto 109:9296ab0bfc11 533 ((PARAM) == UART_SENDBREAK_REQUEST) || \
Kojto 109:9296ab0bfc11 534 ((PARAM) == UART_MUTE_MODE_REQUEST) || \
Kojto 109:9296ab0bfc11 535 ((PARAM) == UART_RXDATA_FLUSH_REQUEST) || \
Kojto 109:9296ab0bfc11 536 ((PARAM) == UART_TXDATA_FLUSH_REQUEST))
Kojto 109:9296ab0bfc11 537 /**
Kojto 109:9296ab0bfc11 538 * @}
Kojto 109:9296ab0bfc11 539 */
Kojto 109:9296ab0bfc11 540
Kojto 109:9296ab0bfc11 541 /** @defgroup UART_Advanced_Features_Initialization_Type UART Advanced Feature Initialization Type
Kojto 109:9296ab0bfc11 542 * @{
Kojto 109:9296ab0bfc11 543 */
Kojto 109:9296ab0bfc11 544 #define UART_ADVFEATURE_NO_INIT ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 545 #define UART_ADVFEATURE_TXINVERT_INIT ((uint32_t)0x00000001)
Kojto 109:9296ab0bfc11 546 #define UART_ADVFEATURE_RXINVERT_INIT ((uint32_t)0x00000002)
Kojto 109:9296ab0bfc11 547 #define UART_ADVFEATURE_DATAINVERT_INIT ((uint32_t)0x00000004)
Kojto 109:9296ab0bfc11 548 #define UART_ADVFEATURE_SWAP_INIT ((uint32_t)0x00000008)
Kojto 109:9296ab0bfc11 549 #define UART_ADVFEATURE_RXOVERRUNDISABLE_INIT ((uint32_t)0x00000010)
Kojto 109:9296ab0bfc11 550 #define UART_ADVFEATURE_DMADISABLEONERROR_INIT ((uint32_t)0x00000020)
Kojto 109:9296ab0bfc11 551 #define UART_ADVFEATURE_AUTOBAUDRATE_INIT ((uint32_t)0x00000040)
Kojto 109:9296ab0bfc11 552 #define UART_ADVFEATURE_MSBFIRST_INIT ((uint32_t)0x00000080)
Kojto 109:9296ab0bfc11 553 #define IS_UART_ADVFEATURE_INIT(INIT) ((INIT) <= (UART_ADVFEATURE_NO_INIT | \
Kojto 109:9296ab0bfc11 554 UART_ADVFEATURE_TXINVERT_INIT | \
Kojto 109:9296ab0bfc11 555 UART_ADVFEATURE_RXINVERT_INIT | \
Kojto 109:9296ab0bfc11 556 UART_ADVFEATURE_DATAINVERT_INIT | \
Kojto 109:9296ab0bfc11 557 UART_ADVFEATURE_SWAP_INIT | \
Kojto 109:9296ab0bfc11 558 UART_ADVFEATURE_RXOVERRUNDISABLE_INIT | \
Kojto 109:9296ab0bfc11 559 UART_ADVFEATURE_DMADISABLEONERROR_INIT | \
Kojto 109:9296ab0bfc11 560 UART_ADVFEATURE_AUTOBAUDRATE_INIT | \
Kojto 109:9296ab0bfc11 561 UART_ADVFEATURE_MSBFIRST_INIT))
Kojto 109:9296ab0bfc11 562 /**
Kojto 109:9296ab0bfc11 563 * @}
Kojto 109:9296ab0bfc11 564 */
Kojto 109:9296ab0bfc11 565
Kojto 109:9296ab0bfc11 566 /** @defgroup UART_Tx_Inv UART Advanced Feature TX Pin Active Level Inversion
Kojto 109:9296ab0bfc11 567 * @{
Kojto 109:9296ab0bfc11 568 */
Kojto 109:9296ab0bfc11 569 #define UART_ADVFEATURE_TXINV_DISABLE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 570 #define UART_ADVFEATURE_TXINV_ENABLE ((uint32_t)USART_CR2_TXINV)
Kojto 109:9296ab0bfc11 571 #define IS_UART_ADVFEATURE_TXINV(TXINV) (((TXINV) == UART_ADVFEATURE_TXINV_DISABLE) || \
Kojto 109:9296ab0bfc11 572 ((TXINV) == UART_ADVFEATURE_TXINV_ENABLE))
Kojto 109:9296ab0bfc11 573 /**
Kojto 109:9296ab0bfc11 574 * @}
Kojto 109:9296ab0bfc11 575 */
Kojto 109:9296ab0bfc11 576
Kojto 109:9296ab0bfc11 577 /** @defgroup UART_Rx_Inv UART Advanced Feature RX Pin Active Level Inversion
Kojto 109:9296ab0bfc11 578 * @{
Kojto 109:9296ab0bfc11 579 */
Kojto 109:9296ab0bfc11 580 #define UART_ADVFEATURE_RXINV_DISABLE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 581 #define UART_ADVFEATURE_RXINV_ENABLE ((uint32_t)USART_CR2_RXINV)
Kojto 109:9296ab0bfc11 582 #define IS_UART_ADVFEATURE_RXINV(RXINV) (((RXINV) == UART_ADVFEATURE_RXINV_DISABLE) || \
Kojto 109:9296ab0bfc11 583 ((RXINV) == UART_ADVFEATURE_RXINV_ENABLE))
Kojto 109:9296ab0bfc11 584 /**
Kojto 109:9296ab0bfc11 585 * @}
Kojto 109:9296ab0bfc11 586 */
Kojto 109:9296ab0bfc11 587
Kojto 109:9296ab0bfc11 588 /** @defgroup UART_Data_Inv UART Advanced Feature Binary Data Inversion
Kojto 109:9296ab0bfc11 589 * @{
Kojto 109:9296ab0bfc11 590 */
Kojto 109:9296ab0bfc11 591 #define UART_ADVFEATURE_DATAINV_DISABLE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 592 #define UART_ADVFEATURE_DATAINV_ENABLE ((uint32_t)USART_CR2_DATAINV)
Kojto 109:9296ab0bfc11 593 #define IS_UART_ADVFEATURE_DATAINV(DATAINV) (((DATAINV) == UART_ADVFEATURE_DATAINV_DISABLE) || \
Kojto 109:9296ab0bfc11 594 ((DATAINV) == UART_ADVFEATURE_DATAINV_ENABLE))
Kojto 109:9296ab0bfc11 595 /**
Kojto 109:9296ab0bfc11 596 * @}
Kojto 109:9296ab0bfc11 597 */
Kojto 109:9296ab0bfc11 598
Kojto 109:9296ab0bfc11 599 /** @defgroup UART_Rx_Tx_Swap UART Advanced Feature RX TX Pins Swap
Kojto 109:9296ab0bfc11 600 * @{
Kojto 109:9296ab0bfc11 601 */
Kojto 109:9296ab0bfc11 602 #define UART_ADVFEATURE_SWAP_DISABLE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 603 #define UART_ADVFEATURE_SWAP_ENABLE ((uint32_t)USART_CR2_SWAP)
Kojto 109:9296ab0bfc11 604 #define IS_UART_ADVFEATURE_SWAP(SWAP) (((SWAP) == UART_ADVFEATURE_SWAP_DISABLE) || \
Kojto 109:9296ab0bfc11 605 ((SWAP) == UART_ADVFEATURE_SWAP_ENABLE))
Kojto 109:9296ab0bfc11 606 /**
Kojto 109:9296ab0bfc11 607 * @}
Kojto 109:9296ab0bfc11 608 */
Kojto 109:9296ab0bfc11 609
Kojto 109:9296ab0bfc11 610 /** @defgroup UART_Overrun_Disable UART Advanced Feature Overrun Disable
Kojto 109:9296ab0bfc11 611 * @{
Kojto 109:9296ab0bfc11 612 */
Kojto 109:9296ab0bfc11 613 #define UART_ADVFEATURE_OVERRUN_ENABLE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 614 #define UART_ADVFEATURE_OVERRUN_DISABLE ((uint32_t)USART_CR3_OVRDIS)
Kojto 109:9296ab0bfc11 615 #define IS_UART_OVERRUN(OVERRUN) (((OVERRUN) == UART_ADVFEATURE_OVERRUN_ENABLE) || \
Kojto 109:9296ab0bfc11 616 ((OVERRUN) == UART_ADVFEATURE_OVERRUN_DISABLE))
Kojto 109:9296ab0bfc11 617 /**
Kojto 109:9296ab0bfc11 618 * @}
Kojto 109:9296ab0bfc11 619 */
Kojto 109:9296ab0bfc11 620
Kojto 109:9296ab0bfc11 621 /** @defgroup UART_AutoBaudRate_Enable UART Advanced Feature Auto BaudRate Enable
Kojto 109:9296ab0bfc11 622 * @{
Kojto 109:9296ab0bfc11 623 */
Kojto 109:9296ab0bfc11 624 #define UART_ADVFEATURE_AUTOBAUDRATE_DISABLE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 625 #define UART_ADVFEATURE_AUTOBAUDRATE_ENABLE ((uint32_t)USART_CR2_ABREN)
Kojto 109:9296ab0bfc11 626 #define IS_UART_ADVFEATURE_AUTOBAUDRATE(AUTOBAUDRATE) (((AUTOBAUDRATE) == UART_ADVFEATURE_AUTOBAUDRATE_DISABLE) || \
Kojto 109:9296ab0bfc11 627 ((AUTOBAUDRATE) == UART_ADVFEATURE_AUTOBAUDRATE_ENABLE))
Kojto 109:9296ab0bfc11 628 /**
Kojto 109:9296ab0bfc11 629 * @}
Kojto 109:9296ab0bfc11 630 */
Kojto 109:9296ab0bfc11 631
Kojto 109:9296ab0bfc11 632 /** @defgroup UART_DMA_Disable_on_Rx_Error UART Advanced Feature DMA Disable On Rx Error
Kojto 109:9296ab0bfc11 633 * @{
Kojto 109:9296ab0bfc11 634 */
Kojto 109:9296ab0bfc11 635 #define UART_ADVFEATURE_DMA_ENABLEONRXERROR ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 636 #define UART_ADVFEATURE_DMA_DISABLEONRXERROR ((uint32_t)USART_CR3_DDRE)
Kojto 109:9296ab0bfc11 637 #define IS_UART_ADVFEATURE_DMAONRXERROR(DMA) (((DMA) == UART_ADVFEATURE_DMA_ENABLEONRXERROR) || \
Kojto 109:9296ab0bfc11 638 ((DMA) == UART_ADVFEATURE_DMA_DISABLEONRXERROR))
Kojto 109:9296ab0bfc11 639 /**
Kojto 109:9296ab0bfc11 640 * @}
Kojto 109:9296ab0bfc11 641 */
Kojto 109:9296ab0bfc11 642
Kojto 109:9296ab0bfc11 643 /** @defgroup UART_MSB_First UART Advanced Feature MSB First
Kojto 109:9296ab0bfc11 644 * @{
Kojto 109:9296ab0bfc11 645 */
Kojto 109:9296ab0bfc11 646 #define UART_ADVFEATURE_MSBFIRST_DISABLE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 647 #define UART_ADVFEATURE_MSBFIRST_ENABLE ((uint32_t)USART_CR2_MSBFIRST)
Kojto 109:9296ab0bfc11 648 #define IS_UART_ADVFEATURE_MSBFIRST(MSBFIRST) (((MSBFIRST) == UART_ADVFEATURE_MSBFIRST_DISABLE) || \
Kojto 109:9296ab0bfc11 649 ((MSBFIRST) == UART_ADVFEATURE_MSBFIRST_ENABLE))
Kojto 109:9296ab0bfc11 650 /**
Kojto 109:9296ab0bfc11 651 * @}
Kojto 109:9296ab0bfc11 652 */
Kojto 109:9296ab0bfc11 653
Kojto 109:9296ab0bfc11 654 /** @defgroup UART_Stop_Mode_Enable UART Advanced Feature Stop Mode Enable
Kojto 109:9296ab0bfc11 655 * @{
Kojto 109:9296ab0bfc11 656 */
Kojto 109:9296ab0bfc11 657 #define UART_ADVFEATURE_STOPMODE_DISABLE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 658 #define UART_ADVFEATURE_STOPMODE_ENABLE ((uint32_t)USART_CR1_UESM)
Kojto 109:9296ab0bfc11 659 #define IS_UART_ADVFEATURE_STOPMODE(STOPMODE) (((STOPMODE) == UART_ADVFEATURE_STOPMODE_DISABLE) || \
Kojto 109:9296ab0bfc11 660 ((STOPMODE) == UART_ADVFEATURE_STOPMODE_ENABLE))
Kojto 109:9296ab0bfc11 661 /**
Kojto 109:9296ab0bfc11 662 * @}
Kojto 109:9296ab0bfc11 663 */
Kojto 109:9296ab0bfc11 664
Kojto 109:9296ab0bfc11 665 /** @defgroup UART_Mute_Mode UART Advanced Feature Mute Mode Enable
Kojto 109:9296ab0bfc11 666 * @{
Kojto 109:9296ab0bfc11 667 */
Kojto 109:9296ab0bfc11 668 #define UART_ADVFEATURE_MUTEMODE_DISABLE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 669 #define UART_ADVFEATURE_MUTEMODE_ENABLE ((uint32_t)USART_CR1_MME)
Kojto 109:9296ab0bfc11 670 #define IS_UART_MUTE_MODE(MUTE) (((MUTE) == UART_ADVFEATURE_MUTEMODE_DISABLE) || \
Kojto 109:9296ab0bfc11 671 ((MUTE) == UART_ADVFEATURE_MUTEMODE_ENABLE))
Kojto 109:9296ab0bfc11 672 /**
Kojto 109:9296ab0bfc11 673 * @}
Kojto 109:9296ab0bfc11 674 */
Kojto 109:9296ab0bfc11 675
Kojto 109:9296ab0bfc11 676 /** @defgroup UART_CR2_ADDRESS_LSB_POS UART Address-matching LSB Position In CR2 Register
Kojto 109:9296ab0bfc11 677 * @{
Kojto 109:9296ab0bfc11 678 */
Kojto 109:9296ab0bfc11 679 #define UART_CR2_ADDRESS_LSB_POS ((uint32_t) 24)
Kojto 109:9296ab0bfc11 680 /**
Kojto 109:9296ab0bfc11 681 * @}
Kojto 109:9296ab0bfc11 682 */
Kojto 109:9296ab0bfc11 683
Kojto 109:9296ab0bfc11 684 /** @defgroup UART_WakeUp_from_Stop_Selection UART WakeUp From Stop Selection
Kojto 109:9296ab0bfc11 685 * @{
Kojto 109:9296ab0bfc11 686 */
Kojto 109:9296ab0bfc11 687 #define UART_WAKEUP_ON_ADDRESS ((uint32_t)0x0000)
Kojto 109:9296ab0bfc11 688 #define UART_WAKEUP_ON_STARTBIT ((uint32_t)USART_CR3_WUS_1)
Kojto 109:9296ab0bfc11 689 #define UART_WAKEUP_ON_READDATA_NONEMPTY ((uint32_t)USART_CR3_WUS)
Kojto 109:9296ab0bfc11 690 #define IS_UART_WAKEUP_SELECTION(WAKE) (((WAKE) == UART_WAKEUP_ON_ADDRESS) || \
Kojto 109:9296ab0bfc11 691 ((WAKE) == UART_WAKEUP_ON_STARTBIT) || \
Kojto 109:9296ab0bfc11 692 ((WAKE) == UART_WAKEUP_ON_READDATA_NONEMPTY))
Kojto 109:9296ab0bfc11 693 /**
Kojto 109:9296ab0bfc11 694 * @}
Kojto 109:9296ab0bfc11 695 */
Kojto 109:9296ab0bfc11 696
Kojto 109:9296ab0bfc11 697 /** @defgroup UART_DriverEnable_Polarity UART DriverEnable Polarity
Kojto 109:9296ab0bfc11 698 * @{
Kojto 109:9296ab0bfc11 699 */
Kojto 109:9296ab0bfc11 700 #define UART_DE_POLARITY_HIGH ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 701 #define UART_DE_POLARITY_LOW ((uint32_t)USART_CR3_DEP)
Kojto 109:9296ab0bfc11 702 #define IS_UART_DE_POLARITY(POLARITY) (((POLARITY) == UART_DE_POLARITY_HIGH) || \
Kojto 109:9296ab0bfc11 703 ((POLARITY) == UART_DE_POLARITY_LOW))
Kojto 109:9296ab0bfc11 704 /**
Kojto 109:9296ab0bfc11 705 * @}
Kojto 109:9296ab0bfc11 706 */
Kojto 109:9296ab0bfc11 707
Kojto 109:9296ab0bfc11 708 /** @defgroup UART_CR1_DEAT_ADDRESS_LSB_POS UART Driver Enable Assertion Time LSB Position In CR1 Register
Kojto 109:9296ab0bfc11 709 * @{
Kojto 109:9296ab0bfc11 710 */
Kojto 109:9296ab0bfc11 711 #define UART_CR1_DEAT_ADDRESS_LSB_POS ((uint32_t) 21)
Kojto 109:9296ab0bfc11 712 /**
Kojto 109:9296ab0bfc11 713 * @}
Kojto 109:9296ab0bfc11 714 */
Kojto 109:9296ab0bfc11 715
Kojto 109:9296ab0bfc11 716 /** @defgroup UART_CR1_DEDT_ADDRESS_LSB_POS UART Driver Enable DeAssertion Time LSB Position In CR1 Register
Kojto 109:9296ab0bfc11 717 * @{
Kojto 109:9296ab0bfc11 718 */
Kojto 109:9296ab0bfc11 719 #define UART_CR1_DEDT_ADDRESS_LSB_POS ((uint32_t) 16)
Kojto 109:9296ab0bfc11 720 /**
Kojto 109:9296ab0bfc11 721 * @}
Kojto 109:9296ab0bfc11 722 */
Kojto 109:9296ab0bfc11 723
Kojto 109:9296ab0bfc11 724 /** @defgroup UART_Interruption_Mask UART Interruptions Flag Mask
Kojto 109:9296ab0bfc11 725 * @{
Kojto 109:9296ab0bfc11 726 */
Kojto 109:9296ab0bfc11 727 #define UART_IT_MASK ((uint32_t)0x001F)
Kojto 109:9296ab0bfc11 728 /**
Kojto 109:9296ab0bfc11 729 * @}
Kojto 109:9296ab0bfc11 730 */
Kojto 109:9296ab0bfc11 731
Kojto 109:9296ab0bfc11 732 /** @defgroup UART_TimeOut_Value UART polling-based communications time-out value
Kojto 109:9296ab0bfc11 733 * @{
Kojto 109:9296ab0bfc11 734 */
Kojto 109:9296ab0bfc11 735 #define HAL_UART_TIMEOUT_VALUE 0x1FFFFFF
Kojto 109:9296ab0bfc11 736 /**
Kojto 109:9296ab0bfc11 737 * @}
Kojto 109:9296ab0bfc11 738 */
Kojto 109:9296ab0bfc11 739
Kojto 109:9296ab0bfc11 740 /**
Kojto 109:9296ab0bfc11 741 * @}
Kojto 109:9296ab0bfc11 742 */
Kojto 109:9296ab0bfc11 743
Kojto 109:9296ab0bfc11 744 /* Exported macros -----------------------------------------------------------*/
Kojto 109:9296ab0bfc11 745 /** @defgroup UART_Exported_Macros UART Exported Macros
Kojto 109:9296ab0bfc11 746 * @{
Kojto 109:9296ab0bfc11 747 */
Kojto 109:9296ab0bfc11 748
Kojto 109:9296ab0bfc11 749 /** @brief Reset UART handle state
Kojto 109:9296ab0bfc11 750 * @param __HANDLE__: UART handle.
Kojto 109:9296ab0bfc11 751 * @retval None
Kojto 109:9296ab0bfc11 752 */
Kojto 109:9296ab0bfc11 753 #define __HAL_UART_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_UART_STATE_RESET)
Kojto 109:9296ab0bfc11 754
Kojto 109:9296ab0bfc11 755 /** @brief Checks whether the specified UART flag is set or not.
Kojto 109:9296ab0bfc11 756 * @param __HANDLE__: specifies the UART Handle.
Kojto 109:9296ab0bfc11 757 * This parameter can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
Kojto 109:9296ab0bfc11 758 * UART peripheral (datasheet: up to five USART/UARTs)
Kojto 109:9296ab0bfc11 759 * @param __FLAG__: specifies the flag to check.
Kojto 109:9296ab0bfc11 760 * This parameter can be one of the following values:
Kojto 109:9296ab0bfc11 761 * @arg UART_FLAG_REACK: Receive enable ackowledge flag
Kojto 109:9296ab0bfc11 762 * @arg UART_FLAG_TEACK: Transmit enable ackowledge flag
Kojto 109:9296ab0bfc11 763 * @arg UART_FLAG_WUF: Wake up from stop mode flag
Kojto 109:9296ab0bfc11 764 * @arg UART_FLAG_RWU: Receiver wake up flag (is the UART in mute mode)
Kojto 109:9296ab0bfc11 765 * @arg UART_FLAG_SBKF: Send Break flag
Kojto 109:9296ab0bfc11 766 * @arg UART_FLAG_CMF: Character match flag
Kojto 109:9296ab0bfc11 767 * @arg UART_FLAG_BUSY: Busy flag
Kojto 109:9296ab0bfc11 768 * @arg UART_FLAG_ABRF: Auto Baud rate detection flag
Kojto 109:9296ab0bfc11 769 * @arg UART_FLAG_ABRE: Auto Baud rate detection error flag
Kojto 109:9296ab0bfc11 770 * @arg UART_FLAG_EOBF: End of block flag
Kojto 109:9296ab0bfc11 771 * @arg UART_FLAG_RTOF: Receiver timeout flag
Kojto 109:9296ab0bfc11 772 * @arg UART_FLAG_CTS: CTS Change flag (not available for UART4 and UART5)
Kojto 109:9296ab0bfc11 773 * @arg UART_FLAG_LBD: LIN Break detection flag
Kojto 109:9296ab0bfc11 774 * @arg UART_FLAG_TXE: Transmit data register empty flag
Kojto 109:9296ab0bfc11 775 * @arg UART_FLAG_TC: Transmission Complete flag
Kojto 109:9296ab0bfc11 776 * @arg UART_FLAG_RXNE: Receive data register not empty flag
Kojto 109:9296ab0bfc11 777 * @arg UART_FLAG_IDLE: Idle Line detection flag
Kojto 109:9296ab0bfc11 778 * @arg UART_FLAG_ORE: OverRun Error flag
Kojto 109:9296ab0bfc11 779 * @arg UART_FLAG_NE: Noise Error flag
Kojto 109:9296ab0bfc11 780 * @arg UART_FLAG_FE: Framing Error flag
Kojto 109:9296ab0bfc11 781 * @arg UART_FLAG_PE: Parity Error flag
Kojto 109:9296ab0bfc11 782 * @retval The new state of __FLAG__ (TRUE or FALSE).
Kojto 109:9296ab0bfc11 783 */
Kojto 109:9296ab0bfc11 784 #define __HAL_UART_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->ISR & (__FLAG__)) == (__FLAG__))
Kojto 109:9296ab0bfc11 785
Kojto 109:9296ab0bfc11 786 /** @brief Enables the specified UART interrupt.
Kojto 109:9296ab0bfc11 787 * @param __HANDLE__: specifies the UART Handle.
Kojto 109:9296ab0bfc11 788 * This parameter can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
Kojto 109:9296ab0bfc11 789 * UART peripheral. (datasheet: up to five USART/UARTs)
Kojto 109:9296ab0bfc11 790 * @param __INTERRUPT__: specifies the UART interrupt source to enable.
Kojto 109:9296ab0bfc11 791 * This parameter can be one of the following values:
Kojto 109:9296ab0bfc11 792 * @arg UART_IT_WUF: Wakeup from stop mode interrupt
Kojto 109:9296ab0bfc11 793 * @arg UART_IT_CM: Character match interrupt
Kojto 109:9296ab0bfc11 794 * @arg UART_IT_CTS: CTS change interrupt
Kojto 109:9296ab0bfc11 795 * @arg UART_IT_LBD: LIN Break detection interrupt
Kojto 109:9296ab0bfc11 796 * @arg UART_IT_TXE: Transmit Data Register empty interrupt
Kojto 109:9296ab0bfc11 797 * @arg UART_IT_TC: Transmission complete interrupt
Kojto 109:9296ab0bfc11 798 * @arg UART_IT_RXNE: Receive Data register not empty interrupt
Kojto 109:9296ab0bfc11 799 * @arg UART_IT_IDLE: Idle line detection interrupt
Kojto 109:9296ab0bfc11 800 * @arg UART_IT_PE: Parity Error interrupt
Kojto 109:9296ab0bfc11 801 * @arg UART_IT_ERR: Error interrupt(Frame error, noise error, overrun error)
Kojto 109:9296ab0bfc11 802 * @retval None
Kojto 109:9296ab0bfc11 803 */
Kojto 109:9296ab0bfc11 804 #define __HAL_UART_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((((uint8_t)(__INTERRUPT__)) >> 5U) == 1)? ((__HANDLE__)->Instance->CR1 |= (1U << ((__INTERRUPT__) & UART_IT_MASK))): \
Kojto 109:9296ab0bfc11 805 ((((uint8_t)(__INTERRUPT__)) >> 5U) == 2)? ((__HANDLE__)->Instance->CR2 |= (1U << ((__INTERRUPT__) & UART_IT_MASK))): \
Kojto 109:9296ab0bfc11 806 ((__HANDLE__)->Instance->CR3 |= (1U << ((__INTERRUPT__) & UART_IT_MASK))))
Kojto 109:9296ab0bfc11 807
Kojto 109:9296ab0bfc11 808
Kojto 109:9296ab0bfc11 809 /** @brief Disables the specified UART interrupt.
Kojto 109:9296ab0bfc11 810 * @param __HANDLE__: specifies the UART Handle.
Kojto 109:9296ab0bfc11 811 * This parameter can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
Kojto 109:9296ab0bfc11 812 * UART peripheral. (datasheet: up to five USART/UARTs)
Kojto 109:9296ab0bfc11 813 * @param __INTERRUPT__: specifies the UART interrupt source to disable.
Kojto 109:9296ab0bfc11 814 * This parameter can be one of the following values:
Kojto 109:9296ab0bfc11 815 * @arg UART_IT_WUF: Wakeup from stop mode interrupt
Kojto 109:9296ab0bfc11 816 * @arg UART_IT_CM: Character match interrupt
Kojto 109:9296ab0bfc11 817 * @arg UART_IT_CTS: CTS change interrupt
Kojto 109:9296ab0bfc11 818 * @arg UART_IT_LBD: LIN Break detection interrupt
Kojto 109:9296ab0bfc11 819 * @arg UART_IT_TXE: Transmit Data Register empty interrupt
Kojto 109:9296ab0bfc11 820 * @arg UART_IT_TC: Transmission complete interrupt
Kojto 109:9296ab0bfc11 821 * @arg UART_IT_RXNE: Receive Data register not empty interrupt
Kojto 109:9296ab0bfc11 822 * @arg UART_IT_IDLE: Idle line detection interrupt
Kojto 109:9296ab0bfc11 823 * @arg UART_IT_PE: Parity Error interrupt
Kojto 109:9296ab0bfc11 824 * @arg UART_IT_ERR: Error interrupt(Frame error, noise error, overrun error)
Kojto 109:9296ab0bfc11 825 * @retval None
Kojto 109:9296ab0bfc11 826 */
Kojto 109:9296ab0bfc11 827 #define __HAL_UART_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((((uint8_t)(__INTERRUPT__)) >> 5U) == 1)? ((__HANDLE__)->Instance->CR1 &= ~ (1U << ((__INTERRUPT__) & UART_IT_MASK))): \
Kojto 109:9296ab0bfc11 828 ((((uint8_t)(__INTERRUPT__)) >> 5U) == 2)? ((__HANDLE__)->Instance->CR2 &= ~ (1U << ((__INTERRUPT__) & UART_IT_MASK))): \
Kojto 109:9296ab0bfc11 829 ((__HANDLE__)->Instance->CR3 &= ~ (1U << ((__INTERRUPT__) & UART_IT_MASK))))
Kojto 109:9296ab0bfc11 830
Kojto 109:9296ab0bfc11 831 /** @brief Checks whether the specified UART interrupt has occurred or not.
Kojto 109:9296ab0bfc11 832 * @param __HANDLE__: specifies the UART Handle.
Kojto 109:9296ab0bfc11 833 * This parameter can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
Kojto 109:9296ab0bfc11 834 * UART peripheral. (datasheet: up to five USART/UARTs)
Kojto 109:9296ab0bfc11 835 * @param __IT__: specifies the UART interrupt to check.
Kojto 109:9296ab0bfc11 836 * This parameter can be one of the following values:
Kojto 109:9296ab0bfc11 837 * @arg UART_IT_WUF: Wakeup from stop mode interrupt
Kojto 109:9296ab0bfc11 838 * @arg UART_IT_CM: Character match interrupt
Kojto 109:9296ab0bfc11 839 * @arg UART_IT_CTS: CTS change interrupt (not available for UART4 and UART5)
Kojto 109:9296ab0bfc11 840 * @arg UART_IT_LBD: LIN Break detection interrupt
Kojto 109:9296ab0bfc11 841 * @arg UART_IT_TXE: Transmit Data Register empty interrupt
Kojto 109:9296ab0bfc11 842 * @arg UART_IT_TC: Transmission complete interrupt
Kojto 109:9296ab0bfc11 843 * @arg UART_IT_RXNE: Receive Data register not empty interrupt
Kojto 109:9296ab0bfc11 844 * @arg UART_IT_IDLE: Idle line detection interrupt
Kojto 109:9296ab0bfc11 845 * @arg UART_IT_ORE: OverRun Error interrupt
Kojto 109:9296ab0bfc11 846 * @arg UART_IT_NE: Noise Error interrupt
Kojto 109:9296ab0bfc11 847 * @arg UART_IT_FE: Framing Error interrupt
Kojto 109:9296ab0bfc11 848 * @arg UART_IT_PE: Parity Error interrupt
Kojto 109:9296ab0bfc11 849 * @retval The new state of __IT__ (TRUE or FALSE).
Kojto 109:9296ab0bfc11 850 */
Kojto 109:9296ab0bfc11 851 #define __HAL_UART_GET_IT(__HANDLE__, __IT__) ((__HANDLE__)->Instance->ISR & ((uint32_t)1 << ((__IT__)>> 0x08)))
Kojto 109:9296ab0bfc11 852
Kojto 109:9296ab0bfc11 853 /** @brief Checks whether the specified UART interrupt source is enabled.
Kojto 109:9296ab0bfc11 854 * @param __HANDLE__: specifies the UART Handle.
Kojto 109:9296ab0bfc11 855 * This parameter can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
Kojto 109:9296ab0bfc11 856 * UART peripheral. (datasheet: up to five USART/UARTs)
Kojto 109:9296ab0bfc11 857 * @param __IT__: specifies the UART interrupt source to check.
Kojto 109:9296ab0bfc11 858 * This parameter can be one of the following values:
Kojto 109:9296ab0bfc11 859 * @arg UART_IT_CTS: CTS change interrupt (not available for UART4 and UART5)
Kojto 109:9296ab0bfc11 860 * @arg UART_IT_LBD: LIN Break detection interrupt
Kojto 109:9296ab0bfc11 861 * @arg UART_IT_TXE: Transmit Data Register empty interrupt
Kojto 109:9296ab0bfc11 862 * @arg UART_IT_TC: Transmission complete interrupt
Kojto 109:9296ab0bfc11 863 * @arg UART_IT_RXNE: Receive Data register not empty interrupt
Kojto 109:9296ab0bfc11 864 * @arg UART_IT_IDLE: Idle line detection interrupt
Kojto 109:9296ab0bfc11 865 * @arg UART_IT_ORE: OverRun Error interrupt
Kojto 109:9296ab0bfc11 866 * @arg UART_IT_NE: Noise Error interrupt
Kojto 109:9296ab0bfc11 867 * @arg UART_IT_FE: Framing Error interrupt
Kojto 109:9296ab0bfc11 868 * @arg UART_IT_PE: Parity Error interrupt
Kojto 109:9296ab0bfc11 869 * @retval The new state of __IT__ (TRUE or FALSE).
Kojto 109:9296ab0bfc11 870 */
Kojto 109:9296ab0bfc11 871 #define __HAL_UART_GET_IT_SOURCE(__HANDLE__, __IT__) ((((((uint8_t)(__IT__)) >> 5U) == 1)? (__HANDLE__)->Instance->CR1:(((((uint8_t)(__IT__)) >> 5U) == 2)? \
Kojto 109:9296ab0bfc11 872 (__HANDLE__)->Instance->CR2 : (__HANDLE__)->Instance->CR3)) & ((uint32_t)1 << (((uint16_t)(__IT__)) & UART_IT_MASK)))
Kojto 109:9296ab0bfc11 873
Kojto 109:9296ab0bfc11 874 /** @brief Clears the specified UART ISR flag, in setting the proper ICR register flag.
Kojto 109:9296ab0bfc11 875 * @param __HANDLE__: specifies the UART Handle.
Kojto 109:9296ab0bfc11 876 * This parameter can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
Kojto 109:9296ab0bfc11 877 * UART peripheral. (datasheet: up to five USART/UARTs)
Kojto 109:9296ab0bfc11 878 * @param __IT_CLEAR__: specifies the interrupt clear register flag that needs to be set
Kojto 109:9296ab0bfc11 879 * to clear the corresponding interrupt
Kojto 109:9296ab0bfc11 880 * This parameter can be one of the following values:
Kojto 109:9296ab0bfc11 881 * @arg UART_CLEAR_PEF: Parity Error Clear Flag
Kojto 109:9296ab0bfc11 882 * @arg UART_CLEAR_FEF: Framing Error Clear Flag
Kojto 109:9296ab0bfc11 883 * @arg UART_CLEAR_NEF: Noise detected Clear Flag
Kojto 109:9296ab0bfc11 884 * @arg UART_CLEAR_OREF: OverRun Error Clear Flag
Kojto 109:9296ab0bfc11 885 * @arg UART_CLEAR_IDLEF: IDLE line detected Clear Flag
Kojto 109:9296ab0bfc11 886 * @arg UART_CLEAR_TCF: Transmission Complete Clear Flag
Kojto 109:9296ab0bfc11 887 * @arg UART_CLEAR_LBDF: LIN Break Detection Clear Flag
Kojto 109:9296ab0bfc11 888 * @arg UART_CLEAR_CTSF: CTS Interrupt Clear Flag
Kojto 109:9296ab0bfc11 889 * @arg UART_CLEAR_RTOF: Receiver Time Out Clear Flag
Kojto 109:9296ab0bfc11 890 * @arg UART_CLEAR_EOBF: End Of Block Clear Flag
Kojto 109:9296ab0bfc11 891 * @arg UART_CLEAR_CMF: Character Match Clear Flag
Kojto 109:9296ab0bfc11 892 * @arg UART_CLEAR_WUF: Wake Up from stop mode Clear Flag
Kojto 109:9296ab0bfc11 893 * @retval None
Kojto 109:9296ab0bfc11 894 */
Kojto 109:9296ab0bfc11 895 #define __HAL_UART_CLEAR_IT(__HANDLE__, __IT_CLEAR__) ((__HANDLE__)->Instance->ICR = (uint32_t)(__IT_CLEAR__))
Kojto 109:9296ab0bfc11 896
Kojto 109:9296ab0bfc11 897 /** @brief Set a specific UART request flag.
Kojto 109:9296ab0bfc11 898 * @param __HANDLE__: specifies the UART Handle.
Kojto 109:9296ab0bfc11 899 * This parameter can be UARTx where x: 1, 2, 3, 4, 5 to select the USART or
Kojto 109:9296ab0bfc11 900 * UART peripheral. (datasheet: up to five USART/UARTs)
Kojto 109:9296ab0bfc11 901 * @param __REQ__: specifies the request flag to set
Kojto 109:9296ab0bfc11 902 * This parameter can be one of the following values:
Kojto 109:9296ab0bfc11 903 * @arg UART_AUTOBAUD_REQUEST: Auto-Baud Rate Request
Kojto 109:9296ab0bfc11 904 * @arg UART_SENDBREAK_REQUEST: Send Break Request
Kojto 109:9296ab0bfc11 905 * @arg UART_MUTE_MODE_REQUEST: Mute Mode Request
Kojto 109:9296ab0bfc11 906 * @arg UART_RXDATA_FLUSH_REQUEST: Receive Data flush Request
Kojto 109:9296ab0bfc11 907 * @arg UART_TXDATA_FLUSH_REQUEST: Transmit data flush Request
Kojto 109:9296ab0bfc11 908 * @retval None
Kojto 109:9296ab0bfc11 909 */
Kojto 109:9296ab0bfc11 910 #define __HAL_UART_SEND_REQ(__HANDLE__, __REQ__) ((__HANDLE__)->Instance->RQR |= (uint32_t)(__REQ__))
Kojto 109:9296ab0bfc11 911
Kojto 109:9296ab0bfc11 912 /** @brief Enable UART
Kojto 109:9296ab0bfc11 913 * @param __HANDLE__: specifies the UART Handle.
Kojto 109:9296ab0bfc11 914 * The Handle Instance can be UARTx where x: 1, 2, 3, 4 or 5 to select the UART peripheral
Kojto 109:9296ab0bfc11 915 * @retval None
Kojto 109:9296ab0bfc11 916 */
Kojto 109:9296ab0bfc11 917 #define __HAL_UART_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE)
Kojto 109:9296ab0bfc11 918
Kojto 109:9296ab0bfc11 919 /** @brief Disable UART
Kojto 109:9296ab0bfc11 920 * @param __HANDLE__: specifies the UART Handle.
Kojto 109:9296ab0bfc11 921 * The Handle Instance can be UARTx where x: 1, 2, 3, 4 or 5 to select the UART peripheral
Kojto 109:9296ab0bfc11 922 * @retval None
Kojto 109:9296ab0bfc11 923 */
Kojto 109:9296ab0bfc11 924 #define __HAL_UART_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE)
Kojto 109:9296ab0bfc11 925
Kojto 109:9296ab0bfc11 926 /** @brief BRR division operation to set BRR register in 8-bit oversampling mode
Kojto 109:9296ab0bfc11 927 * @param _PCLK_: UART clock
Kojto 109:9296ab0bfc11 928 * @param _BAUD_: Baud rate set by the user
Kojto 109:9296ab0bfc11 929 * @retval Division result
Kojto 109:9296ab0bfc11 930 */
Kojto 109:9296ab0bfc11 931 #define __DIV_SAMPLING8(_PCLK_, _BAUD_) (((_PCLK_)*2)/((_BAUD_)))
Kojto 109:9296ab0bfc11 932
Kojto 109:9296ab0bfc11 933 /** @brief BRR division operation to set BRR register in 16-bit oversampling mode
Kojto 109:9296ab0bfc11 934 * @param _PCLK_: UART clock
Kojto 109:9296ab0bfc11 935 * @param _BAUD_: Baud rate set by the user
Kojto 109:9296ab0bfc11 936 * @retval Division result
Kojto 109:9296ab0bfc11 937 */
Kojto 109:9296ab0bfc11 938 #define __DIV_SAMPLING16(_PCLK_, _BAUD_) (((_PCLK_))/((_BAUD_)))
Kojto 109:9296ab0bfc11 939
Kojto 109:9296ab0bfc11 940 /** @brief Check UART Baud rate
Kojto 109:9296ab0bfc11 941 * @param BAUDRATE: Baudrate specified by the user
Kojto 109:9296ab0bfc11 942 * The maximum Baud Rate is derived from the maximum clock on F3 (i.e. 72 MHz)
Kojto 109:9296ab0bfc11 943 * divided by the smallest oversampling used on the USART (i.e. 8)
Kojto 109:9296ab0bfc11 944 * @retval Test result (TRUE or FALSE).
Kojto 109:9296ab0bfc11 945 */
Kojto 109:9296ab0bfc11 946 #define IS_UART_BAUDRATE(BAUDRATE) ((BAUDRATE) < 9000001)
Kojto 109:9296ab0bfc11 947
Kojto 109:9296ab0bfc11 948 /** @brief Check UART assertion time
Kojto 109:9296ab0bfc11 949 * @param TIME: 5-bit value assertion time
Kojto 109:9296ab0bfc11 950 * @retval Test result (TRUE or FALSE).
Kojto 109:9296ab0bfc11 951 */
Kojto 109:9296ab0bfc11 952 #define IS_UART_ASSERTIONTIME(TIME) ((TIME) <= 0x1F)
Kojto 109:9296ab0bfc11 953
Kojto 109:9296ab0bfc11 954 /** @brief Check UART deassertion time
Kojto 109:9296ab0bfc11 955 * @param TIME: 5-bit value deassertion time
Kojto 109:9296ab0bfc11 956 * @retval Test result (TRUE or FALSE).
Kojto 109:9296ab0bfc11 957 */
Kojto 109:9296ab0bfc11 958 #define IS_UART_DEASSERTIONTIME(TIME) ((TIME) <= 0x1F)
Kojto 109:9296ab0bfc11 959
Kojto 109:9296ab0bfc11 960 /**
Kojto 109:9296ab0bfc11 961 * @}
Kojto 109:9296ab0bfc11 962 */
Kojto 109:9296ab0bfc11 963
Kojto 109:9296ab0bfc11 964 /* Include UART HAL Extended module */
Kojto 109:9296ab0bfc11 965 #include "stm32f3xx_hal_uart_ex.h"
Kojto 109:9296ab0bfc11 966
Kojto 109:9296ab0bfc11 967 /* Exported functions --------------------------------------------------------*/
Kojto 109:9296ab0bfc11 968 /** @addtogroup UART_Exported_Functions UART Exported Functions
Kojto 109:9296ab0bfc11 969 * @{
Kojto 109:9296ab0bfc11 970 */
Kojto 109:9296ab0bfc11 971
Kojto 109:9296ab0bfc11 972 /** @addtogroup UART_Exported_Functions_Group1 Initialization and de-initialization functions
Kojto 109:9296ab0bfc11 973 * @brief Initialization and Configuration functions
Kojto 109:9296ab0bfc11 974 * @{
Kojto 109:9296ab0bfc11 975 */
Kojto 109:9296ab0bfc11 976 /* Initialization and de-initialization functions ****************************/
Kojto 109:9296ab0bfc11 977 HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 978 HAL_StatusTypeDef HAL_HalfDuplex_Init(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 979 HAL_StatusTypeDef HAL_LIN_Init(UART_HandleTypeDef *huart, uint32_t BreakDetectLength);
Kojto 109:9296ab0bfc11 980 HAL_StatusTypeDef HAL_MultiProcessor_Init(UART_HandleTypeDef *huart, uint8_t Address, uint32_t WakeUpMethod);
Kojto 109:9296ab0bfc11 981 HAL_StatusTypeDef HAL_UART_DeInit (UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 982 void HAL_UART_MspInit(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 983 void HAL_UART_MspDeInit(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 984 /**
Kojto 109:9296ab0bfc11 985 * @}
Kojto 109:9296ab0bfc11 986 */
Kojto 109:9296ab0bfc11 987
Kojto 109:9296ab0bfc11 988 /** @addtogroup UART_Exported_Functions_Group2 Input and Output operation functions
Kojto 109:9296ab0bfc11 989 * @brief UART Transmit/Receive functions
Kojto 109:9296ab0bfc11 990 * @{
Kojto 109:9296ab0bfc11 991 */
Kojto 109:9296ab0bfc11 992 /* IO operation functions *****************************************************/
Kojto 109:9296ab0bfc11 993 HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout);
Kojto 109:9296ab0bfc11 994 HAL_StatusTypeDef HAL_UART_Receive(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout);
Kojto 109:9296ab0bfc11 995 HAL_StatusTypeDef HAL_UART_Transmit_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);
Kojto 109:9296ab0bfc11 996 HAL_StatusTypeDef HAL_UART_Receive_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);
Kojto 109:9296ab0bfc11 997 HAL_StatusTypeDef HAL_UART_Transmit_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);
Kojto 109:9296ab0bfc11 998 HAL_StatusTypeDef HAL_UART_Receive_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size);
Kojto 109:9296ab0bfc11 999 HAL_StatusTypeDef HAL_UART_DMAPause(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1000 HAL_StatusTypeDef HAL_UART_DMAResume(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1001 HAL_StatusTypeDef HAL_UART_DMAStop(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1002 void HAL_UART_IRQHandler(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1003 void HAL_UART_TxHalfCpltCallback(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1004 void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1005 void HAL_UART_RxHalfCpltCallback(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1006 void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1007 void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1008 void HAL_UART_WakeupCallback(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1009
Kojto 109:9296ab0bfc11 1010 HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, uint32_t Timeout);
Kojto 109:9296ab0bfc11 1011 /**
Kojto 109:9296ab0bfc11 1012 * @}
Kojto 109:9296ab0bfc11 1013 */
Kojto 109:9296ab0bfc11 1014
Kojto 109:9296ab0bfc11 1015 /** @addtogroup UART_Exported_Functions_Group3 Peripheral Control functions
Kojto 109:9296ab0bfc11 1016 * @brief UART control functions
Kojto 109:9296ab0bfc11 1017 * @{
Kojto 109:9296ab0bfc11 1018 */
Kojto 109:9296ab0bfc11 1019 /* Peripheral Control functions ***********************************************/
Kojto 109:9296ab0bfc11 1020 HAL_StatusTypeDef HAL_MultiProcessor_EnableMuteMode(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1021 HAL_StatusTypeDef HAL_MultiProcessor_DisableMuteMode(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1022 void HAL_MultiProcessor_EnterMuteMode(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1023 HAL_StatusTypeDef UART_SetConfig(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1024 HAL_StatusTypeDef HAL_HalfDuplex_EnableTransmitter(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1025 HAL_StatusTypeDef HAL_HalfDuplex_EnableReceiver(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1026 HAL_StatusTypeDef HAL_LIN_SendBreak(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1027
Kojto 109:9296ab0bfc11 1028 HAL_StatusTypeDef UART_CheckIdleState(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1029 void UART_AdvFeatureConfig(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1030 void UART_Wakeup_AddressConfig(UART_HandleTypeDef *huart, UART_WakeUpTypeDef WakeUpSelection);
Kojto 109:9296ab0bfc11 1031 /**
Kojto 109:9296ab0bfc11 1032 * @}
Kojto 109:9296ab0bfc11 1033 */
Kojto 109:9296ab0bfc11 1034
Kojto 109:9296ab0bfc11 1035 /** @addtogroup UART_Exported_Functions_Group4 Peripheral State and Error functions
Kojto 109:9296ab0bfc11 1036 * @brief Peripheral State and Error functions
Kojto 109:9296ab0bfc11 1037 * @{
Kojto 109:9296ab0bfc11 1038 */
Kojto 109:9296ab0bfc11 1039 /* Peripheral State and Error functions ***************************************/
Kojto 109:9296ab0bfc11 1040 HAL_UART_StateTypeDef HAL_UART_GetState(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1041 uint32_t HAL_UART_GetError(UART_HandleTypeDef *huart);
Kojto 109:9296ab0bfc11 1042 /**
Kojto 109:9296ab0bfc11 1043 * @}
Kojto 109:9296ab0bfc11 1044 */
Kojto 109:9296ab0bfc11 1045
Kojto 109:9296ab0bfc11 1046 /**
Kojto 109:9296ab0bfc11 1047 * @}
Kojto 109:9296ab0bfc11 1048 */
Kojto 109:9296ab0bfc11 1049
Kojto 109:9296ab0bfc11 1050 /**
Kojto 109:9296ab0bfc11 1051 * @}
Kojto 109:9296ab0bfc11 1052 */
Kojto 109:9296ab0bfc11 1053
Kojto 109:9296ab0bfc11 1054 /**
Kojto 109:9296ab0bfc11 1055 * @}
Kojto 109:9296ab0bfc11 1056 */
Kojto 109:9296ab0bfc11 1057
Kojto 109:9296ab0bfc11 1058 #ifdef __cplusplus
Kojto 109:9296ab0bfc11 1059 }
Kojto 109:9296ab0bfc11 1060 #endif
Kojto 109:9296ab0bfc11 1061
Kojto 109:9296ab0bfc11 1062 #endif /* __STM32F3xx_HAL_UART_H */
Kojto 109:9296ab0bfc11 1063
Kojto 109:9296ab0bfc11 1064 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/