SilentSensors / mbed-dev

Fork of mbed-dev by mbed official

Committer:
<>
Date:
Thu Mar 30 13:45:57 2017 +0100
Revision:
161:2cc1468da177
Child:
182:a56a73fd2a6f
This updates the lib to the mbed lib v139

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 161:2cc1468da177 1 /**
<> 161:2cc1468da177 2 ******************************************************************************
<> 161:2cc1468da177 3 * @file stm32f7xx_ll_usart.h
<> 161:2cc1468da177 4 * @author MCD Application Team
<> 161:2cc1468da177 5 * @version V1.2.0
<> 161:2cc1468da177 6 * @date 30-December-2016
<> 161:2cc1468da177 7 * @brief Header file of USART LL module.
<> 161:2cc1468da177 8 ******************************************************************************
<> 161:2cc1468da177 9 * @attention
<> 161:2cc1468da177 10 *
<> 161:2cc1468da177 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
<> 161:2cc1468da177 12 *
<> 161:2cc1468da177 13 * Redistribution and use in source and binary forms, with or without modification,
<> 161:2cc1468da177 14 * are permitted provided that the following conditions are met:
<> 161:2cc1468da177 15 * 1. Redistributions of source code must retain the above copyright notice,
<> 161:2cc1468da177 16 * this list of conditions and the following disclaimer.
<> 161:2cc1468da177 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
<> 161:2cc1468da177 18 * this list of conditions and the following disclaimer in the documentation
<> 161:2cc1468da177 19 * and/or other materials provided with the distribution.
<> 161:2cc1468da177 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
<> 161:2cc1468da177 21 * may be used to endorse or promote products derived from this software
<> 161:2cc1468da177 22 * without specific prior written permission.
<> 161:2cc1468da177 23 *
<> 161:2cc1468da177 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
<> 161:2cc1468da177 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
<> 161:2cc1468da177 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<> 161:2cc1468da177 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
<> 161:2cc1468da177 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
<> 161:2cc1468da177 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
<> 161:2cc1468da177 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
<> 161:2cc1468da177 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
<> 161:2cc1468da177 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<> 161:2cc1468da177 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<> 161:2cc1468da177 34 *
<> 161:2cc1468da177 35 ******************************************************************************
<> 161:2cc1468da177 36 */
<> 161:2cc1468da177 37
<> 161:2cc1468da177 38 /* Define to prevent recursive inclusion -------------------------------------*/
<> 161:2cc1468da177 39 #ifndef __STM32F7xx_LL_USART_H
<> 161:2cc1468da177 40 #define __STM32F7xx_LL_USART_H
<> 161:2cc1468da177 41
<> 161:2cc1468da177 42 #ifdef __cplusplus
<> 161:2cc1468da177 43 extern "C" {
<> 161:2cc1468da177 44 #endif
<> 161:2cc1468da177 45
<> 161:2cc1468da177 46 /* Includes ------------------------------------------------------------------*/
<> 161:2cc1468da177 47 #include "stm32f7xx.h"
<> 161:2cc1468da177 48
<> 161:2cc1468da177 49 /** @addtogroup STM32F7xx_LL_Driver
<> 161:2cc1468da177 50 * @{
<> 161:2cc1468da177 51 */
<> 161:2cc1468da177 52
<> 161:2cc1468da177 53 #if defined (USART1) || defined (USART2) || defined (USART3) || defined (USART6) || defined (UART4) || defined (UART5) || defined (UART7) || defined (UART8)
<> 161:2cc1468da177 54
<> 161:2cc1468da177 55 /** @defgroup USART_LL USART
<> 161:2cc1468da177 56 * @{
<> 161:2cc1468da177 57 */
<> 161:2cc1468da177 58
<> 161:2cc1468da177 59 /* Private types -------------------------------------------------------------*/
<> 161:2cc1468da177 60 /* Private variables ---------------------------------------------------------*/
<> 161:2cc1468da177 61
<> 161:2cc1468da177 62 /* Private constants ---------------------------------------------------------*/
<> 161:2cc1468da177 63 /** @defgroup USART_LL_Private_Constants USART Private Constants
<> 161:2cc1468da177 64 * @{
<> 161:2cc1468da177 65 */
<> 161:2cc1468da177 66 /**
<> 161:2cc1468da177 67 * @}
<> 161:2cc1468da177 68 */
<> 161:2cc1468da177 69
<> 161:2cc1468da177 70 /* Private macros ------------------------------------------------------------*/
<> 161:2cc1468da177 71 #if defined(USE_FULL_LL_DRIVER)
<> 161:2cc1468da177 72 /** @defgroup USART_LL_Private_Macros USART Private Macros
<> 161:2cc1468da177 73 * @{
<> 161:2cc1468da177 74 */
<> 161:2cc1468da177 75 /**
<> 161:2cc1468da177 76 * @}
<> 161:2cc1468da177 77 */
<> 161:2cc1468da177 78 #endif /*USE_FULL_LL_DRIVER*/
<> 161:2cc1468da177 79
<> 161:2cc1468da177 80 /* Exported types ------------------------------------------------------------*/
<> 161:2cc1468da177 81 #if defined(USE_FULL_LL_DRIVER)
<> 161:2cc1468da177 82 /** @defgroup USART_LL_ES_INIT USART Exported Init structures
<> 161:2cc1468da177 83 * @{
<> 161:2cc1468da177 84 */
<> 161:2cc1468da177 85
<> 161:2cc1468da177 86 /**
<> 161:2cc1468da177 87 * @brief LL USART Init Structure definition
<> 161:2cc1468da177 88 */
<> 161:2cc1468da177 89 typedef struct
<> 161:2cc1468da177 90 {
<> 161:2cc1468da177 91 uint32_t BaudRate; /*!< This field defines expected Usart communication baud rate.
<> 161:2cc1468da177 92
<> 161:2cc1468da177 93 This feature can be modified afterwards using unitary function @ref LL_USART_SetBaudRate().*/
<> 161:2cc1468da177 94
<> 161:2cc1468da177 95 uint32_t DataWidth; /*!< Specifies the number of data bits transmitted or received in a frame.
<> 161:2cc1468da177 96 This parameter can be a value of @ref USART_LL_EC_DATAWIDTH.
<> 161:2cc1468da177 97
<> 161:2cc1468da177 98 This feature can be modified afterwards using unitary function @ref LL_USART_SetDataWidth().*/
<> 161:2cc1468da177 99
<> 161:2cc1468da177 100 uint32_t StopBits; /*!< Specifies the number of stop bits transmitted.
<> 161:2cc1468da177 101 This parameter can be a value of @ref USART_LL_EC_STOPBITS.
<> 161:2cc1468da177 102
<> 161:2cc1468da177 103 This feature can be modified afterwards using unitary function @ref LL_USART_SetStopBitsLength().*/
<> 161:2cc1468da177 104
<> 161:2cc1468da177 105 uint32_t Parity; /*!< Specifies the parity mode.
<> 161:2cc1468da177 106 This parameter can be a value of @ref USART_LL_EC_PARITY.
<> 161:2cc1468da177 107
<> 161:2cc1468da177 108 This feature can be modified afterwards using unitary function @ref LL_USART_SetParity().*/
<> 161:2cc1468da177 109
<> 161:2cc1468da177 110 uint32_t TransferDirection; /*!< Specifies whether the Receive and/or Transmit mode is enabled or disabled.
<> 161:2cc1468da177 111 This parameter can be a value of @ref USART_LL_EC_DIRECTION.
<> 161:2cc1468da177 112
<> 161:2cc1468da177 113 This feature can be modified afterwards using unitary function @ref LL_USART_SetTransferDirection().*/
<> 161:2cc1468da177 114
<> 161:2cc1468da177 115 uint32_t HardwareFlowControl; /*!< Specifies whether the hardware flow control mode is enabled or disabled.
<> 161:2cc1468da177 116 This parameter can be a value of @ref USART_LL_EC_HWCONTROL.
<> 161:2cc1468da177 117
<> 161:2cc1468da177 118 This feature can be modified afterwards using unitary function @ref LL_USART_SetHWFlowCtrl().*/
<> 161:2cc1468da177 119
<> 161:2cc1468da177 120 uint32_t OverSampling; /*!< Specifies whether USART oversampling mode is 16 or 8.
<> 161:2cc1468da177 121 This parameter can be a value of @ref USART_LL_EC_OVERSAMPLING.
<> 161:2cc1468da177 122
<> 161:2cc1468da177 123 This feature can be modified afterwards using unitary function @ref LL_USART_SetOverSampling().*/
<> 161:2cc1468da177 124
<> 161:2cc1468da177 125 } LL_USART_InitTypeDef;
<> 161:2cc1468da177 126
<> 161:2cc1468da177 127 /**
<> 161:2cc1468da177 128 * @brief LL USART Clock Init Structure definition
<> 161:2cc1468da177 129 */
<> 161:2cc1468da177 130 typedef struct
<> 161:2cc1468da177 131 {
<> 161:2cc1468da177 132 uint32_t ClockOutput; /*!< Specifies whether the USART clock is enabled or disabled.
<> 161:2cc1468da177 133 This parameter can be a value of @ref USART_LL_EC_CLOCK.
<> 161:2cc1468da177 134
<> 161:2cc1468da177 135 USART HW configuration can be modified afterwards using unitary functions
<> 161:2cc1468da177 136 @ref LL_USART_EnableSCLKOutput() or @ref LL_USART_DisableSCLKOutput().
<> 161:2cc1468da177 137 For more details, refer to description of this function. */
<> 161:2cc1468da177 138
<> 161:2cc1468da177 139 uint32_t ClockPolarity; /*!< Specifies the steady state of the serial clock.
<> 161:2cc1468da177 140 This parameter can be a value of @ref USART_LL_EC_POLARITY.
<> 161:2cc1468da177 141
<> 161:2cc1468da177 142 USART HW configuration can be modified afterwards using unitary functions @ref LL_USART_SetClockPolarity().
<> 161:2cc1468da177 143 For more details, refer to description of this function. */
<> 161:2cc1468da177 144
<> 161:2cc1468da177 145 uint32_t ClockPhase; /*!< Specifies the clock transition on which the bit capture is made.
<> 161:2cc1468da177 146 This parameter can be a value of @ref USART_LL_EC_PHASE.
<> 161:2cc1468da177 147
<> 161:2cc1468da177 148 USART HW configuration can be modified afterwards using unitary functions @ref LL_USART_SetClockPhase().
<> 161:2cc1468da177 149 For more details, refer to description of this function. */
<> 161:2cc1468da177 150
<> 161:2cc1468da177 151 uint32_t LastBitClockPulse; /*!< Specifies whether the clock pulse corresponding to the last transmitted
<> 161:2cc1468da177 152 data bit (MSB) has to be output on the SCLK pin in synchronous mode.
<> 161:2cc1468da177 153 This parameter can be a value of @ref USART_LL_EC_LASTCLKPULSE.
<> 161:2cc1468da177 154
<> 161:2cc1468da177 155 USART HW configuration can be modified afterwards using unitary functions @ref LL_USART_SetLastClkPulseOutput().
<> 161:2cc1468da177 156 For more details, refer to description of this function. */
<> 161:2cc1468da177 157
<> 161:2cc1468da177 158 } LL_USART_ClockInitTypeDef;
<> 161:2cc1468da177 159
<> 161:2cc1468da177 160 /**
<> 161:2cc1468da177 161 * @}
<> 161:2cc1468da177 162 */
<> 161:2cc1468da177 163 #endif /* USE_FULL_LL_DRIVER */
<> 161:2cc1468da177 164
<> 161:2cc1468da177 165 /* Exported constants --------------------------------------------------------*/
<> 161:2cc1468da177 166 /** @defgroup USART_LL_Exported_Constants USART Exported Constants
<> 161:2cc1468da177 167 * @{
<> 161:2cc1468da177 168 */
<> 161:2cc1468da177 169
<> 161:2cc1468da177 170 /** @defgroup USART_LL_EC_CLEAR_FLAG Clear Flags Defines
<> 161:2cc1468da177 171 * @brief Flags defines which can be used with LL_USART_WriteReg function
<> 161:2cc1468da177 172 * @{
<> 161:2cc1468da177 173 */
<> 161:2cc1468da177 174 #define LL_USART_ICR_PECF USART_ICR_PECF /*!< Parity error flag */
<> 161:2cc1468da177 175 #define LL_USART_ICR_FECF USART_ICR_FECF /*!< Framing error flag */
<> 161:2cc1468da177 176 #define LL_USART_ICR_NCF USART_ICR_NCF /*!< Noise detected flag */
<> 161:2cc1468da177 177 #define LL_USART_ICR_ORECF USART_ICR_ORECF /*!< Overrun error flag */
<> 161:2cc1468da177 178 #define LL_USART_ICR_IDLECF USART_ICR_IDLECF /*!< Idle line detected flag */
<> 161:2cc1468da177 179 #define LL_USART_ICR_TCCF USART_ICR_TCCF /*!< Transmission complete flag */
<> 161:2cc1468da177 180 #if defined(USART_TCBGT_SUPPORT)
<> 161:2cc1468da177 181 #define LL_USART_ICR_TCBGTCF USART_ICR_TCBGTCF /*!< Transmission completed before guard time flag */
<> 161:2cc1468da177 182 #endif
<> 161:2cc1468da177 183 #define LL_USART_ICR_LBDCF USART_ICR_LBDCF /*!< LIN break detection flag */
<> 161:2cc1468da177 184 #define LL_USART_ICR_CTSCF USART_ICR_CTSCF /*!< CTS flag */
<> 161:2cc1468da177 185 #define LL_USART_ICR_RTOCF USART_ICR_RTOCF /*!< Receiver timeout flag */
<> 161:2cc1468da177 186 #define LL_USART_ICR_EOBCF USART_ICR_EOBCF /*!< End of block flag */
<> 161:2cc1468da177 187 #define LL_USART_ICR_CMCF USART_ICR_CMCF /*!< Character match flag */
<> 161:2cc1468da177 188 /**
<> 161:2cc1468da177 189 * @}
<> 161:2cc1468da177 190 */
<> 161:2cc1468da177 191
<> 161:2cc1468da177 192 /** @defgroup USART_LL_EC_GET_FLAG Get Flags Defines
<> 161:2cc1468da177 193 * @brief Flags defines which can be used with LL_USART_ReadReg function
<> 161:2cc1468da177 194 * @{
<> 161:2cc1468da177 195 */
<> 161:2cc1468da177 196 #define LL_USART_ISR_PE USART_ISR_PE /*!< Parity error flag */
<> 161:2cc1468da177 197 #define LL_USART_ISR_FE USART_ISR_FE /*!< Framing error flag */
<> 161:2cc1468da177 198 #define LL_USART_ISR_NE USART_ISR_NE /*!< Noise detected flag */
<> 161:2cc1468da177 199 #define LL_USART_ISR_ORE USART_ISR_ORE /*!< Overrun error flag */
<> 161:2cc1468da177 200 #define LL_USART_ISR_IDLE USART_ISR_IDLE /*!< Idle line detected flag */
<> 161:2cc1468da177 201 #define LL_USART_ISR_RXNE USART_ISR_RXNE /*!< Read data register not empty flag */
<> 161:2cc1468da177 202 #define LL_USART_ISR_TC USART_ISR_TC /*!< Transmission complete flag */
<> 161:2cc1468da177 203 #define LL_USART_ISR_TXE USART_ISR_TXE /*!< Transmit data register empty flag */
<> 161:2cc1468da177 204 #define LL_USART_ISR_LBDF USART_ISR_LBDF /*!< LIN break detection flag */
<> 161:2cc1468da177 205 #define LL_USART_ISR_CTSIF USART_ISR_CTSIF /*!< CTS interrupt flag */
<> 161:2cc1468da177 206 #define LL_USART_ISR_CTS USART_ISR_CTS /*!< CTS flag */
<> 161:2cc1468da177 207 #define LL_USART_ISR_RTOF USART_ISR_RTOF /*!< Receiver timeout flag */
<> 161:2cc1468da177 208 #define LL_USART_ISR_EOBF USART_ISR_EOBF /*!< End of block flag */
<> 161:2cc1468da177 209 #define LL_USART_ISR_ABRE USART_ISR_ABRE /*!< Auto baud rate error flag */
<> 161:2cc1468da177 210 #define LL_USART_ISR_ABRF USART_ISR_ABRF /*!< Auto baud rate flag */
<> 161:2cc1468da177 211 #define LL_USART_ISR_BUSY USART_ISR_BUSY /*!< Busy flag */
<> 161:2cc1468da177 212 #define LL_USART_ISR_CMF USART_ISR_CMF /*!< Character match flag */
<> 161:2cc1468da177 213 #define LL_USART_ISR_SBKF USART_ISR_SBKF /*!< Send break flag */
<> 161:2cc1468da177 214 #define LL_USART_ISR_RWU USART_ISR_RWU /*!< Receiver wakeup from Mute mode flag */
<> 161:2cc1468da177 215 #define LL_USART_ISR_TEACK USART_ISR_TEACK /*!< Transmit enable acknowledge flag */
<> 161:2cc1468da177 216 #if defined(USART_TCBGT_SUPPORT)
<> 161:2cc1468da177 217 #define LL_USART_ISR_TCBGT USART_ISR_TCBGT /*!< Transmission complete before guard time completion flag */
<> 161:2cc1468da177 218 #endif
<> 161:2cc1468da177 219 /**
<> 161:2cc1468da177 220 * @}
<> 161:2cc1468da177 221 */
<> 161:2cc1468da177 222
<> 161:2cc1468da177 223 /** @defgroup USART_LL_EC_IT IT Defines
<> 161:2cc1468da177 224 * @brief IT defines which can be used with LL_USART_ReadReg and LL_USART_WriteReg functions
<> 161:2cc1468da177 225 * @{
<> 161:2cc1468da177 226 */
<> 161:2cc1468da177 227 #define LL_USART_CR1_IDLEIE USART_CR1_IDLEIE /*!< IDLE interrupt enable */
<> 161:2cc1468da177 228 #define LL_USART_CR1_RXNEIE USART_CR1_RXNEIE /*!< Read data register not empty interrupt enable */
<> 161:2cc1468da177 229 #define LL_USART_CR1_TCIE USART_CR1_TCIE /*!< Transmission complete interrupt enable */
<> 161:2cc1468da177 230 #define LL_USART_CR1_TXEIE USART_CR1_TXEIE /*!< Transmit data register empty interrupt enable */
<> 161:2cc1468da177 231 #define LL_USART_CR1_PEIE USART_CR1_PEIE /*!< Parity error */
<> 161:2cc1468da177 232 #define LL_USART_CR1_CMIE USART_CR1_CMIE /*!< Character match interrupt enable */
<> 161:2cc1468da177 233 #define LL_USART_CR1_RTOIE USART_CR1_RTOIE /*!< Receiver timeout interrupt enable */
<> 161:2cc1468da177 234 #define LL_USART_CR1_EOBIE USART_CR1_EOBIE /*!< End of Block interrupt enable */
<> 161:2cc1468da177 235 #define LL_USART_CR2_LBDIE USART_CR2_LBDIE /*!< LIN break detection interrupt enable */
<> 161:2cc1468da177 236 #define LL_USART_CR3_EIE USART_CR3_EIE /*!< Error interrupt enable */
<> 161:2cc1468da177 237 #define LL_USART_CR3_CTSIE USART_CR3_CTSIE /*!< CTS interrupt enable */
<> 161:2cc1468da177 238 #if defined(USART_TCBGT_SUPPORT)
<> 161:2cc1468da177 239 #define LL_USART_CR3_TCBGTIE USART_CR3_TCBGTIE /*!< Transmission complete before guard time interrupt enable */
<> 161:2cc1468da177 240 #endif
<> 161:2cc1468da177 241 /**
<> 161:2cc1468da177 242 * @}
<> 161:2cc1468da177 243 */
<> 161:2cc1468da177 244
<> 161:2cc1468da177 245 /** @defgroup USART_LL_EC_DIRECTION Communication Direction
<> 161:2cc1468da177 246 * @{
<> 161:2cc1468da177 247 */
<> 161:2cc1468da177 248 #define LL_USART_DIRECTION_NONE 0x00000000U /*!< Transmitter and Receiver are disabled */
<> 161:2cc1468da177 249 #define LL_USART_DIRECTION_RX USART_CR1_RE /*!< Transmitter is disabled and Receiver is enabled */
<> 161:2cc1468da177 250 #define LL_USART_DIRECTION_TX USART_CR1_TE /*!< Transmitter is enabled and Receiver is disabled */
<> 161:2cc1468da177 251 #define LL_USART_DIRECTION_TX_RX (USART_CR1_TE |USART_CR1_RE) /*!< Transmitter and Receiver are enabled */
<> 161:2cc1468da177 252 /**
<> 161:2cc1468da177 253 * @}
<> 161:2cc1468da177 254 */
<> 161:2cc1468da177 255
<> 161:2cc1468da177 256 /** @defgroup USART_LL_EC_PARITY Parity Control
<> 161:2cc1468da177 257 * @{
<> 161:2cc1468da177 258 */
<> 161:2cc1468da177 259 #define LL_USART_PARITY_NONE 0x00000000U /*!< Parity control disabled */
<> 161:2cc1468da177 260 #define LL_USART_PARITY_EVEN USART_CR1_PCE /*!< Parity control enabled and Even Parity is selected */
<> 161:2cc1468da177 261 #define LL_USART_PARITY_ODD (USART_CR1_PCE | USART_CR1_PS) /*!< Parity control enabled and Odd Parity is selected */
<> 161:2cc1468da177 262 /**
<> 161:2cc1468da177 263 * @}
<> 161:2cc1468da177 264 */
<> 161:2cc1468da177 265
<> 161:2cc1468da177 266 /** @defgroup USART_LL_EC_WAKEUP Wakeup
<> 161:2cc1468da177 267 * @{
<> 161:2cc1468da177 268 */
<> 161:2cc1468da177 269 #define LL_USART_WAKEUP_IDLELINE 0x00000000U /*!< USART wake up from Mute mode on Idle Line */
<> 161:2cc1468da177 270 #define LL_USART_WAKEUP_ADDRESSMARK USART_CR1_WAKE /*!< USART wake up from Mute mode on Address Mark */
<> 161:2cc1468da177 271 /**
<> 161:2cc1468da177 272 * @}
<> 161:2cc1468da177 273 */
<> 161:2cc1468da177 274
<> 161:2cc1468da177 275 /** @defgroup USART_LL_EC_DATAWIDTH Datawidth
<> 161:2cc1468da177 276 * @{
<> 161:2cc1468da177 277 */
<> 161:2cc1468da177 278 #define LL_USART_DATAWIDTH_7B USART_CR1_M1 /*!< 7 bits word length : Start bit, 7 data bits, n stop bits */
<> 161:2cc1468da177 279 #define LL_USART_DATAWIDTH_8B 0x00000000U /*!< 8 bits word length : Start bit, 8 data bits, n stop bits */
<> 161:2cc1468da177 280 #define LL_USART_DATAWIDTH_9B USART_CR1_M0 /*!< 9 bits word length : Start bit, 9 data bits, n stop bits */
<> 161:2cc1468da177 281 /**
<> 161:2cc1468da177 282 * @}
<> 161:2cc1468da177 283 */
<> 161:2cc1468da177 284
<> 161:2cc1468da177 285 /** @defgroup USART_LL_EC_OVERSAMPLING Oversampling
<> 161:2cc1468da177 286 * @{
<> 161:2cc1468da177 287 */
<> 161:2cc1468da177 288 #define LL_USART_OVERSAMPLING_16 0x00000000U /*!< Oversampling by 16 */
<> 161:2cc1468da177 289 #define LL_USART_OVERSAMPLING_8 USART_CR1_OVER8 /*!< Oversampling by 8 */
<> 161:2cc1468da177 290 /**
<> 161:2cc1468da177 291 * @}
<> 161:2cc1468da177 292 */
<> 161:2cc1468da177 293
<> 161:2cc1468da177 294 #if defined(USE_FULL_LL_DRIVER)
<> 161:2cc1468da177 295 /** @defgroup USART_LL_EC_CLOCK Clock Signal
<> 161:2cc1468da177 296 * @{
<> 161:2cc1468da177 297 */
<> 161:2cc1468da177 298
<> 161:2cc1468da177 299 #define LL_USART_CLOCK_DISABLE 0x00000000U /*!< Clock signal not provided */
<> 161:2cc1468da177 300 #define LL_USART_CLOCK_ENABLE USART_CR2_CLKEN /*!< Clock signal provided */
<> 161:2cc1468da177 301 /**
<> 161:2cc1468da177 302 * @}
<> 161:2cc1468da177 303 */
<> 161:2cc1468da177 304 #endif /*USE_FULL_LL_DRIVER*/
<> 161:2cc1468da177 305
<> 161:2cc1468da177 306 /** @defgroup USART_LL_EC_LASTCLKPULSE Last Clock Pulse
<> 161:2cc1468da177 307 * @{
<> 161:2cc1468da177 308 */
<> 161:2cc1468da177 309 #define LL_USART_LASTCLKPULSE_NO_OUTPUT 0x00000000U /*!< The clock pulse of the last data bit is not output to the SCLK pin */
<> 161:2cc1468da177 310 #define LL_USART_LASTCLKPULSE_OUTPUT USART_CR2_LBCL /*!< The clock pulse of the last data bit is output to the SCLK pin */
<> 161:2cc1468da177 311 /**
<> 161:2cc1468da177 312 * @}
<> 161:2cc1468da177 313 */
<> 161:2cc1468da177 314
<> 161:2cc1468da177 315 /** @defgroup USART_LL_EC_PHASE Clock Phase
<> 161:2cc1468da177 316 * @{
<> 161:2cc1468da177 317 */
<> 161:2cc1468da177 318 #define LL_USART_PHASE_1EDGE 0x00000000U /*!< The first clock transition is the first data capture edge */
<> 161:2cc1468da177 319 #define LL_USART_PHASE_2EDGE USART_CR2_CPHA /*!< The second clock transition is the first data capture edge */
<> 161:2cc1468da177 320 /**
<> 161:2cc1468da177 321 * @}
<> 161:2cc1468da177 322 */
<> 161:2cc1468da177 323
<> 161:2cc1468da177 324 /** @defgroup USART_LL_EC_POLARITY Clock Polarity
<> 161:2cc1468da177 325 * @{
<> 161:2cc1468da177 326 */
<> 161:2cc1468da177 327 #define LL_USART_POLARITY_LOW 0x00000000U /*!< Steady low value on SCLK pin outside transmission window*/
<> 161:2cc1468da177 328 #define LL_USART_POLARITY_HIGH USART_CR2_CPOL /*!< Steady high value on SCLK pin outside transmission window */
<> 161:2cc1468da177 329 /**
<> 161:2cc1468da177 330 * @}
<> 161:2cc1468da177 331 */
<> 161:2cc1468da177 332
<> 161:2cc1468da177 333 /** @defgroup USART_LL_EC_STOPBITS Stop Bits
<> 161:2cc1468da177 334 * @{
<> 161:2cc1468da177 335 */
<> 161:2cc1468da177 336 #define LL_USART_STOPBITS_0_5 USART_CR2_STOP_0 /*!< 0.5 stop bit */
<> 161:2cc1468da177 337 #define LL_USART_STOPBITS_1 0x00000000U /*!< 1 stop bit */
<> 161:2cc1468da177 338 #define LL_USART_STOPBITS_1_5 (USART_CR2_STOP_0 | USART_CR2_STOP_1) /*!< 1.5 stop bits */
<> 161:2cc1468da177 339 #define LL_USART_STOPBITS_2 USART_CR2_STOP_1 /*!< 2 stop bits */
<> 161:2cc1468da177 340 /**
<> 161:2cc1468da177 341 * @}
<> 161:2cc1468da177 342 */
<> 161:2cc1468da177 343
<> 161:2cc1468da177 344 /** @defgroup USART_LL_EC_TXRX TX RX Pins Swap
<> 161:2cc1468da177 345 * @{
<> 161:2cc1468da177 346 */
<> 161:2cc1468da177 347 #define LL_USART_TXRX_STANDARD 0x00000000U /*!< TX/RX pins are used as defined in standard pinout */
<> 161:2cc1468da177 348 #define LL_USART_TXRX_SWAPPED (USART_CR2_SWAP) /*!< TX and RX pins functions are swapped. */
<> 161:2cc1468da177 349 /**
<> 161:2cc1468da177 350 * @}
<> 161:2cc1468da177 351 */
<> 161:2cc1468da177 352
<> 161:2cc1468da177 353 /** @defgroup USART_LL_EC_RXPIN_LEVEL RX Pin Active Level Inversion
<> 161:2cc1468da177 354 * @{
<> 161:2cc1468da177 355 */
<> 161:2cc1468da177 356 #define LL_USART_RXPIN_LEVEL_STANDARD 0x00000000U /*!< RX pin signal works using the standard logic levels */
<> 161:2cc1468da177 357 #define LL_USART_RXPIN_LEVEL_INVERTED (USART_CR2_RXINV) /*!< RX pin signal values are inverted. */
<> 161:2cc1468da177 358 /**
<> 161:2cc1468da177 359 * @}
<> 161:2cc1468da177 360 */
<> 161:2cc1468da177 361
<> 161:2cc1468da177 362 /** @defgroup USART_LL_EC_TXPIN_LEVEL TX Pin Active Level Inversion
<> 161:2cc1468da177 363 * @{
<> 161:2cc1468da177 364 */
<> 161:2cc1468da177 365 #define LL_USART_TXPIN_LEVEL_STANDARD 0x00000000U /*!< TX pin signal works using the standard logic levels */
<> 161:2cc1468da177 366 #define LL_USART_TXPIN_LEVEL_INVERTED (USART_CR2_TXINV) /*!< TX pin signal values are inverted. */
<> 161:2cc1468da177 367 /**
<> 161:2cc1468da177 368 * @}
<> 161:2cc1468da177 369 */
<> 161:2cc1468da177 370
<> 161:2cc1468da177 371 /** @defgroup USART_LL_EC_BINARY_LOGIC Binary Data Inversion
<> 161:2cc1468da177 372 * @{
<> 161:2cc1468da177 373 */
<> 161:2cc1468da177 374 #define LL_USART_BINARY_LOGIC_POSITIVE 0x00000000U /*!< Logical data from the data register are send/received in positive/direct logic. (1=H, 0=L) */
<> 161:2cc1468da177 375 #define LL_USART_BINARY_LOGIC_NEGATIVE USART_CR2_DATAINV /*!< Logical data from the data register are send/received in negative/inverse logic. (1=L, 0=H). The parity bit is also inverted. */
<> 161:2cc1468da177 376 /**
<> 161:2cc1468da177 377 * @}
<> 161:2cc1468da177 378 */
<> 161:2cc1468da177 379
<> 161:2cc1468da177 380 /** @defgroup USART_LL_EC_BITORDER Bit Order
<> 161:2cc1468da177 381 * @{
<> 161:2cc1468da177 382 */
<> 161:2cc1468da177 383 #define LL_USART_BITORDER_LSBFIRST 0x00000000U /*!< data is transmitted/received with data bit 0 first, following the start bit */
<> 161:2cc1468da177 384 #define LL_USART_BITORDER_MSBFIRST USART_CR2_MSBFIRST /*!< data is transmitted/received with the MSB first, following the start bit */
<> 161:2cc1468da177 385 /**
<> 161:2cc1468da177 386 * @}
<> 161:2cc1468da177 387 */
<> 161:2cc1468da177 388
<> 161:2cc1468da177 389 /** @defgroup USART_LL_EC_AUTOBAUD_DETECT_ON Autobaud Detection
<> 161:2cc1468da177 390 * @{
<> 161:2cc1468da177 391 */
<> 161:2cc1468da177 392 #define LL_USART_AUTOBAUD_DETECT_ON_STARTBIT 0x00000000U /*!< Measurement of the start bit is used to detect the baud rate */
<> 161:2cc1468da177 393 #define LL_USART_AUTOBAUD_DETECT_ON_FALLINGEDGE USART_CR2_ABRMODE_0 /*!< Falling edge to falling edge measurement. Received frame must start with a single bit = 1 -> Frame = Start10xxxxxx */
<> 161:2cc1468da177 394 #define LL_USART_AUTOBAUD_DETECT_ON_7F_FRAME USART_CR2_ABRMODE_1 /*!< 0x7F frame detection */
<> 161:2cc1468da177 395 #define LL_USART_AUTOBAUD_DETECT_ON_55_FRAME (USART_CR2_ABRMODE_1 | USART_CR2_ABRMODE_0) /*!< 0x55 frame detection */
<> 161:2cc1468da177 396 /**
<> 161:2cc1468da177 397 * @}
<> 161:2cc1468da177 398 */
<> 161:2cc1468da177 399
<> 161:2cc1468da177 400 /** @defgroup USART_LL_EC_ADDRESS_DETECT Address Length Detection
<> 161:2cc1468da177 401 * @{
<> 161:2cc1468da177 402 */
<> 161:2cc1468da177 403 #define LL_USART_ADDRESS_DETECT_4B 0x00000000U /*!< 4-bit address detection method selected */
<> 161:2cc1468da177 404 #define LL_USART_ADDRESS_DETECT_7B USART_CR2_ADDM7 /*!< 7-bit address detection (in 8-bit data mode) method selected */
<> 161:2cc1468da177 405 /**
<> 161:2cc1468da177 406 * @}
<> 161:2cc1468da177 407 */
<> 161:2cc1468da177 408
<> 161:2cc1468da177 409 /** @defgroup USART_LL_EC_HWCONTROL Hardware Control
<> 161:2cc1468da177 410 * @{
<> 161:2cc1468da177 411 */
<> 161:2cc1468da177 412 #define LL_USART_HWCONTROL_NONE 0x00000000U /*!< CTS and RTS hardware flow control disabled */
<> 161:2cc1468da177 413 #define LL_USART_HWCONTROL_RTS USART_CR3_RTSE /*!< RTS output enabled, data is only requested when there is space in the receive buffer */
<> 161:2cc1468da177 414 #define LL_USART_HWCONTROL_CTS USART_CR3_CTSE /*!< CTS mode enabled, data is only transmitted when the nCTS input is asserted (tied to 0) */
<> 161:2cc1468da177 415 #define LL_USART_HWCONTROL_RTS_CTS (USART_CR3_RTSE | USART_CR3_CTSE) /*!< CTS and RTS hardware flow control enabled */
<> 161:2cc1468da177 416 /**
<> 161:2cc1468da177 417 * @}
<> 161:2cc1468da177 418 */
<> 161:2cc1468da177 419
<> 161:2cc1468da177 420
<> 161:2cc1468da177 421 /** @defgroup USART_LL_EC_IRDA_POWER IrDA Power
<> 161:2cc1468da177 422 * @{
<> 161:2cc1468da177 423 */
<> 161:2cc1468da177 424 #define LL_USART_IRDA_POWER_NORMAL 0x00000000U /*!< IrDA normal power mode */
<> 161:2cc1468da177 425 #define LL_USART_IRDA_POWER_LOW USART_CR3_IRLP /*!< IrDA low power mode */
<> 161:2cc1468da177 426 /**
<> 161:2cc1468da177 427 * @}
<> 161:2cc1468da177 428 */
<> 161:2cc1468da177 429
<> 161:2cc1468da177 430 /** @defgroup USART_LL_EC_LINBREAK_DETECT LIN Break Detection Length
<> 161:2cc1468da177 431 * @{
<> 161:2cc1468da177 432 */
<> 161:2cc1468da177 433 #define LL_USART_LINBREAK_DETECT_10B 0x00000000U /*!< 10-bit break detection method selected */
<> 161:2cc1468da177 434 #define LL_USART_LINBREAK_DETECT_11B USART_CR2_LBDL /*!< 11-bit break detection method selected */
<> 161:2cc1468da177 435 /**
<> 161:2cc1468da177 436 * @}
<> 161:2cc1468da177 437 */
<> 161:2cc1468da177 438
<> 161:2cc1468da177 439 /** @defgroup USART_LL_EC_DE_POLARITY Driver Enable Polarity
<> 161:2cc1468da177 440 * @{
<> 161:2cc1468da177 441 */
<> 161:2cc1468da177 442 #define LL_USART_DE_POLARITY_HIGH 0x00000000U /*!< DE signal is active high */
<> 161:2cc1468da177 443 #define LL_USART_DE_POLARITY_LOW USART_CR3_DEP /*!< DE signal is active low */
<> 161:2cc1468da177 444 /**
<> 161:2cc1468da177 445 * @}
<> 161:2cc1468da177 446 */
<> 161:2cc1468da177 447
<> 161:2cc1468da177 448 /** @defgroup USART_LL_EC_DMA_REG_DATA DMA Register Data
<> 161:2cc1468da177 449 * @{
<> 161:2cc1468da177 450 */
<> 161:2cc1468da177 451 #define LL_USART_DMA_REG_DATA_TRANSMIT 0x00000000U /*!< Get address of data register used for transmission */
<> 161:2cc1468da177 452 #define LL_USART_DMA_REG_DATA_RECEIVE 0x00000001U /*!< Get address of data register used for reception */
<> 161:2cc1468da177 453 /**
<> 161:2cc1468da177 454 * @}
<> 161:2cc1468da177 455 */
<> 161:2cc1468da177 456
<> 161:2cc1468da177 457 /**
<> 161:2cc1468da177 458 * @}
<> 161:2cc1468da177 459 */
<> 161:2cc1468da177 460
<> 161:2cc1468da177 461 /* Exported macro ------------------------------------------------------------*/
<> 161:2cc1468da177 462 /** @defgroup USART_LL_Exported_Macros USART Exported Macros
<> 161:2cc1468da177 463 * @{
<> 161:2cc1468da177 464 */
<> 161:2cc1468da177 465
<> 161:2cc1468da177 466 /** @defgroup USART_LL_EM_WRITE_READ Common Write and read registers Macros
<> 161:2cc1468da177 467 * @{
<> 161:2cc1468da177 468 */
<> 161:2cc1468da177 469
<> 161:2cc1468da177 470 /**
<> 161:2cc1468da177 471 * @brief Write a value in USART register
<> 161:2cc1468da177 472 * @param __INSTANCE__ USART Instance
<> 161:2cc1468da177 473 * @param __REG__ Register to be written
<> 161:2cc1468da177 474 * @param __VALUE__ Value to be written in the register
<> 161:2cc1468da177 475 * @retval None
<> 161:2cc1468da177 476 */
<> 161:2cc1468da177 477 #define LL_USART_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
<> 161:2cc1468da177 478
<> 161:2cc1468da177 479 /**
<> 161:2cc1468da177 480 * @brief Read a value in USART register
<> 161:2cc1468da177 481 * @param __INSTANCE__ USART Instance
<> 161:2cc1468da177 482 * @param __REG__ Register to be read
<> 161:2cc1468da177 483 * @retval Register value
<> 161:2cc1468da177 484 */
<> 161:2cc1468da177 485 #define LL_USART_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
<> 161:2cc1468da177 486 /**
<> 161:2cc1468da177 487 * @}
<> 161:2cc1468da177 488 */
<> 161:2cc1468da177 489
<> 161:2cc1468da177 490 /** @defgroup USART_LL_EM_Exported_Macros_Helper Exported_Macros_Helper
<> 161:2cc1468da177 491 * @{
<> 161:2cc1468da177 492 */
<> 161:2cc1468da177 493
<> 161:2cc1468da177 494 /**
<> 161:2cc1468da177 495 * @brief Compute USARTDIV value according to Peripheral Clock and
<> 161:2cc1468da177 496 * expected Baud Rate in 8 bits sampling mode (32 bits value of USARTDIV is returned)
<> 161:2cc1468da177 497 * @param __PERIPHCLK__ Peripheral Clock frequency used for USART instance
<> 161:2cc1468da177 498 * @param __BAUDRATE__ Baud rate value to achieve
<> 161:2cc1468da177 499 * @retval USARTDIV value to be used for BRR register filling in OverSampling_8 case
<> 161:2cc1468da177 500 */
<> 161:2cc1468da177 501 #define __LL_USART_DIV_SAMPLING8(__PERIPHCLK__, __BAUDRATE__) ((((__PERIPHCLK__)*2) + ((__BAUDRATE__)/2))/(__BAUDRATE__))
<> 161:2cc1468da177 502
<> 161:2cc1468da177 503 /**
<> 161:2cc1468da177 504 * @brief Compute USARTDIV value according to Peripheral Clock and
<> 161:2cc1468da177 505 * expected Baud Rate in 16 bits sampling mode (32 bits value of USARTDIV is returned)
<> 161:2cc1468da177 506 * @param __PERIPHCLK__ Peripheral Clock frequency used for USART instance
<> 161:2cc1468da177 507 * @param __BAUDRATE__ Baud rate value to achieve
<> 161:2cc1468da177 508 * @retval USARTDIV value to be used for BRR register filling in OverSampling_16 case
<> 161:2cc1468da177 509 */
<> 161:2cc1468da177 510 #define __LL_USART_DIV_SAMPLING16(__PERIPHCLK__, __BAUDRATE__) (((__PERIPHCLK__) + ((__BAUDRATE__)/2))/(__BAUDRATE__))
<> 161:2cc1468da177 511
<> 161:2cc1468da177 512 /**
<> 161:2cc1468da177 513 * @}
<> 161:2cc1468da177 514 */
<> 161:2cc1468da177 515
<> 161:2cc1468da177 516 /**
<> 161:2cc1468da177 517 * @}
<> 161:2cc1468da177 518 */
<> 161:2cc1468da177 519
<> 161:2cc1468da177 520 /* Exported functions --------------------------------------------------------*/
<> 161:2cc1468da177 521
<> 161:2cc1468da177 522 /** @defgroup USART_LL_Exported_Functions USART Exported Functions
<> 161:2cc1468da177 523 * @{
<> 161:2cc1468da177 524 */
<> 161:2cc1468da177 525
<> 161:2cc1468da177 526 /** @defgroup USART_LL_EF_Configuration Configuration functions
<> 161:2cc1468da177 527 * @{
<> 161:2cc1468da177 528 */
<> 161:2cc1468da177 529
<> 161:2cc1468da177 530 /**
<> 161:2cc1468da177 531 * @brief USART Enable
<> 161:2cc1468da177 532 * @rmtoll CR1 UE LL_USART_Enable
<> 161:2cc1468da177 533 * @param USARTx USART Instance
<> 161:2cc1468da177 534 * @retval None
<> 161:2cc1468da177 535 */
<> 161:2cc1468da177 536 __STATIC_INLINE void LL_USART_Enable(USART_TypeDef *USARTx)
<> 161:2cc1468da177 537 {
<> 161:2cc1468da177 538 SET_BIT(USARTx->CR1, USART_CR1_UE);
<> 161:2cc1468da177 539 }
<> 161:2cc1468da177 540
<> 161:2cc1468da177 541 /**
<> 161:2cc1468da177 542 * @brief USART Disable (all USART prescalers and outputs are disabled)
<> 161:2cc1468da177 543 * @note When USART is disabled, USART prescalers and outputs are stopped immediately,
<> 161:2cc1468da177 544 * and current operations are discarded. The configuration of the USART is kept, but all the status
<> 161:2cc1468da177 545 * flags, in the USARTx_ISR are set to their default values.
<> 161:2cc1468da177 546 * @rmtoll CR1 UE LL_USART_Disable
<> 161:2cc1468da177 547 * @param USARTx USART Instance
<> 161:2cc1468da177 548 * @retval None
<> 161:2cc1468da177 549 */
<> 161:2cc1468da177 550 __STATIC_INLINE void LL_USART_Disable(USART_TypeDef *USARTx)
<> 161:2cc1468da177 551 {
<> 161:2cc1468da177 552 CLEAR_BIT(USARTx->CR1, USART_CR1_UE);
<> 161:2cc1468da177 553 }
<> 161:2cc1468da177 554
<> 161:2cc1468da177 555 /**
<> 161:2cc1468da177 556 * @brief Indicate if USART is enabled
<> 161:2cc1468da177 557 * @rmtoll CR1 UE LL_USART_IsEnabled
<> 161:2cc1468da177 558 * @param USARTx USART Instance
<> 161:2cc1468da177 559 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 560 */
<> 161:2cc1468da177 561 __STATIC_INLINE uint32_t LL_USART_IsEnabled(USART_TypeDef *USARTx)
<> 161:2cc1468da177 562 {
<> 161:2cc1468da177 563 return (READ_BIT(USARTx->CR1, USART_CR1_UE) == (USART_CR1_UE));
<> 161:2cc1468da177 564 }
<> 161:2cc1468da177 565
<> 161:2cc1468da177 566
<> 161:2cc1468da177 567 /**
<> 161:2cc1468da177 568 * @brief Receiver Enable (Receiver is enabled and begins searching for a start bit)
<> 161:2cc1468da177 569 * @rmtoll CR1 RE LL_USART_EnableDirectionRx
<> 161:2cc1468da177 570 * @param USARTx USART Instance
<> 161:2cc1468da177 571 * @retval None
<> 161:2cc1468da177 572 */
<> 161:2cc1468da177 573 __STATIC_INLINE void LL_USART_EnableDirectionRx(USART_TypeDef *USARTx)
<> 161:2cc1468da177 574 {
<> 161:2cc1468da177 575 SET_BIT(USARTx->CR1, USART_CR1_RE);
<> 161:2cc1468da177 576 }
<> 161:2cc1468da177 577
<> 161:2cc1468da177 578 /**
<> 161:2cc1468da177 579 * @brief Receiver Disable
<> 161:2cc1468da177 580 * @rmtoll CR1 RE LL_USART_DisableDirectionRx
<> 161:2cc1468da177 581 * @param USARTx USART Instance
<> 161:2cc1468da177 582 * @retval None
<> 161:2cc1468da177 583 */
<> 161:2cc1468da177 584 __STATIC_INLINE void LL_USART_DisableDirectionRx(USART_TypeDef *USARTx)
<> 161:2cc1468da177 585 {
<> 161:2cc1468da177 586 CLEAR_BIT(USARTx->CR1, USART_CR1_RE);
<> 161:2cc1468da177 587 }
<> 161:2cc1468da177 588
<> 161:2cc1468da177 589 /**
<> 161:2cc1468da177 590 * @brief Transmitter Enable
<> 161:2cc1468da177 591 * @rmtoll CR1 TE LL_USART_EnableDirectionTx
<> 161:2cc1468da177 592 * @param USARTx USART Instance
<> 161:2cc1468da177 593 * @retval None
<> 161:2cc1468da177 594 */
<> 161:2cc1468da177 595 __STATIC_INLINE void LL_USART_EnableDirectionTx(USART_TypeDef *USARTx)
<> 161:2cc1468da177 596 {
<> 161:2cc1468da177 597 SET_BIT(USARTx->CR1, USART_CR1_TE);
<> 161:2cc1468da177 598 }
<> 161:2cc1468da177 599
<> 161:2cc1468da177 600 /**
<> 161:2cc1468da177 601 * @brief Transmitter Disable
<> 161:2cc1468da177 602 * @rmtoll CR1 TE LL_USART_DisableDirectionTx
<> 161:2cc1468da177 603 * @param USARTx USART Instance
<> 161:2cc1468da177 604 * @retval None
<> 161:2cc1468da177 605 */
<> 161:2cc1468da177 606 __STATIC_INLINE void LL_USART_DisableDirectionTx(USART_TypeDef *USARTx)
<> 161:2cc1468da177 607 {
<> 161:2cc1468da177 608 CLEAR_BIT(USARTx->CR1, USART_CR1_TE);
<> 161:2cc1468da177 609 }
<> 161:2cc1468da177 610
<> 161:2cc1468da177 611 /**
<> 161:2cc1468da177 612 * @brief Configure simultaneously enabled/disabled states
<> 161:2cc1468da177 613 * of Transmitter and Receiver
<> 161:2cc1468da177 614 * @rmtoll CR1 RE LL_USART_SetTransferDirection\n
<> 161:2cc1468da177 615 * CR1 TE LL_USART_SetTransferDirection
<> 161:2cc1468da177 616 * @param USARTx USART Instance
<> 161:2cc1468da177 617 * @param TransferDirection This parameter can be one of the following values:
<> 161:2cc1468da177 618 * @arg @ref LL_USART_DIRECTION_NONE
<> 161:2cc1468da177 619 * @arg @ref LL_USART_DIRECTION_RX
<> 161:2cc1468da177 620 * @arg @ref LL_USART_DIRECTION_TX
<> 161:2cc1468da177 621 * @arg @ref LL_USART_DIRECTION_TX_RX
<> 161:2cc1468da177 622 * @retval None
<> 161:2cc1468da177 623 */
<> 161:2cc1468da177 624 __STATIC_INLINE void LL_USART_SetTransferDirection(USART_TypeDef *USARTx, uint32_t TransferDirection)
<> 161:2cc1468da177 625 {
<> 161:2cc1468da177 626 MODIFY_REG(USARTx->CR1, USART_CR1_RE | USART_CR1_TE, TransferDirection);
<> 161:2cc1468da177 627 }
<> 161:2cc1468da177 628
<> 161:2cc1468da177 629 /**
<> 161:2cc1468da177 630 * @brief Return enabled/disabled states of Transmitter and Receiver
<> 161:2cc1468da177 631 * @rmtoll CR1 RE LL_USART_GetTransferDirection\n
<> 161:2cc1468da177 632 * CR1 TE LL_USART_GetTransferDirection
<> 161:2cc1468da177 633 * @param USARTx USART Instance
<> 161:2cc1468da177 634 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 635 * @arg @ref LL_USART_DIRECTION_NONE
<> 161:2cc1468da177 636 * @arg @ref LL_USART_DIRECTION_RX
<> 161:2cc1468da177 637 * @arg @ref LL_USART_DIRECTION_TX
<> 161:2cc1468da177 638 * @arg @ref LL_USART_DIRECTION_TX_RX
<> 161:2cc1468da177 639 */
<> 161:2cc1468da177 640 __STATIC_INLINE uint32_t LL_USART_GetTransferDirection(USART_TypeDef *USARTx)
<> 161:2cc1468da177 641 {
<> 161:2cc1468da177 642 return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_RE | USART_CR1_TE));
<> 161:2cc1468da177 643 }
<> 161:2cc1468da177 644
<> 161:2cc1468da177 645 /**
<> 161:2cc1468da177 646 * @brief Configure Parity (enabled/disabled and parity mode if enabled).
<> 161:2cc1468da177 647 * @note This function selects if hardware parity control (generation and detection) is enabled or disabled.
<> 161:2cc1468da177 648 * When the parity control is enabled (Odd or Even), computed parity bit is inserted at the MSB position
<> 161:2cc1468da177 649 * (9th or 8th bit depending on data width) and parity is checked on the received data.
<> 161:2cc1468da177 650 * @rmtoll CR1 PS LL_USART_SetParity\n
<> 161:2cc1468da177 651 * CR1 PCE LL_USART_SetParity
<> 161:2cc1468da177 652 * @param USARTx USART Instance
<> 161:2cc1468da177 653 * @param Parity This parameter can be one of the following values:
<> 161:2cc1468da177 654 * @arg @ref LL_USART_PARITY_NONE
<> 161:2cc1468da177 655 * @arg @ref LL_USART_PARITY_EVEN
<> 161:2cc1468da177 656 * @arg @ref LL_USART_PARITY_ODD
<> 161:2cc1468da177 657 * @retval None
<> 161:2cc1468da177 658 */
<> 161:2cc1468da177 659 __STATIC_INLINE void LL_USART_SetParity(USART_TypeDef *USARTx, uint32_t Parity)
<> 161:2cc1468da177 660 {
<> 161:2cc1468da177 661 MODIFY_REG(USARTx->CR1, USART_CR1_PS | USART_CR1_PCE, Parity);
<> 161:2cc1468da177 662 }
<> 161:2cc1468da177 663
<> 161:2cc1468da177 664 /**
<> 161:2cc1468da177 665 * @brief Return Parity configuration (enabled/disabled and parity mode if enabled)
<> 161:2cc1468da177 666 * @rmtoll CR1 PS LL_USART_GetParity\n
<> 161:2cc1468da177 667 * CR1 PCE LL_USART_GetParity
<> 161:2cc1468da177 668 * @param USARTx USART Instance
<> 161:2cc1468da177 669 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 670 * @arg @ref LL_USART_PARITY_NONE
<> 161:2cc1468da177 671 * @arg @ref LL_USART_PARITY_EVEN
<> 161:2cc1468da177 672 * @arg @ref LL_USART_PARITY_ODD
<> 161:2cc1468da177 673 */
<> 161:2cc1468da177 674 __STATIC_INLINE uint32_t LL_USART_GetParity(USART_TypeDef *USARTx)
<> 161:2cc1468da177 675 {
<> 161:2cc1468da177 676 return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_PS | USART_CR1_PCE));
<> 161:2cc1468da177 677 }
<> 161:2cc1468da177 678
<> 161:2cc1468da177 679 /**
<> 161:2cc1468da177 680 * @brief Set Receiver Wake Up method from Mute mode.
<> 161:2cc1468da177 681 * @rmtoll CR1 WAKE LL_USART_SetWakeUpMethod
<> 161:2cc1468da177 682 * @param USARTx USART Instance
<> 161:2cc1468da177 683 * @param Method This parameter can be one of the following values:
<> 161:2cc1468da177 684 * @arg @ref LL_USART_WAKEUP_IDLELINE
<> 161:2cc1468da177 685 * @arg @ref LL_USART_WAKEUP_ADDRESSMARK
<> 161:2cc1468da177 686 * @retval None
<> 161:2cc1468da177 687 */
<> 161:2cc1468da177 688 __STATIC_INLINE void LL_USART_SetWakeUpMethod(USART_TypeDef *USARTx, uint32_t Method)
<> 161:2cc1468da177 689 {
<> 161:2cc1468da177 690 MODIFY_REG(USARTx->CR1, USART_CR1_WAKE, Method);
<> 161:2cc1468da177 691 }
<> 161:2cc1468da177 692
<> 161:2cc1468da177 693 /**
<> 161:2cc1468da177 694 * @brief Return Receiver Wake Up method from Mute mode
<> 161:2cc1468da177 695 * @rmtoll CR1 WAKE LL_USART_GetWakeUpMethod
<> 161:2cc1468da177 696 * @param USARTx USART Instance
<> 161:2cc1468da177 697 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 698 * @arg @ref LL_USART_WAKEUP_IDLELINE
<> 161:2cc1468da177 699 * @arg @ref LL_USART_WAKEUP_ADDRESSMARK
<> 161:2cc1468da177 700 */
<> 161:2cc1468da177 701 __STATIC_INLINE uint32_t LL_USART_GetWakeUpMethod(USART_TypeDef *USARTx)
<> 161:2cc1468da177 702 {
<> 161:2cc1468da177 703 return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_WAKE));
<> 161:2cc1468da177 704 }
<> 161:2cc1468da177 705
<> 161:2cc1468da177 706 /**
<> 161:2cc1468da177 707 * @brief Set Word length (i.e. nb of data bits, excluding start and stop bits)
<> 161:2cc1468da177 708 * @rmtoll CR1 M0 LL_USART_SetDataWidth\n
<> 161:2cc1468da177 709 * CR1 M1 LL_USART_SetDataWidth
<> 161:2cc1468da177 710 * @param USARTx USART Instance
<> 161:2cc1468da177 711 * @param DataWidth This parameter can be one of the following values:
<> 161:2cc1468da177 712 * @arg @ref LL_USART_DATAWIDTH_7B
<> 161:2cc1468da177 713 * @arg @ref LL_USART_DATAWIDTH_8B
<> 161:2cc1468da177 714 * @arg @ref LL_USART_DATAWIDTH_9B
<> 161:2cc1468da177 715 * @retval None
<> 161:2cc1468da177 716 */
<> 161:2cc1468da177 717 __STATIC_INLINE void LL_USART_SetDataWidth(USART_TypeDef *USARTx, uint32_t DataWidth)
<> 161:2cc1468da177 718 {
<> 161:2cc1468da177 719 MODIFY_REG(USARTx->CR1, USART_CR1_M, DataWidth);
<> 161:2cc1468da177 720 }
<> 161:2cc1468da177 721
<> 161:2cc1468da177 722 /**
<> 161:2cc1468da177 723 * @brief Return Word length (i.e. nb of data bits, excluding start and stop bits)
<> 161:2cc1468da177 724 * @rmtoll CR1 M0 LL_USART_GetDataWidth\n
<> 161:2cc1468da177 725 * CR1 M1 LL_USART_GetDataWidth
<> 161:2cc1468da177 726 * @param USARTx USART Instance
<> 161:2cc1468da177 727 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 728 * @arg @ref LL_USART_DATAWIDTH_7B
<> 161:2cc1468da177 729 * @arg @ref LL_USART_DATAWIDTH_8B
<> 161:2cc1468da177 730 * @arg @ref LL_USART_DATAWIDTH_9B
<> 161:2cc1468da177 731 */
<> 161:2cc1468da177 732 __STATIC_INLINE uint32_t LL_USART_GetDataWidth(USART_TypeDef *USARTx)
<> 161:2cc1468da177 733 {
<> 161:2cc1468da177 734 return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_M));
<> 161:2cc1468da177 735 }
<> 161:2cc1468da177 736
<> 161:2cc1468da177 737 /**
<> 161:2cc1468da177 738 * @brief Allow switch between Mute Mode and Active mode
<> 161:2cc1468da177 739 * @rmtoll CR1 MME LL_USART_EnableMuteMode
<> 161:2cc1468da177 740 * @param USARTx USART Instance
<> 161:2cc1468da177 741 * @retval None
<> 161:2cc1468da177 742 */
<> 161:2cc1468da177 743 __STATIC_INLINE void LL_USART_EnableMuteMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 744 {
<> 161:2cc1468da177 745 SET_BIT(USARTx->CR1, USART_CR1_MME);
<> 161:2cc1468da177 746 }
<> 161:2cc1468da177 747
<> 161:2cc1468da177 748 /**
<> 161:2cc1468da177 749 * @brief Prevent Mute Mode use. Set Receiver in active mode permanently.
<> 161:2cc1468da177 750 * @rmtoll CR1 MME LL_USART_DisableMuteMode
<> 161:2cc1468da177 751 * @param USARTx USART Instance
<> 161:2cc1468da177 752 * @retval None
<> 161:2cc1468da177 753 */
<> 161:2cc1468da177 754 __STATIC_INLINE void LL_USART_DisableMuteMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 755 {
<> 161:2cc1468da177 756 CLEAR_BIT(USARTx->CR1, USART_CR1_MME);
<> 161:2cc1468da177 757 }
<> 161:2cc1468da177 758
<> 161:2cc1468da177 759 /**
<> 161:2cc1468da177 760 * @brief Indicate if switch between Mute Mode and Active mode is allowed
<> 161:2cc1468da177 761 * @rmtoll CR1 MME LL_USART_IsEnabledMuteMode
<> 161:2cc1468da177 762 * @param USARTx USART Instance
<> 161:2cc1468da177 763 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 764 */
<> 161:2cc1468da177 765 __STATIC_INLINE uint32_t LL_USART_IsEnabledMuteMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 766 {
<> 161:2cc1468da177 767 return (READ_BIT(USARTx->CR1, USART_CR1_MME) == (USART_CR1_MME));
<> 161:2cc1468da177 768 }
<> 161:2cc1468da177 769
<> 161:2cc1468da177 770 /**
<> 161:2cc1468da177 771 * @brief Set Oversampling to 8-bit or 16-bit mode
<> 161:2cc1468da177 772 * @rmtoll CR1 OVER8 LL_USART_SetOverSampling
<> 161:2cc1468da177 773 * @param USARTx USART Instance
<> 161:2cc1468da177 774 * @param OverSampling This parameter can be one of the following values:
<> 161:2cc1468da177 775 * @arg @ref LL_USART_OVERSAMPLING_16
<> 161:2cc1468da177 776 * @arg @ref LL_USART_OVERSAMPLING_8
<> 161:2cc1468da177 777 * @retval None
<> 161:2cc1468da177 778 */
<> 161:2cc1468da177 779 __STATIC_INLINE void LL_USART_SetOverSampling(USART_TypeDef *USARTx, uint32_t OverSampling)
<> 161:2cc1468da177 780 {
<> 161:2cc1468da177 781 MODIFY_REG(USARTx->CR1, USART_CR1_OVER8, OverSampling);
<> 161:2cc1468da177 782 }
<> 161:2cc1468da177 783
<> 161:2cc1468da177 784 /**
<> 161:2cc1468da177 785 * @brief Return Oversampling mode
<> 161:2cc1468da177 786 * @rmtoll CR1 OVER8 LL_USART_GetOverSampling
<> 161:2cc1468da177 787 * @param USARTx USART Instance
<> 161:2cc1468da177 788 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 789 * @arg @ref LL_USART_OVERSAMPLING_16
<> 161:2cc1468da177 790 * @arg @ref LL_USART_OVERSAMPLING_8
<> 161:2cc1468da177 791 */
<> 161:2cc1468da177 792 __STATIC_INLINE uint32_t LL_USART_GetOverSampling(USART_TypeDef *USARTx)
<> 161:2cc1468da177 793 {
<> 161:2cc1468da177 794 return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_OVER8));
<> 161:2cc1468da177 795 }
<> 161:2cc1468da177 796
<> 161:2cc1468da177 797 /**
<> 161:2cc1468da177 798 * @brief Configure if Clock pulse of the last data bit is output to the SCLK pin or not
<> 161:2cc1468da177 799 * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 800 * Synchronous mode is supported by the USARTx instance.
<> 161:2cc1468da177 801 * @rmtoll CR2 LBCL LL_USART_SetLastClkPulseOutput
<> 161:2cc1468da177 802 * @param USARTx USART Instance
<> 161:2cc1468da177 803 * @param LastBitClockPulse This parameter can be one of the following values:
<> 161:2cc1468da177 804 * @arg @ref LL_USART_LASTCLKPULSE_NO_OUTPUT
<> 161:2cc1468da177 805 * @arg @ref LL_USART_LASTCLKPULSE_OUTPUT
<> 161:2cc1468da177 806 * @retval None
<> 161:2cc1468da177 807 */
<> 161:2cc1468da177 808 __STATIC_INLINE void LL_USART_SetLastClkPulseOutput(USART_TypeDef *USARTx, uint32_t LastBitClockPulse)
<> 161:2cc1468da177 809 {
<> 161:2cc1468da177 810 MODIFY_REG(USARTx->CR2, USART_CR2_LBCL, LastBitClockPulse);
<> 161:2cc1468da177 811 }
<> 161:2cc1468da177 812
<> 161:2cc1468da177 813 /**
<> 161:2cc1468da177 814 * @brief Retrieve Clock pulse of the last data bit output configuration
<> 161:2cc1468da177 815 * (Last bit Clock pulse output to the SCLK pin or not)
<> 161:2cc1468da177 816 * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 817 * Synchronous mode is supported by the USARTx instance.
<> 161:2cc1468da177 818 * @rmtoll CR2 LBCL LL_USART_GetLastClkPulseOutput
<> 161:2cc1468da177 819 * @param USARTx USART Instance
<> 161:2cc1468da177 820 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 821 * @arg @ref LL_USART_LASTCLKPULSE_NO_OUTPUT
<> 161:2cc1468da177 822 * @arg @ref LL_USART_LASTCLKPULSE_OUTPUT
<> 161:2cc1468da177 823 */
<> 161:2cc1468da177 824 __STATIC_INLINE uint32_t LL_USART_GetLastClkPulseOutput(USART_TypeDef *USARTx)
<> 161:2cc1468da177 825 {
<> 161:2cc1468da177 826 return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_LBCL));
<> 161:2cc1468da177 827 }
<> 161:2cc1468da177 828
<> 161:2cc1468da177 829 /**
<> 161:2cc1468da177 830 * @brief Select the phase of the clock output on the SCLK pin in synchronous mode
<> 161:2cc1468da177 831 * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 832 * Synchronous mode is supported by the USARTx instance.
<> 161:2cc1468da177 833 * @rmtoll CR2 CPHA LL_USART_SetClockPhase
<> 161:2cc1468da177 834 * @param USARTx USART Instance
<> 161:2cc1468da177 835 * @param ClockPhase This parameter can be one of the following values:
<> 161:2cc1468da177 836 * @arg @ref LL_USART_PHASE_1EDGE
<> 161:2cc1468da177 837 * @arg @ref LL_USART_PHASE_2EDGE
<> 161:2cc1468da177 838 * @retval None
<> 161:2cc1468da177 839 */
<> 161:2cc1468da177 840 __STATIC_INLINE void LL_USART_SetClockPhase(USART_TypeDef *USARTx, uint32_t ClockPhase)
<> 161:2cc1468da177 841 {
<> 161:2cc1468da177 842 MODIFY_REG(USARTx->CR2, USART_CR2_CPHA, ClockPhase);
<> 161:2cc1468da177 843 }
<> 161:2cc1468da177 844
<> 161:2cc1468da177 845 /**
<> 161:2cc1468da177 846 * @brief Return phase of the clock output on the SCLK pin in synchronous mode
<> 161:2cc1468da177 847 * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 848 * Synchronous mode is supported by the USARTx instance.
<> 161:2cc1468da177 849 * @rmtoll CR2 CPHA LL_USART_GetClockPhase
<> 161:2cc1468da177 850 * @param USARTx USART Instance
<> 161:2cc1468da177 851 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 852 * @arg @ref LL_USART_PHASE_1EDGE
<> 161:2cc1468da177 853 * @arg @ref LL_USART_PHASE_2EDGE
<> 161:2cc1468da177 854 */
<> 161:2cc1468da177 855 __STATIC_INLINE uint32_t LL_USART_GetClockPhase(USART_TypeDef *USARTx)
<> 161:2cc1468da177 856 {
<> 161:2cc1468da177 857 return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_CPHA));
<> 161:2cc1468da177 858 }
<> 161:2cc1468da177 859
<> 161:2cc1468da177 860 /**
<> 161:2cc1468da177 861 * @brief Select the polarity of the clock output on the SCLK pin in synchronous mode
<> 161:2cc1468da177 862 * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 863 * Synchronous mode is supported by the USARTx instance.
<> 161:2cc1468da177 864 * @rmtoll CR2 CPOL LL_USART_SetClockPolarity
<> 161:2cc1468da177 865 * @param USARTx USART Instance
<> 161:2cc1468da177 866 * @param ClockPolarity This parameter can be one of the following values:
<> 161:2cc1468da177 867 * @arg @ref LL_USART_POLARITY_LOW
<> 161:2cc1468da177 868 * @arg @ref LL_USART_POLARITY_HIGH
<> 161:2cc1468da177 869 * @retval None
<> 161:2cc1468da177 870 */
<> 161:2cc1468da177 871 __STATIC_INLINE void LL_USART_SetClockPolarity(USART_TypeDef *USARTx, uint32_t ClockPolarity)
<> 161:2cc1468da177 872 {
<> 161:2cc1468da177 873 MODIFY_REG(USARTx->CR2, USART_CR2_CPOL, ClockPolarity);
<> 161:2cc1468da177 874 }
<> 161:2cc1468da177 875
<> 161:2cc1468da177 876 /**
<> 161:2cc1468da177 877 * @brief Return polarity of the clock output on the SCLK pin in synchronous mode
<> 161:2cc1468da177 878 * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 879 * Synchronous mode is supported by the USARTx instance.
<> 161:2cc1468da177 880 * @rmtoll CR2 CPOL LL_USART_GetClockPolarity
<> 161:2cc1468da177 881 * @param USARTx USART Instance
<> 161:2cc1468da177 882 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 883 * @arg @ref LL_USART_POLARITY_LOW
<> 161:2cc1468da177 884 * @arg @ref LL_USART_POLARITY_HIGH
<> 161:2cc1468da177 885 */
<> 161:2cc1468da177 886 __STATIC_INLINE uint32_t LL_USART_GetClockPolarity(USART_TypeDef *USARTx)
<> 161:2cc1468da177 887 {
<> 161:2cc1468da177 888 return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_CPOL));
<> 161:2cc1468da177 889 }
<> 161:2cc1468da177 890
<> 161:2cc1468da177 891 /**
<> 161:2cc1468da177 892 * @brief Configure Clock signal format (Phase Polarity and choice about output of last bit clock pulse)
<> 161:2cc1468da177 893 * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 894 * Synchronous mode is supported by the USARTx instance.
<> 161:2cc1468da177 895 * @note Call of this function is equivalent to following function call sequence :
<> 161:2cc1468da177 896 * - Clock Phase configuration using @ref LL_USART_SetClockPhase() function
<> 161:2cc1468da177 897 * - Clock Polarity configuration using @ref LL_USART_SetClockPolarity() function
<> 161:2cc1468da177 898 * - Output of Last bit Clock pulse configuration using @ref LL_USART_SetLastClkPulseOutput() function
<> 161:2cc1468da177 899 * @rmtoll CR2 CPHA LL_USART_ConfigClock\n
<> 161:2cc1468da177 900 * CR2 CPOL LL_USART_ConfigClock\n
<> 161:2cc1468da177 901 * CR2 LBCL LL_USART_ConfigClock
<> 161:2cc1468da177 902 * @param USARTx USART Instance
<> 161:2cc1468da177 903 * @param Phase This parameter can be one of the following values:
<> 161:2cc1468da177 904 * @arg @ref LL_USART_PHASE_1EDGE
<> 161:2cc1468da177 905 * @arg @ref LL_USART_PHASE_2EDGE
<> 161:2cc1468da177 906 * @param Polarity This parameter can be one of the following values:
<> 161:2cc1468da177 907 * @arg @ref LL_USART_POLARITY_LOW
<> 161:2cc1468da177 908 * @arg @ref LL_USART_POLARITY_HIGH
<> 161:2cc1468da177 909 * @param LBCPOutput This parameter can be one of the following values:
<> 161:2cc1468da177 910 * @arg @ref LL_USART_LASTCLKPULSE_NO_OUTPUT
<> 161:2cc1468da177 911 * @arg @ref LL_USART_LASTCLKPULSE_OUTPUT
<> 161:2cc1468da177 912 * @retval None
<> 161:2cc1468da177 913 */
<> 161:2cc1468da177 914 __STATIC_INLINE void LL_USART_ConfigClock(USART_TypeDef *USARTx, uint32_t Phase, uint32_t Polarity, uint32_t LBCPOutput)
<> 161:2cc1468da177 915 {
<> 161:2cc1468da177 916 MODIFY_REG(USARTx->CR2, USART_CR2_CPHA | USART_CR2_CPOL | USART_CR2_LBCL, Phase | Polarity | LBCPOutput);
<> 161:2cc1468da177 917 }
<> 161:2cc1468da177 918
<> 161:2cc1468da177 919 /**
<> 161:2cc1468da177 920 * @brief Enable Clock output on SCLK pin
<> 161:2cc1468da177 921 * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 922 * Synchronous mode is supported by the USARTx instance.
<> 161:2cc1468da177 923 * @rmtoll CR2 CLKEN LL_USART_EnableSCLKOutput
<> 161:2cc1468da177 924 * @param USARTx USART Instance
<> 161:2cc1468da177 925 * @retval None
<> 161:2cc1468da177 926 */
<> 161:2cc1468da177 927 __STATIC_INLINE void LL_USART_EnableSCLKOutput(USART_TypeDef *USARTx)
<> 161:2cc1468da177 928 {
<> 161:2cc1468da177 929 SET_BIT(USARTx->CR2, USART_CR2_CLKEN);
<> 161:2cc1468da177 930 }
<> 161:2cc1468da177 931
<> 161:2cc1468da177 932 /**
<> 161:2cc1468da177 933 * @brief Disable Clock output on SCLK pin
<> 161:2cc1468da177 934 * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 935 * Synchronous mode is supported by the USARTx instance.
<> 161:2cc1468da177 936 * @rmtoll CR2 CLKEN LL_USART_DisableSCLKOutput
<> 161:2cc1468da177 937 * @param USARTx USART Instance
<> 161:2cc1468da177 938 * @retval None
<> 161:2cc1468da177 939 */
<> 161:2cc1468da177 940 __STATIC_INLINE void LL_USART_DisableSCLKOutput(USART_TypeDef *USARTx)
<> 161:2cc1468da177 941 {
<> 161:2cc1468da177 942 CLEAR_BIT(USARTx->CR2, USART_CR2_CLKEN);
<> 161:2cc1468da177 943 }
<> 161:2cc1468da177 944
<> 161:2cc1468da177 945 /**
<> 161:2cc1468da177 946 * @brief Indicate if Clock output on SCLK pin is enabled
<> 161:2cc1468da177 947 * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 948 * Synchronous mode is supported by the USARTx instance.
<> 161:2cc1468da177 949 * @rmtoll CR2 CLKEN LL_USART_IsEnabledSCLKOutput
<> 161:2cc1468da177 950 * @param USARTx USART Instance
<> 161:2cc1468da177 951 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 952 */
<> 161:2cc1468da177 953 __STATIC_INLINE uint32_t LL_USART_IsEnabledSCLKOutput(USART_TypeDef *USARTx)
<> 161:2cc1468da177 954 {
<> 161:2cc1468da177 955 return (READ_BIT(USARTx->CR2, USART_CR2_CLKEN) == (USART_CR2_CLKEN));
<> 161:2cc1468da177 956 }
<> 161:2cc1468da177 957
<> 161:2cc1468da177 958 /**
<> 161:2cc1468da177 959 * @brief Set the length of the stop bits
<> 161:2cc1468da177 960 * @rmtoll CR2 STOP LL_USART_SetStopBitsLength
<> 161:2cc1468da177 961 * @param USARTx USART Instance
<> 161:2cc1468da177 962 * @param StopBits This parameter can be one of the following values:
<> 161:2cc1468da177 963 * @arg @ref LL_USART_STOPBITS_0_5
<> 161:2cc1468da177 964 * @arg @ref LL_USART_STOPBITS_1
<> 161:2cc1468da177 965 * @arg @ref LL_USART_STOPBITS_1_5
<> 161:2cc1468da177 966 * @arg @ref LL_USART_STOPBITS_2
<> 161:2cc1468da177 967 * @retval None
<> 161:2cc1468da177 968 */
<> 161:2cc1468da177 969 __STATIC_INLINE void LL_USART_SetStopBitsLength(USART_TypeDef *USARTx, uint32_t StopBits)
<> 161:2cc1468da177 970 {
<> 161:2cc1468da177 971 MODIFY_REG(USARTx->CR2, USART_CR2_STOP, StopBits);
<> 161:2cc1468da177 972 }
<> 161:2cc1468da177 973
<> 161:2cc1468da177 974 /**
<> 161:2cc1468da177 975 * @brief Retrieve the length of the stop bits
<> 161:2cc1468da177 976 * @rmtoll CR2 STOP LL_USART_GetStopBitsLength
<> 161:2cc1468da177 977 * @param USARTx USART Instance
<> 161:2cc1468da177 978 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 979 * @arg @ref LL_USART_STOPBITS_0_5
<> 161:2cc1468da177 980 * @arg @ref LL_USART_STOPBITS_1
<> 161:2cc1468da177 981 * @arg @ref LL_USART_STOPBITS_1_5
<> 161:2cc1468da177 982 * @arg @ref LL_USART_STOPBITS_2
<> 161:2cc1468da177 983 */
<> 161:2cc1468da177 984 __STATIC_INLINE uint32_t LL_USART_GetStopBitsLength(USART_TypeDef *USARTx)
<> 161:2cc1468da177 985 {
<> 161:2cc1468da177 986 return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_STOP));
<> 161:2cc1468da177 987 }
<> 161:2cc1468da177 988
<> 161:2cc1468da177 989 /**
<> 161:2cc1468da177 990 * @brief Configure Character frame format (Datawidth, Parity control, Stop Bits)
<> 161:2cc1468da177 991 * @note Call of this function is equivalent to following function call sequence :
<> 161:2cc1468da177 992 * - Data Width configuration using @ref LL_USART_SetDataWidth() function
<> 161:2cc1468da177 993 * - Parity Control and mode configuration using @ref LL_USART_SetParity() function
<> 161:2cc1468da177 994 * - Stop bits configuration using @ref LL_USART_SetStopBitsLength() function
<> 161:2cc1468da177 995 * @rmtoll CR1 PS LL_USART_ConfigCharacter\n
<> 161:2cc1468da177 996 * CR1 PCE LL_USART_ConfigCharacter\n
<> 161:2cc1468da177 997 * CR1 M0 LL_USART_ConfigCharacter\n
<> 161:2cc1468da177 998 * CR1 M1 LL_USART_ConfigCharacter\n
<> 161:2cc1468da177 999 * CR2 STOP LL_USART_ConfigCharacter
<> 161:2cc1468da177 1000 * @param USARTx USART Instance
<> 161:2cc1468da177 1001 * @param DataWidth This parameter can be one of the following values:
<> 161:2cc1468da177 1002 * @arg @ref LL_USART_DATAWIDTH_7B
<> 161:2cc1468da177 1003 * @arg @ref LL_USART_DATAWIDTH_8B
<> 161:2cc1468da177 1004 * @arg @ref LL_USART_DATAWIDTH_9B
<> 161:2cc1468da177 1005 * @param Parity This parameter can be one of the following values:
<> 161:2cc1468da177 1006 * @arg @ref LL_USART_PARITY_NONE
<> 161:2cc1468da177 1007 * @arg @ref LL_USART_PARITY_EVEN
<> 161:2cc1468da177 1008 * @arg @ref LL_USART_PARITY_ODD
<> 161:2cc1468da177 1009 * @param StopBits This parameter can be one of the following values:
<> 161:2cc1468da177 1010 * @arg @ref LL_USART_STOPBITS_0_5
<> 161:2cc1468da177 1011 * @arg @ref LL_USART_STOPBITS_1
<> 161:2cc1468da177 1012 * @arg @ref LL_USART_STOPBITS_1_5
<> 161:2cc1468da177 1013 * @arg @ref LL_USART_STOPBITS_2
<> 161:2cc1468da177 1014 * @retval None
<> 161:2cc1468da177 1015 */
<> 161:2cc1468da177 1016 __STATIC_INLINE void LL_USART_ConfigCharacter(USART_TypeDef *USARTx, uint32_t DataWidth, uint32_t Parity,
<> 161:2cc1468da177 1017 uint32_t StopBits)
<> 161:2cc1468da177 1018 {
<> 161:2cc1468da177 1019 MODIFY_REG(USARTx->CR1, USART_CR1_PS | USART_CR1_PCE | USART_CR1_M, Parity | DataWidth);
<> 161:2cc1468da177 1020 MODIFY_REG(USARTx->CR2, USART_CR2_STOP, StopBits);
<> 161:2cc1468da177 1021 }
<> 161:2cc1468da177 1022
<> 161:2cc1468da177 1023 /**
<> 161:2cc1468da177 1024 * @brief Configure TX/RX pins swapping setting.
<> 161:2cc1468da177 1025 * @rmtoll CR2 SWAP LL_USART_SetTXRXSwap
<> 161:2cc1468da177 1026 * @param USARTx USART Instance
<> 161:2cc1468da177 1027 * @param SwapConfig This parameter can be one of the following values:
<> 161:2cc1468da177 1028 * @arg @ref LL_USART_TXRX_STANDARD
<> 161:2cc1468da177 1029 * @arg @ref LL_USART_TXRX_SWAPPED
<> 161:2cc1468da177 1030 * @retval None
<> 161:2cc1468da177 1031 */
<> 161:2cc1468da177 1032 __STATIC_INLINE void LL_USART_SetTXRXSwap(USART_TypeDef *USARTx, uint32_t SwapConfig)
<> 161:2cc1468da177 1033 {
<> 161:2cc1468da177 1034 MODIFY_REG(USARTx->CR2, USART_CR2_SWAP, SwapConfig);
<> 161:2cc1468da177 1035 }
<> 161:2cc1468da177 1036
<> 161:2cc1468da177 1037 /**
<> 161:2cc1468da177 1038 * @brief Retrieve TX/RX pins swapping configuration.
<> 161:2cc1468da177 1039 * @rmtoll CR2 SWAP LL_USART_GetTXRXSwap
<> 161:2cc1468da177 1040 * @param USARTx USART Instance
<> 161:2cc1468da177 1041 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 1042 * @arg @ref LL_USART_TXRX_STANDARD
<> 161:2cc1468da177 1043 * @arg @ref LL_USART_TXRX_SWAPPED
<> 161:2cc1468da177 1044 */
<> 161:2cc1468da177 1045 __STATIC_INLINE uint32_t LL_USART_GetTXRXSwap(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1046 {
<> 161:2cc1468da177 1047 return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_SWAP));
<> 161:2cc1468da177 1048 }
<> 161:2cc1468da177 1049
<> 161:2cc1468da177 1050 /**
<> 161:2cc1468da177 1051 * @brief Configure RX pin active level logic
<> 161:2cc1468da177 1052 * @rmtoll CR2 RXINV LL_USART_SetRXPinLevel
<> 161:2cc1468da177 1053 * @param USARTx USART Instance
<> 161:2cc1468da177 1054 * @param PinInvMethod This parameter can be one of the following values:
<> 161:2cc1468da177 1055 * @arg @ref LL_USART_RXPIN_LEVEL_STANDARD
<> 161:2cc1468da177 1056 * @arg @ref LL_USART_RXPIN_LEVEL_INVERTED
<> 161:2cc1468da177 1057 * @retval None
<> 161:2cc1468da177 1058 */
<> 161:2cc1468da177 1059 __STATIC_INLINE void LL_USART_SetRXPinLevel(USART_TypeDef *USARTx, uint32_t PinInvMethod)
<> 161:2cc1468da177 1060 {
<> 161:2cc1468da177 1061 MODIFY_REG(USARTx->CR2, USART_CR2_RXINV, PinInvMethod);
<> 161:2cc1468da177 1062 }
<> 161:2cc1468da177 1063
<> 161:2cc1468da177 1064 /**
<> 161:2cc1468da177 1065 * @brief Retrieve RX pin active level logic configuration
<> 161:2cc1468da177 1066 * @rmtoll CR2 RXINV LL_USART_GetRXPinLevel
<> 161:2cc1468da177 1067 * @param USARTx USART Instance
<> 161:2cc1468da177 1068 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 1069 * @arg @ref LL_USART_RXPIN_LEVEL_STANDARD
<> 161:2cc1468da177 1070 * @arg @ref LL_USART_RXPIN_LEVEL_INVERTED
<> 161:2cc1468da177 1071 */
<> 161:2cc1468da177 1072 __STATIC_INLINE uint32_t LL_USART_GetRXPinLevel(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1073 {
<> 161:2cc1468da177 1074 return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_RXINV));
<> 161:2cc1468da177 1075 }
<> 161:2cc1468da177 1076
<> 161:2cc1468da177 1077 /**
<> 161:2cc1468da177 1078 * @brief Configure TX pin active level logic
<> 161:2cc1468da177 1079 * @rmtoll CR2 TXINV LL_USART_SetTXPinLevel
<> 161:2cc1468da177 1080 * @param USARTx USART Instance
<> 161:2cc1468da177 1081 * @param PinInvMethod This parameter can be one of the following values:
<> 161:2cc1468da177 1082 * @arg @ref LL_USART_TXPIN_LEVEL_STANDARD
<> 161:2cc1468da177 1083 * @arg @ref LL_USART_TXPIN_LEVEL_INVERTED
<> 161:2cc1468da177 1084 * @retval None
<> 161:2cc1468da177 1085 */
<> 161:2cc1468da177 1086 __STATIC_INLINE void LL_USART_SetTXPinLevel(USART_TypeDef *USARTx, uint32_t PinInvMethod)
<> 161:2cc1468da177 1087 {
<> 161:2cc1468da177 1088 MODIFY_REG(USARTx->CR2, USART_CR2_TXINV, PinInvMethod);
<> 161:2cc1468da177 1089 }
<> 161:2cc1468da177 1090
<> 161:2cc1468da177 1091 /**
<> 161:2cc1468da177 1092 * @brief Retrieve TX pin active level logic configuration
<> 161:2cc1468da177 1093 * @rmtoll CR2 TXINV LL_USART_GetTXPinLevel
<> 161:2cc1468da177 1094 * @param USARTx USART Instance
<> 161:2cc1468da177 1095 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 1096 * @arg @ref LL_USART_TXPIN_LEVEL_STANDARD
<> 161:2cc1468da177 1097 * @arg @ref LL_USART_TXPIN_LEVEL_INVERTED
<> 161:2cc1468da177 1098 */
<> 161:2cc1468da177 1099 __STATIC_INLINE uint32_t LL_USART_GetTXPinLevel(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1100 {
<> 161:2cc1468da177 1101 return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_TXINV));
<> 161:2cc1468da177 1102 }
<> 161:2cc1468da177 1103
<> 161:2cc1468da177 1104 /**
<> 161:2cc1468da177 1105 * @brief Configure Binary data logic.
<> 161:2cc1468da177 1106 * @note Allow to define how Logical data from the data register are send/received :
<> 161:2cc1468da177 1107 * either in positive/direct logic (1=H, 0=L) or in negative/inverse logic (1=L, 0=H)
<> 161:2cc1468da177 1108 * @rmtoll CR2 DATAINV LL_USART_SetBinaryDataLogic
<> 161:2cc1468da177 1109 * @param USARTx USART Instance
<> 161:2cc1468da177 1110 * @param DataLogic This parameter can be one of the following values:
<> 161:2cc1468da177 1111 * @arg @ref LL_USART_BINARY_LOGIC_POSITIVE
<> 161:2cc1468da177 1112 * @arg @ref LL_USART_BINARY_LOGIC_NEGATIVE
<> 161:2cc1468da177 1113 * @retval None
<> 161:2cc1468da177 1114 */
<> 161:2cc1468da177 1115 __STATIC_INLINE void LL_USART_SetBinaryDataLogic(USART_TypeDef *USARTx, uint32_t DataLogic)
<> 161:2cc1468da177 1116 {
<> 161:2cc1468da177 1117 MODIFY_REG(USARTx->CR2, USART_CR2_DATAINV, DataLogic);
<> 161:2cc1468da177 1118 }
<> 161:2cc1468da177 1119
<> 161:2cc1468da177 1120 /**
<> 161:2cc1468da177 1121 * @brief Retrieve Binary data configuration
<> 161:2cc1468da177 1122 * @rmtoll CR2 DATAINV LL_USART_GetBinaryDataLogic
<> 161:2cc1468da177 1123 * @param USARTx USART Instance
<> 161:2cc1468da177 1124 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 1125 * @arg @ref LL_USART_BINARY_LOGIC_POSITIVE
<> 161:2cc1468da177 1126 * @arg @ref LL_USART_BINARY_LOGIC_NEGATIVE
<> 161:2cc1468da177 1127 */
<> 161:2cc1468da177 1128 __STATIC_INLINE uint32_t LL_USART_GetBinaryDataLogic(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1129 {
<> 161:2cc1468da177 1130 return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_DATAINV));
<> 161:2cc1468da177 1131 }
<> 161:2cc1468da177 1132
<> 161:2cc1468da177 1133 /**
<> 161:2cc1468da177 1134 * @brief Configure transfer bit order (either Less or Most Significant Bit First)
<> 161:2cc1468da177 1135 * @note MSB First means data is transmitted/received with the MSB first, following the start bit.
<> 161:2cc1468da177 1136 * LSB First means data is transmitted/received with data bit 0 first, following the start bit.
<> 161:2cc1468da177 1137 * @rmtoll CR2 MSBFIRST LL_USART_SetTransferBitOrder
<> 161:2cc1468da177 1138 * @param USARTx USART Instance
<> 161:2cc1468da177 1139 * @param BitOrder This parameter can be one of the following values:
<> 161:2cc1468da177 1140 * @arg @ref LL_USART_BITORDER_LSBFIRST
<> 161:2cc1468da177 1141 * @arg @ref LL_USART_BITORDER_MSBFIRST
<> 161:2cc1468da177 1142 * @retval None
<> 161:2cc1468da177 1143 */
<> 161:2cc1468da177 1144 __STATIC_INLINE void LL_USART_SetTransferBitOrder(USART_TypeDef *USARTx, uint32_t BitOrder)
<> 161:2cc1468da177 1145 {
<> 161:2cc1468da177 1146 MODIFY_REG(USARTx->CR2, USART_CR2_MSBFIRST, BitOrder);
<> 161:2cc1468da177 1147 }
<> 161:2cc1468da177 1148
<> 161:2cc1468da177 1149 /**
<> 161:2cc1468da177 1150 * @brief Return transfer bit order (either Less or Most Significant Bit First)
<> 161:2cc1468da177 1151 * @note MSB First means data is transmitted/received with the MSB first, following the start bit.
<> 161:2cc1468da177 1152 * LSB First means data is transmitted/received with data bit 0 first, following the start bit.
<> 161:2cc1468da177 1153 * @rmtoll CR2 MSBFIRST LL_USART_GetTransferBitOrder
<> 161:2cc1468da177 1154 * @param USARTx USART Instance
<> 161:2cc1468da177 1155 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 1156 * @arg @ref LL_USART_BITORDER_LSBFIRST
<> 161:2cc1468da177 1157 * @arg @ref LL_USART_BITORDER_MSBFIRST
<> 161:2cc1468da177 1158 */
<> 161:2cc1468da177 1159 __STATIC_INLINE uint32_t LL_USART_GetTransferBitOrder(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1160 {
<> 161:2cc1468da177 1161 return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_MSBFIRST));
<> 161:2cc1468da177 1162 }
<> 161:2cc1468da177 1163
<> 161:2cc1468da177 1164 /**
<> 161:2cc1468da177 1165 * @brief Enable Auto Baud-Rate Detection
<> 161:2cc1468da177 1166 * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1167 * Auto Baud Rate detection feature is supported by the USARTx instance.
<> 161:2cc1468da177 1168 * @rmtoll CR2 ABREN LL_USART_EnableAutoBaudRate
<> 161:2cc1468da177 1169 * @param USARTx USART Instance
<> 161:2cc1468da177 1170 * @retval None
<> 161:2cc1468da177 1171 */
<> 161:2cc1468da177 1172 __STATIC_INLINE void LL_USART_EnableAutoBaudRate(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1173 {
<> 161:2cc1468da177 1174 SET_BIT(USARTx->CR2, USART_CR2_ABREN);
<> 161:2cc1468da177 1175 }
<> 161:2cc1468da177 1176
<> 161:2cc1468da177 1177 /**
<> 161:2cc1468da177 1178 * @brief Disable Auto Baud-Rate Detection
<> 161:2cc1468da177 1179 * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1180 * Auto Baud Rate detection feature is supported by the USARTx instance.
<> 161:2cc1468da177 1181 * @rmtoll CR2 ABREN LL_USART_DisableAutoBaudRate
<> 161:2cc1468da177 1182 * @param USARTx USART Instance
<> 161:2cc1468da177 1183 * @retval None
<> 161:2cc1468da177 1184 */
<> 161:2cc1468da177 1185 __STATIC_INLINE void LL_USART_DisableAutoBaudRate(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1186 {
<> 161:2cc1468da177 1187 CLEAR_BIT(USARTx->CR2, USART_CR2_ABREN);
<> 161:2cc1468da177 1188 }
<> 161:2cc1468da177 1189
<> 161:2cc1468da177 1190 /**
<> 161:2cc1468da177 1191 * @brief Indicate if Auto Baud-Rate Detection mechanism is enabled
<> 161:2cc1468da177 1192 * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1193 * Auto Baud Rate detection feature is supported by the USARTx instance.
<> 161:2cc1468da177 1194 * @rmtoll CR2 ABREN LL_USART_IsEnabledAutoBaud
<> 161:2cc1468da177 1195 * @param USARTx USART Instance
<> 161:2cc1468da177 1196 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 1197 */
<> 161:2cc1468da177 1198 __STATIC_INLINE uint32_t LL_USART_IsEnabledAutoBaud(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1199 {
<> 161:2cc1468da177 1200 return (READ_BIT(USARTx->CR2, USART_CR2_ABREN) == (USART_CR2_ABREN));
<> 161:2cc1468da177 1201 }
<> 161:2cc1468da177 1202
<> 161:2cc1468da177 1203 /**
<> 161:2cc1468da177 1204 * @brief Set Auto Baud-Rate mode bits
<> 161:2cc1468da177 1205 * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1206 * Auto Baud Rate detection feature is supported by the USARTx instance.
<> 161:2cc1468da177 1207 * @rmtoll CR2 ABRMODE LL_USART_SetAutoBaudRateMode
<> 161:2cc1468da177 1208 * @param USARTx USART Instance
<> 161:2cc1468da177 1209 * @param AutoBaudRateMode This parameter can be one of the following values:
<> 161:2cc1468da177 1210 * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_STARTBIT
<> 161:2cc1468da177 1211 * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_FALLINGEDGE
<> 161:2cc1468da177 1212 * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_7F_FRAME
<> 161:2cc1468da177 1213 * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_55_FRAME
<> 161:2cc1468da177 1214 * @retval None
<> 161:2cc1468da177 1215 */
<> 161:2cc1468da177 1216 __STATIC_INLINE void LL_USART_SetAutoBaudRateMode(USART_TypeDef *USARTx, uint32_t AutoBaudRateMode)
<> 161:2cc1468da177 1217 {
<> 161:2cc1468da177 1218 MODIFY_REG(USARTx->CR2, USART_CR2_ABRMODE, AutoBaudRateMode);
<> 161:2cc1468da177 1219 }
<> 161:2cc1468da177 1220
<> 161:2cc1468da177 1221 /**
<> 161:2cc1468da177 1222 * @brief Return Auto Baud-Rate mode
<> 161:2cc1468da177 1223 * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1224 * Auto Baud Rate detection feature is supported by the USARTx instance.
<> 161:2cc1468da177 1225 * @rmtoll CR2 ABRMODE LL_USART_GetAutoBaudRateMode
<> 161:2cc1468da177 1226 * @param USARTx USART Instance
<> 161:2cc1468da177 1227 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 1228 * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_STARTBIT
<> 161:2cc1468da177 1229 * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_FALLINGEDGE
<> 161:2cc1468da177 1230 * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_7F_FRAME
<> 161:2cc1468da177 1231 * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_55_FRAME
<> 161:2cc1468da177 1232 */
<> 161:2cc1468da177 1233 __STATIC_INLINE uint32_t LL_USART_GetAutoBaudRateMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1234 {
<> 161:2cc1468da177 1235 return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_ABRMODE));
<> 161:2cc1468da177 1236 }
<> 161:2cc1468da177 1237
<> 161:2cc1468da177 1238 /**
<> 161:2cc1468da177 1239 * @brief Enable Receiver Timeout
<> 161:2cc1468da177 1240 * @rmtoll CR2 RTOEN LL_USART_EnableRxTimeout
<> 161:2cc1468da177 1241 * @param USARTx USART Instance
<> 161:2cc1468da177 1242 * @retval None
<> 161:2cc1468da177 1243 */
<> 161:2cc1468da177 1244 __STATIC_INLINE void LL_USART_EnableRxTimeout(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1245 {
<> 161:2cc1468da177 1246 SET_BIT(USARTx->CR2, USART_CR2_RTOEN);
<> 161:2cc1468da177 1247 }
<> 161:2cc1468da177 1248
<> 161:2cc1468da177 1249 /**
<> 161:2cc1468da177 1250 * @brief Disable Receiver Timeout
<> 161:2cc1468da177 1251 * @rmtoll CR2 RTOEN LL_USART_DisableRxTimeout
<> 161:2cc1468da177 1252 * @param USARTx USART Instance
<> 161:2cc1468da177 1253 * @retval None
<> 161:2cc1468da177 1254 */
<> 161:2cc1468da177 1255 __STATIC_INLINE void LL_USART_DisableRxTimeout(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1256 {
<> 161:2cc1468da177 1257 CLEAR_BIT(USARTx->CR2, USART_CR2_RTOEN);
<> 161:2cc1468da177 1258 }
<> 161:2cc1468da177 1259
<> 161:2cc1468da177 1260 /**
<> 161:2cc1468da177 1261 * @brief Indicate if Receiver Timeout feature is enabled
<> 161:2cc1468da177 1262 * @rmtoll CR2 RTOEN LL_USART_IsEnabledRxTimeout
<> 161:2cc1468da177 1263 * @param USARTx USART Instance
<> 161:2cc1468da177 1264 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 1265 */
<> 161:2cc1468da177 1266 __STATIC_INLINE uint32_t LL_USART_IsEnabledRxTimeout(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1267 {
<> 161:2cc1468da177 1268 return (READ_BIT(USARTx->CR2, USART_CR2_RTOEN) == (USART_CR2_RTOEN));
<> 161:2cc1468da177 1269 }
<> 161:2cc1468da177 1270
<> 161:2cc1468da177 1271 /**
<> 161:2cc1468da177 1272 * @brief Set Address of the USART node.
<> 161:2cc1468da177 1273 * @note This is used in multiprocessor communication during Mute mode or Stop mode,
<> 161:2cc1468da177 1274 * for wake up with address mark detection.
<> 161:2cc1468da177 1275 * @note 4bits address node is used when 4-bit Address Detection is selected in ADDM7.
<> 161:2cc1468da177 1276 * (b7-b4 should be set to 0)
<> 161:2cc1468da177 1277 * 8bits address node is used when 7-bit Address Detection is selected in ADDM7.
<> 161:2cc1468da177 1278 * (This is used in multiprocessor communication during Mute mode or Stop mode,
<> 161:2cc1468da177 1279 * for wake up with 7-bit address mark detection.
<> 161:2cc1468da177 1280 * The MSB of the character sent by the transmitter should be equal to 1.
<> 161:2cc1468da177 1281 * It may also be used for character detection during normal reception,
<> 161:2cc1468da177 1282 * Mute mode inactive (for example, end of block detection in ModBus protocol).
<> 161:2cc1468da177 1283 * In this case, the whole received character (8-bit) is compared to the ADD[7:0]
<> 161:2cc1468da177 1284 * value and CMF flag is set on match)
<> 161:2cc1468da177 1285 * @rmtoll CR2 ADD LL_USART_ConfigNodeAddress\n
<> 161:2cc1468da177 1286 * CR2 ADDM7 LL_USART_ConfigNodeAddress
<> 161:2cc1468da177 1287 * @param USARTx USART Instance
<> 161:2cc1468da177 1288 * @param AddressLen This parameter can be one of the following values:
<> 161:2cc1468da177 1289 * @arg @ref LL_USART_ADDRESS_DETECT_4B
<> 161:2cc1468da177 1290 * @arg @ref LL_USART_ADDRESS_DETECT_7B
<> 161:2cc1468da177 1291 * @param NodeAddress 4 or 7 bit Address of the USART node.
<> 161:2cc1468da177 1292 * @retval None
<> 161:2cc1468da177 1293 */
<> 161:2cc1468da177 1294 __STATIC_INLINE void LL_USART_ConfigNodeAddress(USART_TypeDef *USARTx, uint32_t AddressLen, uint32_t NodeAddress)
<> 161:2cc1468da177 1295 {
<> 161:2cc1468da177 1296 MODIFY_REG(USARTx->CR2, USART_CR2_ADD | USART_CR2_ADDM7,
<> 161:2cc1468da177 1297 (uint32_t)(AddressLen | (NodeAddress << USART_CR2_ADD_Pos)));
<> 161:2cc1468da177 1298 }
<> 161:2cc1468da177 1299
<> 161:2cc1468da177 1300 /**
<> 161:2cc1468da177 1301 * @brief Return 8 bit Address of the USART node as set in ADD field of CR2.
<> 161:2cc1468da177 1302 * @note If 4-bit Address Detection is selected in ADDM7,
<> 161:2cc1468da177 1303 * only 4bits (b3-b0) of returned value are relevant (b31-b4 are not relevant)
<> 161:2cc1468da177 1304 * If 7-bit Address Detection is selected in ADDM7,
<> 161:2cc1468da177 1305 * only 8bits (b7-b0) of returned value are relevant (b31-b8 are not relevant)
<> 161:2cc1468da177 1306 * @rmtoll CR2 ADD LL_USART_GetNodeAddress
<> 161:2cc1468da177 1307 * @param USARTx USART Instance
<> 161:2cc1468da177 1308 * @retval Address of the USART node (Value between Min_Data=0 and Max_Data=255)
<> 161:2cc1468da177 1309 */
<> 161:2cc1468da177 1310 __STATIC_INLINE uint32_t LL_USART_GetNodeAddress(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1311 {
<> 161:2cc1468da177 1312 return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_ADD) >> USART_CR2_ADD_Pos);
<> 161:2cc1468da177 1313 }
<> 161:2cc1468da177 1314
<> 161:2cc1468da177 1315 /**
<> 161:2cc1468da177 1316 * @brief Return Length of Node Address used in Address Detection mode (7-bit or 4-bit)
<> 161:2cc1468da177 1317 * @rmtoll CR2 ADDM7 LL_USART_GetNodeAddressLen
<> 161:2cc1468da177 1318 * @param USARTx USART Instance
<> 161:2cc1468da177 1319 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 1320 * @arg @ref LL_USART_ADDRESS_DETECT_4B
<> 161:2cc1468da177 1321 * @arg @ref LL_USART_ADDRESS_DETECT_7B
<> 161:2cc1468da177 1322 */
<> 161:2cc1468da177 1323 __STATIC_INLINE uint32_t LL_USART_GetNodeAddressLen(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1324 {
<> 161:2cc1468da177 1325 return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_ADDM7));
<> 161:2cc1468da177 1326 }
<> 161:2cc1468da177 1327
<> 161:2cc1468da177 1328 /**
<> 161:2cc1468da177 1329 * @brief Enable RTS HW Flow Control
<> 161:2cc1468da177 1330 * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1331 * Hardware Flow control feature is supported by the USARTx instance.
<> 161:2cc1468da177 1332 * @rmtoll CR3 RTSE LL_USART_EnableRTSHWFlowCtrl
<> 161:2cc1468da177 1333 * @param USARTx USART Instance
<> 161:2cc1468da177 1334 * @retval None
<> 161:2cc1468da177 1335 */
<> 161:2cc1468da177 1336 __STATIC_INLINE void LL_USART_EnableRTSHWFlowCtrl(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1337 {
<> 161:2cc1468da177 1338 SET_BIT(USARTx->CR3, USART_CR3_RTSE);
<> 161:2cc1468da177 1339 }
<> 161:2cc1468da177 1340
<> 161:2cc1468da177 1341 /**
<> 161:2cc1468da177 1342 * @brief Disable RTS HW Flow Control
<> 161:2cc1468da177 1343 * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1344 * Hardware Flow control feature is supported by the USARTx instance.
<> 161:2cc1468da177 1345 * @rmtoll CR3 RTSE LL_USART_DisableRTSHWFlowCtrl
<> 161:2cc1468da177 1346 * @param USARTx USART Instance
<> 161:2cc1468da177 1347 * @retval None
<> 161:2cc1468da177 1348 */
<> 161:2cc1468da177 1349 __STATIC_INLINE void LL_USART_DisableRTSHWFlowCtrl(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1350 {
<> 161:2cc1468da177 1351 CLEAR_BIT(USARTx->CR3, USART_CR3_RTSE);
<> 161:2cc1468da177 1352 }
<> 161:2cc1468da177 1353
<> 161:2cc1468da177 1354 /**
<> 161:2cc1468da177 1355 * @brief Enable CTS HW Flow Control
<> 161:2cc1468da177 1356 * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1357 * Hardware Flow control feature is supported by the USARTx instance.
<> 161:2cc1468da177 1358 * @rmtoll CR3 CTSE LL_USART_EnableCTSHWFlowCtrl
<> 161:2cc1468da177 1359 * @param USARTx USART Instance
<> 161:2cc1468da177 1360 * @retval None
<> 161:2cc1468da177 1361 */
<> 161:2cc1468da177 1362 __STATIC_INLINE void LL_USART_EnableCTSHWFlowCtrl(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1363 {
<> 161:2cc1468da177 1364 SET_BIT(USARTx->CR3, USART_CR3_CTSE);
<> 161:2cc1468da177 1365 }
<> 161:2cc1468da177 1366
<> 161:2cc1468da177 1367 /**
<> 161:2cc1468da177 1368 * @brief Disable CTS HW Flow Control
<> 161:2cc1468da177 1369 * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1370 * Hardware Flow control feature is supported by the USARTx instance.
<> 161:2cc1468da177 1371 * @rmtoll CR3 CTSE LL_USART_DisableCTSHWFlowCtrl
<> 161:2cc1468da177 1372 * @param USARTx USART Instance
<> 161:2cc1468da177 1373 * @retval None
<> 161:2cc1468da177 1374 */
<> 161:2cc1468da177 1375 __STATIC_INLINE void LL_USART_DisableCTSHWFlowCtrl(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1376 {
<> 161:2cc1468da177 1377 CLEAR_BIT(USARTx->CR3, USART_CR3_CTSE);
<> 161:2cc1468da177 1378 }
<> 161:2cc1468da177 1379
<> 161:2cc1468da177 1380 /**
<> 161:2cc1468da177 1381 * @brief Configure HW Flow Control mode (both CTS and RTS)
<> 161:2cc1468da177 1382 * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1383 * Hardware Flow control feature is supported by the USARTx instance.
<> 161:2cc1468da177 1384 * @rmtoll CR3 RTSE LL_USART_SetHWFlowCtrl\n
<> 161:2cc1468da177 1385 * CR3 CTSE LL_USART_SetHWFlowCtrl
<> 161:2cc1468da177 1386 * @param USARTx USART Instance
<> 161:2cc1468da177 1387 * @param HardwareFlowControl This parameter can be one of the following values:
<> 161:2cc1468da177 1388 * @arg @ref LL_USART_HWCONTROL_NONE
<> 161:2cc1468da177 1389 * @arg @ref LL_USART_HWCONTROL_RTS
<> 161:2cc1468da177 1390 * @arg @ref LL_USART_HWCONTROL_CTS
<> 161:2cc1468da177 1391 * @arg @ref LL_USART_HWCONTROL_RTS_CTS
<> 161:2cc1468da177 1392 * @retval None
<> 161:2cc1468da177 1393 */
<> 161:2cc1468da177 1394 __STATIC_INLINE void LL_USART_SetHWFlowCtrl(USART_TypeDef *USARTx, uint32_t HardwareFlowControl)
<> 161:2cc1468da177 1395 {
<> 161:2cc1468da177 1396 MODIFY_REG(USARTx->CR3, USART_CR3_RTSE | USART_CR3_CTSE, HardwareFlowControl);
<> 161:2cc1468da177 1397 }
<> 161:2cc1468da177 1398
<> 161:2cc1468da177 1399 /**
<> 161:2cc1468da177 1400 * @brief Return HW Flow Control configuration (both CTS and RTS)
<> 161:2cc1468da177 1401 * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1402 * Hardware Flow control feature is supported by the USARTx instance.
<> 161:2cc1468da177 1403 * @rmtoll CR3 RTSE LL_USART_GetHWFlowCtrl\n
<> 161:2cc1468da177 1404 * CR3 CTSE LL_USART_GetHWFlowCtrl
<> 161:2cc1468da177 1405 * @param USARTx USART Instance
<> 161:2cc1468da177 1406 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 1407 * @arg @ref LL_USART_HWCONTROL_NONE
<> 161:2cc1468da177 1408 * @arg @ref LL_USART_HWCONTROL_RTS
<> 161:2cc1468da177 1409 * @arg @ref LL_USART_HWCONTROL_CTS
<> 161:2cc1468da177 1410 * @arg @ref LL_USART_HWCONTROL_RTS_CTS
<> 161:2cc1468da177 1411 */
<> 161:2cc1468da177 1412 __STATIC_INLINE uint32_t LL_USART_GetHWFlowCtrl(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1413 {
<> 161:2cc1468da177 1414 return (uint32_t)(READ_BIT(USARTx->CR3, USART_CR3_RTSE | USART_CR3_CTSE));
<> 161:2cc1468da177 1415 }
<> 161:2cc1468da177 1416
<> 161:2cc1468da177 1417 /**
<> 161:2cc1468da177 1418 * @brief Enable One bit sampling method
<> 161:2cc1468da177 1419 * @rmtoll CR3 ONEBIT LL_USART_EnableOneBitSamp
<> 161:2cc1468da177 1420 * @param USARTx USART Instance
<> 161:2cc1468da177 1421 * @retval None
<> 161:2cc1468da177 1422 */
<> 161:2cc1468da177 1423 __STATIC_INLINE void LL_USART_EnableOneBitSamp(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1424 {
<> 161:2cc1468da177 1425 SET_BIT(USARTx->CR3, USART_CR3_ONEBIT);
<> 161:2cc1468da177 1426 }
<> 161:2cc1468da177 1427
<> 161:2cc1468da177 1428 /**
<> 161:2cc1468da177 1429 * @brief Disable One bit sampling method
<> 161:2cc1468da177 1430 * @rmtoll CR3 ONEBIT LL_USART_DisableOneBitSamp
<> 161:2cc1468da177 1431 * @param USARTx USART Instance
<> 161:2cc1468da177 1432 * @retval None
<> 161:2cc1468da177 1433 */
<> 161:2cc1468da177 1434 __STATIC_INLINE void LL_USART_DisableOneBitSamp(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1435 {
<> 161:2cc1468da177 1436 CLEAR_BIT(USARTx->CR3, USART_CR3_ONEBIT);
<> 161:2cc1468da177 1437 }
<> 161:2cc1468da177 1438
<> 161:2cc1468da177 1439 /**
<> 161:2cc1468da177 1440 * @brief Indicate if One bit sampling method is enabled
<> 161:2cc1468da177 1441 * @rmtoll CR3 ONEBIT LL_USART_IsEnabledOneBitSamp
<> 161:2cc1468da177 1442 * @param USARTx USART Instance
<> 161:2cc1468da177 1443 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 1444 */
<> 161:2cc1468da177 1445 __STATIC_INLINE uint32_t LL_USART_IsEnabledOneBitSamp(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1446 {
<> 161:2cc1468da177 1447 return (READ_BIT(USARTx->CR3, USART_CR3_ONEBIT) == (USART_CR3_ONEBIT));
<> 161:2cc1468da177 1448 }
<> 161:2cc1468da177 1449
<> 161:2cc1468da177 1450 /**
<> 161:2cc1468da177 1451 * @brief Enable Overrun detection
<> 161:2cc1468da177 1452 * @rmtoll CR3 OVRDIS LL_USART_EnableOverrunDetect
<> 161:2cc1468da177 1453 * @param USARTx USART Instance
<> 161:2cc1468da177 1454 * @retval None
<> 161:2cc1468da177 1455 */
<> 161:2cc1468da177 1456 __STATIC_INLINE void LL_USART_EnableOverrunDetect(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1457 {
<> 161:2cc1468da177 1458 CLEAR_BIT(USARTx->CR3, USART_CR3_OVRDIS);
<> 161:2cc1468da177 1459 }
<> 161:2cc1468da177 1460
<> 161:2cc1468da177 1461 /**
<> 161:2cc1468da177 1462 * @brief Disable Overrun detection
<> 161:2cc1468da177 1463 * @rmtoll CR3 OVRDIS LL_USART_DisableOverrunDetect
<> 161:2cc1468da177 1464 * @param USARTx USART Instance
<> 161:2cc1468da177 1465 * @retval None
<> 161:2cc1468da177 1466 */
<> 161:2cc1468da177 1467 __STATIC_INLINE void LL_USART_DisableOverrunDetect(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1468 {
<> 161:2cc1468da177 1469 SET_BIT(USARTx->CR3, USART_CR3_OVRDIS);
<> 161:2cc1468da177 1470 }
<> 161:2cc1468da177 1471
<> 161:2cc1468da177 1472 /**
<> 161:2cc1468da177 1473 * @brief Indicate if Overrun detection is enabled
<> 161:2cc1468da177 1474 * @rmtoll CR3 OVRDIS LL_USART_IsEnabledOverrunDetect
<> 161:2cc1468da177 1475 * @param USARTx USART Instance
<> 161:2cc1468da177 1476 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 1477 */
<> 161:2cc1468da177 1478 __STATIC_INLINE uint32_t LL_USART_IsEnabledOverrunDetect(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1479 {
<> 161:2cc1468da177 1480 return (READ_BIT(USARTx->CR3, USART_CR3_OVRDIS) != USART_CR3_OVRDIS);
<> 161:2cc1468da177 1481 }
<> 161:2cc1468da177 1482
<> 161:2cc1468da177 1483
<> 161:2cc1468da177 1484 /**
<> 161:2cc1468da177 1485 * @brief Configure USART BRR register for achieving expected Baud Rate value.
<> 161:2cc1468da177 1486 * @note Compute and set USARTDIV value in BRR Register (full BRR content)
<> 161:2cc1468da177 1487 * according to used Peripheral Clock, Oversampling mode, and expected Baud Rate values
<> 161:2cc1468da177 1488 * @note Peripheral clock and Baud rate values provided as function parameters should be valid
<> 161:2cc1468da177 1489 * (Baud rate value != 0)
<> 161:2cc1468da177 1490 * @note In case of oversampling by 16 and 8, BRR content must be greater than or equal to 16d.
<> 161:2cc1468da177 1491 * @rmtoll BRR BRR LL_USART_SetBaudRate
<> 161:2cc1468da177 1492 * @param USARTx USART Instance
<> 161:2cc1468da177 1493 * @param PeriphClk Peripheral Clock
<> 161:2cc1468da177 1494 * @param OverSampling This parameter can be one of the following values:
<> 161:2cc1468da177 1495 * @arg @ref LL_USART_OVERSAMPLING_16
<> 161:2cc1468da177 1496 * @arg @ref LL_USART_OVERSAMPLING_8
<> 161:2cc1468da177 1497 * @param BaudRate Baud Rate
<> 161:2cc1468da177 1498 * @retval None
<> 161:2cc1468da177 1499 */
<> 161:2cc1468da177 1500 __STATIC_INLINE void LL_USART_SetBaudRate(USART_TypeDef *USARTx, uint32_t PeriphClk, uint32_t OverSampling,
<> 161:2cc1468da177 1501 uint32_t BaudRate)
<> 161:2cc1468da177 1502 {
<> 161:2cc1468da177 1503 register uint32_t usartdiv = 0x0U;
<> 161:2cc1468da177 1504 register uint32_t brrtemp = 0x0U;
<> 161:2cc1468da177 1505
<> 161:2cc1468da177 1506 if (OverSampling == LL_USART_OVERSAMPLING_8)
<> 161:2cc1468da177 1507 {
<> 161:2cc1468da177 1508 usartdiv = (uint16_t)(__LL_USART_DIV_SAMPLING8(PeriphClk, BaudRate));
<> 161:2cc1468da177 1509 brrtemp = usartdiv & 0xFFF0U;
<> 161:2cc1468da177 1510 brrtemp |= (uint16_t)((usartdiv & (uint16_t)0x000FU) >> 1U);
<> 161:2cc1468da177 1511 USARTx->BRR = brrtemp;
<> 161:2cc1468da177 1512 }
<> 161:2cc1468da177 1513 else
<> 161:2cc1468da177 1514 {
<> 161:2cc1468da177 1515 USARTx->BRR = (uint16_t)(__LL_USART_DIV_SAMPLING16(PeriphClk, BaudRate));
<> 161:2cc1468da177 1516 }
<> 161:2cc1468da177 1517 }
<> 161:2cc1468da177 1518
<> 161:2cc1468da177 1519 /**
<> 161:2cc1468da177 1520 * @brief Return current Baud Rate value, according to USARTDIV present in BRR register
<> 161:2cc1468da177 1521 * (full BRR content), and to used Peripheral Clock and Oversampling mode values
<> 161:2cc1468da177 1522 * @note In case of non-initialized or invalid value stored in BRR register, value 0 will be returned.
<> 161:2cc1468da177 1523 * @note In case of oversampling by 16 and 8, BRR content must be greater than or equal to 16d.
<> 161:2cc1468da177 1524 * @rmtoll BRR BRR LL_USART_GetBaudRate
<> 161:2cc1468da177 1525 * @param USARTx USART Instance
<> 161:2cc1468da177 1526 * @param PeriphClk Peripheral Clock
<> 161:2cc1468da177 1527 * @param OverSampling This parameter can be one of the following values:
<> 161:2cc1468da177 1528 * @arg @ref LL_USART_OVERSAMPLING_16
<> 161:2cc1468da177 1529 * @arg @ref LL_USART_OVERSAMPLING_8
<> 161:2cc1468da177 1530 * @retval Baud Rate
<> 161:2cc1468da177 1531 */
<> 161:2cc1468da177 1532 __STATIC_INLINE uint32_t LL_USART_GetBaudRate(USART_TypeDef *USARTx, uint32_t PeriphClk, uint32_t OverSampling)
<> 161:2cc1468da177 1533 {
<> 161:2cc1468da177 1534 register uint32_t usartdiv = 0x0U;
<> 161:2cc1468da177 1535 register uint32_t brrresult = 0x0U;
<> 161:2cc1468da177 1536
<> 161:2cc1468da177 1537 usartdiv = USARTx->BRR;
<> 161:2cc1468da177 1538
<> 161:2cc1468da177 1539 if (OverSampling == LL_USART_OVERSAMPLING_8)
<> 161:2cc1468da177 1540 {
<> 161:2cc1468da177 1541 if ((usartdiv & 0xFFF7U) != 0U)
<> 161:2cc1468da177 1542 {
<> 161:2cc1468da177 1543 usartdiv = (uint16_t)((usartdiv & 0xFFF0U) | ((usartdiv & 0x0007U) << 1U)) ;
<> 161:2cc1468da177 1544 brrresult = (PeriphClk * 2U) / usartdiv;
<> 161:2cc1468da177 1545 }
<> 161:2cc1468da177 1546 }
<> 161:2cc1468da177 1547 else
<> 161:2cc1468da177 1548 {
<> 161:2cc1468da177 1549 if ((usartdiv & 0xFFFFU) != 0U)
<> 161:2cc1468da177 1550 {
<> 161:2cc1468da177 1551 brrresult = PeriphClk / usartdiv;
<> 161:2cc1468da177 1552 }
<> 161:2cc1468da177 1553 }
<> 161:2cc1468da177 1554 return (brrresult);
<> 161:2cc1468da177 1555 }
<> 161:2cc1468da177 1556
<> 161:2cc1468da177 1557 /**
<> 161:2cc1468da177 1558 * @brief Set Receiver Time Out Value (expressed in nb of bits duration)
<> 161:2cc1468da177 1559 * @rmtoll RTOR RTO LL_USART_SetRxTimeout
<> 161:2cc1468da177 1560 * @param USARTx USART Instance
<> 161:2cc1468da177 1561 * @param Timeout Value between Min_Data=0x00 and Max_Data=0x00FFFFFF
<> 161:2cc1468da177 1562 * @retval None
<> 161:2cc1468da177 1563 */
<> 161:2cc1468da177 1564 __STATIC_INLINE void LL_USART_SetRxTimeout(USART_TypeDef *USARTx, uint32_t Timeout)
<> 161:2cc1468da177 1565 {
<> 161:2cc1468da177 1566 MODIFY_REG(USARTx->RTOR, USART_RTOR_RTO, Timeout);
<> 161:2cc1468da177 1567 }
<> 161:2cc1468da177 1568
<> 161:2cc1468da177 1569 /**
<> 161:2cc1468da177 1570 * @brief Get Receiver Time Out Value (expressed in nb of bits duration)
<> 161:2cc1468da177 1571 * @rmtoll RTOR RTO LL_USART_GetRxTimeout
<> 161:2cc1468da177 1572 * @param USARTx USART Instance
<> 161:2cc1468da177 1573 * @retval Value between Min_Data=0x00 and Max_Data=0x00FFFFFF
<> 161:2cc1468da177 1574 */
<> 161:2cc1468da177 1575 __STATIC_INLINE uint32_t LL_USART_GetRxTimeout(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1576 {
<> 161:2cc1468da177 1577 return (uint32_t)(READ_BIT(USARTx->RTOR, USART_RTOR_RTO));
<> 161:2cc1468da177 1578 }
<> 161:2cc1468da177 1579
<> 161:2cc1468da177 1580 /**
<> 161:2cc1468da177 1581 * @brief Set Block Length value in reception
<> 161:2cc1468da177 1582 * @rmtoll RTOR BLEN LL_USART_SetBlockLength
<> 161:2cc1468da177 1583 * @param USARTx USART Instance
<> 161:2cc1468da177 1584 * @param BlockLength Value between Min_Data=0x00 and Max_Data=0xFF
<> 161:2cc1468da177 1585 * @retval None
<> 161:2cc1468da177 1586 */
<> 161:2cc1468da177 1587 __STATIC_INLINE void LL_USART_SetBlockLength(USART_TypeDef *USARTx, uint32_t BlockLength)
<> 161:2cc1468da177 1588 {
<> 161:2cc1468da177 1589 MODIFY_REG(USARTx->RTOR, USART_RTOR_BLEN, BlockLength << USART_RTOR_BLEN_Pos);
<> 161:2cc1468da177 1590 }
<> 161:2cc1468da177 1591
<> 161:2cc1468da177 1592 /**
<> 161:2cc1468da177 1593 * @brief Get Block Length value in reception
<> 161:2cc1468da177 1594 * @rmtoll RTOR BLEN LL_USART_GetBlockLength
<> 161:2cc1468da177 1595 * @param USARTx USART Instance
<> 161:2cc1468da177 1596 * @retval Value between Min_Data=0x00 and Max_Data=0xFF
<> 161:2cc1468da177 1597 */
<> 161:2cc1468da177 1598 __STATIC_INLINE uint32_t LL_USART_GetBlockLength(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1599 {
<> 161:2cc1468da177 1600 return (uint32_t)(READ_BIT(USARTx->RTOR, USART_RTOR_BLEN) >> USART_RTOR_BLEN_Pos);
<> 161:2cc1468da177 1601 }
<> 161:2cc1468da177 1602
<> 161:2cc1468da177 1603 /**
<> 161:2cc1468da177 1604 * @}
<> 161:2cc1468da177 1605 */
<> 161:2cc1468da177 1606
<> 161:2cc1468da177 1607 /** @defgroup USART_LL_EF_Configuration_IRDA Configuration functions related to Irda feature
<> 161:2cc1468da177 1608 * @{
<> 161:2cc1468da177 1609 */
<> 161:2cc1468da177 1610
<> 161:2cc1468da177 1611 /**
<> 161:2cc1468da177 1612 * @brief Enable IrDA mode
<> 161:2cc1468da177 1613 * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1614 * IrDA feature is supported by the USARTx instance.
<> 161:2cc1468da177 1615 * @rmtoll CR3 IREN LL_USART_EnableIrda
<> 161:2cc1468da177 1616 * @param USARTx USART Instance
<> 161:2cc1468da177 1617 * @retval None
<> 161:2cc1468da177 1618 */
<> 161:2cc1468da177 1619 __STATIC_INLINE void LL_USART_EnableIrda(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1620 {
<> 161:2cc1468da177 1621 SET_BIT(USARTx->CR3, USART_CR3_IREN);
<> 161:2cc1468da177 1622 }
<> 161:2cc1468da177 1623
<> 161:2cc1468da177 1624 /**
<> 161:2cc1468da177 1625 * @brief Disable IrDA mode
<> 161:2cc1468da177 1626 * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1627 * IrDA feature is supported by the USARTx instance.
<> 161:2cc1468da177 1628 * @rmtoll CR3 IREN LL_USART_DisableIrda
<> 161:2cc1468da177 1629 * @param USARTx USART Instance
<> 161:2cc1468da177 1630 * @retval None
<> 161:2cc1468da177 1631 */
<> 161:2cc1468da177 1632 __STATIC_INLINE void LL_USART_DisableIrda(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1633 {
<> 161:2cc1468da177 1634 CLEAR_BIT(USARTx->CR3, USART_CR3_IREN);
<> 161:2cc1468da177 1635 }
<> 161:2cc1468da177 1636
<> 161:2cc1468da177 1637 /**
<> 161:2cc1468da177 1638 * @brief Indicate if IrDA mode is enabled
<> 161:2cc1468da177 1639 * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1640 * IrDA feature is supported by the USARTx instance.
<> 161:2cc1468da177 1641 * @rmtoll CR3 IREN LL_USART_IsEnabledIrda
<> 161:2cc1468da177 1642 * @param USARTx USART Instance
<> 161:2cc1468da177 1643 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 1644 */
<> 161:2cc1468da177 1645 __STATIC_INLINE uint32_t LL_USART_IsEnabledIrda(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1646 {
<> 161:2cc1468da177 1647 return (READ_BIT(USARTx->CR3, USART_CR3_IREN) == (USART_CR3_IREN));
<> 161:2cc1468da177 1648 }
<> 161:2cc1468da177 1649
<> 161:2cc1468da177 1650 /**
<> 161:2cc1468da177 1651 * @brief Configure IrDA Power Mode (Normal or Low Power)
<> 161:2cc1468da177 1652 * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1653 * IrDA feature is supported by the USARTx instance.
<> 161:2cc1468da177 1654 * @rmtoll CR3 IRLP LL_USART_SetIrdaPowerMode
<> 161:2cc1468da177 1655 * @param USARTx USART Instance
<> 161:2cc1468da177 1656 * @param PowerMode This parameter can be one of the following values:
<> 161:2cc1468da177 1657 * @arg @ref LL_USART_IRDA_POWER_NORMAL
<> 161:2cc1468da177 1658 * @arg @ref LL_USART_IRDA_POWER_LOW
<> 161:2cc1468da177 1659 * @retval None
<> 161:2cc1468da177 1660 */
<> 161:2cc1468da177 1661 __STATIC_INLINE void LL_USART_SetIrdaPowerMode(USART_TypeDef *USARTx, uint32_t PowerMode)
<> 161:2cc1468da177 1662 {
<> 161:2cc1468da177 1663 MODIFY_REG(USARTx->CR3, USART_CR3_IRLP, PowerMode);
<> 161:2cc1468da177 1664 }
<> 161:2cc1468da177 1665
<> 161:2cc1468da177 1666 /**
<> 161:2cc1468da177 1667 * @brief Retrieve IrDA Power Mode configuration (Normal or Low Power)
<> 161:2cc1468da177 1668 * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1669 * IrDA feature is supported by the USARTx instance.
<> 161:2cc1468da177 1670 * @rmtoll CR3 IRLP LL_USART_GetIrdaPowerMode
<> 161:2cc1468da177 1671 * @param USARTx USART Instance
<> 161:2cc1468da177 1672 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 1673 * @arg @ref LL_USART_IRDA_POWER_NORMAL
<> 161:2cc1468da177 1674 * @arg @ref LL_USART_PHASE_2EDGE
<> 161:2cc1468da177 1675 */
<> 161:2cc1468da177 1676 __STATIC_INLINE uint32_t LL_USART_GetIrdaPowerMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1677 {
<> 161:2cc1468da177 1678 return (uint32_t)(READ_BIT(USARTx->CR3, USART_CR3_IRLP));
<> 161:2cc1468da177 1679 }
<> 161:2cc1468da177 1680
<> 161:2cc1468da177 1681 /**
<> 161:2cc1468da177 1682 * @brief Set Irda prescaler value, used for dividing the USART clock source
<> 161:2cc1468da177 1683 * to achieve the Irda Low Power frequency (8 bits value)
<> 161:2cc1468da177 1684 * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1685 * IrDA feature is supported by the USARTx instance.
<> 161:2cc1468da177 1686 * @rmtoll GTPR PSC LL_USART_SetIrdaPrescaler
<> 161:2cc1468da177 1687 * @param USARTx USART Instance
<> 161:2cc1468da177 1688 * @param PrescalerValue Value between Min_Data=0x00 and Max_Data=0xFF
<> 161:2cc1468da177 1689 * @retval None
<> 161:2cc1468da177 1690 */
<> 161:2cc1468da177 1691 __STATIC_INLINE void LL_USART_SetIrdaPrescaler(USART_TypeDef *USARTx, uint32_t PrescalerValue)
<> 161:2cc1468da177 1692 {
<> 161:2cc1468da177 1693 MODIFY_REG(USARTx->GTPR, USART_GTPR_PSC, PrescalerValue);
<> 161:2cc1468da177 1694 }
<> 161:2cc1468da177 1695
<> 161:2cc1468da177 1696 /**
<> 161:2cc1468da177 1697 * @brief Return Irda prescaler value, used for dividing the USART clock source
<> 161:2cc1468da177 1698 * to achieve the Irda Low Power frequency (8 bits value)
<> 161:2cc1468da177 1699 * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1700 * IrDA feature is supported by the USARTx instance.
<> 161:2cc1468da177 1701 * @rmtoll GTPR PSC LL_USART_GetIrdaPrescaler
<> 161:2cc1468da177 1702 * @param USARTx USART Instance
<> 161:2cc1468da177 1703 * @retval Irda prescaler value (Value between Min_Data=0x00 and Max_Data=0xFF)
<> 161:2cc1468da177 1704 */
<> 161:2cc1468da177 1705 __STATIC_INLINE uint32_t LL_USART_GetIrdaPrescaler(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1706 {
<> 161:2cc1468da177 1707 return (uint32_t)(READ_BIT(USARTx->GTPR, USART_GTPR_PSC));
<> 161:2cc1468da177 1708 }
<> 161:2cc1468da177 1709
<> 161:2cc1468da177 1710 /**
<> 161:2cc1468da177 1711 * @}
<> 161:2cc1468da177 1712 */
<> 161:2cc1468da177 1713
<> 161:2cc1468da177 1714 /** @defgroup USART_LL_EF_Configuration_Smartcard Configuration functions related to Smartcard feature
<> 161:2cc1468da177 1715 * @{
<> 161:2cc1468da177 1716 */
<> 161:2cc1468da177 1717
<> 161:2cc1468da177 1718 /**
<> 161:2cc1468da177 1719 * @brief Enable Smartcard NACK transmission
<> 161:2cc1468da177 1720 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1721 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 1722 * @rmtoll CR3 NACK LL_USART_EnableSmartcardNACK
<> 161:2cc1468da177 1723 * @param USARTx USART Instance
<> 161:2cc1468da177 1724 * @retval None
<> 161:2cc1468da177 1725 */
<> 161:2cc1468da177 1726 __STATIC_INLINE void LL_USART_EnableSmartcardNACK(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1727 {
<> 161:2cc1468da177 1728 SET_BIT(USARTx->CR3, USART_CR3_NACK);
<> 161:2cc1468da177 1729 }
<> 161:2cc1468da177 1730
<> 161:2cc1468da177 1731 /**
<> 161:2cc1468da177 1732 * @brief Disable Smartcard NACK transmission
<> 161:2cc1468da177 1733 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1734 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 1735 * @rmtoll CR3 NACK LL_USART_DisableSmartcardNACK
<> 161:2cc1468da177 1736 * @param USARTx USART Instance
<> 161:2cc1468da177 1737 * @retval None
<> 161:2cc1468da177 1738 */
<> 161:2cc1468da177 1739 __STATIC_INLINE void LL_USART_DisableSmartcardNACK(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1740 {
<> 161:2cc1468da177 1741 CLEAR_BIT(USARTx->CR3, USART_CR3_NACK);
<> 161:2cc1468da177 1742 }
<> 161:2cc1468da177 1743
<> 161:2cc1468da177 1744 /**
<> 161:2cc1468da177 1745 * @brief Indicate if Smartcard NACK transmission is enabled
<> 161:2cc1468da177 1746 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1747 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 1748 * @rmtoll CR3 NACK LL_USART_IsEnabledSmartcardNACK
<> 161:2cc1468da177 1749 * @param USARTx USART Instance
<> 161:2cc1468da177 1750 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 1751 */
<> 161:2cc1468da177 1752 __STATIC_INLINE uint32_t LL_USART_IsEnabledSmartcardNACK(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1753 {
<> 161:2cc1468da177 1754 return (READ_BIT(USARTx->CR3, USART_CR3_NACK) == (USART_CR3_NACK));
<> 161:2cc1468da177 1755 }
<> 161:2cc1468da177 1756
<> 161:2cc1468da177 1757 /**
<> 161:2cc1468da177 1758 * @brief Enable Smartcard mode
<> 161:2cc1468da177 1759 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1760 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 1761 * @rmtoll CR3 SCEN LL_USART_EnableSmartcard
<> 161:2cc1468da177 1762 * @param USARTx USART Instance
<> 161:2cc1468da177 1763 * @retval None
<> 161:2cc1468da177 1764 */
<> 161:2cc1468da177 1765 __STATIC_INLINE void LL_USART_EnableSmartcard(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1766 {
<> 161:2cc1468da177 1767 SET_BIT(USARTx->CR3, USART_CR3_SCEN);
<> 161:2cc1468da177 1768 }
<> 161:2cc1468da177 1769
<> 161:2cc1468da177 1770 /**
<> 161:2cc1468da177 1771 * @brief Disable Smartcard mode
<> 161:2cc1468da177 1772 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1773 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 1774 * @rmtoll CR3 SCEN LL_USART_DisableSmartcard
<> 161:2cc1468da177 1775 * @param USARTx USART Instance
<> 161:2cc1468da177 1776 * @retval None
<> 161:2cc1468da177 1777 */
<> 161:2cc1468da177 1778 __STATIC_INLINE void LL_USART_DisableSmartcard(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1779 {
<> 161:2cc1468da177 1780 CLEAR_BIT(USARTx->CR3, USART_CR3_SCEN);
<> 161:2cc1468da177 1781 }
<> 161:2cc1468da177 1782
<> 161:2cc1468da177 1783 /**
<> 161:2cc1468da177 1784 * @brief Indicate if Smartcard mode is enabled
<> 161:2cc1468da177 1785 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1786 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 1787 * @rmtoll CR3 SCEN LL_USART_IsEnabledSmartcard
<> 161:2cc1468da177 1788 * @param USARTx USART Instance
<> 161:2cc1468da177 1789 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 1790 */
<> 161:2cc1468da177 1791 __STATIC_INLINE uint32_t LL_USART_IsEnabledSmartcard(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1792 {
<> 161:2cc1468da177 1793 return (READ_BIT(USARTx->CR3, USART_CR3_SCEN) == (USART_CR3_SCEN));
<> 161:2cc1468da177 1794 }
<> 161:2cc1468da177 1795
<> 161:2cc1468da177 1796 /**
<> 161:2cc1468da177 1797 * @brief Set Smartcard Auto-Retry Count value (SCARCNT[2:0] bits)
<> 161:2cc1468da177 1798 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1799 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 1800 * @note This bit-field specifies the number of retries in transmit and receive, in Smartcard mode.
<> 161:2cc1468da177 1801 * In transmission mode, it specifies the number of automatic retransmission retries, before
<> 161:2cc1468da177 1802 * generating a transmission error (FE bit set).
<> 161:2cc1468da177 1803 * In reception mode, it specifies the number or erroneous reception trials, before generating a
<> 161:2cc1468da177 1804 * reception error (RXNE and PE bits set)
<> 161:2cc1468da177 1805 * @rmtoll CR3 SCARCNT LL_USART_SetSmartcardAutoRetryCount
<> 161:2cc1468da177 1806 * @param USARTx USART Instance
<> 161:2cc1468da177 1807 * @param AutoRetryCount Value between Min_Data=0 and Max_Data=7
<> 161:2cc1468da177 1808 * @retval None
<> 161:2cc1468da177 1809 */
<> 161:2cc1468da177 1810 __STATIC_INLINE void LL_USART_SetSmartcardAutoRetryCount(USART_TypeDef *USARTx, uint32_t AutoRetryCount)
<> 161:2cc1468da177 1811 {
<> 161:2cc1468da177 1812 MODIFY_REG(USARTx->CR3, USART_CR3_SCARCNT, AutoRetryCount << USART_CR3_SCARCNT_Pos);
<> 161:2cc1468da177 1813 }
<> 161:2cc1468da177 1814
<> 161:2cc1468da177 1815 /**
<> 161:2cc1468da177 1816 * @brief Return Smartcard Auto-Retry Count value (SCARCNT[2:0] bits)
<> 161:2cc1468da177 1817 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1818 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 1819 * @rmtoll CR3 SCARCNT LL_USART_GetSmartcardAutoRetryCount
<> 161:2cc1468da177 1820 * @param USARTx USART Instance
<> 161:2cc1468da177 1821 * @retval Smartcard Auto-Retry Count value (Value between Min_Data=0 and Max_Data=7)
<> 161:2cc1468da177 1822 */
<> 161:2cc1468da177 1823 __STATIC_INLINE uint32_t LL_USART_GetSmartcardAutoRetryCount(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1824 {
<> 161:2cc1468da177 1825 return (uint32_t)(READ_BIT(USARTx->CR3, USART_CR3_SCARCNT) >> USART_CR3_SCARCNT_Pos);
<> 161:2cc1468da177 1826 }
<> 161:2cc1468da177 1827
<> 161:2cc1468da177 1828 /**
<> 161:2cc1468da177 1829 * @brief Set Smartcard prescaler value, used for dividing the USART clock
<> 161:2cc1468da177 1830 * source to provide the SMARTCARD Clock (5 bits value)
<> 161:2cc1468da177 1831 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1832 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 1833 * @rmtoll GTPR PSC LL_USART_SetSmartcardPrescaler
<> 161:2cc1468da177 1834 * @param USARTx USART Instance
<> 161:2cc1468da177 1835 * @param PrescalerValue Value between Min_Data=0 and Max_Data=31
<> 161:2cc1468da177 1836 * @retval None
<> 161:2cc1468da177 1837 */
<> 161:2cc1468da177 1838 __STATIC_INLINE void LL_USART_SetSmartcardPrescaler(USART_TypeDef *USARTx, uint32_t PrescalerValue)
<> 161:2cc1468da177 1839 {
<> 161:2cc1468da177 1840 MODIFY_REG(USARTx->GTPR, USART_GTPR_PSC, PrescalerValue);
<> 161:2cc1468da177 1841 }
<> 161:2cc1468da177 1842
<> 161:2cc1468da177 1843 /**
<> 161:2cc1468da177 1844 * @brief Return Smartcard prescaler value, used for dividing the USART clock
<> 161:2cc1468da177 1845 * source to provide the SMARTCARD Clock (5 bits value)
<> 161:2cc1468da177 1846 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1847 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 1848 * @rmtoll GTPR PSC LL_USART_GetSmartcardPrescaler
<> 161:2cc1468da177 1849 * @param USARTx USART Instance
<> 161:2cc1468da177 1850 * @retval Smartcard prescaler value (Value between Min_Data=0 and Max_Data=31)
<> 161:2cc1468da177 1851 */
<> 161:2cc1468da177 1852 __STATIC_INLINE uint32_t LL_USART_GetSmartcardPrescaler(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1853 {
<> 161:2cc1468da177 1854 return (uint32_t)(READ_BIT(USARTx->GTPR, USART_GTPR_PSC));
<> 161:2cc1468da177 1855 }
<> 161:2cc1468da177 1856
<> 161:2cc1468da177 1857 /**
<> 161:2cc1468da177 1858 * @brief Set Smartcard Guard time value, expressed in nb of baud clocks periods
<> 161:2cc1468da177 1859 * (GT[7:0] bits : Guard time value)
<> 161:2cc1468da177 1860 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1861 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 1862 * @rmtoll GTPR GT LL_USART_SetSmartcardGuardTime
<> 161:2cc1468da177 1863 * @param USARTx USART Instance
<> 161:2cc1468da177 1864 * @param GuardTime Value between Min_Data=0x00 and Max_Data=0xFF
<> 161:2cc1468da177 1865 * @retval None
<> 161:2cc1468da177 1866 */
<> 161:2cc1468da177 1867 __STATIC_INLINE void LL_USART_SetSmartcardGuardTime(USART_TypeDef *USARTx, uint32_t GuardTime)
<> 161:2cc1468da177 1868 {
<> 161:2cc1468da177 1869 MODIFY_REG(USARTx->GTPR, USART_GTPR_GT, GuardTime << USART_GTPR_GT_Pos);
<> 161:2cc1468da177 1870 }
<> 161:2cc1468da177 1871
<> 161:2cc1468da177 1872 /**
<> 161:2cc1468da177 1873 * @brief Return Smartcard Guard time value, expressed in nb of baud clocks periods
<> 161:2cc1468da177 1874 * (GT[7:0] bits : Guard time value)
<> 161:2cc1468da177 1875 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1876 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 1877 * @rmtoll GTPR GT LL_USART_GetSmartcardGuardTime
<> 161:2cc1468da177 1878 * @param USARTx USART Instance
<> 161:2cc1468da177 1879 * @retval Smartcard Guard time value (Value between Min_Data=0x00 and Max_Data=0xFF)
<> 161:2cc1468da177 1880 */
<> 161:2cc1468da177 1881 __STATIC_INLINE uint32_t LL_USART_GetSmartcardGuardTime(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1882 {
<> 161:2cc1468da177 1883 return (uint32_t)(READ_BIT(USARTx->GTPR, USART_GTPR_GT) >> USART_GTPR_GT_Pos);
<> 161:2cc1468da177 1884 }
<> 161:2cc1468da177 1885
<> 161:2cc1468da177 1886 /**
<> 161:2cc1468da177 1887 * @}
<> 161:2cc1468da177 1888 */
<> 161:2cc1468da177 1889
<> 161:2cc1468da177 1890 /** @defgroup USART_LL_EF_Configuration_HalfDuplex Configuration functions related to Half Duplex feature
<> 161:2cc1468da177 1891 * @{
<> 161:2cc1468da177 1892 */
<> 161:2cc1468da177 1893
<> 161:2cc1468da177 1894 /**
<> 161:2cc1468da177 1895 * @brief Enable Single Wire Half-Duplex mode
<> 161:2cc1468da177 1896 * @note Macro @ref IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1897 * Half-Duplex mode is supported by the USARTx instance.
<> 161:2cc1468da177 1898 * @rmtoll CR3 HDSEL LL_USART_EnableHalfDuplex
<> 161:2cc1468da177 1899 * @param USARTx USART Instance
<> 161:2cc1468da177 1900 * @retval None
<> 161:2cc1468da177 1901 */
<> 161:2cc1468da177 1902 __STATIC_INLINE void LL_USART_EnableHalfDuplex(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1903 {
<> 161:2cc1468da177 1904 SET_BIT(USARTx->CR3, USART_CR3_HDSEL);
<> 161:2cc1468da177 1905 }
<> 161:2cc1468da177 1906
<> 161:2cc1468da177 1907 /**
<> 161:2cc1468da177 1908 * @brief Disable Single Wire Half-Duplex mode
<> 161:2cc1468da177 1909 * @note Macro @ref IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1910 * Half-Duplex mode is supported by the USARTx instance.
<> 161:2cc1468da177 1911 * @rmtoll CR3 HDSEL LL_USART_DisableHalfDuplex
<> 161:2cc1468da177 1912 * @param USARTx USART Instance
<> 161:2cc1468da177 1913 * @retval None
<> 161:2cc1468da177 1914 */
<> 161:2cc1468da177 1915 __STATIC_INLINE void LL_USART_DisableHalfDuplex(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1916 {
<> 161:2cc1468da177 1917 CLEAR_BIT(USARTx->CR3, USART_CR3_HDSEL);
<> 161:2cc1468da177 1918 }
<> 161:2cc1468da177 1919
<> 161:2cc1468da177 1920 /**
<> 161:2cc1468da177 1921 * @brief Indicate if Single Wire Half-Duplex mode is enabled
<> 161:2cc1468da177 1922 * @note Macro @ref IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1923 * Half-Duplex mode is supported by the USARTx instance.
<> 161:2cc1468da177 1924 * @rmtoll CR3 HDSEL LL_USART_IsEnabledHalfDuplex
<> 161:2cc1468da177 1925 * @param USARTx USART Instance
<> 161:2cc1468da177 1926 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 1927 */
<> 161:2cc1468da177 1928 __STATIC_INLINE uint32_t LL_USART_IsEnabledHalfDuplex(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1929 {
<> 161:2cc1468da177 1930 return (READ_BIT(USARTx->CR3, USART_CR3_HDSEL) == (USART_CR3_HDSEL));
<> 161:2cc1468da177 1931 }
<> 161:2cc1468da177 1932
<> 161:2cc1468da177 1933 /**
<> 161:2cc1468da177 1934 * @}
<> 161:2cc1468da177 1935 */
<> 161:2cc1468da177 1936
<> 161:2cc1468da177 1937 /** @defgroup USART_LL_EF_Configuration_LIN Configuration functions related to LIN feature
<> 161:2cc1468da177 1938 * @{
<> 161:2cc1468da177 1939 */
<> 161:2cc1468da177 1940
<> 161:2cc1468da177 1941 /**
<> 161:2cc1468da177 1942 * @brief Set LIN Break Detection Length
<> 161:2cc1468da177 1943 * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1944 * LIN feature is supported by the USARTx instance.
<> 161:2cc1468da177 1945 * @rmtoll CR2 LBDL LL_USART_SetLINBrkDetectionLen
<> 161:2cc1468da177 1946 * @param USARTx USART Instance
<> 161:2cc1468da177 1947 * @param LINBDLength This parameter can be one of the following values:
<> 161:2cc1468da177 1948 * @arg @ref LL_USART_LINBREAK_DETECT_10B
<> 161:2cc1468da177 1949 * @arg @ref LL_USART_LINBREAK_DETECT_11B
<> 161:2cc1468da177 1950 * @retval None
<> 161:2cc1468da177 1951 */
<> 161:2cc1468da177 1952 __STATIC_INLINE void LL_USART_SetLINBrkDetectionLen(USART_TypeDef *USARTx, uint32_t LINBDLength)
<> 161:2cc1468da177 1953 {
<> 161:2cc1468da177 1954 MODIFY_REG(USARTx->CR2, USART_CR2_LBDL, LINBDLength);
<> 161:2cc1468da177 1955 }
<> 161:2cc1468da177 1956
<> 161:2cc1468da177 1957 /**
<> 161:2cc1468da177 1958 * @brief Return LIN Break Detection Length
<> 161:2cc1468da177 1959 * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1960 * LIN feature is supported by the USARTx instance.
<> 161:2cc1468da177 1961 * @rmtoll CR2 LBDL LL_USART_GetLINBrkDetectionLen
<> 161:2cc1468da177 1962 * @param USARTx USART Instance
<> 161:2cc1468da177 1963 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 1964 * @arg @ref LL_USART_LINBREAK_DETECT_10B
<> 161:2cc1468da177 1965 * @arg @ref LL_USART_LINBREAK_DETECT_11B
<> 161:2cc1468da177 1966 */
<> 161:2cc1468da177 1967 __STATIC_INLINE uint32_t LL_USART_GetLINBrkDetectionLen(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1968 {
<> 161:2cc1468da177 1969 return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_LBDL));
<> 161:2cc1468da177 1970 }
<> 161:2cc1468da177 1971
<> 161:2cc1468da177 1972 /**
<> 161:2cc1468da177 1973 * @brief Enable LIN mode
<> 161:2cc1468da177 1974 * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1975 * LIN feature is supported by the USARTx instance.
<> 161:2cc1468da177 1976 * @rmtoll CR2 LINEN LL_USART_EnableLIN
<> 161:2cc1468da177 1977 * @param USARTx USART Instance
<> 161:2cc1468da177 1978 * @retval None
<> 161:2cc1468da177 1979 */
<> 161:2cc1468da177 1980 __STATIC_INLINE void LL_USART_EnableLIN(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1981 {
<> 161:2cc1468da177 1982 SET_BIT(USARTx->CR2, USART_CR2_LINEN);
<> 161:2cc1468da177 1983 }
<> 161:2cc1468da177 1984
<> 161:2cc1468da177 1985 /**
<> 161:2cc1468da177 1986 * @brief Disable LIN mode
<> 161:2cc1468da177 1987 * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 1988 * LIN feature is supported by the USARTx instance.
<> 161:2cc1468da177 1989 * @rmtoll CR2 LINEN LL_USART_DisableLIN
<> 161:2cc1468da177 1990 * @param USARTx USART Instance
<> 161:2cc1468da177 1991 * @retval None
<> 161:2cc1468da177 1992 */
<> 161:2cc1468da177 1993 __STATIC_INLINE void LL_USART_DisableLIN(USART_TypeDef *USARTx)
<> 161:2cc1468da177 1994 {
<> 161:2cc1468da177 1995 CLEAR_BIT(USARTx->CR2, USART_CR2_LINEN);
<> 161:2cc1468da177 1996 }
<> 161:2cc1468da177 1997
<> 161:2cc1468da177 1998 /**
<> 161:2cc1468da177 1999 * @brief Indicate if LIN mode is enabled
<> 161:2cc1468da177 2000 * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2001 * LIN feature is supported by the USARTx instance.
<> 161:2cc1468da177 2002 * @rmtoll CR2 LINEN LL_USART_IsEnabledLIN
<> 161:2cc1468da177 2003 * @param USARTx USART Instance
<> 161:2cc1468da177 2004 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2005 */
<> 161:2cc1468da177 2006 __STATIC_INLINE uint32_t LL_USART_IsEnabledLIN(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2007 {
<> 161:2cc1468da177 2008 return (READ_BIT(USARTx->CR2, USART_CR2_LINEN) == (USART_CR2_LINEN));
<> 161:2cc1468da177 2009 }
<> 161:2cc1468da177 2010
<> 161:2cc1468da177 2011 /**
<> 161:2cc1468da177 2012 * @}
<> 161:2cc1468da177 2013 */
<> 161:2cc1468da177 2014
<> 161:2cc1468da177 2015 /** @defgroup USART_LL_EF_Configuration_DE Configuration functions related to Driver Enable feature
<> 161:2cc1468da177 2016 * @{
<> 161:2cc1468da177 2017 */
<> 161:2cc1468da177 2018
<> 161:2cc1468da177 2019 /**
<> 161:2cc1468da177 2020 * @brief Set DEDT (Driver Enable De-Assertion Time), Time value expressed on 5 bits ([4:0] bits).
<> 161:2cc1468da177 2021 * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2022 * Driver Enable feature is supported by the USARTx instance.
<> 161:2cc1468da177 2023 * @rmtoll CR1 DEDT LL_USART_SetDEDeassertionTime
<> 161:2cc1468da177 2024 * @param USARTx USART Instance
<> 161:2cc1468da177 2025 * @param Time Value between Min_Data=0 and Max_Data=31
<> 161:2cc1468da177 2026 * @retval None
<> 161:2cc1468da177 2027 */
<> 161:2cc1468da177 2028 __STATIC_INLINE void LL_USART_SetDEDeassertionTime(USART_TypeDef *USARTx, uint32_t Time)
<> 161:2cc1468da177 2029 {
<> 161:2cc1468da177 2030 MODIFY_REG(USARTx->CR1, USART_CR1_DEDT, Time << USART_CR1_DEDT_Pos);
<> 161:2cc1468da177 2031 }
<> 161:2cc1468da177 2032
<> 161:2cc1468da177 2033 /**
<> 161:2cc1468da177 2034 * @brief Return DEDT (Driver Enable De-Assertion Time)
<> 161:2cc1468da177 2035 * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2036 * Driver Enable feature is supported by the USARTx instance.
<> 161:2cc1468da177 2037 * @rmtoll CR1 DEDT LL_USART_GetDEDeassertionTime
<> 161:2cc1468da177 2038 * @param USARTx USART Instance
<> 161:2cc1468da177 2039 * @retval Time value expressed on 5 bits ([4:0] bits) : Value between Min_Data=0 and Max_Data=31
<> 161:2cc1468da177 2040 */
<> 161:2cc1468da177 2041 __STATIC_INLINE uint32_t LL_USART_GetDEDeassertionTime(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2042 {
<> 161:2cc1468da177 2043 return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_DEDT) >> USART_CR1_DEDT_Pos);
<> 161:2cc1468da177 2044 }
<> 161:2cc1468da177 2045
<> 161:2cc1468da177 2046 /**
<> 161:2cc1468da177 2047 * @brief Set DEAT (Driver Enable Assertion Time), Time value expressed on 5 bits ([4:0] bits).
<> 161:2cc1468da177 2048 * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2049 * Driver Enable feature is supported by the USARTx instance.
<> 161:2cc1468da177 2050 * @rmtoll CR1 DEAT LL_USART_SetDEAssertionTime
<> 161:2cc1468da177 2051 * @param USARTx USART Instance
<> 161:2cc1468da177 2052 * @param Time Value between Min_Data=0 and Max_Data=31
<> 161:2cc1468da177 2053 * @retval None
<> 161:2cc1468da177 2054 */
<> 161:2cc1468da177 2055 __STATIC_INLINE void LL_USART_SetDEAssertionTime(USART_TypeDef *USARTx, uint32_t Time)
<> 161:2cc1468da177 2056 {
<> 161:2cc1468da177 2057 MODIFY_REG(USARTx->CR1, USART_CR1_DEAT, Time << USART_CR1_DEAT_Pos);
<> 161:2cc1468da177 2058 }
<> 161:2cc1468da177 2059
<> 161:2cc1468da177 2060 /**
<> 161:2cc1468da177 2061 * @brief Return DEAT (Driver Enable Assertion Time)
<> 161:2cc1468da177 2062 * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2063 * Driver Enable feature is supported by the USARTx instance.
<> 161:2cc1468da177 2064 * @rmtoll CR1 DEAT LL_USART_GetDEAssertionTime
<> 161:2cc1468da177 2065 * @param USARTx USART Instance
<> 161:2cc1468da177 2066 * @retval Time value expressed on 5 bits ([4:0] bits) : Value between Min_Data=0 and Max_Data=31
<> 161:2cc1468da177 2067 */
<> 161:2cc1468da177 2068 __STATIC_INLINE uint32_t LL_USART_GetDEAssertionTime(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2069 {
<> 161:2cc1468da177 2070 return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_DEAT) >> USART_CR1_DEAT_Pos);
<> 161:2cc1468da177 2071 }
<> 161:2cc1468da177 2072
<> 161:2cc1468da177 2073 /**
<> 161:2cc1468da177 2074 * @brief Enable Driver Enable (DE) Mode
<> 161:2cc1468da177 2075 * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2076 * Driver Enable feature is supported by the USARTx instance.
<> 161:2cc1468da177 2077 * @rmtoll CR3 DEM LL_USART_EnableDEMode
<> 161:2cc1468da177 2078 * @param USARTx USART Instance
<> 161:2cc1468da177 2079 * @retval None
<> 161:2cc1468da177 2080 */
<> 161:2cc1468da177 2081 __STATIC_INLINE void LL_USART_EnableDEMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2082 {
<> 161:2cc1468da177 2083 SET_BIT(USARTx->CR3, USART_CR3_DEM);
<> 161:2cc1468da177 2084 }
<> 161:2cc1468da177 2085
<> 161:2cc1468da177 2086 /**
<> 161:2cc1468da177 2087 * @brief Disable Driver Enable (DE) Mode
<> 161:2cc1468da177 2088 * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2089 * Driver Enable feature is supported by the USARTx instance.
<> 161:2cc1468da177 2090 * @rmtoll CR3 DEM LL_USART_DisableDEMode
<> 161:2cc1468da177 2091 * @param USARTx USART Instance
<> 161:2cc1468da177 2092 * @retval None
<> 161:2cc1468da177 2093 */
<> 161:2cc1468da177 2094 __STATIC_INLINE void LL_USART_DisableDEMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2095 {
<> 161:2cc1468da177 2096 CLEAR_BIT(USARTx->CR3, USART_CR3_DEM);
<> 161:2cc1468da177 2097 }
<> 161:2cc1468da177 2098
<> 161:2cc1468da177 2099 /**
<> 161:2cc1468da177 2100 * @brief Indicate if Driver Enable (DE) Mode is enabled
<> 161:2cc1468da177 2101 * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2102 * Driver Enable feature is supported by the USARTx instance.
<> 161:2cc1468da177 2103 * @rmtoll CR3 DEM LL_USART_IsEnabledDEMode
<> 161:2cc1468da177 2104 * @param USARTx USART Instance
<> 161:2cc1468da177 2105 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2106 */
<> 161:2cc1468da177 2107 __STATIC_INLINE uint32_t LL_USART_IsEnabledDEMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2108 {
<> 161:2cc1468da177 2109 return (READ_BIT(USARTx->CR3, USART_CR3_DEM) == (USART_CR3_DEM));
<> 161:2cc1468da177 2110 }
<> 161:2cc1468da177 2111
<> 161:2cc1468da177 2112 /**
<> 161:2cc1468da177 2113 * @brief Select Driver Enable Polarity
<> 161:2cc1468da177 2114 * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2115 * Driver Enable feature is supported by the USARTx instance.
<> 161:2cc1468da177 2116 * @rmtoll CR3 DEP LL_USART_SetDESignalPolarity
<> 161:2cc1468da177 2117 * @param USARTx USART Instance
<> 161:2cc1468da177 2118 * @param Polarity This parameter can be one of the following values:
<> 161:2cc1468da177 2119 * @arg @ref LL_USART_DE_POLARITY_HIGH
<> 161:2cc1468da177 2120 * @arg @ref LL_USART_DE_POLARITY_LOW
<> 161:2cc1468da177 2121 * @retval None
<> 161:2cc1468da177 2122 */
<> 161:2cc1468da177 2123 __STATIC_INLINE void LL_USART_SetDESignalPolarity(USART_TypeDef *USARTx, uint32_t Polarity)
<> 161:2cc1468da177 2124 {
<> 161:2cc1468da177 2125 MODIFY_REG(USARTx->CR3, USART_CR3_DEP, Polarity);
<> 161:2cc1468da177 2126 }
<> 161:2cc1468da177 2127
<> 161:2cc1468da177 2128 /**
<> 161:2cc1468da177 2129 * @brief Return Driver Enable Polarity
<> 161:2cc1468da177 2130 * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2131 * Driver Enable feature is supported by the USARTx instance.
<> 161:2cc1468da177 2132 * @rmtoll CR3 DEP LL_USART_GetDESignalPolarity
<> 161:2cc1468da177 2133 * @param USARTx USART Instance
<> 161:2cc1468da177 2134 * @retval Returned value can be one of the following values:
<> 161:2cc1468da177 2135 * @arg @ref LL_USART_DE_POLARITY_HIGH
<> 161:2cc1468da177 2136 * @arg @ref LL_USART_DE_POLARITY_LOW
<> 161:2cc1468da177 2137 */
<> 161:2cc1468da177 2138 __STATIC_INLINE uint32_t LL_USART_GetDESignalPolarity(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2139 {
<> 161:2cc1468da177 2140 return (uint32_t)(READ_BIT(USARTx->CR3, USART_CR3_DEP));
<> 161:2cc1468da177 2141 }
<> 161:2cc1468da177 2142
<> 161:2cc1468da177 2143 /**
<> 161:2cc1468da177 2144 * @}
<> 161:2cc1468da177 2145 */
<> 161:2cc1468da177 2146
<> 161:2cc1468da177 2147 /** @defgroup USART_LL_EF_AdvancedConfiguration Advanced Configurations services
<> 161:2cc1468da177 2148 * @{
<> 161:2cc1468da177 2149 */
<> 161:2cc1468da177 2150
<> 161:2cc1468da177 2151 /**
<> 161:2cc1468da177 2152 * @brief Perform basic configuration of USART for enabling use in Asynchronous Mode (UART)
<> 161:2cc1468da177 2153 * @note In UART mode, the following bits must be kept cleared:
<> 161:2cc1468da177 2154 * - LINEN bit in the USART_CR2 register,
<> 161:2cc1468da177 2155 * - CLKEN bit in the USART_CR2 register,
<> 161:2cc1468da177 2156 * - SCEN bit in the USART_CR3 register,
<> 161:2cc1468da177 2157 * - IREN bit in the USART_CR3 register,
<> 161:2cc1468da177 2158 * - HDSEL bit in the USART_CR3 register.
<> 161:2cc1468da177 2159 * @note Call of this function is equivalent to following function call sequence :
<> 161:2cc1468da177 2160 * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function
<> 161:2cc1468da177 2161 * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function
<> 161:2cc1468da177 2162 * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function
<> 161:2cc1468da177 2163 * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function
<> 161:2cc1468da177 2164 * - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function
<> 161:2cc1468da177 2165 * @note Other remaining configurations items related to Asynchronous Mode
<> 161:2cc1468da177 2166 * (as Baud Rate, Word length, Parity, ...) should be set using
<> 161:2cc1468da177 2167 * dedicated functions
<> 161:2cc1468da177 2168 * @rmtoll CR2 LINEN LL_USART_ConfigAsyncMode\n
<> 161:2cc1468da177 2169 * CR2 CLKEN LL_USART_ConfigAsyncMode\n
<> 161:2cc1468da177 2170 * CR3 SCEN LL_USART_ConfigAsyncMode\n
<> 161:2cc1468da177 2171 * CR3 IREN LL_USART_ConfigAsyncMode\n
<> 161:2cc1468da177 2172 * CR3 HDSEL LL_USART_ConfigAsyncMode
<> 161:2cc1468da177 2173 * @param USARTx USART Instance
<> 161:2cc1468da177 2174 * @retval None
<> 161:2cc1468da177 2175 */
<> 161:2cc1468da177 2176 __STATIC_INLINE void LL_USART_ConfigAsyncMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2177 {
<> 161:2cc1468da177 2178 /* In Asynchronous mode, the following bits must be kept cleared:
<> 161:2cc1468da177 2179 - LINEN, CLKEN bits in the USART_CR2 register,
<> 161:2cc1468da177 2180 - SCEN, IREN and HDSEL bits in the USART_CR3 register.*/
<> 161:2cc1468da177 2181 CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN));
<> 161:2cc1468da177 2182 CLEAR_BIT(USARTx->CR3, (USART_CR3_SCEN | USART_CR3_IREN | USART_CR3_HDSEL));
<> 161:2cc1468da177 2183 }
<> 161:2cc1468da177 2184
<> 161:2cc1468da177 2185 /**
<> 161:2cc1468da177 2186 * @brief Perform basic configuration of USART for enabling use in Synchronous Mode
<> 161:2cc1468da177 2187 * @note In Synchronous mode, the following bits must be kept cleared:
<> 161:2cc1468da177 2188 * - LINEN bit in the USART_CR2 register,
<> 161:2cc1468da177 2189 * - SCEN bit in the USART_CR3 register,
<> 161:2cc1468da177 2190 * - IREN bit in the USART_CR3 register,
<> 161:2cc1468da177 2191 * - HDSEL bit in the USART_CR3 register.
<> 161:2cc1468da177 2192 * This function also sets the USART in Synchronous mode.
<> 161:2cc1468da177 2193 * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2194 * Synchronous mode is supported by the USARTx instance.
<> 161:2cc1468da177 2195 * @note Call of this function is equivalent to following function call sequence :
<> 161:2cc1468da177 2196 * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function
<> 161:2cc1468da177 2197 * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function
<> 161:2cc1468da177 2198 * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function
<> 161:2cc1468da177 2199 * - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function
<> 161:2cc1468da177 2200 * - Set CLKEN in CR2 using @ref LL_USART_EnableSCLKOutput() function
<> 161:2cc1468da177 2201 * @note Other remaining configurations items related to Synchronous Mode
<> 161:2cc1468da177 2202 * (as Baud Rate, Word length, Parity, Clock Polarity, ...) should be set using
<> 161:2cc1468da177 2203 * dedicated functions
<> 161:2cc1468da177 2204 * @rmtoll CR2 LINEN LL_USART_ConfigSyncMode\n
<> 161:2cc1468da177 2205 * CR2 CLKEN LL_USART_ConfigSyncMode\n
<> 161:2cc1468da177 2206 * CR3 SCEN LL_USART_ConfigSyncMode\n
<> 161:2cc1468da177 2207 * CR3 IREN LL_USART_ConfigSyncMode\n
<> 161:2cc1468da177 2208 * CR3 HDSEL LL_USART_ConfigSyncMode
<> 161:2cc1468da177 2209 * @param USARTx USART Instance
<> 161:2cc1468da177 2210 * @retval None
<> 161:2cc1468da177 2211 */
<> 161:2cc1468da177 2212 __STATIC_INLINE void LL_USART_ConfigSyncMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2213 {
<> 161:2cc1468da177 2214 /* In Synchronous mode, the following bits must be kept cleared:
<> 161:2cc1468da177 2215 - LINEN bit in the USART_CR2 register,
<> 161:2cc1468da177 2216 - SCEN, IREN and HDSEL bits in the USART_CR3 register.*/
<> 161:2cc1468da177 2217 CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN));
<> 161:2cc1468da177 2218 CLEAR_BIT(USARTx->CR3, (USART_CR3_SCEN | USART_CR3_IREN | USART_CR3_HDSEL));
<> 161:2cc1468da177 2219 /* set the UART/USART in Synchronous mode */
<> 161:2cc1468da177 2220 SET_BIT(USARTx->CR2, USART_CR2_CLKEN);
<> 161:2cc1468da177 2221 }
<> 161:2cc1468da177 2222
<> 161:2cc1468da177 2223 /**
<> 161:2cc1468da177 2224 * @brief Perform basic configuration of USART for enabling use in LIN Mode
<> 161:2cc1468da177 2225 * @note In LIN mode, the following bits must be kept cleared:
<> 161:2cc1468da177 2226 * - STOP and CLKEN bits in the USART_CR2 register,
<> 161:2cc1468da177 2227 * - SCEN bit in the USART_CR3 register,
<> 161:2cc1468da177 2228 * - IREN bit in the USART_CR3 register,
<> 161:2cc1468da177 2229 * - HDSEL bit in the USART_CR3 register.
<> 161:2cc1468da177 2230 * This function also set the UART/USART in LIN mode.
<> 161:2cc1468da177 2231 * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2232 * LIN feature is supported by the USARTx instance.
<> 161:2cc1468da177 2233 * @note Call of this function is equivalent to following function call sequence :
<> 161:2cc1468da177 2234 * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function
<> 161:2cc1468da177 2235 * - Clear STOP in CR2 using @ref LL_USART_SetStopBitsLength() function
<> 161:2cc1468da177 2236 * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function
<> 161:2cc1468da177 2237 * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function
<> 161:2cc1468da177 2238 * - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function
<> 161:2cc1468da177 2239 * - Set LINEN in CR2 using @ref LL_USART_EnableLIN() function
<> 161:2cc1468da177 2240 * @note Other remaining configurations items related to LIN Mode
<> 161:2cc1468da177 2241 * (as Baud Rate, Word length, LIN Break Detection Length, ...) should be set using
<> 161:2cc1468da177 2242 * dedicated functions
<> 161:2cc1468da177 2243 * @rmtoll CR2 CLKEN LL_USART_ConfigLINMode\n
<> 161:2cc1468da177 2244 * CR2 STOP LL_USART_ConfigLINMode\n
<> 161:2cc1468da177 2245 * CR2 LINEN LL_USART_ConfigLINMode\n
<> 161:2cc1468da177 2246 * CR3 IREN LL_USART_ConfigLINMode\n
<> 161:2cc1468da177 2247 * CR3 SCEN LL_USART_ConfigLINMode\n
<> 161:2cc1468da177 2248 * CR3 HDSEL LL_USART_ConfigLINMode
<> 161:2cc1468da177 2249 * @param USARTx USART Instance
<> 161:2cc1468da177 2250 * @retval None
<> 161:2cc1468da177 2251 */
<> 161:2cc1468da177 2252 __STATIC_INLINE void LL_USART_ConfigLINMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2253 {
<> 161:2cc1468da177 2254 /* In LIN mode, the following bits must be kept cleared:
<> 161:2cc1468da177 2255 - STOP and CLKEN bits in the USART_CR2 register,
<> 161:2cc1468da177 2256 - IREN, SCEN and HDSEL bits in the USART_CR3 register.*/
<> 161:2cc1468da177 2257 CLEAR_BIT(USARTx->CR2, (USART_CR2_CLKEN | USART_CR2_STOP));
<> 161:2cc1468da177 2258 CLEAR_BIT(USARTx->CR3, (USART_CR3_IREN | USART_CR3_SCEN | USART_CR3_HDSEL));
<> 161:2cc1468da177 2259 /* Set the UART/USART in LIN mode */
<> 161:2cc1468da177 2260 SET_BIT(USARTx->CR2, USART_CR2_LINEN);
<> 161:2cc1468da177 2261 }
<> 161:2cc1468da177 2262
<> 161:2cc1468da177 2263 /**
<> 161:2cc1468da177 2264 * @brief Perform basic configuration of USART for enabling use in Half Duplex Mode
<> 161:2cc1468da177 2265 * @note In Half Duplex mode, the following bits must be kept cleared:
<> 161:2cc1468da177 2266 * - LINEN bit in the USART_CR2 register,
<> 161:2cc1468da177 2267 * - CLKEN bit in the USART_CR2 register,
<> 161:2cc1468da177 2268 * - SCEN bit in the USART_CR3 register,
<> 161:2cc1468da177 2269 * - IREN bit in the USART_CR3 register,
<> 161:2cc1468da177 2270 * This function also sets the UART/USART in Half Duplex mode.
<> 161:2cc1468da177 2271 * @note Macro @ref IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2272 * Half-Duplex mode is supported by the USARTx instance.
<> 161:2cc1468da177 2273 * @note Call of this function is equivalent to following function call sequence :
<> 161:2cc1468da177 2274 * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function
<> 161:2cc1468da177 2275 * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function
<> 161:2cc1468da177 2276 * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function
<> 161:2cc1468da177 2277 * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function
<> 161:2cc1468da177 2278 * - Set HDSEL in CR3 using @ref LL_USART_EnableHalfDuplex() function
<> 161:2cc1468da177 2279 * @note Other remaining configurations items related to Half Duplex Mode
<> 161:2cc1468da177 2280 * (as Baud Rate, Word length, Parity, ...) should be set using
<> 161:2cc1468da177 2281 * dedicated functions
<> 161:2cc1468da177 2282 * @rmtoll CR2 LINEN LL_USART_ConfigHalfDuplexMode\n
<> 161:2cc1468da177 2283 * CR2 CLKEN LL_USART_ConfigHalfDuplexMode\n
<> 161:2cc1468da177 2284 * CR3 HDSEL LL_USART_ConfigHalfDuplexMode\n
<> 161:2cc1468da177 2285 * CR3 SCEN LL_USART_ConfigHalfDuplexMode\n
<> 161:2cc1468da177 2286 * CR3 IREN LL_USART_ConfigHalfDuplexMode
<> 161:2cc1468da177 2287 * @param USARTx USART Instance
<> 161:2cc1468da177 2288 * @retval None
<> 161:2cc1468da177 2289 */
<> 161:2cc1468da177 2290 __STATIC_INLINE void LL_USART_ConfigHalfDuplexMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2291 {
<> 161:2cc1468da177 2292 /* In Half Duplex mode, the following bits must be kept cleared:
<> 161:2cc1468da177 2293 - LINEN and CLKEN bits in the USART_CR2 register,
<> 161:2cc1468da177 2294 - SCEN and IREN bits in the USART_CR3 register.*/
<> 161:2cc1468da177 2295 CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN));
<> 161:2cc1468da177 2296 CLEAR_BIT(USARTx->CR3, (USART_CR3_SCEN | USART_CR3_IREN));
<> 161:2cc1468da177 2297 /* set the UART/USART in Half Duplex mode */
<> 161:2cc1468da177 2298 SET_BIT(USARTx->CR3, USART_CR3_HDSEL);
<> 161:2cc1468da177 2299 }
<> 161:2cc1468da177 2300
<> 161:2cc1468da177 2301 /**
<> 161:2cc1468da177 2302 * @brief Perform basic configuration of USART for enabling use in Smartcard Mode
<> 161:2cc1468da177 2303 * @note In Smartcard mode, the following bits must be kept cleared:
<> 161:2cc1468da177 2304 * - LINEN bit in the USART_CR2 register,
<> 161:2cc1468da177 2305 * - IREN bit in the USART_CR3 register,
<> 161:2cc1468da177 2306 * - HDSEL bit in the USART_CR3 register.
<> 161:2cc1468da177 2307 * This function also configures Stop bits to 1.5 bits and
<> 161:2cc1468da177 2308 * sets the USART in Smartcard mode (SCEN bit).
<> 161:2cc1468da177 2309 * Clock Output is also enabled (CLKEN).
<> 161:2cc1468da177 2310 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2311 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 2312 * @note Call of this function is equivalent to following function call sequence :
<> 161:2cc1468da177 2313 * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function
<> 161:2cc1468da177 2314 * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function
<> 161:2cc1468da177 2315 * - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function
<> 161:2cc1468da177 2316 * - Configure STOP in CR2 using @ref LL_USART_SetStopBitsLength() function
<> 161:2cc1468da177 2317 * - Set CLKEN in CR2 using @ref LL_USART_EnableSCLKOutput() function
<> 161:2cc1468da177 2318 * - Set SCEN in CR3 using @ref LL_USART_EnableSmartcard() function
<> 161:2cc1468da177 2319 * @note Other remaining configurations items related to Smartcard Mode
<> 161:2cc1468da177 2320 * (as Baud Rate, Word length, Parity, ...) should be set using
<> 161:2cc1468da177 2321 * dedicated functions
<> 161:2cc1468da177 2322 * @rmtoll CR2 LINEN LL_USART_ConfigSmartcardMode\n
<> 161:2cc1468da177 2323 * CR2 STOP LL_USART_ConfigSmartcardMode\n
<> 161:2cc1468da177 2324 * CR2 CLKEN LL_USART_ConfigSmartcardMode\n
<> 161:2cc1468da177 2325 * CR3 HDSEL LL_USART_ConfigSmartcardMode\n
<> 161:2cc1468da177 2326 * CR3 SCEN LL_USART_ConfigSmartcardMode
<> 161:2cc1468da177 2327 * @param USARTx USART Instance
<> 161:2cc1468da177 2328 * @retval None
<> 161:2cc1468da177 2329 */
<> 161:2cc1468da177 2330 __STATIC_INLINE void LL_USART_ConfigSmartcardMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2331 {
<> 161:2cc1468da177 2332 /* In Smartcard mode, the following bits must be kept cleared:
<> 161:2cc1468da177 2333 - LINEN bit in the USART_CR2 register,
<> 161:2cc1468da177 2334 - IREN and HDSEL bits in the USART_CR3 register.*/
<> 161:2cc1468da177 2335 CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN));
<> 161:2cc1468da177 2336 CLEAR_BIT(USARTx->CR3, (USART_CR3_IREN | USART_CR3_HDSEL));
<> 161:2cc1468da177 2337 /* Configure Stop bits to 1.5 bits */
<> 161:2cc1468da177 2338 /* Synchronous mode is activated by default */
<> 161:2cc1468da177 2339 SET_BIT(USARTx->CR2, (USART_CR2_STOP_0 | USART_CR2_STOP_1 | USART_CR2_CLKEN));
<> 161:2cc1468da177 2340 /* set the UART/USART in Smartcard mode */
<> 161:2cc1468da177 2341 SET_BIT(USARTx->CR3, USART_CR3_SCEN);
<> 161:2cc1468da177 2342 }
<> 161:2cc1468da177 2343
<> 161:2cc1468da177 2344 /**
<> 161:2cc1468da177 2345 * @brief Perform basic configuration of USART for enabling use in Irda Mode
<> 161:2cc1468da177 2346 * @note In IRDA mode, the following bits must be kept cleared:
<> 161:2cc1468da177 2347 * - LINEN bit in the USART_CR2 register,
<> 161:2cc1468da177 2348 * - STOP and CLKEN bits in the USART_CR2 register,
<> 161:2cc1468da177 2349 * - SCEN bit in the USART_CR3 register,
<> 161:2cc1468da177 2350 * - HDSEL bit in the USART_CR3 register.
<> 161:2cc1468da177 2351 * This function also sets the UART/USART in IRDA mode (IREN bit).
<> 161:2cc1468da177 2352 * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2353 * IrDA feature is supported by the USARTx instance.
<> 161:2cc1468da177 2354 * @note Call of this function is equivalent to following function call sequence :
<> 161:2cc1468da177 2355 * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function
<> 161:2cc1468da177 2356 * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function
<> 161:2cc1468da177 2357 * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function
<> 161:2cc1468da177 2358 * - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function
<> 161:2cc1468da177 2359 * - Configure STOP in CR2 using @ref LL_USART_SetStopBitsLength() function
<> 161:2cc1468da177 2360 * - Set IREN in CR3 using @ref LL_USART_EnableIrda() function
<> 161:2cc1468da177 2361 * @note Other remaining configurations items related to Irda Mode
<> 161:2cc1468da177 2362 * (as Baud Rate, Word length, Power mode, ...) should be set using
<> 161:2cc1468da177 2363 * dedicated functions
<> 161:2cc1468da177 2364 * @rmtoll CR2 LINEN LL_USART_ConfigIrdaMode\n
<> 161:2cc1468da177 2365 * CR2 CLKEN LL_USART_ConfigIrdaMode\n
<> 161:2cc1468da177 2366 * CR2 STOP LL_USART_ConfigIrdaMode\n
<> 161:2cc1468da177 2367 * CR3 SCEN LL_USART_ConfigIrdaMode\n
<> 161:2cc1468da177 2368 * CR3 HDSEL LL_USART_ConfigIrdaMode\n
<> 161:2cc1468da177 2369 * CR3 IREN LL_USART_ConfigIrdaMode
<> 161:2cc1468da177 2370 * @param USARTx USART Instance
<> 161:2cc1468da177 2371 * @retval None
<> 161:2cc1468da177 2372 */
<> 161:2cc1468da177 2373 __STATIC_INLINE void LL_USART_ConfigIrdaMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2374 {
<> 161:2cc1468da177 2375 /* In IRDA mode, the following bits must be kept cleared:
<> 161:2cc1468da177 2376 - LINEN, STOP and CLKEN bits in the USART_CR2 register,
<> 161:2cc1468da177 2377 - SCEN and HDSEL bits in the USART_CR3 register.*/
<> 161:2cc1468da177 2378 CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN | USART_CR2_STOP));
<> 161:2cc1468da177 2379 CLEAR_BIT(USARTx->CR3, (USART_CR3_SCEN | USART_CR3_HDSEL));
<> 161:2cc1468da177 2380 /* set the UART/USART in IRDA mode */
<> 161:2cc1468da177 2381 SET_BIT(USARTx->CR3, USART_CR3_IREN);
<> 161:2cc1468da177 2382 }
<> 161:2cc1468da177 2383
<> 161:2cc1468da177 2384 /**
<> 161:2cc1468da177 2385 * @brief Perform basic configuration of USART for enabling use in Multi processor Mode
<> 161:2cc1468da177 2386 * (several USARTs connected in a network, one of the USARTs can be the master,
<> 161:2cc1468da177 2387 * its TX output connected to the RX inputs of the other slaves USARTs).
<> 161:2cc1468da177 2388 * @note In MultiProcessor mode, the following bits must be kept cleared:
<> 161:2cc1468da177 2389 * - LINEN bit in the USART_CR2 register,
<> 161:2cc1468da177 2390 * - CLKEN bit in the USART_CR2 register,
<> 161:2cc1468da177 2391 * - SCEN bit in the USART_CR3 register,
<> 161:2cc1468da177 2392 * - IREN bit in the USART_CR3 register,
<> 161:2cc1468da177 2393 * - HDSEL bit in the USART_CR3 register.
<> 161:2cc1468da177 2394 * @note Call of this function is equivalent to following function call sequence :
<> 161:2cc1468da177 2395 * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function
<> 161:2cc1468da177 2396 * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function
<> 161:2cc1468da177 2397 * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function
<> 161:2cc1468da177 2398 * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function
<> 161:2cc1468da177 2399 * - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function
<> 161:2cc1468da177 2400 * @note Other remaining configurations items related to Multi processor Mode
<> 161:2cc1468da177 2401 * (as Baud Rate, Wake Up Method, Node address, ...) should be set using
<> 161:2cc1468da177 2402 * dedicated functions
<> 161:2cc1468da177 2403 * @rmtoll CR2 LINEN LL_USART_ConfigMultiProcessMode\n
<> 161:2cc1468da177 2404 * CR2 CLKEN LL_USART_ConfigMultiProcessMode\n
<> 161:2cc1468da177 2405 * CR3 SCEN LL_USART_ConfigMultiProcessMode\n
<> 161:2cc1468da177 2406 * CR3 HDSEL LL_USART_ConfigMultiProcessMode\n
<> 161:2cc1468da177 2407 * CR3 IREN LL_USART_ConfigMultiProcessMode
<> 161:2cc1468da177 2408 * @param USARTx USART Instance
<> 161:2cc1468da177 2409 * @retval None
<> 161:2cc1468da177 2410 */
<> 161:2cc1468da177 2411 __STATIC_INLINE void LL_USART_ConfigMultiProcessMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2412 {
<> 161:2cc1468da177 2413 /* In Multi Processor mode, the following bits must be kept cleared:
<> 161:2cc1468da177 2414 - LINEN and CLKEN bits in the USART_CR2 register,
<> 161:2cc1468da177 2415 - IREN, SCEN and HDSEL bits in the USART_CR3 register.*/
<> 161:2cc1468da177 2416 CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN));
<> 161:2cc1468da177 2417 CLEAR_BIT(USARTx->CR3, (USART_CR3_SCEN | USART_CR3_HDSEL | USART_CR3_IREN));
<> 161:2cc1468da177 2418 }
<> 161:2cc1468da177 2419
<> 161:2cc1468da177 2420 /**
<> 161:2cc1468da177 2421 * @}
<> 161:2cc1468da177 2422 */
<> 161:2cc1468da177 2423
<> 161:2cc1468da177 2424 /** @defgroup USART_LL_EF_FLAG_Management FLAG_Management
<> 161:2cc1468da177 2425 * @{
<> 161:2cc1468da177 2426 */
<> 161:2cc1468da177 2427
<> 161:2cc1468da177 2428 /**
<> 161:2cc1468da177 2429 * @brief Check if the USART Parity Error Flag is set or not
<> 161:2cc1468da177 2430 * @rmtoll ISR PE LL_USART_IsActiveFlag_PE
<> 161:2cc1468da177 2431 * @param USARTx USART Instance
<> 161:2cc1468da177 2432 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2433 */
<> 161:2cc1468da177 2434 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_PE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2435 {
<> 161:2cc1468da177 2436 return (READ_BIT(USARTx->ISR, USART_ISR_PE) == (USART_ISR_PE));
<> 161:2cc1468da177 2437 }
<> 161:2cc1468da177 2438
<> 161:2cc1468da177 2439 /**
<> 161:2cc1468da177 2440 * @brief Check if the USART Framing Error Flag is set or not
<> 161:2cc1468da177 2441 * @rmtoll ISR FE LL_USART_IsActiveFlag_FE
<> 161:2cc1468da177 2442 * @param USARTx USART Instance
<> 161:2cc1468da177 2443 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2444 */
<> 161:2cc1468da177 2445 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_FE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2446 {
<> 161:2cc1468da177 2447 return (READ_BIT(USARTx->ISR, USART_ISR_FE) == (USART_ISR_FE));
<> 161:2cc1468da177 2448 }
<> 161:2cc1468da177 2449
<> 161:2cc1468da177 2450 /**
<> 161:2cc1468da177 2451 * @brief Check if the USART Noise error detected Flag is set or not
<> 161:2cc1468da177 2452 * @rmtoll ISR NF LL_USART_IsActiveFlag_NE
<> 161:2cc1468da177 2453 * @param USARTx USART Instance
<> 161:2cc1468da177 2454 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2455 */
<> 161:2cc1468da177 2456 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_NE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2457 {
<> 161:2cc1468da177 2458 return (READ_BIT(USARTx->ISR, USART_ISR_NE) == (USART_ISR_NE));
<> 161:2cc1468da177 2459 }
<> 161:2cc1468da177 2460
<> 161:2cc1468da177 2461 /**
<> 161:2cc1468da177 2462 * @brief Check if the USART OverRun Error Flag is set or not
<> 161:2cc1468da177 2463 * @rmtoll ISR ORE LL_USART_IsActiveFlag_ORE
<> 161:2cc1468da177 2464 * @param USARTx USART Instance
<> 161:2cc1468da177 2465 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2466 */
<> 161:2cc1468da177 2467 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_ORE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2468 {
<> 161:2cc1468da177 2469 return (READ_BIT(USARTx->ISR, USART_ISR_ORE) == (USART_ISR_ORE));
<> 161:2cc1468da177 2470 }
<> 161:2cc1468da177 2471
<> 161:2cc1468da177 2472 /**
<> 161:2cc1468da177 2473 * @brief Check if the USART IDLE line detected Flag is set or not
<> 161:2cc1468da177 2474 * @rmtoll ISR IDLE LL_USART_IsActiveFlag_IDLE
<> 161:2cc1468da177 2475 * @param USARTx USART Instance
<> 161:2cc1468da177 2476 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2477 */
<> 161:2cc1468da177 2478 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_IDLE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2479 {
<> 161:2cc1468da177 2480 return (READ_BIT(USARTx->ISR, USART_ISR_IDLE) == (USART_ISR_IDLE));
<> 161:2cc1468da177 2481 }
<> 161:2cc1468da177 2482
<> 161:2cc1468da177 2483 /**
<> 161:2cc1468da177 2484 * @brief Check if the USART Read Data Register Not Empty Flag is set or not
<> 161:2cc1468da177 2485 * @rmtoll ISR RXNE LL_USART_IsActiveFlag_RXNE
<> 161:2cc1468da177 2486 * @param USARTx USART Instance
<> 161:2cc1468da177 2487 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2488 */
<> 161:2cc1468da177 2489 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_RXNE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2490 {
<> 161:2cc1468da177 2491 return (READ_BIT(USARTx->ISR, USART_ISR_RXNE) == (USART_ISR_RXNE));
<> 161:2cc1468da177 2492 }
<> 161:2cc1468da177 2493
<> 161:2cc1468da177 2494 /**
<> 161:2cc1468da177 2495 * @brief Check if the USART Transmission Complete Flag is set or not
<> 161:2cc1468da177 2496 * @rmtoll ISR TC LL_USART_IsActiveFlag_TC
<> 161:2cc1468da177 2497 * @param USARTx USART Instance
<> 161:2cc1468da177 2498 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2499 */
<> 161:2cc1468da177 2500 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_TC(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2501 {
<> 161:2cc1468da177 2502 return (READ_BIT(USARTx->ISR, USART_ISR_TC) == (USART_ISR_TC));
<> 161:2cc1468da177 2503 }
<> 161:2cc1468da177 2504
<> 161:2cc1468da177 2505 /**
<> 161:2cc1468da177 2506 * @brief Check if the USART Transmit Data Register Empty Flag is set or not
<> 161:2cc1468da177 2507 * @rmtoll ISR TXE LL_USART_IsActiveFlag_TXE
<> 161:2cc1468da177 2508 * @param USARTx USART Instance
<> 161:2cc1468da177 2509 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2510 */
<> 161:2cc1468da177 2511 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_TXE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2512 {
<> 161:2cc1468da177 2513 return (READ_BIT(USARTx->ISR, USART_ISR_TXE) == (USART_ISR_TXE));
<> 161:2cc1468da177 2514 }
<> 161:2cc1468da177 2515
<> 161:2cc1468da177 2516 /**
<> 161:2cc1468da177 2517 * @brief Check if the USART LIN Break Detection Flag is set or not
<> 161:2cc1468da177 2518 * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2519 * LIN feature is supported by the USARTx instance.
<> 161:2cc1468da177 2520 * @rmtoll ISR LBDF LL_USART_IsActiveFlag_LBD
<> 161:2cc1468da177 2521 * @param USARTx USART Instance
<> 161:2cc1468da177 2522 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2523 */
<> 161:2cc1468da177 2524 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_LBD(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2525 {
<> 161:2cc1468da177 2526 return (READ_BIT(USARTx->ISR, USART_ISR_LBDF) == (USART_ISR_LBDF));
<> 161:2cc1468da177 2527 }
<> 161:2cc1468da177 2528
<> 161:2cc1468da177 2529 /**
<> 161:2cc1468da177 2530 * @brief Check if the USART CTS interrupt Flag is set or not
<> 161:2cc1468da177 2531 * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2532 * Hardware Flow control feature is supported by the USARTx instance.
<> 161:2cc1468da177 2533 * @rmtoll ISR CTSIF LL_USART_IsActiveFlag_nCTS
<> 161:2cc1468da177 2534 * @param USARTx USART Instance
<> 161:2cc1468da177 2535 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2536 */
<> 161:2cc1468da177 2537 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_nCTS(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2538 {
<> 161:2cc1468da177 2539 return (READ_BIT(USARTx->ISR, USART_ISR_CTSIF) == (USART_ISR_CTSIF));
<> 161:2cc1468da177 2540 }
<> 161:2cc1468da177 2541
<> 161:2cc1468da177 2542 /**
<> 161:2cc1468da177 2543 * @brief Check if the USART CTS Flag is set or not
<> 161:2cc1468da177 2544 * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2545 * Hardware Flow control feature is supported by the USARTx instance.
<> 161:2cc1468da177 2546 * @rmtoll ISR CTS LL_USART_IsActiveFlag_CTS
<> 161:2cc1468da177 2547 * @param USARTx USART Instance
<> 161:2cc1468da177 2548 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2549 */
<> 161:2cc1468da177 2550 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_CTS(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2551 {
<> 161:2cc1468da177 2552 return (READ_BIT(USARTx->ISR, USART_ISR_CTS) == (USART_ISR_CTS));
<> 161:2cc1468da177 2553 }
<> 161:2cc1468da177 2554
<> 161:2cc1468da177 2555 /**
<> 161:2cc1468da177 2556 * @brief Check if the USART Receiver Time Out Flag is set or not
<> 161:2cc1468da177 2557 * @rmtoll ISR RTOF LL_USART_IsActiveFlag_RTO
<> 161:2cc1468da177 2558 * @param USARTx USART Instance
<> 161:2cc1468da177 2559 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2560 */
<> 161:2cc1468da177 2561 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_RTO(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2562 {
<> 161:2cc1468da177 2563 return (READ_BIT(USARTx->ISR, USART_ISR_RTOF) == (USART_ISR_RTOF));
<> 161:2cc1468da177 2564 }
<> 161:2cc1468da177 2565
<> 161:2cc1468da177 2566 /**
<> 161:2cc1468da177 2567 * @brief Check if the USART End Of Block Flag is set or not
<> 161:2cc1468da177 2568 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2569 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 2570 * @rmtoll ISR EOBF LL_USART_IsActiveFlag_EOB
<> 161:2cc1468da177 2571 * @param USARTx USART Instance
<> 161:2cc1468da177 2572 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2573 */
<> 161:2cc1468da177 2574 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_EOB(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2575 {
<> 161:2cc1468da177 2576 return (READ_BIT(USARTx->ISR, USART_ISR_EOBF) == (USART_ISR_EOBF));
<> 161:2cc1468da177 2577 }
<> 161:2cc1468da177 2578
<> 161:2cc1468da177 2579 /**
<> 161:2cc1468da177 2580 * @brief Check if the USART Auto-Baud Rate Error Flag is set or not
<> 161:2cc1468da177 2581 * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2582 * Auto Baud Rate detection feature is supported by the USARTx instance.
<> 161:2cc1468da177 2583 * @rmtoll ISR ABRE LL_USART_IsActiveFlag_ABRE
<> 161:2cc1468da177 2584 * @param USARTx USART Instance
<> 161:2cc1468da177 2585 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2586 */
<> 161:2cc1468da177 2587 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_ABRE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2588 {
<> 161:2cc1468da177 2589 return (READ_BIT(USARTx->ISR, USART_ISR_ABRE) == (USART_ISR_ABRE));
<> 161:2cc1468da177 2590 }
<> 161:2cc1468da177 2591
<> 161:2cc1468da177 2592 /**
<> 161:2cc1468da177 2593 * @brief Check if the USART Auto-Baud Rate Flag is set or not
<> 161:2cc1468da177 2594 * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2595 * Auto Baud Rate detection feature is supported by the USARTx instance.
<> 161:2cc1468da177 2596 * @rmtoll ISR ABRF LL_USART_IsActiveFlag_ABR
<> 161:2cc1468da177 2597 * @param USARTx USART Instance
<> 161:2cc1468da177 2598 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2599 */
<> 161:2cc1468da177 2600 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_ABR(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2601 {
<> 161:2cc1468da177 2602 return (READ_BIT(USARTx->ISR, USART_ISR_ABRF) == (USART_ISR_ABRF));
<> 161:2cc1468da177 2603 }
<> 161:2cc1468da177 2604
<> 161:2cc1468da177 2605 /**
<> 161:2cc1468da177 2606 * @brief Check if the USART Busy Flag is set or not
<> 161:2cc1468da177 2607 * @rmtoll ISR BUSY LL_USART_IsActiveFlag_BUSY
<> 161:2cc1468da177 2608 * @param USARTx USART Instance
<> 161:2cc1468da177 2609 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2610 */
<> 161:2cc1468da177 2611 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_BUSY(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2612 {
<> 161:2cc1468da177 2613 return (READ_BIT(USARTx->ISR, USART_ISR_BUSY) == (USART_ISR_BUSY));
<> 161:2cc1468da177 2614 }
<> 161:2cc1468da177 2615
<> 161:2cc1468da177 2616 /**
<> 161:2cc1468da177 2617 * @brief Check if the USART Character Match Flag is set or not
<> 161:2cc1468da177 2618 * @rmtoll ISR CMF LL_USART_IsActiveFlag_CM
<> 161:2cc1468da177 2619 * @param USARTx USART Instance
<> 161:2cc1468da177 2620 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2621 */
<> 161:2cc1468da177 2622 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_CM(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2623 {
<> 161:2cc1468da177 2624 return (READ_BIT(USARTx->ISR, USART_ISR_CMF) == (USART_ISR_CMF));
<> 161:2cc1468da177 2625 }
<> 161:2cc1468da177 2626
<> 161:2cc1468da177 2627 /**
<> 161:2cc1468da177 2628 * @brief Check if the USART Send Break Flag is set or not
<> 161:2cc1468da177 2629 * @rmtoll ISR SBKF LL_USART_IsActiveFlag_SBK
<> 161:2cc1468da177 2630 * @param USARTx USART Instance
<> 161:2cc1468da177 2631 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2632 */
<> 161:2cc1468da177 2633 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_SBK(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2634 {
<> 161:2cc1468da177 2635 return (READ_BIT(USARTx->ISR, USART_ISR_SBKF) == (USART_ISR_SBKF));
<> 161:2cc1468da177 2636 }
<> 161:2cc1468da177 2637
<> 161:2cc1468da177 2638 /**
<> 161:2cc1468da177 2639 * @brief Check if the USART Receive Wake Up from mute mode Flag is set or not
<> 161:2cc1468da177 2640 * @rmtoll ISR RWU LL_USART_IsActiveFlag_RWU
<> 161:2cc1468da177 2641 * @param USARTx USART Instance
<> 161:2cc1468da177 2642 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2643 */
<> 161:2cc1468da177 2644 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_RWU(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2645 {
<> 161:2cc1468da177 2646 return (READ_BIT(USARTx->ISR, USART_ISR_RWU) == (USART_ISR_RWU));
<> 161:2cc1468da177 2647 }
<> 161:2cc1468da177 2648
<> 161:2cc1468da177 2649
<> 161:2cc1468da177 2650 /**
<> 161:2cc1468da177 2651 * @brief Check if the USART Transmit Enable Acknowledge Flag is set or not
<> 161:2cc1468da177 2652 * @rmtoll ISR TEACK LL_USART_IsActiveFlag_TEACK
<> 161:2cc1468da177 2653 * @param USARTx USART Instance
<> 161:2cc1468da177 2654 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2655 */
<> 161:2cc1468da177 2656 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_TEACK(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2657 {
<> 161:2cc1468da177 2658 return (READ_BIT(USARTx->ISR, USART_ISR_TEACK) == (USART_ISR_TEACK));
<> 161:2cc1468da177 2659 }
<> 161:2cc1468da177 2660
<> 161:2cc1468da177 2661
<> 161:2cc1468da177 2662 #if defined(USART_TCBGT_SUPPORT)
<> 161:2cc1468da177 2663 /* Function available only on devices supporting Transmit Complete before Guard Time feature */
<> 161:2cc1468da177 2664 /**
<> 161:2cc1468da177 2665 * @brief Check if the Smartcard Transmission Complete Before Guard Time Flag is set or not
<> 161:2cc1468da177 2666 * @rmtoll ISR TCBGT LL_USART_IsActiveFlag_TCBGT
<> 161:2cc1468da177 2667 * @param USARTx USART Instance
<> 161:2cc1468da177 2668 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 2669 */
<> 161:2cc1468da177 2670 __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_TCBGT(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2671 {
<> 161:2cc1468da177 2672 return (READ_BIT(USARTx->ISR, USART_ISR_TCBGT) == (USART_ISR_TCBGT));
<> 161:2cc1468da177 2673 }
<> 161:2cc1468da177 2674 #endif
<> 161:2cc1468da177 2675
<> 161:2cc1468da177 2676 /**
<> 161:2cc1468da177 2677 * @brief Clear Parity Error Flag
<> 161:2cc1468da177 2678 * @rmtoll ICR PECF LL_USART_ClearFlag_PE
<> 161:2cc1468da177 2679 * @param USARTx USART Instance
<> 161:2cc1468da177 2680 * @retval None
<> 161:2cc1468da177 2681 */
<> 161:2cc1468da177 2682 __STATIC_INLINE void LL_USART_ClearFlag_PE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2683 {
<> 161:2cc1468da177 2684 WRITE_REG(USARTx->ICR, USART_ICR_PECF);
<> 161:2cc1468da177 2685 }
<> 161:2cc1468da177 2686
<> 161:2cc1468da177 2687 /**
<> 161:2cc1468da177 2688 * @brief Clear Framing Error Flag
<> 161:2cc1468da177 2689 * @rmtoll ICR FECF LL_USART_ClearFlag_FE
<> 161:2cc1468da177 2690 * @param USARTx USART Instance
<> 161:2cc1468da177 2691 * @retval None
<> 161:2cc1468da177 2692 */
<> 161:2cc1468da177 2693 __STATIC_INLINE void LL_USART_ClearFlag_FE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2694 {
<> 161:2cc1468da177 2695 WRITE_REG(USARTx->ICR, USART_ICR_FECF);
<> 161:2cc1468da177 2696 }
<> 161:2cc1468da177 2697
<> 161:2cc1468da177 2698 /**
<> 161:2cc1468da177 2699 * @brief Clear Noise detected Flag
<> 161:2cc1468da177 2700 * @rmtoll ICR NCF LL_USART_ClearFlag_NE
<> 161:2cc1468da177 2701 * @param USARTx USART Instance
<> 161:2cc1468da177 2702 * @retval None
<> 161:2cc1468da177 2703 */
<> 161:2cc1468da177 2704 __STATIC_INLINE void LL_USART_ClearFlag_NE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2705 {
<> 161:2cc1468da177 2706 WRITE_REG(USARTx->ICR, USART_ICR_NCF);
<> 161:2cc1468da177 2707 }
<> 161:2cc1468da177 2708
<> 161:2cc1468da177 2709 /**
<> 161:2cc1468da177 2710 * @brief Clear OverRun Error Flag
<> 161:2cc1468da177 2711 * @rmtoll ICR ORECF LL_USART_ClearFlag_ORE
<> 161:2cc1468da177 2712 * @param USARTx USART Instance
<> 161:2cc1468da177 2713 * @retval None
<> 161:2cc1468da177 2714 */
<> 161:2cc1468da177 2715 __STATIC_INLINE void LL_USART_ClearFlag_ORE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2716 {
<> 161:2cc1468da177 2717 WRITE_REG(USARTx->ICR, USART_ICR_ORECF);
<> 161:2cc1468da177 2718 }
<> 161:2cc1468da177 2719
<> 161:2cc1468da177 2720 /**
<> 161:2cc1468da177 2721 * @brief Clear IDLE line detected Flag
<> 161:2cc1468da177 2722 * @rmtoll ICR IDLECF LL_USART_ClearFlag_IDLE
<> 161:2cc1468da177 2723 * @param USARTx USART Instance
<> 161:2cc1468da177 2724 * @retval None
<> 161:2cc1468da177 2725 */
<> 161:2cc1468da177 2726 __STATIC_INLINE void LL_USART_ClearFlag_IDLE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2727 {
<> 161:2cc1468da177 2728 WRITE_REG(USARTx->ICR, USART_ICR_IDLECF);
<> 161:2cc1468da177 2729 }
<> 161:2cc1468da177 2730
<> 161:2cc1468da177 2731 /**
<> 161:2cc1468da177 2732 * @brief Clear Transmission Complete Flag
<> 161:2cc1468da177 2733 * @rmtoll ICR TCCF LL_USART_ClearFlag_TC
<> 161:2cc1468da177 2734 * @param USARTx USART Instance
<> 161:2cc1468da177 2735 * @retval None
<> 161:2cc1468da177 2736 */
<> 161:2cc1468da177 2737 __STATIC_INLINE void LL_USART_ClearFlag_TC(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2738 {
<> 161:2cc1468da177 2739 WRITE_REG(USARTx->ICR, USART_ICR_TCCF);
<> 161:2cc1468da177 2740 }
<> 161:2cc1468da177 2741
<> 161:2cc1468da177 2742 #if defined(USART_TCBGT_SUPPORT)
<> 161:2cc1468da177 2743 /* Function available only on devices supporting Transmit Complete before Guard Time feature */
<> 161:2cc1468da177 2744 /**
<> 161:2cc1468da177 2745 * @brief Clear Smartcard Transmission Complete Before Guard Time Flag
<> 161:2cc1468da177 2746 * @rmtoll ICR TCBGTCF LL_USART_ClearFlag_TCBGT
<> 161:2cc1468da177 2747 * @param USARTx USART Instance
<> 161:2cc1468da177 2748 * @retval None
<> 161:2cc1468da177 2749 */
<> 161:2cc1468da177 2750 __STATIC_INLINE void LL_USART_ClearFlag_TCBGT(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2751 {
<> 161:2cc1468da177 2752 WRITE_REG(USARTx->ICR, USART_ICR_TCBGTCF);
<> 161:2cc1468da177 2753 }
<> 161:2cc1468da177 2754 #endif
<> 161:2cc1468da177 2755
<> 161:2cc1468da177 2756 /**
<> 161:2cc1468da177 2757 * @brief Clear LIN Break Detection Flag
<> 161:2cc1468da177 2758 * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2759 * LIN feature is supported by the USARTx instance.
<> 161:2cc1468da177 2760 * @rmtoll ICR LBDCF LL_USART_ClearFlag_LBD
<> 161:2cc1468da177 2761 * @param USARTx USART Instance
<> 161:2cc1468da177 2762 * @retval None
<> 161:2cc1468da177 2763 */
<> 161:2cc1468da177 2764 __STATIC_INLINE void LL_USART_ClearFlag_LBD(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2765 {
<> 161:2cc1468da177 2766 WRITE_REG(USARTx->ICR, USART_ICR_LBDCF);
<> 161:2cc1468da177 2767 }
<> 161:2cc1468da177 2768
<> 161:2cc1468da177 2769 /**
<> 161:2cc1468da177 2770 * @brief Clear CTS Interrupt Flag
<> 161:2cc1468da177 2771 * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2772 * Hardware Flow control feature is supported by the USARTx instance.
<> 161:2cc1468da177 2773 * @rmtoll ICR CTSCF LL_USART_ClearFlag_nCTS
<> 161:2cc1468da177 2774 * @param USARTx USART Instance
<> 161:2cc1468da177 2775 * @retval None
<> 161:2cc1468da177 2776 */
<> 161:2cc1468da177 2777 __STATIC_INLINE void LL_USART_ClearFlag_nCTS(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2778 {
<> 161:2cc1468da177 2779 WRITE_REG(USARTx->ICR, USART_ICR_CTSCF);
<> 161:2cc1468da177 2780 }
<> 161:2cc1468da177 2781
<> 161:2cc1468da177 2782 /**
<> 161:2cc1468da177 2783 * @brief Clear Receiver Time Out Flag
<> 161:2cc1468da177 2784 * @rmtoll ICR RTOCF LL_USART_ClearFlag_RTO
<> 161:2cc1468da177 2785 * @param USARTx USART Instance
<> 161:2cc1468da177 2786 * @retval None
<> 161:2cc1468da177 2787 */
<> 161:2cc1468da177 2788 __STATIC_INLINE void LL_USART_ClearFlag_RTO(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2789 {
<> 161:2cc1468da177 2790 WRITE_REG(USARTx->ICR, USART_ICR_RTOCF);
<> 161:2cc1468da177 2791 }
<> 161:2cc1468da177 2792
<> 161:2cc1468da177 2793 /**
<> 161:2cc1468da177 2794 * @brief Clear End Of Block Flag
<> 161:2cc1468da177 2795 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2796 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 2797 * @rmtoll ICR EOBCF LL_USART_ClearFlag_EOB
<> 161:2cc1468da177 2798 * @param USARTx USART Instance
<> 161:2cc1468da177 2799 * @retval None
<> 161:2cc1468da177 2800 */
<> 161:2cc1468da177 2801 __STATIC_INLINE void LL_USART_ClearFlag_EOB(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2802 {
<> 161:2cc1468da177 2803 WRITE_REG(USARTx->ICR, USART_ICR_EOBCF);
<> 161:2cc1468da177 2804 }
<> 161:2cc1468da177 2805
<> 161:2cc1468da177 2806 /**
<> 161:2cc1468da177 2807 * @brief Clear Character Match Flag
<> 161:2cc1468da177 2808 * @rmtoll ICR CMCF LL_USART_ClearFlag_CM
<> 161:2cc1468da177 2809 * @param USARTx USART Instance
<> 161:2cc1468da177 2810 * @retval None
<> 161:2cc1468da177 2811 */
<> 161:2cc1468da177 2812 __STATIC_INLINE void LL_USART_ClearFlag_CM(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2813 {
<> 161:2cc1468da177 2814 WRITE_REG(USARTx->ICR, USART_ICR_CMCF);
<> 161:2cc1468da177 2815 }
<> 161:2cc1468da177 2816
<> 161:2cc1468da177 2817
<> 161:2cc1468da177 2818 /**
<> 161:2cc1468da177 2819 * @}
<> 161:2cc1468da177 2820 */
<> 161:2cc1468da177 2821
<> 161:2cc1468da177 2822 /** @defgroup USART_LL_EF_IT_Management IT_Management
<> 161:2cc1468da177 2823 * @{
<> 161:2cc1468da177 2824 */
<> 161:2cc1468da177 2825
<> 161:2cc1468da177 2826 /**
<> 161:2cc1468da177 2827 * @brief Enable IDLE Interrupt
<> 161:2cc1468da177 2828 * @rmtoll CR1 IDLEIE LL_USART_EnableIT_IDLE
<> 161:2cc1468da177 2829 * @param USARTx USART Instance
<> 161:2cc1468da177 2830 * @retval None
<> 161:2cc1468da177 2831 */
<> 161:2cc1468da177 2832 __STATIC_INLINE void LL_USART_EnableIT_IDLE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2833 {
<> 161:2cc1468da177 2834 SET_BIT(USARTx->CR1, USART_CR1_IDLEIE);
<> 161:2cc1468da177 2835 }
<> 161:2cc1468da177 2836
<> 161:2cc1468da177 2837 /**
<> 161:2cc1468da177 2838 * @brief Enable RX Not Empty Interrupt
<> 161:2cc1468da177 2839 * @rmtoll CR1 RXNEIE LL_USART_EnableIT_RXNE
<> 161:2cc1468da177 2840 * @param USARTx USART Instance
<> 161:2cc1468da177 2841 * @retval None
<> 161:2cc1468da177 2842 */
<> 161:2cc1468da177 2843 __STATIC_INLINE void LL_USART_EnableIT_RXNE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2844 {
<> 161:2cc1468da177 2845 SET_BIT(USARTx->CR1, USART_CR1_RXNEIE);
<> 161:2cc1468da177 2846 }
<> 161:2cc1468da177 2847
<> 161:2cc1468da177 2848 /**
<> 161:2cc1468da177 2849 * @brief Enable Transmission Complete Interrupt
<> 161:2cc1468da177 2850 * @rmtoll CR1 TCIE LL_USART_EnableIT_TC
<> 161:2cc1468da177 2851 * @param USARTx USART Instance
<> 161:2cc1468da177 2852 * @retval None
<> 161:2cc1468da177 2853 */
<> 161:2cc1468da177 2854 __STATIC_INLINE void LL_USART_EnableIT_TC(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2855 {
<> 161:2cc1468da177 2856 SET_BIT(USARTx->CR1, USART_CR1_TCIE);
<> 161:2cc1468da177 2857 }
<> 161:2cc1468da177 2858
<> 161:2cc1468da177 2859 /**
<> 161:2cc1468da177 2860 * @brief Enable TX Empty Interrupt
<> 161:2cc1468da177 2861 * @rmtoll CR1 TXEIE LL_USART_EnableIT_TXE
<> 161:2cc1468da177 2862 * @param USARTx USART Instance
<> 161:2cc1468da177 2863 * @retval None
<> 161:2cc1468da177 2864 */
<> 161:2cc1468da177 2865 __STATIC_INLINE void LL_USART_EnableIT_TXE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2866 {
<> 161:2cc1468da177 2867 SET_BIT(USARTx->CR1, USART_CR1_TXEIE);
<> 161:2cc1468da177 2868 }
<> 161:2cc1468da177 2869
<> 161:2cc1468da177 2870 /**
<> 161:2cc1468da177 2871 * @brief Enable Parity Error Interrupt
<> 161:2cc1468da177 2872 * @rmtoll CR1 PEIE LL_USART_EnableIT_PE
<> 161:2cc1468da177 2873 * @param USARTx USART Instance
<> 161:2cc1468da177 2874 * @retval None
<> 161:2cc1468da177 2875 */
<> 161:2cc1468da177 2876 __STATIC_INLINE void LL_USART_EnableIT_PE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2877 {
<> 161:2cc1468da177 2878 SET_BIT(USARTx->CR1, USART_CR1_PEIE);
<> 161:2cc1468da177 2879 }
<> 161:2cc1468da177 2880
<> 161:2cc1468da177 2881 /**
<> 161:2cc1468da177 2882 * @brief Enable Character Match Interrupt
<> 161:2cc1468da177 2883 * @rmtoll CR1 CMIE LL_USART_EnableIT_CM
<> 161:2cc1468da177 2884 * @param USARTx USART Instance
<> 161:2cc1468da177 2885 * @retval None
<> 161:2cc1468da177 2886 */
<> 161:2cc1468da177 2887 __STATIC_INLINE void LL_USART_EnableIT_CM(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2888 {
<> 161:2cc1468da177 2889 SET_BIT(USARTx->CR1, USART_CR1_CMIE);
<> 161:2cc1468da177 2890 }
<> 161:2cc1468da177 2891
<> 161:2cc1468da177 2892 /**
<> 161:2cc1468da177 2893 * @brief Enable Receiver Timeout Interrupt
<> 161:2cc1468da177 2894 * @rmtoll CR1 RTOIE LL_USART_EnableIT_RTO
<> 161:2cc1468da177 2895 * @param USARTx USART Instance
<> 161:2cc1468da177 2896 * @retval None
<> 161:2cc1468da177 2897 */
<> 161:2cc1468da177 2898 __STATIC_INLINE void LL_USART_EnableIT_RTO(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2899 {
<> 161:2cc1468da177 2900 SET_BIT(USARTx->CR1, USART_CR1_RTOIE);
<> 161:2cc1468da177 2901 }
<> 161:2cc1468da177 2902
<> 161:2cc1468da177 2903 /**
<> 161:2cc1468da177 2904 * @brief Enable End Of Block Interrupt
<> 161:2cc1468da177 2905 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2906 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 2907 * @rmtoll CR1 EOBIE LL_USART_EnableIT_EOB
<> 161:2cc1468da177 2908 * @param USARTx USART Instance
<> 161:2cc1468da177 2909 * @retval None
<> 161:2cc1468da177 2910 */
<> 161:2cc1468da177 2911 __STATIC_INLINE void LL_USART_EnableIT_EOB(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2912 {
<> 161:2cc1468da177 2913 SET_BIT(USARTx->CR1, USART_CR1_EOBIE);
<> 161:2cc1468da177 2914 }
<> 161:2cc1468da177 2915
<> 161:2cc1468da177 2916 /**
<> 161:2cc1468da177 2917 * @brief Enable LIN Break Detection Interrupt
<> 161:2cc1468da177 2918 * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2919 * LIN feature is supported by the USARTx instance.
<> 161:2cc1468da177 2920 * @rmtoll CR2 LBDIE LL_USART_EnableIT_LBD
<> 161:2cc1468da177 2921 * @param USARTx USART Instance
<> 161:2cc1468da177 2922 * @retval None
<> 161:2cc1468da177 2923 */
<> 161:2cc1468da177 2924 __STATIC_INLINE void LL_USART_EnableIT_LBD(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2925 {
<> 161:2cc1468da177 2926 SET_BIT(USARTx->CR2, USART_CR2_LBDIE);
<> 161:2cc1468da177 2927 }
<> 161:2cc1468da177 2928
<> 161:2cc1468da177 2929 /**
<> 161:2cc1468da177 2930 * @brief Enable Error Interrupt
<> 161:2cc1468da177 2931 * @note When set, Error Interrupt Enable Bit is enabling interrupt generation in case of a framing
<> 161:2cc1468da177 2932 * error, overrun error or noise flag (FE=1 or ORE=1 or NF=1 in the USARTx_ISR register).
<> 161:2cc1468da177 2933 * 0: Interrupt is inhibited
<> 161:2cc1468da177 2934 * 1: An interrupt is generated when FE=1 or ORE=1 or NF=1 in the USARTx_ISR register.
<> 161:2cc1468da177 2935 * @rmtoll CR3 EIE LL_USART_EnableIT_ERROR
<> 161:2cc1468da177 2936 * @param USARTx USART Instance
<> 161:2cc1468da177 2937 * @retval None
<> 161:2cc1468da177 2938 */
<> 161:2cc1468da177 2939 __STATIC_INLINE void LL_USART_EnableIT_ERROR(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2940 {
<> 161:2cc1468da177 2941 SET_BIT(USARTx->CR3, USART_CR3_EIE);
<> 161:2cc1468da177 2942 }
<> 161:2cc1468da177 2943
<> 161:2cc1468da177 2944 /**
<> 161:2cc1468da177 2945 * @brief Enable CTS Interrupt
<> 161:2cc1468da177 2946 * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2947 * Hardware Flow control feature is supported by the USARTx instance.
<> 161:2cc1468da177 2948 * @rmtoll CR3 CTSIE LL_USART_EnableIT_CTS
<> 161:2cc1468da177 2949 * @param USARTx USART Instance
<> 161:2cc1468da177 2950 * @retval None
<> 161:2cc1468da177 2951 */
<> 161:2cc1468da177 2952 __STATIC_INLINE void LL_USART_EnableIT_CTS(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2953 {
<> 161:2cc1468da177 2954 SET_BIT(USARTx->CR3, USART_CR3_CTSIE);
<> 161:2cc1468da177 2955 }
<> 161:2cc1468da177 2956
<> 161:2cc1468da177 2957
<> 161:2cc1468da177 2958 #if defined(USART_TCBGT_SUPPORT)
<> 161:2cc1468da177 2959 /* Function available only on devices supporting Transmit Complete before Guard Time feature */
<> 161:2cc1468da177 2960 /**
<> 161:2cc1468da177 2961 * @brief Enable Smartcard Transmission Complete Before Guard Time Interrupt
<> 161:2cc1468da177 2962 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 2963 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 2964 * @rmtoll CR3 TCBGTIE LL_USART_EnableIT_TCBGT
<> 161:2cc1468da177 2965 * @param USARTx USART Instance
<> 161:2cc1468da177 2966 * @retval None
<> 161:2cc1468da177 2967 */
<> 161:2cc1468da177 2968 __STATIC_INLINE void LL_USART_EnableIT_TCBGT(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2969 {
<> 161:2cc1468da177 2970 SET_BIT(USARTx->CR3, USART_CR3_TCBGTIE);
<> 161:2cc1468da177 2971 }
<> 161:2cc1468da177 2972 #endif
<> 161:2cc1468da177 2973
<> 161:2cc1468da177 2974 /**
<> 161:2cc1468da177 2975 * @brief Disable IDLE Interrupt
<> 161:2cc1468da177 2976 * @rmtoll CR1 IDLEIE LL_USART_DisableIT_IDLE
<> 161:2cc1468da177 2977 * @param USARTx USART Instance
<> 161:2cc1468da177 2978 * @retval None
<> 161:2cc1468da177 2979 */
<> 161:2cc1468da177 2980 __STATIC_INLINE void LL_USART_DisableIT_IDLE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2981 {
<> 161:2cc1468da177 2982 CLEAR_BIT(USARTx->CR1, USART_CR1_IDLEIE);
<> 161:2cc1468da177 2983 }
<> 161:2cc1468da177 2984
<> 161:2cc1468da177 2985 /**
<> 161:2cc1468da177 2986 * @brief Disable RX Not Empty Interrupt
<> 161:2cc1468da177 2987 * @rmtoll CR1 RXNEIE LL_USART_DisableIT_RXNE
<> 161:2cc1468da177 2988 * @param USARTx USART Instance
<> 161:2cc1468da177 2989 * @retval None
<> 161:2cc1468da177 2990 */
<> 161:2cc1468da177 2991 __STATIC_INLINE void LL_USART_DisableIT_RXNE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 2992 {
<> 161:2cc1468da177 2993 CLEAR_BIT(USARTx->CR1, USART_CR1_RXNEIE);
<> 161:2cc1468da177 2994 }
<> 161:2cc1468da177 2995
<> 161:2cc1468da177 2996 /**
<> 161:2cc1468da177 2997 * @brief Disable Transmission Complete Interrupt
<> 161:2cc1468da177 2998 * @rmtoll CR1 TCIE LL_USART_DisableIT_TC
<> 161:2cc1468da177 2999 * @param USARTx USART Instance
<> 161:2cc1468da177 3000 * @retval None
<> 161:2cc1468da177 3001 */
<> 161:2cc1468da177 3002 __STATIC_INLINE void LL_USART_DisableIT_TC(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3003 {
<> 161:2cc1468da177 3004 CLEAR_BIT(USARTx->CR1, USART_CR1_TCIE);
<> 161:2cc1468da177 3005 }
<> 161:2cc1468da177 3006
<> 161:2cc1468da177 3007 /**
<> 161:2cc1468da177 3008 * @brief Disable TX Empty Interrupt
<> 161:2cc1468da177 3009 * @rmtoll CR1 TXEIE LL_USART_DisableIT_TXE
<> 161:2cc1468da177 3010 * @param USARTx USART Instance
<> 161:2cc1468da177 3011 * @retval None
<> 161:2cc1468da177 3012 */
<> 161:2cc1468da177 3013 __STATIC_INLINE void LL_USART_DisableIT_TXE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3014 {
<> 161:2cc1468da177 3015 CLEAR_BIT(USARTx->CR1, USART_CR1_TXEIE);
<> 161:2cc1468da177 3016 }
<> 161:2cc1468da177 3017
<> 161:2cc1468da177 3018 /**
<> 161:2cc1468da177 3019 * @brief Disable Parity Error Interrupt
<> 161:2cc1468da177 3020 * @rmtoll CR1 PEIE LL_USART_DisableIT_PE
<> 161:2cc1468da177 3021 * @param USARTx USART Instance
<> 161:2cc1468da177 3022 * @retval None
<> 161:2cc1468da177 3023 */
<> 161:2cc1468da177 3024 __STATIC_INLINE void LL_USART_DisableIT_PE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3025 {
<> 161:2cc1468da177 3026 CLEAR_BIT(USARTx->CR1, USART_CR1_PEIE);
<> 161:2cc1468da177 3027 }
<> 161:2cc1468da177 3028
<> 161:2cc1468da177 3029 /**
<> 161:2cc1468da177 3030 * @brief Disable Character Match Interrupt
<> 161:2cc1468da177 3031 * @rmtoll CR1 CMIE LL_USART_DisableIT_CM
<> 161:2cc1468da177 3032 * @param USARTx USART Instance
<> 161:2cc1468da177 3033 * @retval None
<> 161:2cc1468da177 3034 */
<> 161:2cc1468da177 3035 __STATIC_INLINE void LL_USART_DisableIT_CM(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3036 {
<> 161:2cc1468da177 3037 CLEAR_BIT(USARTx->CR1, USART_CR1_CMIE);
<> 161:2cc1468da177 3038 }
<> 161:2cc1468da177 3039
<> 161:2cc1468da177 3040 /**
<> 161:2cc1468da177 3041 * @brief Disable Receiver Timeout Interrupt
<> 161:2cc1468da177 3042 * @rmtoll CR1 RTOIE LL_USART_DisableIT_RTO
<> 161:2cc1468da177 3043 * @param USARTx USART Instance
<> 161:2cc1468da177 3044 * @retval None
<> 161:2cc1468da177 3045 */
<> 161:2cc1468da177 3046 __STATIC_INLINE void LL_USART_DisableIT_RTO(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3047 {
<> 161:2cc1468da177 3048 CLEAR_BIT(USARTx->CR1, USART_CR1_RTOIE);
<> 161:2cc1468da177 3049 }
<> 161:2cc1468da177 3050
<> 161:2cc1468da177 3051 /**
<> 161:2cc1468da177 3052 * @brief Disable End Of Block Interrupt
<> 161:2cc1468da177 3053 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 3054 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 3055 * @rmtoll CR1 EOBIE LL_USART_DisableIT_EOB
<> 161:2cc1468da177 3056 * @param USARTx USART Instance
<> 161:2cc1468da177 3057 * @retval None
<> 161:2cc1468da177 3058 */
<> 161:2cc1468da177 3059 __STATIC_INLINE void LL_USART_DisableIT_EOB(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3060 {
<> 161:2cc1468da177 3061 CLEAR_BIT(USARTx->CR1, USART_CR1_EOBIE);
<> 161:2cc1468da177 3062 }
<> 161:2cc1468da177 3063
<> 161:2cc1468da177 3064 /**
<> 161:2cc1468da177 3065 * @brief Disable LIN Break Detection Interrupt
<> 161:2cc1468da177 3066 * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 3067 * LIN feature is supported by the USARTx instance.
<> 161:2cc1468da177 3068 * @rmtoll CR2 LBDIE LL_USART_DisableIT_LBD
<> 161:2cc1468da177 3069 * @param USARTx USART Instance
<> 161:2cc1468da177 3070 * @retval None
<> 161:2cc1468da177 3071 */
<> 161:2cc1468da177 3072 __STATIC_INLINE void LL_USART_DisableIT_LBD(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3073 {
<> 161:2cc1468da177 3074 CLEAR_BIT(USARTx->CR2, USART_CR2_LBDIE);
<> 161:2cc1468da177 3075 }
<> 161:2cc1468da177 3076
<> 161:2cc1468da177 3077 /**
<> 161:2cc1468da177 3078 * @brief Disable Error Interrupt
<> 161:2cc1468da177 3079 * @note When set, Error Interrupt Enable Bit is enabling interrupt generation in case of a framing
<> 161:2cc1468da177 3080 * error, overrun error or noise flag (FE=1 or ORE=1 or NF=1 in the USARTx_ISR register).
<> 161:2cc1468da177 3081 * 0: Interrupt is inhibited
<> 161:2cc1468da177 3082 * 1: An interrupt is generated when FE=1 or ORE=1 or NF=1 in the USARTx_ISR register.
<> 161:2cc1468da177 3083 * @rmtoll CR3 EIE LL_USART_DisableIT_ERROR
<> 161:2cc1468da177 3084 * @param USARTx USART Instance
<> 161:2cc1468da177 3085 * @retval None
<> 161:2cc1468da177 3086 */
<> 161:2cc1468da177 3087 __STATIC_INLINE void LL_USART_DisableIT_ERROR(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3088 {
<> 161:2cc1468da177 3089 CLEAR_BIT(USARTx->CR3, USART_CR3_EIE);
<> 161:2cc1468da177 3090 }
<> 161:2cc1468da177 3091
<> 161:2cc1468da177 3092 /**
<> 161:2cc1468da177 3093 * @brief Disable CTS Interrupt
<> 161:2cc1468da177 3094 * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 3095 * Hardware Flow control feature is supported by the USARTx instance.
<> 161:2cc1468da177 3096 * @rmtoll CR3 CTSIE LL_USART_DisableIT_CTS
<> 161:2cc1468da177 3097 * @param USARTx USART Instance
<> 161:2cc1468da177 3098 * @retval None
<> 161:2cc1468da177 3099 */
<> 161:2cc1468da177 3100 __STATIC_INLINE void LL_USART_DisableIT_CTS(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3101 {
<> 161:2cc1468da177 3102 CLEAR_BIT(USARTx->CR3, USART_CR3_CTSIE);
<> 161:2cc1468da177 3103 }
<> 161:2cc1468da177 3104
<> 161:2cc1468da177 3105
<> 161:2cc1468da177 3106 #if defined(USART_TCBGT_SUPPORT)
<> 161:2cc1468da177 3107 /* Function available only on devices supporting Transmit Complete before Guard Time feature */
<> 161:2cc1468da177 3108 /**
<> 161:2cc1468da177 3109 * @brief Disable Smartcard Transmission Complete Before Guard Time Interrupt
<> 161:2cc1468da177 3110 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 3111 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 3112 * @rmtoll CR3 TCBGTIE LL_USART_DisableIT_TCBGT
<> 161:2cc1468da177 3113 * @param USARTx USART Instance
<> 161:2cc1468da177 3114 * @retval None
<> 161:2cc1468da177 3115 */
<> 161:2cc1468da177 3116 __STATIC_INLINE void LL_USART_DisableIT_TCBGT(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3117 {
<> 161:2cc1468da177 3118 CLEAR_BIT(USARTx->CR3, USART_CR3_TCBGTIE);
<> 161:2cc1468da177 3119 }
<> 161:2cc1468da177 3120 #endif
<> 161:2cc1468da177 3121
<> 161:2cc1468da177 3122 /**
<> 161:2cc1468da177 3123 * @brief Check if the USART IDLE Interrupt source is enabled or disabled.
<> 161:2cc1468da177 3124 * @rmtoll CR1 IDLEIE LL_USART_IsEnabledIT_IDLE
<> 161:2cc1468da177 3125 * @param USARTx USART Instance
<> 161:2cc1468da177 3126 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 3127 */
<> 161:2cc1468da177 3128 __STATIC_INLINE uint32_t LL_USART_IsEnabledIT_IDLE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3129 {
<> 161:2cc1468da177 3130 return (READ_BIT(USARTx->CR1, USART_CR1_IDLEIE) == (USART_CR1_IDLEIE));
<> 161:2cc1468da177 3131 }
<> 161:2cc1468da177 3132
<> 161:2cc1468da177 3133 /**
<> 161:2cc1468da177 3134 * @brief Check if the USART RX Not Empty Interrupt is enabled or disabled.
<> 161:2cc1468da177 3135 * @rmtoll CR1 RXNEIE LL_USART_IsEnabledIT_RXNE
<> 161:2cc1468da177 3136 * @param USARTx USART Instance
<> 161:2cc1468da177 3137 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 3138 */
<> 161:2cc1468da177 3139 __STATIC_INLINE uint32_t LL_USART_IsEnabledIT_RXNE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3140 {
<> 161:2cc1468da177 3141 return (READ_BIT(USARTx->CR1, USART_CR1_RXNEIE) == (USART_CR1_RXNEIE));
<> 161:2cc1468da177 3142 }
<> 161:2cc1468da177 3143
<> 161:2cc1468da177 3144 /**
<> 161:2cc1468da177 3145 * @brief Check if the USART Transmission Complete Interrupt is enabled or disabled.
<> 161:2cc1468da177 3146 * @rmtoll CR1 TCIE LL_USART_IsEnabledIT_TC
<> 161:2cc1468da177 3147 * @param USARTx USART Instance
<> 161:2cc1468da177 3148 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 3149 */
<> 161:2cc1468da177 3150 __STATIC_INLINE uint32_t LL_USART_IsEnabledIT_TC(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3151 {
<> 161:2cc1468da177 3152 return (READ_BIT(USARTx->CR1, USART_CR1_TCIE) == (USART_CR1_TCIE));
<> 161:2cc1468da177 3153 }
<> 161:2cc1468da177 3154
<> 161:2cc1468da177 3155 /**
<> 161:2cc1468da177 3156 * @brief Check if the USART TX Empty Interrupt is enabled or disabled.
<> 161:2cc1468da177 3157 * @rmtoll CR1 TXEIE LL_USART_IsEnabledIT_TXE
<> 161:2cc1468da177 3158 * @param USARTx USART Instance
<> 161:2cc1468da177 3159 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 3160 */
<> 161:2cc1468da177 3161 __STATIC_INLINE uint32_t LL_USART_IsEnabledIT_TXE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3162 {
<> 161:2cc1468da177 3163 return (READ_BIT(USARTx->CR1, USART_CR1_TXEIE) == (USART_CR1_TXEIE));
<> 161:2cc1468da177 3164 }
<> 161:2cc1468da177 3165
<> 161:2cc1468da177 3166 /**
<> 161:2cc1468da177 3167 * @brief Check if the USART Parity Error Interrupt is enabled or disabled.
<> 161:2cc1468da177 3168 * @rmtoll CR1 PEIE LL_USART_IsEnabledIT_PE
<> 161:2cc1468da177 3169 * @param USARTx USART Instance
<> 161:2cc1468da177 3170 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 3171 */
<> 161:2cc1468da177 3172 __STATIC_INLINE uint32_t LL_USART_IsEnabledIT_PE(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3173 {
<> 161:2cc1468da177 3174 return (READ_BIT(USARTx->CR1, USART_CR1_PEIE) == (USART_CR1_PEIE));
<> 161:2cc1468da177 3175 }
<> 161:2cc1468da177 3176
<> 161:2cc1468da177 3177 /**
<> 161:2cc1468da177 3178 * @brief Check if the USART Character Match Interrupt is enabled or disabled.
<> 161:2cc1468da177 3179 * @rmtoll CR1 CMIE LL_USART_IsEnabledIT_CM
<> 161:2cc1468da177 3180 * @param USARTx USART Instance
<> 161:2cc1468da177 3181 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 3182 */
<> 161:2cc1468da177 3183 __STATIC_INLINE uint32_t LL_USART_IsEnabledIT_CM(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3184 {
<> 161:2cc1468da177 3185 return (READ_BIT(USARTx->CR1, USART_CR1_CMIE) == (USART_CR1_CMIE));
<> 161:2cc1468da177 3186 }
<> 161:2cc1468da177 3187
<> 161:2cc1468da177 3188 /**
<> 161:2cc1468da177 3189 * @brief Check if the USART Receiver Timeout Interrupt is enabled or disabled.
<> 161:2cc1468da177 3190 * @rmtoll CR1 RTOIE LL_USART_IsEnabledIT_RTO
<> 161:2cc1468da177 3191 * @param USARTx USART Instance
<> 161:2cc1468da177 3192 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 3193 */
<> 161:2cc1468da177 3194 __STATIC_INLINE uint32_t LL_USART_IsEnabledIT_RTO(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3195 {
<> 161:2cc1468da177 3196 return (READ_BIT(USARTx->CR1, USART_CR1_RTOIE) == (USART_CR1_RTOIE));
<> 161:2cc1468da177 3197 }
<> 161:2cc1468da177 3198
<> 161:2cc1468da177 3199 /**
<> 161:2cc1468da177 3200 * @brief Check if the USART End Of Block Interrupt is enabled or disabled.
<> 161:2cc1468da177 3201 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 3202 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 3203 * @rmtoll CR1 EOBIE LL_USART_IsEnabledIT_EOB
<> 161:2cc1468da177 3204 * @param USARTx USART Instance
<> 161:2cc1468da177 3205 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 3206 */
<> 161:2cc1468da177 3207 __STATIC_INLINE uint32_t LL_USART_IsEnabledIT_EOB(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3208 {
<> 161:2cc1468da177 3209 return (READ_BIT(USARTx->CR1, USART_CR1_EOBIE) == (USART_CR1_EOBIE));
<> 161:2cc1468da177 3210 }
<> 161:2cc1468da177 3211
<> 161:2cc1468da177 3212 /**
<> 161:2cc1468da177 3213 * @brief Check if the USART LIN Break Detection Interrupt is enabled or disabled.
<> 161:2cc1468da177 3214 * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 3215 * LIN feature is supported by the USARTx instance.
<> 161:2cc1468da177 3216 * @rmtoll CR2 LBDIE LL_USART_IsEnabledIT_LBD
<> 161:2cc1468da177 3217 * @param USARTx USART Instance
<> 161:2cc1468da177 3218 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 3219 */
<> 161:2cc1468da177 3220 __STATIC_INLINE uint32_t LL_USART_IsEnabledIT_LBD(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3221 {
<> 161:2cc1468da177 3222 return (READ_BIT(USARTx->CR2, USART_CR2_LBDIE) == (USART_CR2_LBDIE));
<> 161:2cc1468da177 3223 }
<> 161:2cc1468da177 3224
<> 161:2cc1468da177 3225 /**
<> 161:2cc1468da177 3226 * @brief Check if the USART Error Interrupt is enabled or disabled.
<> 161:2cc1468da177 3227 * @rmtoll CR3 EIE LL_USART_IsEnabledIT_ERROR
<> 161:2cc1468da177 3228 * @param USARTx USART Instance
<> 161:2cc1468da177 3229 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 3230 */
<> 161:2cc1468da177 3231 __STATIC_INLINE uint32_t LL_USART_IsEnabledIT_ERROR(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3232 {
<> 161:2cc1468da177 3233 return (READ_BIT(USARTx->CR3, USART_CR3_EIE) == (USART_CR3_EIE));
<> 161:2cc1468da177 3234 }
<> 161:2cc1468da177 3235
<> 161:2cc1468da177 3236 /**
<> 161:2cc1468da177 3237 * @brief Check if the USART CTS Interrupt is enabled or disabled.
<> 161:2cc1468da177 3238 * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 3239 * Hardware Flow control feature is supported by the USARTx instance.
<> 161:2cc1468da177 3240 * @rmtoll CR3 CTSIE LL_USART_IsEnabledIT_CTS
<> 161:2cc1468da177 3241 * @param USARTx USART Instance
<> 161:2cc1468da177 3242 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 3243 */
<> 161:2cc1468da177 3244 __STATIC_INLINE uint32_t LL_USART_IsEnabledIT_CTS(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3245 {
<> 161:2cc1468da177 3246 return (READ_BIT(USARTx->CR3, USART_CR3_CTSIE) == (USART_CR3_CTSIE));
<> 161:2cc1468da177 3247 }
<> 161:2cc1468da177 3248
<> 161:2cc1468da177 3249
<> 161:2cc1468da177 3250 #if defined(USART_TCBGT_SUPPORT)
<> 161:2cc1468da177 3251 /* Function available only on devices supporting Transmit Complete before Guard Time feature */
<> 161:2cc1468da177 3252 /**
<> 161:2cc1468da177 3253 * @brief Check if the Smartcard Transmission Complete Before Guard Time Interrupt is enabled or disabled.
<> 161:2cc1468da177 3254 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 3255 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 3256 * @rmtoll CR3 TCBGTIE LL_USART_IsEnabledIT_TCBGT
<> 161:2cc1468da177 3257 * @param USARTx USART Instance
<> 161:2cc1468da177 3258 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 3259 */
<> 161:2cc1468da177 3260 __STATIC_INLINE uint32_t LL_USART_IsEnabledIT_TCBGT(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3261 {
<> 161:2cc1468da177 3262 return (READ_BIT(USARTx->CR3, USART_CR3_TCBGTIE) == (USART_CR3_TCBGTIE));
<> 161:2cc1468da177 3263 }
<> 161:2cc1468da177 3264 #endif
<> 161:2cc1468da177 3265
<> 161:2cc1468da177 3266 /**
<> 161:2cc1468da177 3267 * @}
<> 161:2cc1468da177 3268 */
<> 161:2cc1468da177 3269
<> 161:2cc1468da177 3270 /** @defgroup USART_LL_EF_DMA_Management DMA_Management
<> 161:2cc1468da177 3271 * @{
<> 161:2cc1468da177 3272 */
<> 161:2cc1468da177 3273
<> 161:2cc1468da177 3274 /**
<> 161:2cc1468da177 3275 * @brief Enable DMA Mode for reception
<> 161:2cc1468da177 3276 * @rmtoll CR3 DMAR LL_USART_EnableDMAReq_RX
<> 161:2cc1468da177 3277 * @param USARTx USART Instance
<> 161:2cc1468da177 3278 * @retval None
<> 161:2cc1468da177 3279 */
<> 161:2cc1468da177 3280 __STATIC_INLINE void LL_USART_EnableDMAReq_RX(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3281 {
<> 161:2cc1468da177 3282 SET_BIT(USARTx->CR3, USART_CR3_DMAR);
<> 161:2cc1468da177 3283 }
<> 161:2cc1468da177 3284
<> 161:2cc1468da177 3285 /**
<> 161:2cc1468da177 3286 * @brief Disable DMA Mode for reception
<> 161:2cc1468da177 3287 * @rmtoll CR3 DMAR LL_USART_DisableDMAReq_RX
<> 161:2cc1468da177 3288 * @param USARTx USART Instance
<> 161:2cc1468da177 3289 * @retval None
<> 161:2cc1468da177 3290 */
<> 161:2cc1468da177 3291 __STATIC_INLINE void LL_USART_DisableDMAReq_RX(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3292 {
<> 161:2cc1468da177 3293 CLEAR_BIT(USARTx->CR3, USART_CR3_DMAR);
<> 161:2cc1468da177 3294 }
<> 161:2cc1468da177 3295
<> 161:2cc1468da177 3296 /**
<> 161:2cc1468da177 3297 * @brief Check if DMA Mode is enabled for reception
<> 161:2cc1468da177 3298 * @rmtoll CR3 DMAR LL_USART_IsEnabledDMAReq_RX
<> 161:2cc1468da177 3299 * @param USARTx USART Instance
<> 161:2cc1468da177 3300 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 3301 */
<> 161:2cc1468da177 3302 __STATIC_INLINE uint32_t LL_USART_IsEnabledDMAReq_RX(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3303 {
<> 161:2cc1468da177 3304 return (READ_BIT(USARTx->CR3, USART_CR3_DMAR) == (USART_CR3_DMAR));
<> 161:2cc1468da177 3305 }
<> 161:2cc1468da177 3306
<> 161:2cc1468da177 3307 /**
<> 161:2cc1468da177 3308 * @brief Enable DMA Mode for transmission
<> 161:2cc1468da177 3309 * @rmtoll CR3 DMAT LL_USART_EnableDMAReq_TX
<> 161:2cc1468da177 3310 * @param USARTx USART Instance
<> 161:2cc1468da177 3311 * @retval None
<> 161:2cc1468da177 3312 */
<> 161:2cc1468da177 3313 __STATIC_INLINE void LL_USART_EnableDMAReq_TX(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3314 {
<> 161:2cc1468da177 3315 SET_BIT(USARTx->CR3, USART_CR3_DMAT);
<> 161:2cc1468da177 3316 }
<> 161:2cc1468da177 3317
<> 161:2cc1468da177 3318 /**
<> 161:2cc1468da177 3319 * @brief Disable DMA Mode for transmission
<> 161:2cc1468da177 3320 * @rmtoll CR3 DMAT LL_USART_DisableDMAReq_TX
<> 161:2cc1468da177 3321 * @param USARTx USART Instance
<> 161:2cc1468da177 3322 * @retval None
<> 161:2cc1468da177 3323 */
<> 161:2cc1468da177 3324 __STATIC_INLINE void LL_USART_DisableDMAReq_TX(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3325 {
<> 161:2cc1468da177 3326 CLEAR_BIT(USARTx->CR3, USART_CR3_DMAT);
<> 161:2cc1468da177 3327 }
<> 161:2cc1468da177 3328
<> 161:2cc1468da177 3329 /**
<> 161:2cc1468da177 3330 * @brief Check if DMA Mode is enabled for transmission
<> 161:2cc1468da177 3331 * @rmtoll CR3 DMAT LL_USART_IsEnabledDMAReq_TX
<> 161:2cc1468da177 3332 * @param USARTx USART Instance
<> 161:2cc1468da177 3333 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 3334 */
<> 161:2cc1468da177 3335 __STATIC_INLINE uint32_t LL_USART_IsEnabledDMAReq_TX(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3336 {
<> 161:2cc1468da177 3337 return (READ_BIT(USARTx->CR3, USART_CR3_DMAT) == (USART_CR3_DMAT));
<> 161:2cc1468da177 3338 }
<> 161:2cc1468da177 3339
<> 161:2cc1468da177 3340 /**
<> 161:2cc1468da177 3341 * @brief Enable DMA Disabling on Reception Error
<> 161:2cc1468da177 3342 * @rmtoll CR3 DDRE LL_USART_EnableDMADeactOnRxErr
<> 161:2cc1468da177 3343 * @param USARTx USART Instance
<> 161:2cc1468da177 3344 * @retval None
<> 161:2cc1468da177 3345 */
<> 161:2cc1468da177 3346 __STATIC_INLINE void LL_USART_EnableDMADeactOnRxErr(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3347 {
<> 161:2cc1468da177 3348 SET_BIT(USARTx->CR3, USART_CR3_DDRE);
<> 161:2cc1468da177 3349 }
<> 161:2cc1468da177 3350
<> 161:2cc1468da177 3351 /**
<> 161:2cc1468da177 3352 * @brief Disable DMA Disabling on Reception Error
<> 161:2cc1468da177 3353 * @rmtoll CR3 DDRE LL_USART_DisableDMADeactOnRxErr
<> 161:2cc1468da177 3354 * @param USARTx USART Instance
<> 161:2cc1468da177 3355 * @retval None
<> 161:2cc1468da177 3356 */
<> 161:2cc1468da177 3357 __STATIC_INLINE void LL_USART_DisableDMADeactOnRxErr(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3358 {
<> 161:2cc1468da177 3359 CLEAR_BIT(USARTx->CR3, USART_CR3_DDRE);
<> 161:2cc1468da177 3360 }
<> 161:2cc1468da177 3361
<> 161:2cc1468da177 3362 /**
<> 161:2cc1468da177 3363 * @brief Indicate if DMA Disabling on Reception Error is disabled
<> 161:2cc1468da177 3364 * @rmtoll CR3 DDRE LL_USART_IsEnabledDMADeactOnRxErr
<> 161:2cc1468da177 3365 * @param USARTx USART Instance
<> 161:2cc1468da177 3366 * @retval State of bit (1 or 0).
<> 161:2cc1468da177 3367 */
<> 161:2cc1468da177 3368 __STATIC_INLINE uint32_t LL_USART_IsEnabledDMADeactOnRxErr(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3369 {
<> 161:2cc1468da177 3370 return (READ_BIT(USARTx->CR3, USART_CR3_DDRE) == (USART_CR3_DDRE));
<> 161:2cc1468da177 3371 }
<> 161:2cc1468da177 3372
<> 161:2cc1468da177 3373 /**
<> 161:2cc1468da177 3374 * @brief Get the data register address used for DMA transfer
<> 161:2cc1468da177 3375 * @rmtoll RDR RDR LL_USART_DMA_GetRegAddr\n
<> 161:2cc1468da177 3376 * @rmtoll TDR TDR LL_USART_DMA_GetRegAddr
<> 161:2cc1468da177 3377 * @param USARTx USART Instance
<> 161:2cc1468da177 3378 * @param Direction This parameter can be one of the following values:
<> 161:2cc1468da177 3379 * @arg @ref LL_USART_DMA_REG_DATA_TRANSMIT
<> 161:2cc1468da177 3380 * @arg @ref LL_USART_DMA_REG_DATA_RECEIVE
<> 161:2cc1468da177 3381 * @retval Address of data register
<> 161:2cc1468da177 3382 */
<> 161:2cc1468da177 3383 __STATIC_INLINE uint32_t LL_USART_DMA_GetRegAddr(USART_TypeDef *USARTx, uint32_t Direction)
<> 161:2cc1468da177 3384 {
<> 161:2cc1468da177 3385 register uint32_t data_reg_addr = 0U;
<> 161:2cc1468da177 3386
<> 161:2cc1468da177 3387 if (Direction == LL_USART_DMA_REG_DATA_TRANSMIT)
<> 161:2cc1468da177 3388 {
<> 161:2cc1468da177 3389 /* return address of TDR register */
<> 161:2cc1468da177 3390 data_reg_addr = (uint32_t) &(USARTx->TDR);
<> 161:2cc1468da177 3391 }
<> 161:2cc1468da177 3392 else
<> 161:2cc1468da177 3393 {
<> 161:2cc1468da177 3394 /* return address of RDR register */
<> 161:2cc1468da177 3395 data_reg_addr = (uint32_t) &(USARTx->RDR);
<> 161:2cc1468da177 3396 }
<> 161:2cc1468da177 3397
<> 161:2cc1468da177 3398 return data_reg_addr;
<> 161:2cc1468da177 3399 }
<> 161:2cc1468da177 3400
<> 161:2cc1468da177 3401 /**
<> 161:2cc1468da177 3402 * @}
<> 161:2cc1468da177 3403 */
<> 161:2cc1468da177 3404
<> 161:2cc1468da177 3405 /** @defgroup USART_LL_EF_Data_Management Data_Management
<> 161:2cc1468da177 3406 * @{
<> 161:2cc1468da177 3407 */
<> 161:2cc1468da177 3408
<> 161:2cc1468da177 3409 /**
<> 161:2cc1468da177 3410 * @brief Read Receiver Data register (Receive Data value, 8 bits)
<> 161:2cc1468da177 3411 * @rmtoll RDR RDR LL_USART_ReceiveData8
<> 161:2cc1468da177 3412 * @param USARTx USART Instance
<> 161:2cc1468da177 3413 * @retval Value between Min_Data=0x00 and Max_Data=0xFF
<> 161:2cc1468da177 3414 */
<> 161:2cc1468da177 3415 __STATIC_INLINE uint8_t LL_USART_ReceiveData8(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3416 {
<> 161:2cc1468da177 3417 return (uint8_t)(READ_BIT(USARTx->RDR, USART_RDR_RDR));
<> 161:2cc1468da177 3418 }
<> 161:2cc1468da177 3419
<> 161:2cc1468da177 3420 /**
<> 161:2cc1468da177 3421 * @brief Read Receiver Data register (Receive Data value, 9 bits)
<> 161:2cc1468da177 3422 * @rmtoll RDR RDR LL_USART_ReceiveData9
<> 161:2cc1468da177 3423 * @param USARTx USART Instance
<> 161:2cc1468da177 3424 * @retval Value between Min_Data=0x00 and Max_Data=0x1FF
<> 161:2cc1468da177 3425 */
<> 161:2cc1468da177 3426 __STATIC_INLINE uint16_t LL_USART_ReceiveData9(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3427 {
<> 161:2cc1468da177 3428 return (uint16_t)(READ_BIT(USARTx->RDR, USART_RDR_RDR));
<> 161:2cc1468da177 3429 }
<> 161:2cc1468da177 3430
<> 161:2cc1468da177 3431 /**
<> 161:2cc1468da177 3432 * @brief Write in Transmitter Data Register (Transmit Data value, 8 bits)
<> 161:2cc1468da177 3433 * @rmtoll TDR TDR LL_USART_TransmitData8
<> 161:2cc1468da177 3434 * @param USARTx USART Instance
<> 161:2cc1468da177 3435 * @param Value between Min_Data=0x00 and Max_Data=0xFF
<> 161:2cc1468da177 3436 * @retval None
<> 161:2cc1468da177 3437 */
<> 161:2cc1468da177 3438 __STATIC_INLINE void LL_USART_TransmitData8(USART_TypeDef *USARTx, uint8_t Value)
<> 161:2cc1468da177 3439 {
<> 161:2cc1468da177 3440 USARTx->TDR = Value;
<> 161:2cc1468da177 3441 }
<> 161:2cc1468da177 3442
<> 161:2cc1468da177 3443 /**
<> 161:2cc1468da177 3444 * @brief Write in Transmitter Data Register (Transmit Data value, 9 bits)
<> 161:2cc1468da177 3445 * @rmtoll TDR TDR LL_USART_TransmitData9
<> 161:2cc1468da177 3446 * @param USARTx USART Instance
<> 161:2cc1468da177 3447 * @param Value between Min_Data=0x00 and Max_Data=0x1FF
<> 161:2cc1468da177 3448 * @retval None
<> 161:2cc1468da177 3449 */
<> 161:2cc1468da177 3450 __STATIC_INLINE void LL_USART_TransmitData9(USART_TypeDef *USARTx, uint16_t Value)
<> 161:2cc1468da177 3451 {
<> 161:2cc1468da177 3452 USARTx->TDR = Value & 0x1FFU;
<> 161:2cc1468da177 3453 }
<> 161:2cc1468da177 3454
<> 161:2cc1468da177 3455 /**
<> 161:2cc1468da177 3456 * @}
<> 161:2cc1468da177 3457 */
<> 161:2cc1468da177 3458
<> 161:2cc1468da177 3459 /** @defgroup USART_LL_EF_Execution Execution
<> 161:2cc1468da177 3460 * @{
<> 161:2cc1468da177 3461 */
<> 161:2cc1468da177 3462
<> 161:2cc1468da177 3463 /**
<> 161:2cc1468da177 3464 * @brief Request an Automatic Baud Rate measurement on next received data frame
<> 161:2cc1468da177 3465 * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 3466 * Auto Baud Rate detection feature is supported by the USARTx instance.
<> 161:2cc1468da177 3467 * @rmtoll RQR ABRRQ LL_USART_RequestAutoBaudRate
<> 161:2cc1468da177 3468 * @param USARTx USART Instance
<> 161:2cc1468da177 3469 * @retval None
<> 161:2cc1468da177 3470 */
<> 161:2cc1468da177 3471 __STATIC_INLINE void LL_USART_RequestAutoBaudRate(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3472 {
<> 161:2cc1468da177 3473 SET_BIT(USARTx->RQR, USART_RQR_ABRRQ);
<> 161:2cc1468da177 3474 }
<> 161:2cc1468da177 3475
<> 161:2cc1468da177 3476 /**
<> 161:2cc1468da177 3477 * @brief Request Break sending
<> 161:2cc1468da177 3478 * @rmtoll RQR SBKRQ LL_USART_RequestBreakSending
<> 161:2cc1468da177 3479 * @param USARTx USART Instance
<> 161:2cc1468da177 3480 * @retval None
<> 161:2cc1468da177 3481 */
<> 161:2cc1468da177 3482 __STATIC_INLINE void LL_USART_RequestBreakSending(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3483 {
<> 161:2cc1468da177 3484 SET_BIT(USARTx->RQR, USART_RQR_SBKRQ);
<> 161:2cc1468da177 3485 }
<> 161:2cc1468da177 3486
<> 161:2cc1468da177 3487 /**
<> 161:2cc1468da177 3488 * @brief Put USART in mute mode and set the RWU flag
<> 161:2cc1468da177 3489 * @rmtoll RQR MMRQ LL_USART_RequestEnterMuteMode
<> 161:2cc1468da177 3490 * @param USARTx USART Instance
<> 161:2cc1468da177 3491 * @retval None
<> 161:2cc1468da177 3492 */
<> 161:2cc1468da177 3493 __STATIC_INLINE void LL_USART_RequestEnterMuteMode(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3494 {
<> 161:2cc1468da177 3495 SET_BIT(USARTx->RQR, USART_RQR_MMRQ);
<> 161:2cc1468da177 3496 }
<> 161:2cc1468da177 3497
<> 161:2cc1468da177 3498 /**
<> 161:2cc1468da177 3499 * @brief Request a Receive Data flush
<> 161:2cc1468da177 3500 * @rmtoll RQR RXFRQ LL_USART_RequestRxDataFlush
<> 161:2cc1468da177 3501 * @param USARTx USART Instance
<> 161:2cc1468da177 3502 * @retval None
<> 161:2cc1468da177 3503 */
<> 161:2cc1468da177 3504 __STATIC_INLINE void LL_USART_RequestRxDataFlush(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3505 {
<> 161:2cc1468da177 3506 SET_BIT(USARTx->RQR, USART_RQR_RXFRQ);
<> 161:2cc1468da177 3507 }
<> 161:2cc1468da177 3508
<> 161:2cc1468da177 3509 /**
<> 161:2cc1468da177 3510 * @brief Request a Transmit data flush
<> 161:2cc1468da177 3511 * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not
<> 161:2cc1468da177 3512 * Smartcard feature is supported by the USARTx instance.
<> 161:2cc1468da177 3513 * @rmtoll RQR TXFRQ LL_USART_RequestTxDataFlush
<> 161:2cc1468da177 3514 * @param USARTx USART Instance
<> 161:2cc1468da177 3515 * @retval None
<> 161:2cc1468da177 3516 */
<> 161:2cc1468da177 3517 __STATIC_INLINE void LL_USART_RequestTxDataFlush(USART_TypeDef *USARTx)
<> 161:2cc1468da177 3518 {
<> 161:2cc1468da177 3519 SET_BIT(USARTx->RQR, USART_RQR_TXFRQ);
<> 161:2cc1468da177 3520 }
<> 161:2cc1468da177 3521
<> 161:2cc1468da177 3522 /**
<> 161:2cc1468da177 3523 * @}
<> 161:2cc1468da177 3524 */
<> 161:2cc1468da177 3525
<> 161:2cc1468da177 3526 #if defined(USE_FULL_LL_DRIVER)
<> 161:2cc1468da177 3527 /** @defgroup USART_LL_EF_Init Initialization and de-initialization functions
<> 161:2cc1468da177 3528 * @{
<> 161:2cc1468da177 3529 */
<> 161:2cc1468da177 3530 ErrorStatus LL_USART_DeInit(USART_TypeDef *USARTx);
<> 161:2cc1468da177 3531 ErrorStatus LL_USART_Init(USART_TypeDef *USARTx, LL_USART_InitTypeDef *USART_InitStruct);
<> 161:2cc1468da177 3532 void LL_USART_StructInit(LL_USART_InitTypeDef *USART_InitStruct);
<> 161:2cc1468da177 3533 ErrorStatus LL_USART_ClockInit(USART_TypeDef *USARTx, LL_USART_ClockInitTypeDef *USART_ClockInitStruct);
<> 161:2cc1468da177 3534 void LL_USART_ClockStructInit(LL_USART_ClockInitTypeDef *USART_ClockInitStruct);
<> 161:2cc1468da177 3535 /**
<> 161:2cc1468da177 3536 * @}
<> 161:2cc1468da177 3537 */
<> 161:2cc1468da177 3538 #endif /* USE_FULL_LL_DRIVER */
<> 161:2cc1468da177 3539
<> 161:2cc1468da177 3540 /**
<> 161:2cc1468da177 3541 * @}
<> 161:2cc1468da177 3542 */
<> 161:2cc1468da177 3543
<> 161:2cc1468da177 3544 /**
<> 161:2cc1468da177 3545 * @}
<> 161:2cc1468da177 3546 */
<> 161:2cc1468da177 3547
<> 161:2cc1468da177 3548 #endif /* USART1 || USART2 || USART3 || USART6 || UART4 || UART5 || UART7 || UART8 */
<> 161:2cc1468da177 3549
<> 161:2cc1468da177 3550 /**
<> 161:2cc1468da177 3551 * @}
<> 161:2cc1468da177 3552 */
<> 161:2cc1468da177 3553
<> 161:2cc1468da177 3554 #ifdef __cplusplus
<> 161:2cc1468da177 3555 }
<> 161:2cc1468da177 3556 #endif
<> 161:2cc1468da177 3557
<> 161:2cc1468da177 3558 #endif /* __STM32F7xx_LL_USART_H */
<> 161:2cc1468da177 3559
<> 161:2cc1468da177 3560 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/