Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 6 | ||
---|---|---|---|
Line 64... | Line 64... | ||
64 | typedef struct |
64 | typedef struct |
65 | { |
65 | { |
66 | 66 | ||
67 | uint32_t BaudRate; /*!< This field defines expected Usart communication baud rate. |
67 | uint32_t BaudRate; /*!< This field defines expected Usart communication baud rate. |
68 | 68 | ||
69 | This feature can be modified afterwards using unitary function @ref LL_USART_SetBaudRate().*/ |
69 | This feature can be modified afterwards using unitary |
- | 70 | function @ref LL_USART_SetBaudRate().*/ |
|
70 | 71 | ||
71 | uint32_t DataWidth; /*!< Specifies the number of data bits transmitted or received in a frame. |
72 | uint32_t DataWidth; /*!< Specifies the number of data bits transmitted or received in a frame. |
72 | This parameter can be a value of @ref USART_LL_EC_DATAWIDTH. |
73 | This parameter can be a value of @ref USART_LL_EC_DATAWIDTH. |
73 | 74 | ||
74 | This feature can be modified afterwards using unitary function @ref LL_USART_SetDataWidth().*/ |
75 | This feature can be modified afterwards using unitary |
- | 76 | function @ref LL_USART_SetDataWidth().*/ |
|
75 | 77 | ||
76 | uint32_t StopBits; /*!< Specifies the number of stop bits transmitted. |
78 | uint32_t StopBits; /*!< Specifies the number of stop bits transmitted. |
77 | This parameter can be a value of @ref USART_LL_EC_STOPBITS. |
79 | This parameter can be a value of @ref USART_LL_EC_STOPBITS. |
78 | 80 | ||
79 | This feature can be modified afterwards using unitary function @ref LL_USART_SetStopBitsLength().*/ |
81 | This feature can be modified afterwards using unitary |
- | 82 | function @ref LL_USART_SetStopBitsLength().*/ |
|
80 | 83 | ||
81 | uint32_t Parity; /*!< Specifies the parity mode. |
84 | uint32_t Parity; /*!< Specifies the parity mode. |
82 | This parameter can be a value of @ref USART_LL_EC_PARITY. |
85 | This parameter can be a value of @ref USART_LL_EC_PARITY. |
83 | 86 | ||
84 | This feature can be modified afterwards using unitary function @ref LL_USART_SetParity().*/ |
87 | This feature can be modified afterwards using unitary |
- | 88 | function @ref LL_USART_SetParity().*/ |
|
85 | 89 | ||
86 | uint32_t TransferDirection; /*!< Specifies whether the Receive and/or Transmit mode is enabled or disabled. |
90 | uint32_t TransferDirection; /*!< Specifies whether the Receive and/or Transmit mode is enabled or disabled. |
87 | This parameter can be a value of @ref USART_LL_EC_DIRECTION. |
91 | This parameter can be a value of @ref USART_LL_EC_DIRECTION. |
88 | 92 | ||
89 | This feature can be modified afterwards using unitary function @ref LL_USART_SetTransferDirection().*/ |
93 | This feature can be modified afterwards using unitary |
- | 94 | function @ref LL_USART_SetTransferDirection().*/ |
|
90 | 95 | ||
91 | uint32_t HardwareFlowControl; /*!< Specifies whether the hardware flow control mode is enabled or disabled. |
96 | uint32_t HardwareFlowControl; /*!< Specifies whether the hardware flow control mode is enabled or disabled. |
92 | This parameter can be a value of @ref USART_LL_EC_HWCONTROL. |
97 | This parameter can be a value of @ref USART_LL_EC_HWCONTROL. |
93 | 98 | ||
94 | This feature can be modified afterwards using unitary function @ref LL_USART_SetHWFlowCtrl().*/ |
99 | This feature can be modified afterwards using unitary |
- | 100 | function @ref LL_USART_SetHWFlowCtrl().*/ |
|
95 | 101 | ||
96 | uint32_t OverSampling; /*!< Specifies whether USART oversampling mode is 16 or 8. |
102 | uint32_t OverSampling; /*!< Specifies whether USART oversampling mode is 16 or 8. |
97 | This parameter can be a value of @ref USART_LL_EC_OVERSAMPLING. |
103 | This parameter can be a value of @ref USART_LL_EC_OVERSAMPLING. |
98 | 104 | ||
99 | This feature can be modified afterwards using unitary function @ref LL_USART_SetOverSampling().*/ |
105 | This feature can be modified afterwards using unitary |
- | 106 | function @ref LL_USART_SetOverSampling().*/ |
|
100 | 107 | ||
101 | } LL_USART_InitTypeDef; |
108 | } LL_USART_InitTypeDef; |
102 | 109 | ||
103 | /** |
110 | /** |
104 | * @brief LL USART Clock Init Structure definition |
111 | * @brief LL USART Clock Init Structure definition |
Line 113... | Line 120... | ||
113 | For more details, refer to description of this function. */ |
120 | For more details, refer to description of this function. */ |
114 | 121 | ||
115 | uint32_t ClockPolarity; /*!< Specifies the steady state of the serial clock. |
122 | uint32_t ClockPolarity; /*!< Specifies the steady state of the serial clock. |
116 | This parameter can be a value of @ref USART_LL_EC_POLARITY. |
123 | This parameter can be a value of @ref USART_LL_EC_POLARITY. |
117 | 124 | ||
118 | USART HW configuration can be modified afterwards using unitary functions @ref LL_USART_SetClockPolarity(). |
125 | USART HW configuration can be modified afterwards using unitary |
- | 126 | functions @ref LL_USART_SetClockPolarity(). |
|
119 | For more details, refer to description of this function. */ |
127 | For more details, refer to description of this function. */ |
120 | 128 | ||
121 | uint32_t ClockPhase; /*!< Specifies the clock transition on which the bit capture is made. |
129 | uint32_t ClockPhase; /*!< Specifies the clock transition on which the bit capture is made. |
122 | This parameter can be a value of @ref USART_LL_EC_PHASE. |
130 | This parameter can be a value of @ref USART_LL_EC_PHASE. |
123 | 131 | ||
124 | USART HW configuration can be modified afterwards using unitary functions @ref LL_USART_SetClockPhase(). |
132 | USART HW configuration can be modified afterwards using unitary |
- | 133 | functions @ref LL_USART_SetClockPhase(). |
|
125 | For more details, refer to description of this function. */ |
134 | For more details, refer to description of this function. */ |
126 | 135 | ||
127 | uint32_t LastBitClockPulse; /*!< Specifies whether the clock pulse corresponding to the last transmitted |
136 | uint32_t LastBitClockPulse; /*!< Specifies whether the clock pulse corresponding to the last transmitted |
128 | data bit (MSB) has to be output on the SCLK pin in synchronous mode. |
137 | data bit (MSB) has to be output on the SCLK pin in synchronous mode. |
129 | This parameter can be a value of @ref USART_LL_EC_LASTCLKPULSE. |
138 | This parameter can be a value of @ref USART_LL_EC_LASTCLKPULSE. |
130 | 139 | ||
131 | USART HW configuration can be modified afterwards using unitary functions @ref LL_USART_SetLastClkPulseOutput(). |
140 | USART HW configuration can be modified afterwards using unitary |
- | 141 | functions @ref LL_USART_SetLastClkPulseOutput(). |
|
132 | For more details, refer to description of this function. */ |
142 | For more details, refer to description of this function. */ |
133 | 143 | ||
134 | } LL_USART_ClockInitTypeDef; |
144 | } LL_USART_ClockInitTypeDef; |
135 | 145 | ||
136 | /** |
146 | /** |
Line 145... | Line 155... | ||
145 | 155 | ||
146 | /** @defgroup USART_LL_EC_CLEAR_FLAG Clear Flags Defines |
156 | /** @defgroup USART_LL_EC_CLEAR_FLAG Clear Flags Defines |
147 | * @brief Flags defines which can be used with LL_USART_WriteReg function |
157 | * @brief Flags defines which can be used with LL_USART_WriteReg function |
148 | * @{ |
158 | * @{ |
149 | */ |
159 | */ |
150 | #define LL_USART_ICR_PECF USART_ICR_PECF /*!< Parity error flag */ |
160 | #define LL_USART_ICR_PECF USART_ICR_PECF /*!< Parity error clear flag */ |
151 | #define LL_USART_ICR_FECF USART_ICR_FECF /*!< Framing error flag */ |
161 | #define LL_USART_ICR_FECF USART_ICR_FECF /*!< Framing error clear flag */ |
152 | #define LL_USART_ICR_NCF USART_ICR_NCF /*!< Noise error detected flag */ |
162 | #define LL_USART_ICR_NCF USART_ICR_NCF /*!< Noise error detected clear flag */ |
153 | #define LL_USART_ICR_ORECF USART_ICR_ORECF /*!< Overrun error flag */ |
163 | #define LL_USART_ICR_ORECF USART_ICR_ORECF /*!< Overrun error clear flag */ |
154 | #define LL_USART_ICR_IDLECF USART_ICR_IDLECF /*!< Idle line detected flag */ |
164 | #define LL_USART_ICR_IDLECF USART_ICR_IDLECF /*!< Idle line detected clear flag */ |
155 | #define LL_USART_ICR_TCCF USART_ICR_TCCF /*!< Transmission complete flag */ |
165 | #define LL_USART_ICR_TCCF USART_ICR_TCCF /*!< Transmission complete clear flag */ |
156 | #if defined USART_LIN_SUPPORT |
166 | #if defined USART_LIN_SUPPORT |
157 | #define LL_USART_ICR_LBDCF USART_ICR_LBDCF /*!< LIN break detection flag */ |
167 | #define LL_USART_ICR_LBDCF USART_ICR_LBDCF /*!< LIN break detection clear flag */ |
158 | #endif /* USART_LIN_SUPPORT */ |
168 | #endif /* USART_LIN_SUPPORT */ |
159 | #define LL_USART_ICR_CTSCF USART_ICR_CTSCF /*!< CTS flag */ |
169 | #define LL_USART_ICR_CTSCF USART_ICR_CTSCF /*!< CTS clear flag */ |
160 | #define LL_USART_ICR_RTOCF USART_ICR_RTOCF /*!< Receiver timeout flag */ |
170 | #define LL_USART_ICR_RTOCF USART_ICR_RTOCF /*!< Receiver timeout clear flag */ |
161 | #if defined USART_SMARTCARD_SUPPORT |
171 | #if defined USART_SMARTCARD_SUPPORT |
162 | #define LL_USART_ICR_EOBCF USART_ICR_EOBCF /*!< End of block flag */ |
172 | #define LL_USART_ICR_EOBCF USART_ICR_EOBCF /*!< End of block clear flag */ |
163 | #endif /* USART_SMARTCARD_SUPPORT */ |
173 | #endif /* USART_SMARTCARD_SUPPORT */ |
164 | #define LL_USART_ICR_CMCF USART_ICR_CMCF /*!< Character match flag */ |
174 | #define LL_USART_ICR_CMCF USART_ICR_CMCF /*!< Character match clear flag */ |
165 | #if defined(USART_CR1_UESM) |
175 | #if defined(USART_CR1_UESM) |
- | 176 | #if defined(USART_CR3_WUFIE) |
|
166 | #define LL_USART_ICR_WUCF USART_ICR_WUCF /*!< Wakeup from Stop mode flag */ |
177 | #define LL_USART_ICR_WUCF USART_ICR_WUCF /*!< Wakeup from Stop mode clear flag */ |
- | 178 | #endif /* USART_CR3_WUFIE */ |
|
167 | #endif /* USART_CR1_UESM */ |
179 | #endif /* USART_CR1_UESM */ |
168 | /** |
180 | /** |
169 | * @} |
181 | * @} |
170 | */ |
182 | */ |
171 | 183 | ||
Line 195... | Line 207... | ||
195 | #define LL_USART_ISR_BUSY USART_ISR_BUSY /*!< Busy flag */ |
207 | #define LL_USART_ISR_BUSY USART_ISR_BUSY /*!< Busy flag */ |
196 | #define LL_USART_ISR_CMF USART_ISR_CMF /*!< Character match flag */ |
208 | #define LL_USART_ISR_CMF USART_ISR_CMF /*!< Character match flag */ |
197 | #define LL_USART_ISR_SBKF USART_ISR_SBKF /*!< Send break flag */ |
209 | #define LL_USART_ISR_SBKF USART_ISR_SBKF /*!< Send break flag */ |
198 | #define LL_USART_ISR_RWU USART_ISR_RWU /*!< Receiver wakeup from Mute mode flag */ |
210 | #define LL_USART_ISR_RWU USART_ISR_RWU /*!< Receiver wakeup from Mute mode flag */ |
199 | #if defined(USART_CR1_UESM) |
211 | #if defined(USART_CR1_UESM) |
- | 212 | #if defined(USART_CR3_WUFIE) |
|
200 | #define LL_USART_ISR_WUF USART_ISR_WUF /*!< Wakeup from Stop mode flag */ |
213 | #define LL_USART_ISR_WUF USART_ISR_WUF /*!< Wakeup from Stop mode flag */ |
- | 214 | #endif /* USART_CR3_WUFIE */ |
|
201 | #endif /* USART_CR1_UESM */ |
215 | #endif /* USART_CR1_UESM */ |
202 | #define LL_USART_ISR_TEACK USART_ISR_TEACK /*!< Transmit enable acknowledge flag */ |
216 | #define LL_USART_ISR_TEACK USART_ISR_TEACK /*!< Transmit enable acknowledge flag */ |
203 | #define LL_USART_ISR_REACK USART_ISR_REACK /*!< Receive enable acknowledge flag */ |
217 | #define LL_USART_ISR_REACK USART_ISR_REACK /*!< Receive enable acknowledge flag */ |
204 | /** |
218 | /** |
205 | * @} |
219 | * @} |
Line 223... | Line 237... | ||
223 | #define LL_USART_CR2_LBDIE USART_CR2_LBDIE /*!< LIN break detection interrupt enable */ |
237 | #define LL_USART_CR2_LBDIE USART_CR2_LBDIE /*!< LIN break detection interrupt enable */ |
224 | #endif /* USART_LIN_SUPPORT */ |
238 | #endif /* USART_LIN_SUPPORT */ |
225 | #define LL_USART_CR3_EIE USART_CR3_EIE /*!< Error interrupt enable */ |
239 | #define LL_USART_CR3_EIE USART_CR3_EIE /*!< Error interrupt enable */ |
226 | #define LL_USART_CR3_CTSIE USART_CR3_CTSIE /*!< CTS interrupt enable */ |
240 | #define LL_USART_CR3_CTSIE USART_CR3_CTSIE /*!< CTS interrupt enable */ |
227 | #if defined(USART_CR1_UESM) |
241 | #if defined(USART_CR1_UESM) |
- | 242 | #if defined(USART_CR3_WUFIE) |
|
228 | #define LL_USART_CR3_WUFIE USART_CR3_WUFIE /*!< Wakeup from Stop mode interrupt enable */ |
243 | #define LL_USART_CR3_WUFIE USART_CR3_WUFIE /*!< Wakeup from Stop mode interrupt enable */ |
- | 244 | #endif /* USART_CR3_WUFIE */ |
|
229 | #endif /* USART_CR1_UESM */ |
245 | #endif /* USART_CR1_UESM */ |
230 | /** |
246 | /** |
231 | * @} |
247 | * @} |
232 | */ |
248 | */ |
233 | 249 | ||
Line 416... | Line 432... | ||
416 | /** |
432 | /** |
417 | * @} |
433 | * @} |
418 | */ |
434 | */ |
419 | 435 | ||
420 | #if defined(USART_CR1_UESM) |
436 | #if defined(USART_CR1_UESM) |
- | 437 | #if defined(USART_CR3_WUS) |
|
421 | /** @defgroup USART_LL_EC_WAKEUP_ON Wakeup Activation |
438 | /** @defgroup USART_LL_EC_WAKEUP_ON Wakeup Activation |
422 | * @{ |
439 | * @{ |
423 | */ |
440 | */ |
424 | #define LL_USART_WAKEUP_ON_ADDRESS 0x00000000U /*!< Wake up active on address match */ |
441 | #define LL_USART_WAKEUP_ON_ADDRESS 0x00000000U /*!< Wake up active on address match */ |
425 | #define LL_USART_WAKEUP_ON_STARTBIT USART_CR3_WUS_1 /*!< Wake up active on Start bit detection */ |
442 | #define LL_USART_WAKEUP_ON_STARTBIT USART_CR3_WUS_1 /*!< Wake up active on Start bit detection */ |
426 | #define LL_USART_WAKEUP_ON_RXNE (USART_CR3_WUS_0 | USART_CR3_WUS_1) /*!< Wake up active on RXNE */ |
443 | #define LL_USART_WAKEUP_ON_RXNE (USART_CR3_WUS_0 | USART_CR3_WUS_1) /*!< Wake up active on RXNE */ |
427 | /** |
444 | /** |
428 | * @} |
445 | * @} |
429 | */ |
446 | */ |
430 | 447 | ||
- | 448 | #endif /* USART_CR3_WUS */ |
|
431 | #endif /* USART_CR1_UESM */ |
449 | #endif /* USART_CR1_UESM */ |
432 | #if defined(USART_IRDA_SUPPORT) |
450 | #if defined(USART_IRDA_SUPPORT) |
433 | /** @defgroup USART_LL_EC_IRDA_POWER IrDA Power |
451 | /** @defgroup USART_LL_EC_IRDA_POWER IrDA Power |
434 | * @{ |
452 | * @{ |
435 | */ |
453 | */ |
Line 582... | Line 600... | ||
582 | #if defined(USART_CR1_UESM) |
600 | #if defined(USART_CR1_UESM) |
583 | /** |
601 | /** |
584 | * @brief USART enabled in STOP Mode. |
602 | * @brief USART enabled in STOP Mode. |
585 | * @note When this function is enabled, USART is able to wake up the MCU from Stop mode, provided that |
603 | * @note When this function is enabled, USART is able to wake up the MCU from Stop mode, provided that |
586 | * USART clock selection is HSI or LSE in RCC. |
604 | * USART clock selection is HSI or LSE in RCC. |
587 | * @note Macro @ref IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
605 | * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
588 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
606 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
589 | * @rmtoll CR1 UESM LL_USART_EnableInStopMode |
607 | * @rmtoll CR1 UESM LL_USART_EnableInStopMode |
590 | * @param USARTx USART Instance |
608 | * @param USARTx USART Instance |
591 | * @retval None |
609 | * @retval None |
592 | */ |
610 | */ |
593 | __STATIC_INLINE void LL_USART_EnableInStopMode(USART_TypeDef *USARTx) |
611 | __STATIC_INLINE void LL_USART_EnableInStopMode(USART_TypeDef *USARTx) |
594 | { |
612 | { |
595 | SET_BIT(USARTx->CR1, USART_CR1_UESM); |
613 | ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_UESM); |
596 | } |
614 | } |
597 | 615 | ||
598 | /** |
616 | /** |
599 | * @brief USART disabled in STOP Mode. |
617 | * @brief USART disabled in STOP Mode. |
600 | * @note When this function is disabled, USART is not able to wake up the MCU from Stop mode |
618 | * @note When this function is disabled, USART is not able to wake up the MCU from Stop mode |
601 | * @note Macro @ref IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
619 | * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
602 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
620 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
603 | * @rmtoll CR1 UESM LL_USART_DisableInStopMode |
621 | * @rmtoll CR1 UESM LL_USART_DisableInStopMode |
604 | * @param USARTx USART Instance |
622 | * @param USARTx USART Instance |
605 | * @retval None |
623 | * @retval None |
606 | */ |
624 | */ |
607 | __STATIC_INLINE void LL_USART_DisableInStopMode(USART_TypeDef *USARTx) |
625 | __STATIC_INLINE void LL_USART_DisableInStopMode(USART_TypeDef *USARTx) |
608 | { |
626 | { |
609 | CLEAR_BIT(USARTx->CR1, USART_CR1_UESM); |
627 | ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_UESM); |
610 | } |
628 | } |
611 | 629 | ||
612 | /** |
630 | /** |
613 | * @brief Indicate if USART is enabled in STOP Mode (able to wake up MCU from Stop mode or not) |
631 | * @brief Indicate if USART is enabled in STOP Mode (able to wake up MCU from Stop mode or not) |
614 | * @note Macro @ref IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
632 | * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
615 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
633 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
616 | * @rmtoll CR1 UESM LL_USART_IsEnabledInStopMode |
634 | * @rmtoll CR1 UESM LL_USART_IsEnabledInStopMode |
617 | * @param USARTx USART Instance |
635 | * @param USARTx USART Instance |
618 | * @retval State of bit (1 or 0). |
636 | * @retval State of bit (1 or 0). |
619 | */ |
637 | */ |
Line 629... | Line 647... | ||
629 | * @param USARTx USART Instance |
647 | * @param USARTx USART Instance |
630 | * @retval None |
648 | * @retval None |
631 | */ |
649 | */ |
632 | __STATIC_INLINE void LL_USART_EnableDirectionRx(USART_TypeDef *USARTx) |
650 | __STATIC_INLINE void LL_USART_EnableDirectionRx(USART_TypeDef *USARTx) |
633 | { |
651 | { |
634 | SET_BIT(USARTx->CR1, USART_CR1_RE); |
652 | ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_RE); |
635 | } |
653 | } |
636 | 654 | ||
637 | /** |
655 | /** |
638 | * @brief Receiver Disable |
656 | * @brief Receiver Disable |
639 | * @rmtoll CR1 RE LL_USART_DisableDirectionRx |
657 | * @rmtoll CR1 RE LL_USART_DisableDirectionRx |
640 | * @param USARTx USART Instance |
658 | * @param USARTx USART Instance |
641 | * @retval None |
659 | * @retval None |
642 | */ |
660 | */ |
643 | __STATIC_INLINE void LL_USART_DisableDirectionRx(USART_TypeDef *USARTx) |
661 | __STATIC_INLINE void LL_USART_DisableDirectionRx(USART_TypeDef *USARTx) |
644 | { |
662 | { |
645 | CLEAR_BIT(USARTx->CR1, USART_CR1_RE); |
663 | ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_RE); |
646 | } |
664 | } |
647 | 665 | ||
648 | /** |
666 | /** |
649 | * @brief Transmitter Enable |
667 | * @brief Transmitter Enable |
650 | * @rmtoll CR1 TE LL_USART_EnableDirectionTx |
668 | * @rmtoll CR1 TE LL_USART_EnableDirectionTx |
651 | * @param USARTx USART Instance |
669 | * @param USARTx USART Instance |
652 | * @retval None |
670 | * @retval None |
653 | */ |
671 | */ |
654 | __STATIC_INLINE void LL_USART_EnableDirectionTx(USART_TypeDef *USARTx) |
672 | __STATIC_INLINE void LL_USART_EnableDirectionTx(USART_TypeDef *USARTx) |
655 | { |
673 | { |
656 | SET_BIT(USARTx->CR1, USART_CR1_TE); |
674 | ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_TE); |
657 | } |
675 | } |
658 | 676 | ||
659 | /** |
677 | /** |
660 | * @brief Transmitter Disable |
678 | * @brief Transmitter Disable |
661 | * @rmtoll CR1 TE LL_USART_DisableDirectionTx |
679 | * @rmtoll CR1 TE LL_USART_DisableDirectionTx |
662 | * @param USARTx USART Instance |
680 | * @param USARTx USART Instance |
663 | * @retval None |
681 | * @retval None |
664 | */ |
682 | */ |
665 | __STATIC_INLINE void LL_USART_DisableDirectionTx(USART_TypeDef *USARTx) |
683 | __STATIC_INLINE void LL_USART_DisableDirectionTx(USART_TypeDef *USARTx) |
666 | { |
684 | { |
667 | CLEAR_BIT(USARTx->CR1, USART_CR1_TE); |
685 | ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_TE); |
668 | } |
686 | } |
669 | 687 | ||
670 | /** |
688 | /** |
671 | * @brief Configure simultaneously enabled/disabled states |
689 | * @brief Configure simultaneously enabled/disabled states |
672 | * of Transmitter and Receiver |
690 | * of Transmitter and Receiver |
Line 680... | Line 698... | ||
680 | * @arg @ref LL_USART_DIRECTION_TX_RX |
698 | * @arg @ref LL_USART_DIRECTION_TX_RX |
681 | * @retval None |
699 | * @retval None |
682 | */ |
700 | */ |
683 | __STATIC_INLINE void LL_USART_SetTransferDirection(USART_TypeDef *USARTx, uint32_t TransferDirection) |
701 | __STATIC_INLINE void LL_USART_SetTransferDirection(USART_TypeDef *USARTx, uint32_t TransferDirection) |
684 | { |
702 | { |
685 | MODIFY_REG(USARTx->CR1, USART_CR1_RE | USART_CR1_TE, TransferDirection); |
703 | ATOMIC_MODIFY_REG(USARTx->CR1, USART_CR1_RE | USART_CR1_TE, TransferDirection); |
686 | } |
704 | } |
687 | 705 | ||
688 | /** |
706 | /** |
689 | * @brief Return enabled/disabled states of Transmitter and Receiver |
707 | * @brief Return enabled/disabled states of Transmitter and Receiver |
690 | * @rmtoll CR1 RE LL_USART_GetTransferDirection\n |
708 | * @rmtoll CR1 RE LL_USART_GetTransferDirection\n |
Line 803... | Line 821... | ||
803 | * @param USARTx USART Instance |
821 | * @param USARTx USART Instance |
804 | * @retval None |
822 | * @retval None |
805 | */ |
823 | */ |
806 | __STATIC_INLINE void LL_USART_EnableMuteMode(USART_TypeDef *USARTx) |
824 | __STATIC_INLINE void LL_USART_EnableMuteMode(USART_TypeDef *USARTx) |
807 | { |
825 | { |
808 | SET_BIT(USARTx->CR1, USART_CR1_MME); |
826 | ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_MME); |
809 | } |
827 | } |
810 | 828 | ||
811 | /** |
829 | /** |
812 | * @brief Prevent Mute Mode use. Set Receiver in active mode permanently. |
830 | * @brief Prevent Mute Mode use. Set Receiver in active mode permanently. |
813 | * @rmtoll CR1 MME LL_USART_DisableMuteMode |
831 | * @rmtoll CR1 MME LL_USART_DisableMuteMode |
814 | * @param USARTx USART Instance |
832 | * @param USARTx USART Instance |
815 | * @retval None |
833 | * @retval None |
816 | */ |
834 | */ |
817 | __STATIC_INLINE void LL_USART_DisableMuteMode(USART_TypeDef *USARTx) |
835 | __STATIC_INLINE void LL_USART_DisableMuteMode(USART_TypeDef *USARTx) |
818 | { |
836 | { |
819 | CLEAR_BIT(USARTx->CR1, USART_CR1_MME); |
837 | ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_MME); |
820 | } |
838 | } |
821 | 839 | ||
822 | /** |
840 | /** |
823 | * @brief Indicate if switch between Mute Mode and Active mode is allowed |
841 | * @brief Indicate if switch between Mute Mode and Active mode is allowed |
824 | * @rmtoll CR1 MME LL_USART_IsEnabledMuteMode |
842 | * @rmtoll CR1 MME LL_USART_IsEnabledMuteMode |
Line 857... | Line 875... | ||
857 | return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_OVER8)); |
875 | return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_OVER8)); |
858 | } |
876 | } |
859 | 877 | ||
860 | /** |
878 | /** |
861 | * @brief Configure if Clock pulse of the last data bit is output to the SCLK pin or not |
879 | * @brief Configure if Clock pulse of the last data bit is output to the SCLK pin or not |
862 | * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not |
880 | * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not |
863 | * Synchronous mode is supported by the USARTx instance. |
881 | * Synchronous mode is supported by the USARTx instance. |
864 | * @rmtoll CR2 LBCL LL_USART_SetLastClkPulseOutput |
882 | * @rmtoll CR2 LBCL LL_USART_SetLastClkPulseOutput |
865 | * @param USARTx USART Instance |
883 | * @param USARTx USART Instance |
866 | * @param LastBitClockPulse This parameter can be one of the following values: |
884 | * @param LastBitClockPulse This parameter can be one of the following values: |
867 | * @arg @ref LL_USART_LASTCLKPULSE_NO_OUTPUT |
885 | * @arg @ref LL_USART_LASTCLKPULSE_NO_OUTPUT |
Line 874... | Line 892... | ||
874 | } |
892 | } |
875 | 893 | ||
876 | /** |
894 | /** |
877 | * @brief Retrieve Clock pulse of the last data bit output configuration |
895 | * @brief Retrieve Clock pulse of the last data bit output configuration |
878 | * (Last bit Clock pulse output to the SCLK pin or not) |
896 | * (Last bit Clock pulse output to the SCLK pin or not) |
879 | * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not |
897 | * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not |
880 | * Synchronous mode is supported by the USARTx instance. |
898 | * Synchronous mode is supported by the USARTx instance. |
881 | * @rmtoll CR2 LBCL LL_USART_GetLastClkPulseOutput |
899 | * @rmtoll CR2 LBCL LL_USART_GetLastClkPulseOutput |
882 | * @param USARTx USART Instance |
900 | * @param USARTx USART Instance |
883 | * @retval Returned value can be one of the following values: |
901 | * @retval Returned value can be one of the following values: |
884 | * @arg @ref LL_USART_LASTCLKPULSE_NO_OUTPUT |
902 | * @arg @ref LL_USART_LASTCLKPULSE_NO_OUTPUT |
Line 889... | Line 907... | ||
889 | return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_LBCL)); |
907 | return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_LBCL)); |
890 | } |
908 | } |
891 | 909 | ||
892 | /** |
910 | /** |
893 | * @brief Select the phase of the clock output on the SCLK pin in synchronous mode |
911 | * @brief Select the phase of the clock output on the SCLK pin in synchronous mode |
894 | * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not |
912 | * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not |
895 | * Synchronous mode is supported by the USARTx instance. |
913 | * Synchronous mode is supported by the USARTx instance. |
896 | * @rmtoll CR2 CPHA LL_USART_SetClockPhase |
914 | * @rmtoll CR2 CPHA LL_USART_SetClockPhase |
897 | * @param USARTx USART Instance |
915 | * @param USARTx USART Instance |
898 | * @param ClockPhase This parameter can be one of the following values: |
916 | * @param ClockPhase This parameter can be one of the following values: |
899 | * @arg @ref LL_USART_PHASE_1EDGE |
917 | * @arg @ref LL_USART_PHASE_1EDGE |
Line 905... | Line 923... | ||
905 | MODIFY_REG(USARTx->CR2, USART_CR2_CPHA, ClockPhase); |
923 | MODIFY_REG(USARTx->CR2, USART_CR2_CPHA, ClockPhase); |
906 | } |
924 | } |
907 | 925 | ||
908 | /** |
926 | /** |
909 | * @brief Return phase of the clock output on the SCLK pin in synchronous mode |
927 | * @brief Return phase of the clock output on the SCLK pin in synchronous mode |
910 | * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not |
928 | * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not |
911 | * Synchronous mode is supported by the USARTx instance. |
929 | * Synchronous mode is supported by the USARTx instance. |
912 | * @rmtoll CR2 CPHA LL_USART_GetClockPhase |
930 | * @rmtoll CR2 CPHA LL_USART_GetClockPhase |
913 | * @param USARTx USART Instance |
931 | * @param USARTx USART Instance |
914 | * @retval Returned value can be one of the following values: |
932 | * @retval Returned value can be one of the following values: |
915 | * @arg @ref LL_USART_PHASE_1EDGE |
933 | * @arg @ref LL_USART_PHASE_1EDGE |
Line 920... | Line 938... | ||
920 | return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_CPHA)); |
938 | return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_CPHA)); |
921 | } |
939 | } |
922 | 940 | ||
923 | /** |
941 | /** |
924 | * @brief Select the polarity of the clock output on the SCLK pin in synchronous mode |
942 | * @brief Select the polarity of the clock output on the SCLK pin in synchronous mode |
925 | * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not |
943 | * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not |
926 | * Synchronous mode is supported by the USARTx instance. |
944 | * Synchronous mode is supported by the USARTx instance. |
927 | * @rmtoll CR2 CPOL LL_USART_SetClockPolarity |
945 | * @rmtoll CR2 CPOL LL_USART_SetClockPolarity |
928 | * @param USARTx USART Instance |
946 | * @param USARTx USART Instance |
929 | * @param ClockPolarity This parameter can be one of the following values: |
947 | * @param ClockPolarity This parameter can be one of the following values: |
930 | * @arg @ref LL_USART_POLARITY_LOW |
948 | * @arg @ref LL_USART_POLARITY_LOW |
Line 936... | Line 954... | ||
936 | MODIFY_REG(USARTx->CR2, USART_CR2_CPOL, ClockPolarity); |
954 | MODIFY_REG(USARTx->CR2, USART_CR2_CPOL, ClockPolarity); |
937 | } |
955 | } |
938 | 956 | ||
939 | /** |
957 | /** |
940 | * @brief Return polarity of the clock output on the SCLK pin in synchronous mode |
958 | * @brief Return polarity of the clock output on the SCLK pin in synchronous mode |
941 | * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not |
959 | * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not |
942 | * Synchronous mode is supported by the USARTx instance. |
960 | * Synchronous mode is supported by the USARTx instance. |
943 | * @rmtoll CR2 CPOL LL_USART_GetClockPolarity |
961 | * @rmtoll CR2 CPOL LL_USART_GetClockPolarity |
944 | * @param USARTx USART Instance |
962 | * @param USARTx USART Instance |
945 | * @retval Returned value can be one of the following values: |
963 | * @retval Returned value can be one of the following values: |
946 | * @arg @ref LL_USART_POLARITY_LOW |
964 | * @arg @ref LL_USART_POLARITY_LOW |
Line 951... | Line 969... | ||
951 | return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_CPOL)); |
969 | return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_CPOL)); |
952 | } |
970 | } |
953 | 971 | ||
954 | /** |
972 | /** |
955 | * @brief Configure Clock signal format (Phase Polarity and choice about output of last bit clock pulse) |
973 | * @brief Configure Clock signal format (Phase Polarity and choice about output of last bit clock pulse) |
956 | * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not |
974 | * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not |
957 | * Synchronous mode is supported by the USARTx instance. |
975 | * Synchronous mode is supported by the USARTx instance. |
958 | * @note Call of this function is equivalent to following function call sequence : |
976 | * @note Call of this function is equivalent to following function call sequence : |
959 | * - Clock Phase configuration using @ref LL_USART_SetClockPhase() function |
977 | * - Clock Phase configuration using @ref LL_USART_SetClockPhase() function |
960 | * - Clock Polarity configuration using @ref LL_USART_SetClockPolarity() function |
978 | * - Clock Polarity configuration using @ref LL_USART_SetClockPolarity() function |
961 | * - Output of Last bit Clock pulse configuration using @ref LL_USART_SetLastClkPulseOutput() function |
979 | * - Output of Last bit Clock pulse configuration using @ref LL_USART_SetLastClkPulseOutput() function |
Line 979... | Line 997... | ||
979 | MODIFY_REG(USARTx->CR2, USART_CR2_CPHA | USART_CR2_CPOL | USART_CR2_LBCL, Phase | Polarity | LBCPOutput); |
997 | MODIFY_REG(USARTx->CR2, USART_CR2_CPHA | USART_CR2_CPOL | USART_CR2_LBCL, Phase | Polarity | LBCPOutput); |
980 | } |
998 | } |
981 | 999 | ||
982 | /** |
1000 | /** |
983 | * @brief Enable Clock output on SCLK pin |
1001 | * @brief Enable Clock output on SCLK pin |
984 | * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not |
1002 | * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not |
985 | * Synchronous mode is supported by the USARTx instance. |
1003 | * Synchronous mode is supported by the USARTx instance. |
986 | * @rmtoll CR2 CLKEN LL_USART_EnableSCLKOutput |
1004 | * @rmtoll CR2 CLKEN LL_USART_EnableSCLKOutput |
987 | * @param USARTx USART Instance |
1005 | * @param USARTx USART Instance |
988 | * @retval None |
1006 | * @retval None |
989 | */ |
1007 | */ |
Line 992... | Line 1010... | ||
992 | SET_BIT(USARTx->CR2, USART_CR2_CLKEN); |
1010 | SET_BIT(USARTx->CR2, USART_CR2_CLKEN); |
993 | } |
1011 | } |
994 | 1012 | ||
995 | /** |
1013 | /** |
996 | * @brief Disable Clock output on SCLK pin |
1014 | * @brief Disable Clock output on SCLK pin |
997 | * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not |
1015 | * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not |
998 | * Synchronous mode is supported by the USARTx instance. |
1016 | * Synchronous mode is supported by the USARTx instance. |
999 | * @rmtoll CR2 CLKEN LL_USART_DisableSCLKOutput |
1017 | * @rmtoll CR2 CLKEN LL_USART_DisableSCLKOutput |
1000 | * @param USARTx USART Instance |
1018 | * @param USARTx USART Instance |
1001 | * @retval None |
1019 | * @retval None |
1002 | */ |
1020 | */ |
Line 1005... | Line 1023... | ||
1005 | CLEAR_BIT(USARTx->CR2, USART_CR2_CLKEN); |
1023 | CLEAR_BIT(USARTx->CR2, USART_CR2_CLKEN); |
1006 | } |
1024 | } |
1007 | 1025 | ||
1008 | /** |
1026 | /** |
1009 | * @brief Indicate if Clock output on SCLK pin is enabled |
1027 | * @brief Indicate if Clock output on SCLK pin is enabled |
1010 | * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not |
1028 | * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not |
1011 | * Synchronous mode is supported by the USARTx instance. |
1029 | * Synchronous mode is supported by the USARTx instance. |
1012 | * @rmtoll CR2 CLKEN LL_USART_IsEnabledSCLKOutput |
1030 | * @rmtoll CR2 CLKEN LL_USART_IsEnabledSCLKOutput |
1013 | * @param USARTx USART Instance |
1031 | * @param USARTx USART Instance |
1014 | * @retval State of bit (1 or 0). |
1032 | * @retval State of bit (1 or 0). |
1015 | */ |
1033 | */ |
Line 1230... | Line 1248... | ||
1230 | return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_MSBFIRST)); |
1248 | return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_MSBFIRST)); |
1231 | } |
1249 | } |
1232 | 1250 | ||
1233 | /** |
1251 | /** |
1234 | * @brief Enable Auto Baud-Rate Detection |
1252 | * @brief Enable Auto Baud-Rate Detection |
1235 | * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
1253 | * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
1236 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
1254 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
1237 | * @rmtoll CR2 ABREN LL_USART_EnableAutoBaudRate |
1255 | * @rmtoll CR2 ABREN LL_USART_EnableAutoBaudRate |
1238 | * @param USARTx USART Instance |
1256 | * @param USARTx USART Instance |
1239 | * @retval None |
1257 | * @retval None |
1240 | */ |
1258 | */ |
Line 1243... | Line 1261... | ||
1243 | SET_BIT(USARTx->CR2, USART_CR2_ABREN); |
1261 | SET_BIT(USARTx->CR2, USART_CR2_ABREN); |
1244 | } |
1262 | } |
1245 | 1263 | ||
1246 | /** |
1264 | /** |
1247 | * @brief Disable Auto Baud-Rate Detection |
1265 | * @brief Disable Auto Baud-Rate Detection |
1248 | * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
1266 | * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
1249 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
1267 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
1250 | * @rmtoll CR2 ABREN LL_USART_DisableAutoBaudRate |
1268 | * @rmtoll CR2 ABREN LL_USART_DisableAutoBaudRate |
1251 | * @param USARTx USART Instance |
1269 | * @param USARTx USART Instance |
1252 | * @retval None |
1270 | * @retval None |
1253 | */ |
1271 | */ |
Line 1256... | Line 1274... | ||
1256 | CLEAR_BIT(USARTx->CR2, USART_CR2_ABREN); |
1274 | CLEAR_BIT(USARTx->CR2, USART_CR2_ABREN); |
1257 | } |
1275 | } |
1258 | 1276 | ||
1259 | /** |
1277 | /** |
1260 | * @brief Indicate if Auto Baud-Rate Detection mechanism is enabled |
1278 | * @brief Indicate if Auto Baud-Rate Detection mechanism is enabled |
1261 | * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
1279 | * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
1262 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
1280 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
1263 | * @rmtoll CR2 ABREN LL_USART_IsEnabledAutoBaud |
1281 | * @rmtoll CR2 ABREN LL_USART_IsEnabledAutoBaud |
1264 | * @param USARTx USART Instance |
1282 | * @param USARTx USART Instance |
1265 | * @retval State of bit (1 or 0). |
1283 | * @retval State of bit (1 or 0). |
1266 | */ |
1284 | */ |
Line 1269... | Line 1287... | ||
1269 | return ((READ_BIT(USARTx->CR2, USART_CR2_ABREN) == (USART_CR2_ABREN)) ? 1UL : 0UL); |
1287 | return ((READ_BIT(USARTx->CR2, USART_CR2_ABREN) == (USART_CR2_ABREN)) ? 1UL : 0UL); |
1270 | } |
1288 | } |
1271 | 1289 | ||
1272 | /** |
1290 | /** |
1273 | * @brief Set Auto Baud-Rate mode bits |
1291 | * @brief Set Auto Baud-Rate mode bits |
1274 | * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
1292 | * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
1275 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
1293 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
1276 | * @rmtoll CR2 ABRMODE LL_USART_SetAutoBaudRateMode |
1294 | * @rmtoll CR2 ABRMODE LL_USART_SetAutoBaudRateMode |
1277 | * @param USARTx USART Instance |
1295 | * @param USARTx USART Instance |
1278 | * @param AutoBaudRateMode This parameter can be one of the following values: |
1296 | * @param AutoBaudRateMode This parameter can be one of the following values: |
1279 | * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_STARTBIT |
1297 | * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_STARTBIT |
Line 1289... | Line 1307... | ||
1289 | MODIFY_REG(USARTx->CR2, USART_CR2_ABRMODE, AutoBaudRateMode); |
1307 | MODIFY_REG(USARTx->CR2, USART_CR2_ABRMODE, AutoBaudRateMode); |
1290 | } |
1308 | } |
1291 | 1309 | ||
1292 | /** |
1310 | /** |
1293 | * @brief Return Auto Baud-Rate mode |
1311 | * @brief Return Auto Baud-Rate mode |
1294 | * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
1312 | * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
1295 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
1313 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
1296 | * @rmtoll CR2 ABRMODE LL_USART_GetAutoBaudRateMode |
1314 | * @rmtoll CR2 ABRMODE LL_USART_GetAutoBaudRateMode |
1297 | * @param USARTx USART Instance |
1315 | * @param USARTx USART Instance |
1298 | * @retval Returned value can be one of the following values: |
1316 | * @retval Returned value can be one of the following values: |
1299 | * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_STARTBIT |
1317 | * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_STARTBIT |
Line 1398... | Line 1416... | ||
1398 | return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_ADDM7)); |
1416 | return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_ADDM7)); |
1399 | } |
1417 | } |
1400 | 1418 | ||
1401 | /** |
1419 | /** |
1402 | * @brief Enable RTS HW Flow Control |
1420 | * @brief Enable RTS HW Flow Control |
1403 | * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
1421 | * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
1404 | * Hardware Flow control feature is supported by the USARTx instance. |
1422 | * Hardware Flow control feature is supported by the USARTx instance. |
1405 | * @rmtoll CR3 RTSE LL_USART_EnableRTSHWFlowCtrl |
1423 | * @rmtoll CR3 RTSE LL_USART_EnableRTSHWFlowCtrl |
1406 | * @param USARTx USART Instance |
1424 | * @param USARTx USART Instance |
1407 | * @retval None |
1425 | * @retval None |
1408 | */ |
1426 | */ |
Line 1411... | Line 1429... | ||
1411 | SET_BIT(USARTx->CR3, USART_CR3_RTSE); |
1429 | SET_BIT(USARTx->CR3, USART_CR3_RTSE); |
1412 | } |
1430 | } |
1413 | 1431 | ||
1414 | /** |
1432 | /** |
1415 | * @brief Disable RTS HW Flow Control |
1433 | * @brief Disable RTS HW Flow Control |
1416 | * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
1434 | * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
1417 | * Hardware Flow control feature is supported by the USARTx instance. |
1435 | * Hardware Flow control feature is supported by the USARTx instance. |
1418 | * @rmtoll CR3 RTSE LL_USART_DisableRTSHWFlowCtrl |
1436 | * @rmtoll CR3 RTSE LL_USART_DisableRTSHWFlowCtrl |
1419 | * @param USARTx USART Instance |
1437 | * @param USARTx USART Instance |
1420 | * @retval None |
1438 | * @retval None |
1421 | */ |
1439 | */ |
Line 1424... | Line 1442... | ||
1424 | CLEAR_BIT(USARTx->CR3, USART_CR3_RTSE); |
1442 | CLEAR_BIT(USARTx->CR3, USART_CR3_RTSE); |
1425 | } |
1443 | } |
1426 | 1444 | ||
1427 | /** |
1445 | /** |
1428 | * @brief Enable CTS HW Flow Control |
1446 | * @brief Enable CTS HW Flow Control |
1429 | * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
1447 | * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
1430 | * Hardware Flow control feature is supported by the USARTx instance. |
1448 | * Hardware Flow control feature is supported by the USARTx instance. |
1431 | * @rmtoll CR3 CTSE LL_USART_EnableCTSHWFlowCtrl |
1449 | * @rmtoll CR3 CTSE LL_USART_EnableCTSHWFlowCtrl |
1432 | * @param USARTx USART Instance |
1450 | * @param USARTx USART Instance |
1433 | * @retval None |
1451 | * @retval None |
1434 | */ |
1452 | */ |
Line 1437... | Line 1455... | ||
1437 | SET_BIT(USARTx->CR3, USART_CR3_CTSE); |
1455 | SET_BIT(USARTx->CR3, USART_CR3_CTSE); |
1438 | } |
1456 | } |
1439 | 1457 | ||
1440 | /** |
1458 | /** |
1441 | * @brief Disable CTS HW Flow Control |
1459 | * @brief Disable CTS HW Flow Control |
1442 | * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
1460 | * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
1443 | * Hardware Flow control feature is supported by the USARTx instance. |
1461 | * Hardware Flow control feature is supported by the USARTx instance. |
1444 | * @rmtoll CR3 CTSE LL_USART_DisableCTSHWFlowCtrl |
1462 | * @rmtoll CR3 CTSE LL_USART_DisableCTSHWFlowCtrl |
1445 | * @param USARTx USART Instance |
1463 | * @param USARTx USART Instance |
1446 | * @retval None |
1464 | * @retval None |
1447 | */ |
1465 | */ |
Line 1450... | Line 1468... | ||
1450 | CLEAR_BIT(USARTx->CR3, USART_CR3_CTSE); |
1468 | CLEAR_BIT(USARTx->CR3, USART_CR3_CTSE); |
1451 | } |
1469 | } |
1452 | 1470 | ||
1453 | /** |
1471 | /** |
1454 | * @brief Configure HW Flow Control mode (both CTS and RTS) |
1472 | * @brief Configure HW Flow Control mode (both CTS and RTS) |
1455 | * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
1473 | * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
1456 | * Hardware Flow control feature is supported by the USARTx instance. |
1474 | * Hardware Flow control feature is supported by the USARTx instance. |
1457 | * @rmtoll CR3 RTSE LL_USART_SetHWFlowCtrl\n |
1475 | * @rmtoll CR3 RTSE LL_USART_SetHWFlowCtrl\n |
1458 | * CR3 CTSE LL_USART_SetHWFlowCtrl |
1476 | * CR3 CTSE LL_USART_SetHWFlowCtrl |
1459 | * @param USARTx USART Instance |
1477 | * @param USARTx USART Instance |
1460 | * @param HardwareFlowControl This parameter can be one of the following values: |
1478 | * @param HardwareFlowControl This parameter can be one of the following values: |
Line 1469... | Line 1487... | ||
1469 | MODIFY_REG(USARTx->CR3, USART_CR3_RTSE | USART_CR3_CTSE, HardwareFlowControl); |
1487 | MODIFY_REG(USARTx->CR3, USART_CR3_RTSE | USART_CR3_CTSE, HardwareFlowControl); |
1470 | } |
1488 | } |
1471 | 1489 | ||
1472 | /** |
1490 | /** |
1473 | * @brief Return HW Flow Control configuration (both CTS and RTS) |
1491 | * @brief Return HW Flow Control configuration (both CTS and RTS) |
1474 | * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
1492 | * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
1475 | * Hardware Flow control feature is supported by the USARTx instance. |
1493 | * Hardware Flow control feature is supported by the USARTx instance. |
1476 | * @rmtoll CR3 RTSE LL_USART_GetHWFlowCtrl\n |
1494 | * @rmtoll CR3 RTSE LL_USART_GetHWFlowCtrl\n |
1477 | * CR3 CTSE LL_USART_GetHWFlowCtrl |
1495 | * CR3 CTSE LL_USART_GetHWFlowCtrl |
1478 | * @param USARTx USART Instance |
1496 | * @param USARTx USART Instance |
1479 | * @retval Returned value can be one of the following values: |
1497 | * @retval Returned value can be one of the following values: |
Line 1552... | Line 1570... | ||
1552 | { |
1570 | { |
1553 | return ((READ_BIT(USARTx->CR3, USART_CR3_OVRDIS) != USART_CR3_OVRDIS) ? 1UL : 0UL); |
1571 | return ((READ_BIT(USARTx->CR3, USART_CR3_OVRDIS) != USART_CR3_OVRDIS) ? 1UL : 0UL); |
1554 | } |
1572 | } |
1555 | 1573 | ||
1556 | #if defined(USART_CR1_UESM) |
1574 | #if defined(USART_CR1_UESM) |
- | 1575 | #if defined(USART_CR3_WUS) |
|
1557 | /** |
1576 | /** |
1558 | * @brief Select event type for Wake UP Interrupt Flag (WUS[1:0] bits) |
1577 | * @brief Select event type for Wake UP Interrupt Flag (WUS[1:0] bits) |
1559 | * @note Macro @ref IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
1578 | * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
1560 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
1579 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
1561 | * @rmtoll CR3 WUS LL_USART_SetWKUPType |
1580 | * @rmtoll CR3 WUS LL_USART_SetWKUPType |
1562 | * @param USARTx USART Instance |
1581 | * @param USARTx USART Instance |
1563 | * @param Type This parameter can be one of the following values: |
1582 | * @param Type This parameter can be one of the following values: |
1564 | * @arg @ref LL_USART_WAKEUP_ON_ADDRESS |
1583 | * @arg @ref LL_USART_WAKEUP_ON_ADDRESS |
Line 1571... | Line 1590... | ||
1571 | MODIFY_REG(USARTx->CR3, USART_CR3_WUS, Type); |
1590 | MODIFY_REG(USARTx->CR3, USART_CR3_WUS, Type); |
1572 | } |
1591 | } |
1573 | 1592 | ||
1574 | /** |
1593 | /** |
1575 | * @brief Return event type for Wake UP Interrupt Flag (WUS[1:0] bits) |
1594 | * @brief Return event type for Wake UP Interrupt Flag (WUS[1:0] bits) |
1576 | * @note Macro @ref IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
1595 | * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
1577 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
1596 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
1578 | * @rmtoll CR3 WUS LL_USART_GetWKUPType |
1597 | * @rmtoll CR3 WUS LL_USART_GetWKUPType |
1579 | * @param USARTx USART Instance |
1598 | * @param USARTx USART Instance |
1580 | * @retval Returned value can be one of the following values: |
1599 | * @retval Returned value can be one of the following values: |
1581 | * @arg @ref LL_USART_WAKEUP_ON_ADDRESS |
1600 | * @arg @ref LL_USART_WAKEUP_ON_ADDRESS |
Line 1585... | Line 1604... | ||
1585 | __STATIC_INLINE uint32_t LL_USART_GetWKUPType(USART_TypeDef *USARTx) |
1604 | __STATIC_INLINE uint32_t LL_USART_GetWKUPType(USART_TypeDef *USARTx) |
1586 | { |
1605 | { |
1587 | return (uint32_t)(READ_BIT(USARTx->CR3, USART_CR3_WUS)); |
1606 | return (uint32_t)(READ_BIT(USARTx->CR3, USART_CR3_WUS)); |
1588 | } |
1607 | } |
1589 | 1608 | ||
- | 1609 | #endif /* USART_CR3_WUS */ |
|
1590 | #endif /* USART_CR1_UESM */ |
1610 | #endif /* USART_CR1_UESM */ |
1591 | /** |
1611 | /** |
1592 | * @brief Configure USART BRR register for achieving expected Baud Rate value. |
1612 | * @brief Configure USART BRR register for achieving expected Baud Rate value. |
1593 | * @note Compute and set USARTDIV value in BRR Register (full BRR content) |
1613 | * @note Compute and set USARTDIV value in BRR Register (full BRR content) |
1594 | * according to used Peripheral Clock, Oversampling mode, and expected Baud Rate values |
1614 | * according to used Peripheral Clock, Oversampling mode, and expected Baud Rate values |
Line 1606... | Line 1626... | ||
1606 | */ |
1626 | */ |
1607 | __STATIC_INLINE void LL_USART_SetBaudRate(USART_TypeDef *USARTx, uint32_t PeriphClk, uint32_t OverSampling, |
1627 | __STATIC_INLINE void LL_USART_SetBaudRate(USART_TypeDef *USARTx, uint32_t PeriphClk, uint32_t OverSampling, |
1608 | uint32_t BaudRate) |
1628 | uint32_t BaudRate) |
1609 | { |
1629 | { |
1610 | uint32_t usartdiv; |
1630 | uint32_t usartdiv; |
1611 | register uint32_t brrtemp; |
1631 | uint32_t brrtemp; |
1612 | 1632 | ||
1613 | if (OverSampling == LL_USART_OVERSAMPLING_8) |
1633 | if (OverSampling == LL_USART_OVERSAMPLING_8) |
1614 | { |
1634 | { |
1615 | usartdiv = (uint16_t)(__LL_USART_DIV_SAMPLING8(PeriphClk, BaudRate)); |
1635 | usartdiv = (uint16_t)(__LL_USART_DIV_SAMPLING8(PeriphClk, BaudRate)); |
1616 | brrtemp = usartdiv & 0xFFF0U; |
1636 | brrtemp = usartdiv & 0xFFF0U; |
Line 1636... | Line 1656... | ||
1636 | * @arg @ref LL_USART_OVERSAMPLING_8 |
1656 | * @arg @ref LL_USART_OVERSAMPLING_8 |
1637 | * @retval Baud Rate |
1657 | * @retval Baud Rate |
1638 | */ |
1658 | */ |
1639 | __STATIC_INLINE uint32_t LL_USART_GetBaudRate(USART_TypeDef *USARTx, uint32_t PeriphClk, uint32_t OverSampling) |
1659 | __STATIC_INLINE uint32_t LL_USART_GetBaudRate(USART_TypeDef *USARTx, uint32_t PeriphClk, uint32_t OverSampling) |
1640 | { |
1660 | { |
1641 | register uint32_t usartdiv; |
1661 | uint32_t usartdiv; |
1642 | register uint32_t brrresult = 0x0U; |
1662 | uint32_t brrresult = 0x0U; |
1643 | 1663 | ||
1644 | usartdiv = USARTx->BRR; |
1664 | usartdiv = USARTx->BRR; |
1645 | 1665 | ||
1646 | if (usartdiv == 0U) |
1666 | if (usartdiv == 0U) |
1647 | { |
1667 | { |
Line 1722... | Line 1742... | ||
1722 | * @{ |
1742 | * @{ |
1723 | */ |
1743 | */ |
1724 | 1744 | ||
1725 | /** |
1745 | /** |
1726 | * @brief Enable IrDA mode |
1746 | * @brief Enable IrDA mode |
1727 | * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
1747 | * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
1728 | * IrDA feature is supported by the USARTx instance. |
1748 | * IrDA feature is supported by the USARTx instance. |
1729 | * @rmtoll CR3 IREN LL_USART_EnableIrda |
1749 | * @rmtoll CR3 IREN LL_USART_EnableIrda |
1730 | * @param USARTx USART Instance |
1750 | * @param USARTx USART Instance |
1731 | * @retval None |
1751 | * @retval None |
1732 | */ |
1752 | */ |
Line 1735... | Line 1755... | ||
1735 | SET_BIT(USARTx->CR3, USART_CR3_IREN); |
1755 | SET_BIT(USARTx->CR3, USART_CR3_IREN); |
1736 | } |
1756 | } |
1737 | 1757 | ||
1738 | /** |
1758 | /** |
1739 | * @brief Disable IrDA mode |
1759 | * @brief Disable IrDA mode |
1740 | * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
1760 | * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
1741 | * IrDA feature is supported by the USARTx instance. |
1761 | * IrDA feature is supported by the USARTx instance. |
1742 | * @rmtoll CR3 IREN LL_USART_DisableIrda |
1762 | * @rmtoll CR3 IREN LL_USART_DisableIrda |
1743 | * @param USARTx USART Instance |
1763 | * @param USARTx USART Instance |
1744 | * @retval None |
1764 | * @retval None |
1745 | */ |
1765 | */ |
Line 1748... | Line 1768... | ||
1748 | CLEAR_BIT(USARTx->CR3, USART_CR3_IREN); |
1768 | CLEAR_BIT(USARTx->CR3, USART_CR3_IREN); |
1749 | } |
1769 | } |
1750 | 1770 | ||
1751 | /** |
1771 | /** |
1752 | * @brief Indicate if IrDA mode is enabled |
1772 | * @brief Indicate if IrDA mode is enabled |
1753 | * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
1773 | * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
1754 | * IrDA feature is supported by the USARTx instance. |
1774 | * IrDA feature is supported by the USARTx instance. |
1755 | * @rmtoll CR3 IREN LL_USART_IsEnabledIrda |
1775 | * @rmtoll CR3 IREN LL_USART_IsEnabledIrda |
1756 | * @param USARTx USART Instance |
1776 | * @param USARTx USART Instance |
1757 | * @retval State of bit (1 or 0). |
1777 | * @retval State of bit (1 or 0). |
1758 | */ |
1778 | */ |
Line 1761... | Line 1781... | ||
1761 | return ((READ_BIT(USARTx->CR3, USART_CR3_IREN) == (USART_CR3_IREN)) ? 1UL : 0UL); |
1781 | return ((READ_BIT(USARTx->CR3, USART_CR3_IREN) == (USART_CR3_IREN)) ? 1UL : 0UL); |
1762 | } |
1782 | } |
1763 | 1783 | ||
1764 | /** |
1784 | /** |
1765 | * @brief Configure IrDA Power Mode (Normal or Low Power) |
1785 | * @brief Configure IrDA Power Mode (Normal or Low Power) |
1766 | * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
1786 | * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
1767 | * IrDA feature is supported by the USARTx instance. |
1787 | * IrDA feature is supported by the USARTx instance. |
1768 | * @rmtoll CR3 IRLP LL_USART_SetIrdaPowerMode |
1788 | * @rmtoll CR3 IRLP LL_USART_SetIrdaPowerMode |
1769 | * @param USARTx USART Instance |
1789 | * @param USARTx USART Instance |
1770 | * @param PowerMode This parameter can be one of the following values: |
1790 | * @param PowerMode This parameter can be one of the following values: |
1771 | * @arg @ref LL_USART_IRDA_POWER_NORMAL |
1791 | * @arg @ref LL_USART_IRDA_POWER_NORMAL |
Line 1777... | Line 1797... | ||
1777 | MODIFY_REG(USARTx->CR3, USART_CR3_IRLP, PowerMode); |
1797 | MODIFY_REG(USARTx->CR3, USART_CR3_IRLP, PowerMode); |
1778 | } |
1798 | } |
1779 | 1799 | ||
1780 | /** |
1800 | /** |
1781 | * @brief Retrieve IrDA Power Mode configuration (Normal or Low Power) |
1801 | * @brief Retrieve IrDA Power Mode configuration (Normal or Low Power) |
1782 | * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
1802 | * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
1783 | * IrDA feature is supported by the USARTx instance. |
1803 | * IrDA feature is supported by the USARTx instance. |
1784 | * @rmtoll CR3 IRLP LL_USART_GetIrdaPowerMode |
1804 | * @rmtoll CR3 IRLP LL_USART_GetIrdaPowerMode |
1785 | * @param USARTx USART Instance |
1805 | * @param USARTx USART Instance |
1786 | * @retval Returned value can be one of the following values: |
1806 | * @retval Returned value can be one of the following values: |
1787 | * @arg @ref LL_USART_IRDA_POWER_NORMAL |
1807 | * @arg @ref LL_USART_IRDA_POWER_NORMAL |
Line 1793... | Line 1813... | ||
1793 | } |
1813 | } |
1794 | 1814 | ||
1795 | /** |
1815 | /** |
1796 | * @brief Set Irda prescaler value, used for dividing the USART clock source |
1816 | * @brief Set Irda prescaler value, used for dividing the USART clock source |
1797 | * to achieve the Irda Low Power frequency (8 bits value) |
1817 | * to achieve the Irda Low Power frequency (8 bits value) |
1798 | * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
1818 | * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
1799 | * IrDA feature is supported by the USARTx instance. |
1819 | * IrDA feature is supported by the USARTx instance. |
1800 | * @rmtoll GTPR PSC LL_USART_SetIrdaPrescaler |
1820 | * @rmtoll GTPR PSC LL_USART_SetIrdaPrescaler |
1801 | * @param USARTx USART Instance |
1821 | * @param USARTx USART Instance |
1802 | * @param PrescalerValue Value between Min_Data=0x00 and Max_Data=0xFF |
1822 | * @param PrescalerValue Value between Min_Data=0x00 and Max_Data=0xFF |
1803 | * @retval None |
1823 | * @retval None |
Line 1808... | Line 1828... | ||
1808 | } |
1828 | } |
1809 | 1829 | ||
1810 | /** |
1830 | /** |
1811 | * @brief Return Irda prescaler value, used for dividing the USART clock source |
1831 | * @brief Return Irda prescaler value, used for dividing the USART clock source |
1812 | * to achieve the Irda Low Power frequency (8 bits value) |
1832 | * to achieve the Irda Low Power frequency (8 bits value) |
1813 | * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
1833 | * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
1814 | * IrDA feature is supported by the USARTx instance. |
1834 | * IrDA feature is supported by the USARTx instance. |
1815 | * @rmtoll GTPR PSC LL_USART_GetIrdaPrescaler |
1835 | * @rmtoll GTPR PSC LL_USART_GetIrdaPrescaler |
1816 | * @param USARTx USART Instance |
1836 | * @param USARTx USART Instance |
1817 | * @retval Irda prescaler value (Value between Min_Data=0x00 and Max_Data=0xFF) |
1837 | * @retval Irda prescaler value (Value between Min_Data=0x00 and Max_Data=0xFF) |
1818 | */ |
1838 | */ |
Line 1831... | Line 1851... | ||
1831 | * @{ |
1851 | * @{ |
1832 | */ |
1852 | */ |
1833 | 1853 | ||
1834 | /** |
1854 | /** |
1835 | * @brief Enable Smartcard NACK transmission |
1855 | * @brief Enable Smartcard NACK transmission |
1836 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1856 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1837 | * Smartcard feature is supported by the USARTx instance. |
1857 | * Smartcard feature is supported by the USARTx instance. |
1838 | * @rmtoll CR3 NACK LL_USART_EnableSmartcardNACK |
1858 | * @rmtoll CR3 NACK LL_USART_EnableSmartcardNACK |
1839 | * @param USARTx USART Instance |
1859 | * @param USARTx USART Instance |
1840 | * @retval None |
1860 | * @retval None |
1841 | */ |
1861 | */ |
Line 1844... | Line 1864... | ||
1844 | SET_BIT(USARTx->CR3, USART_CR3_NACK); |
1864 | SET_BIT(USARTx->CR3, USART_CR3_NACK); |
1845 | } |
1865 | } |
1846 | 1866 | ||
1847 | /** |
1867 | /** |
1848 | * @brief Disable Smartcard NACK transmission |
1868 | * @brief Disable Smartcard NACK transmission |
1849 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1869 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1850 | * Smartcard feature is supported by the USARTx instance. |
1870 | * Smartcard feature is supported by the USARTx instance. |
1851 | * @rmtoll CR3 NACK LL_USART_DisableSmartcardNACK |
1871 | * @rmtoll CR3 NACK LL_USART_DisableSmartcardNACK |
1852 | * @param USARTx USART Instance |
1872 | * @param USARTx USART Instance |
1853 | * @retval None |
1873 | * @retval None |
1854 | */ |
1874 | */ |
Line 1857... | Line 1877... | ||
1857 | CLEAR_BIT(USARTx->CR3, USART_CR3_NACK); |
1877 | CLEAR_BIT(USARTx->CR3, USART_CR3_NACK); |
1858 | } |
1878 | } |
1859 | 1879 | ||
1860 | /** |
1880 | /** |
1861 | * @brief Indicate if Smartcard NACK transmission is enabled |
1881 | * @brief Indicate if Smartcard NACK transmission is enabled |
1862 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1882 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1863 | * Smartcard feature is supported by the USARTx instance. |
1883 | * Smartcard feature is supported by the USARTx instance. |
1864 | * @rmtoll CR3 NACK LL_USART_IsEnabledSmartcardNACK |
1884 | * @rmtoll CR3 NACK LL_USART_IsEnabledSmartcardNACK |
1865 | * @param USARTx USART Instance |
1885 | * @param USARTx USART Instance |
1866 | * @retval State of bit (1 or 0). |
1886 | * @retval State of bit (1 or 0). |
1867 | */ |
1887 | */ |
Line 1870... | Line 1890... | ||
1870 | return ((READ_BIT(USARTx->CR3, USART_CR3_NACK) == (USART_CR3_NACK)) ? 1UL : 0UL); |
1890 | return ((READ_BIT(USARTx->CR3, USART_CR3_NACK) == (USART_CR3_NACK)) ? 1UL : 0UL); |
1871 | } |
1891 | } |
1872 | 1892 | ||
1873 | /** |
1893 | /** |
1874 | * @brief Enable Smartcard mode |
1894 | * @brief Enable Smartcard mode |
1875 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1895 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1876 | * Smartcard feature is supported by the USARTx instance. |
1896 | * Smartcard feature is supported by the USARTx instance. |
1877 | * @rmtoll CR3 SCEN LL_USART_EnableSmartcard |
1897 | * @rmtoll CR3 SCEN LL_USART_EnableSmartcard |
1878 | * @param USARTx USART Instance |
1898 | * @param USARTx USART Instance |
1879 | * @retval None |
1899 | * @retval None |
1880 | */ |
1900 | */ |
Line 1883... | Line 1903... | ||
1883 | SET_BIT(USARTx->CR3, USART_CR3_SCEN); |
1903 | SET_BIT(USARTx->CR3, USART_CR3_SCEN); |
1884 | } |
1904 | } |
1885 | 1905 | ||
1886 | /** |
1906 | /** |
1887 | * @brief Disable Smartcard mode |
1907 | * @brief Disable Smartcard mode |
1888 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1908 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1889 | * Smartcard feature is supported by the USARTx instance. |
1909 | * Smartcard feature is supported by the USARTx instance. |
1890 | * @rmtoll CR3 SCEN LL_USART_DisableSmartcard |
1910 | * @rmtoll CR3 SCEN LL_USART_DisableSmartcard |
1891 | * @param USARTx USART Instance |
1911 | * @param USARTx USART Instance |
1892 | * @retval None |
1912 | * @retval None |
1893 | */ |
1913 | */ |
Line 1896... | Line 1916... | ||
1896 | CLEAR_BIT(USARTx->CR3, USART_CR3_SCEN); |
1916 | CLEAR_BIT(USARTx->CR3, USART_CR3_SCEN); |
1897 | } |
1917 | } |
1898 | 1918 | ||
1899 | /** |
1919 | /** |
1900 | * @brief Indicate if Smartcard mode is enabled |
1920 | * @brief Indicate if Smartcard mode is enabled |
1901 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1921 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1902 | * Smartcard feature is supported by the USARTx instance. |
1922 | * Smartcard feature is supported by the USARTx instance. |
1903 | * @rmtoll CR3 SCEN LL_USART_IsEnabledSmartcard |
1923 | * @rmtoll CR3 SCEN LL_USART_IsEnabledSmartcard |
1904 | * @param USARTx USART Instance |
1924 | * @param USARTx USART Instance |
1905 | * @retval State of bit (1 or 0). |
1925 | * @retval State of bit (1 or 0). |
1906 | */ |
1926 | */ |
Line 1909... | Line 1929... | ||
1909 | return ((READ_BIT(USARTx->CR3, USART_CR3_SCEN) == (USART_CR3_SCEN)) ? 1UL : 0UL); |
1929 | return ((READ_BIT(USARTx->CR3, USART_CR3_SCEN) == (USART_CR3_SCEN)) ? 1UL : 0UL); |
1910 | } |
1930 | } |
1911 | 1931 | ||
1912 | /** |
1932 | /** |
1913 | * @brief Set Smartcard Auto-Retry Count value (SCARCNT[2:0] bits) |
1933 | * @brief Set Smartcard Auto-Retry Count value (SCARCNT[2:0] bits) |
1914 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1934 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1915 | * Smartcard feature is supported by the USARTx instance. |
1935 | * Smartcard feature is supported by the USARTx instance. |
1916 | * @note This bit-field specifies the number of retries in transmit and receive, in Smartcard mode. |
1936 | * @note This bit-field specifies the number of retries in transmit and receive, in Smartcard mode. |
1917 | * In transmission mode, it specifies the number of automatic retransmission retries, before |
1937 | * In transmission mode, it specifies the number of automatic retransmission retries, before |
1918 | * generating a transmission error (FE bit set). |
1938 | * generating a transmission error (FE bit set). |
1919 | * In reception mode, it specifies the number or erroneous reception trials, before generating a |
1939 | * In reception mode, it specifies the number or erroneous reception trials, before generating a |
Line 1928... | Line 1948... | ||
1928 | MODIFY_REG(USARTx->CR3, USART_CR3_SCARCNT, AutoRetryCount << USART_CR3_SCARCNT_Pos); |
1948 | MODIFY_REG(USARTx->CR3, USART_CR3_SCARCNT, AutoRetryCount << USART_CR3_SCARCNT_Pos); |
1929 | } |
1949 | } |
1930 | 1950 | ||
1931 | /** |
1951 | /** |
1932 | * @brief Return Smartcard Auto-Retry Count value (SCARCNT[2:0] bits) |
1952 | * @brief Return Smartcard Auto-Retry Count value (SCARCNT[2:0] bits) |
1933 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1953 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1934 | * Smartcard feature is supported by the USARTx instance. |
1954 | * Smartcard feature is supported by the USARTx instance. |
1935 | * @rmtoll CR3 SCARCNT LL_USART_GetSmartcardAutoRetryCount |
1955 | * @rmtoll CR3 SCARCNT LL_USART_GetSmartcardAutoRetryCount |
1936 | * @param USARTx USART Instance |
1956 | * @param USARTx USART Instance |
1937 | * @retval Smartcard Auto-Retry Count value (Value between Min_Data=0 and Max_Data=7) |
1957 | * @retval Smartcard Auto-Retry Count value (Value between Min_Data=0 and Max_Data=7) |
1938 | */ |
1958 | */ |
Line 1942... | Line 1962... | ||
1942 | } |
1962 | } |
1943 | 1963 | ||
1944 | /** |
1964 | /** |
1945 | * @brief Set Smartcard prescaler value, used for dividing the USART clock |
1965 | * @brief Set Smartcard prescaler value, used for dividing the USART clock |
1946 | * source to provide the SMARTCARD Clock (5 bits value) |
1966 | * source to provide the SMARTCARD Clock (5 bits value) |
1947 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1967 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1948 | * Smartcard feature is supported by the USARTx instance. |
1968 | * Smartcard feature is supported by the USARTx instance. |
1949 | * @rmtoll GTPR PSC LL_USART_SetSmartcardPrescaler |
1969 | * @rmtoll GTPR PSC LL_USART_SetSmartcardPrescaler |
1950 | * @param USARTx USART Instance |
1970 | * @param USARTx USART Instance |
1951 | * @param PrescalerValue Value between Min_Data=0 and Max_Data=31 |
1971 | * @param PrescalerValue Value between Min_Data=0 and Max_Data=31 |
1952 | * @retval None |
1972 | * @retval None |
Line 1957... | Line 1977... | ||
1957 | } |
1977 | } |
1958 | 1978 | ||
1959 | /** |
1979 | /** |
1960 | * @brief Return Smartcard prescaler value, used for dividing the USART clock |
1980 | * @brief Return Smartcard prescaler value, used for dividing the USART clock |
1961 | * source to provide the SMARTCARD Clock (5 bits value) |
1981 | * source to provide the SMARTCARD Clock (5 bits value) |
1962 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1982 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1963 | * Smartcard feature is supported by the USARTx instance. |
1983 | * Smartcard feature is supported by the USARTx instance. |
1964 | * @rmtoll GTPR PSC LL_USART_GetSmartcardPrescaler |
1984 | * @rmtoll GTPR PSC LL_USART_GetSmartcardPrescaler |
1965 | * @param USARTx USART Instance |
1985 | * @param USARTx USART Instance |
1966 | * @retval Smartcard prescaler value (Value between Min_Data=0 and Max_Data=31) |
1986 | * @retval Smartcard prescaler value (Value between Min_Data=0 and Max_Data=31) |
1967 | */ |
1987 | */ |
Line 1971... | Line 1991... | ||
1971 | } |
1991 | } |
1972 | 1992 | ||
1973 | /** |
1993 | /** |
1974 | * @brief Set Smartcard Guard time value, expressed in nb of baud clocks periods |
1994 | * @brief Set Smartcard Guard time value, expressed in nb of baud clocks periods |
1975 | * (GT[7:0] bits : Guard time value) |
1995 | * (GT[7:0] bits : Guard time value) |
1976 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1996 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1977 | * Smartcard feature is supported by the USARTx instance. |
1997 | * Smartcard feature is supported by the USARTx instance. |
1978 | * @rmtoll GTPR GT LL_USART_SetSmartcardGuardTime |
1998 | * @rmtoll GTPR GT LL_USART_SetSmartcardGuardTime |
1979 | * @param USARTx USART Instance |
1999 | * @param USARTx USART Instance |
1980 | * @param GuardTime Value between Min_Data=0x00 and Max_Data=0xFF |
2000 | * @param GuardTime Value between Min_Data=0x00 and Max_Data=0xFF |
1981 | * @retval None |
2001 | * @retval None |
Line 1986... | Line 2006... | ||
1986 | } |
2006 | } |
1987 | 2007 | ||
1988 | /** |
2008 | /** |
1989 | * @brief Return Smartcard Guard time value, expressed in nb of baud clocks periods |
2009 | * @brief Return Smartcard Guard time value, expressed in nb of baud clocks periods |
1990 | * (GT[7:0] bits : Guard time value) |
2010 | * (GT[7:0] bits : Guard time value) |
1991 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
2011 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
1992 | * Smartcard feature is supported by the USARTx instance. |
2012 | * Smartcard feature is supported by the USARTx instance. |
1993 | * @rmtoll GTPR GT LL_USART_GetSmartcardGuardTime |
2013 | * @rmtoll GTPR GT LL_USART_GetSmartcardGuardTime |
1994 | * @param USARTx USART Instance |
2014 | * @param USARTx USART Instance |
1995 | * @retval Smartcard Guard time value (Value between Min_Data=0x00 and Max_Data=0xFF) |
2015 | * @retval Smartcard Guard time value (Value between Min_Data=0x00 and Max_Data=0xFF) |
1996 | */ |
2016 | */ |
Line 2008... | Line 2028... | ||
2008 | * @{ |
2028 | * @{ |
2009 | */ |
2029 | */ |
2010 | 2030 | ||
2011 | /** |
2031 | /** |
2012 | * @brief Enable Single Wire Half-Duplex mode |
2032 | * @brief Enable Single Wire Half-Duplex mode |
2013 | * @note Macro @ref IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not |
2033 | * @note Macro IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not |
2014 | * Half-Duplex mode is supported by the USARTx instance. |
2034 | * Half-Duplex mode is supported by the USARTx instance. |
2015 | * @rmtoll CR3 HDSEL LL_USART_EnableHalfDuplex |
2035 | * @rmtoll CR3 HDSEL LL_USART_EnableHalfDuplex |
2016 | * @param USARTx USART Instance |
2036 | * @param USARTx USART Instance |
2017 | * @retval None |
2037 | * @retval None |
2018 | */ |
2038 | */ |
Line 2021... | Line 2041... | ||
2021 | SET_BIT(USARTx->CR3, USART_CR3_HDSEL); |
2041 | SET_BIT(USARTx->CR3, USART_CR3_HDSEL); |
2022 | } |
2042 | } |
2023 | 2043 | ||
2024 | /** |
2044 | /** |
2025 | * @brief Disable Single Wire Half-Duplex mode |
2045 | * @brief Disable Single Wire Half-Duplex mode |
2026 | * @note Macro @ref IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not |
2046 | * @note Macro IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not |
2027 | * Half-Duplex mode is supported by the USARTx instance. |
2047 | * Half-Duplex mode is supported by the USARTx instance. |
2028 | * @rmtoll CR3 HDSEL LL_USART_DisableHalfDuplex |
2048 | * @rmtoll CR3 HDSEL LL_USART_DisableHalfDuplex |
2029 | * @param USARTx USART Instance |
2049 | * @param USARTx USART Instance |
2030 | * @retval None |
2050 | * @retval None |
2031 | */ |
2051 | */ |
Line 2034... | Line 2054... | ||
2034 | CLEAR_BIT(USARTx->CR3, USART_CR3_HDSEL); |
2054 | CLEAR_BIT(USARTx->CR3, USART_CR3_HDSEL); |
2035 | } |
2055 | } |
2036 | 2056 | ||
2037 | /** |
2057 | /** |
2038 | * @brief Indicate if Single Wire Half-Duplex mode is enabled |
2058 | * @brief Indicate if Single Wire Half-Duplex mode is enabled |
2039 | * @note Macro @ref IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not |
2059 | * @note Macro IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not |
2040 | * Half-Duplex mode is supported by the USARTx instance. |
2060 | * Half-Duplex mode is supported by the USARTx instance. |
2041 | * @rmtoll CR3 HDSEL LL_USART_IsEnabledHalfDuplex |
2061 | * @rmtoll CR3 HDSEL LL_USART_IsEnabledHalfDuplex |
2042 | * @param USARTx USART Instance |
2062 | * @param USARTx USART Instance |
2043 | * @retval State of bit (1 or 0). |
2063 | * @retval State of bit (1 or 0). |
2044 | */ |
2064 | */ |
Line 2056... | Line 2076... | ||
2056 | * @{ |
2076 | * @{ |
2057 | */ |
2077 | */ |
2058 | 2078 | ||
2059 | /** |
2079 | /** |
2060 | * @brief Set LIN Break Detection Length |
2080 | * @brief Set LIN Break Detection Length |
2061 | * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
2081 | * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
2062 | * LIN feature is supported by the USARTx instance. |
2082 | * LIN feature is supported by the USARTx instance. |
2063 | * @rmtoll CR2 LBDL LL_USART_SetLINBrkDetectionLen |
2083 | * @rmtoll CR2 LBDL LL_USART_SetLINBrkDetectionLen |
2064 | * @param USARTx USART Instance |
2084 | * @param USARTx USART Instance |
2065 | * @param LINBDLength This parameter can be one of the following values: |
2085 | * @param LINBDLength This parameter can be one of the following values: |
2066 | * @arg @ref LL_USART_LINBREAK_DETECT_10B |
2086 | * @arg @ref LL_USART_LINBREAK_DETECT_10B |
Line 2072... | Line 2092... | ||
2072 | MODIFY_REG(USARTx->CR2, USART_CR2_LBDL, LINBDLength); |
2092 | MODIFY_REG(USARTx->CR2, USART_CR2_LBDL, LINBDLength); |
2073 | } |
2093 | } |
2074 | 2094 | ||
2075 | /** |
2095 | /** |
2076 | * @brief Return LIN Break Detection Length |
2096 | * @brief Return LIN Break Detection Length |
2077 | * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
2097 | * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
2078 | * LIN feature is supported by the USARTx instance. |
2098 | * LIN feature is supported by the USARTx instance. |
2079 | * @rmtoll CR2 LBDL LL_USART_GetLINBrkDetectionLen |
2099 | * @rmtoll CR2 LBDL LL_USART_GetLINBrkDetectionLen |
2080 | * @param USARTx USART Instance |
2100 | * @param USARTx USART Instance |
2081 | * @retval Returned value can be one of the following values: |
2101 | * @retval Returned value can be one of the following values: |
2082 | * @arg @ref LL_USART_LINBREAK_DETECT_10B |
2102 | * @arg @ref LL_USART_LINBREAK_DETECT_10B |
Line 2087... | Line 2107... | ||
2087 | return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_LBDL)); |
2107 | return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_LBDL)); |
2088 | } |
2108 | } |
2089 | 2109 | ||
2090 | /** |
2110 | /** |
2091 | * @brief Enable LIN mode |
2111 | * @brief Enable LIN mode |
2092 | * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
2112 | * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
2093 | * LIN feature is supported by the USARTx instance. |
2113 | * LIN feature is supported by the USARTx instance. |
2094 | * @rmtoll CR2 LINEN LL_USART_EnableLIN |
2114 | * @rmtoll CR2 LINEN LL_USART_EnableLIN |
2095 | * @param USARTx USART Instance |
2115 | * @param USARTx USART Instance |
2096 | * @retval None |
2116 | * @retval None |
2097 | */ |
2117 | */ |
Line 2100... | Line 2120... | ||
2100 | SET_BIT(USARTx->CR2, USART_CR2_LINEN); |
2120 | SET_BIT(USARTx->CR2, USART_CR2_LINEN); |
2101 | } |
2121 | } |
2102 | 2122 | ||
2103 | /** |
2123 | /** |
2104 | * @brief Disable LIN mode |
2124 | * @brief Disable LIN mode |
2105 | * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
2125 | * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
2106 | * LIN feature is supported by the USARTx instance. |
2126 | * LIN feature is supported by the USARTx instance. |
2107 | * @rmtoll CR2 LINEN LL_USART_DisableLIN |
2127 | * @rmtoll CR2 LINEN LL_USART_DisableLIN |
2108 | * @param USARTx USART Instance |
2128 | * @param USARTx USART Instance |
2109 | * @retval None |
2129 | * @retval None |
2110 | */ |
2130 | */ |
Line 2113... | Line 2133... | ||
2113 | CLEAR_BIT(USARTx->CR2, USART_CR2_LINEN); |
2133 | CLEAR_BIT(USARTx->CR2, USART_CR2_LINEN); |
2114 | } |
2134 | } |
2115 | 2135 | ||
2116 | /** |
2136 | /** |
2117 | * @brief Indicate if LIN mode is enabled |
2137 | * @brief Indicate if LIN mode is enabled |
2118 | * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
2138 | * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
2119 | * LIN feature is supported by the USARTx instance. |
2139 | * LIN feature is supported by the USARTx instance. |
2120 | * @rmtoll CR2 LINEN LL_USART_IsEnabledLIN |
2140 | * @rmtoll CR2 LINEN LL_USART_IsEnabledLIN |
2121 | * @param USARTx USART Instance |
2141 | * @param USARTx USART Instance |
2122 | * @retval State of bit (1 or 0). |
2142 | * @retval State of bit (1 or 0). |
2123 | */ |
2143 | */ |
Line 2135... | Line 2155... | ||
2135 | * @{ |
2155 | * @{ |
2136 | */ |
2156 | */ |
2137 | 2157 | ||
2138 | /** |
2158 | /** |
2139 | * @brief Set DEDT (Driver Enable De-Assertion Time), Time value expressed on 5 bits ([4:0] bits). |
2159 | * @brief Set DEDT (Driver Enable De-Assertion Time), Time value expressed on 5 bits ([4:0] bits). |
2140 | * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2160 | * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2141 | * Driver Enable feature is supported by the USARTx instance. |
2161 | * Driver Enable feature is supported by the USARTx instance. |
2142 | * @rmtoll CR1 DEDT LL_USART_SetDEDeassertionTime |
2162 | * @rmtoll CR1 DEDT LL_USART_SetDEDeassertionTime |
2143 | * @param USARTx USART Instance |
2163 | * @param USARTx USART Instance |
2144 | * @param Time Value between Min_Data=0 and Max_Data=31 |
2164 | * @param Time Value between Min_Data=0 and Max_Data=31 |
2145 | * @retval None |
2165 | * @retval None |
Line 2149... | Line 2169... | ||
2149 | MODIFY_REG(USARTx->CR1, USART_CR1_DEDT, Time << USART_CR1_DEDT_Pos); |
2169 | MODIFY_REG(USARTx->CR1, USART_CR1_DEDT, Time << USART_CR1_DEDT_Pos); |
2150 | } |
2170 | } |
2151 | 2171 | ||
2152 | /** |
2172 | /** |
2153 | * @brief Return DEDT (Driver Enable De-Assertion Time) |
2173 | * @brief Return DEDT (Driver Enable De-Assertion Time) |
2154 | * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2174 | * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2155 | * Driver Enable feature is supported by the USARTx instance. |
2175 | * Driver Enable feature is supported by the USARTx instance. |
2156 | * @rmtoll CR1 DEDT LL_USART_GetDEDeassertionTime |
2176 | * @rmtoll CR1 DEDT LL_USART_GetDEDeassertionTime |
2157 | * @param USARTx USART Instance |
2177 | * @param USARTx USART Instance |
2158 | * @retval Time value expressed on 5 bits ([4:0] bits) : Value between Min_Data=0 and Max_Data=31 |
2178 | * @retval Time value expressed on 5 bits ([4:0] bits) : Value between Min_Data=0 and Max_Data=31 |
2159 | */ |
2179 | */ |
Line 2162... | Line 2182... | ||
2162 | return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_DEDT) >> USART_CR1_DEDT_Pos); |
2182 | return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_DEDT) >> USART_CR1_DEDT_Pos); |
2163 | } |
2183 | } |
2164 | 2184 | ||
2165 | /** |
2185 | /** |
2166 | * @brief Set DEAT (Driver Enable Assertion Time), Time value expressed on 5 bits ([4:0] bits). |
2186 | * @brief Set DEAT (Driver Enable Assertion Time), Time value expressed on 5 bits ([4:0] bits). |
2167 | * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2187 | * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2168 | * Driver Enable feature is supported by the USARTx instance. |
2188 | * Driver Enable feature is supported by the USARTx instance. |
2169 | * @rmtoll CR1 DEAT LL_USART_SetDEAssertionTime |
2189 | * @rmtoll CR1 DEAT LL_USART_SetDEAssertionTime |
2170 | * @param USARTx USART Instance |
2190 | * @param USARTx USART Instance |
2171 | * @param Time Value between Min_Data=0 and Max_Data=31 |
2191 | * @param Time Value between Min_Data=0 and Max_Data=31 |
2172 | * @retval None |
2192 | * @retval None |
Line 2176... | Line 2196... | ||
2176 | MODIFY_REG(USARTx->CR1, USART_CR1_DEAT, Time << USART_CR1_DEAT_Pos); |
2196 | MODIFY_REG(USARTx->CR1, USART_CR1_DEAT, Time << USART_CR1_DEAT_Pos); |
2177 | } |
2197 | } |
2178 | 2198 | ||
2179 | /** |
2199 | /** |
2180 | * @brief Return DEAT (Driver Enable Assertion Time) |
2200 | * @brief Return DEAT (Driver Enable Assertion Time) |
2181 | * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2201 | * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2182 | * Driver Enable feature is supported by the USARTx instance. |
2202 | * Driver Enable feature is supported by the USARTx instance. |
2183 | * @rmtoll CR1 DEAT LL_USART_GetDEAssertionTime |
2203 | * @rmtoll CR1 DEAT LL_USART_GetDEAssertionTime |
2184 | * @param USARTx USART Instance |
2204 | * @param USARTx USART Instance |
2185 | * @retval Time value expressed on 5 bits ([4:0] bits) : Value between Min_Data=0 and Max_Data=31 |
2205 | * @retval Time value expressed on 5 bits ([4:0] bits) : Value between Min_Data=0 and Max_Data=31 |
2186 | */ |
2206 | */ |
Line 2189... | Line 2209... | ||
2189 | return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_DEAT) >> USART_CR1_DEAT_Pos); |
2209 | return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_DEAT) >> USART_CR1_DEAT_Pos); |
2190 | } |
2210 | } |
2191 | 2211 | ||
2192 | /** |
2212 | /** |
2193 | * @brief Enable Driver Enable (DE) Mode |
2213 | * @brief Enable Driver Enable (DE) Mode |
2194 | * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2214 | * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2195 | * Driver Enable feature is supported by the USARTx instance. |
2215 | * Driver Enable feature is supported by the USARTx instance. |
2196 | * @rmtoll CR3 DEM LL_USART_EnableDEMode |
2216 | * @rmtoll CR3 DEM LL_USART_EnableDEMode |
2197 | * @param USARTx USART Instance |
2217 | * @param USARTx USART Instance |
2198 | * @retval None |
2218 | * @retval None |
2199 | */ |
2219 | */ |
Line 2202... | Line 2222... | ||
2202 | SET_BIT(USARTx->CR3, USART_CR3_DEM); |
2222 | SET_BIT(USARTx->CR3, USART_CR3_DEM); |
2203 | } |
2223 | } |
2204 | 2224 | ||
2205 | /** |
2225 | /** |
2206 | * @brief Disable Driver Enable (DE) Mode |
2226 | * @brief Disable Driver Enable (DE) Mode |
2207 | * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2227 | * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2208 | * Driver Enable feature is supported by the USARTx instance. |
2228 | * Driver Enable feature is supported by the USARTx instance. |
2209 | * @rmtoll CR3 DEM LL_USART_DisableDEMode |
2229 | * @rmtoll CR3 DEM LL_USART_DisableDEMode |
2210 | * @param USARTx USART Instance |
2230 | * @param USARTx USART Instance |
2211 | * @retval None |
2231 | * @retval None |
2212 | */ |
2232 | */ |
Line 2215... | Line 2235... | ||
2215 | CLEAR_BIT(USARTx->CR3, USART_CR3_DEM); |
2235 | CLEAR_BIT(USARTx->CR3, USART_CR3_DEM); |
2216 | } |
2236 | } |
2217 | 2237 | ||
2218 | /** |
2238 | /** |
2219 | * @brief Indicate if Driver Enable (DE) Mode is enabled |
2239 | * @brief Indicate if Driver Enable (DE) Mode is enabled |
2220 | * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2240 | * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2221 | * Driver Enable feature is supported by the USARTx instance. |
2241 | * Driver Enable feature is supported by the USARTx instance. |
2222 | * @rmtoll CR3 DEM LL_USART_IsEnabledDEMode |
2242 | * @rmtoll CR3 DEM LL_USART_IsEnabledDEMode |
2223 | * @param USARTx USART Instance |
2243 | * @param USARTx USART Instance |
2224 | * @retval State of bit (1 or 0). |
2244 | * @retval State of bit (1 or 0). |
2225 | */ |
2245 | */ |
Line 2228... | Line 2248... | ||
2228 | return ((READ_BIT(USARTx->CR3, USART_CR3_DEM) == (USART_CR3_DEM)) ? 1UL : 0UL); |
2248 | return ((READ_BIT(USARTx->CR3, USART_CR3_DEM) == (USART_CR3_DEM)) ? 1UL : 0UL); |
2229 | } |
2249 | } |
2230 | 2250 | ||
2231 | /** |
2251 | /** |
2232 | * @brief Select Driver Enable Polarity |
2252 | * @brief Select Driver Enable Polarity |
2233 | * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2253 | * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2234 | * Driver Enable feature is supported by the USARTx instance. |
2254 | * Driver Enable feature is supported by the USARTx instance. |
2235 | * @rmtoll CR3 DEP LL_USART_SetDESignalPolarity |
2255 | * @rmtoll CR3 DEP LL_USART_SetDESignalPolarity |
2236 | * @param USARTx USART Instance |
2256 | * @param USARTx USART Instance |
2237 | * @param Polarity This parameter can be one of the following values: |
2257 | * @param Polarity This parameter can be one of the following values: |
2238 | * @arg @ref LL_USART_DE_POLARITY_HIGH |
2258 | * @arg @ref LL_USART_DE_POLARITY_HIGH |
Line 2244... | Line 2264... | ||
2244 | MODIFY_REG(USARTx->CR3, USART_CR3_DEP, Polarity); |
2264 | MODIFY_REG(USARTx->CR3, USART_CR3_DEP, Polarity); |
2245 | } |
2265 | } |
2246 | 2266 | ||
2247 | /** |
2267 | /** |
2248 | * @brief Return Driver Enable Polarity |
2268 | * @brief Return Driver Enable Polarity |
2249 | * @note Macro @ref IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2269 | * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not |
2250 | * Driver Enable feature is supported by the USARTx instance. |
2270 | * Driver Enable feature is supported by the USARTx instance. |
2251 | * @rmtoll CR3 DEP LL_USART_GetDESignalPolarity |
2271 | * @rmtoll CR3 DEP LL_USART_GetDESignalPolarity |
2252 | * @param USARTx USART Instance |
2272 | * @param USARTx USART Instance |
2253 | * @retval Returned value can be one of the following values: |
2273 | * @retval Returned value can be one of the following values: |
2254 | * @arg @ref LL_USART_DE_POLARITY_HIGH |
2274 | * @arg @ref LL_USART_DE_POLARITY_HIGH |
Line 2324... | Line 2344... | ||
2324 | * - LINEN bit in the USART_CR2 register (if LIN feature is supported), |
2344 | * - LINEN bit in the USART_CR2 register (if LIN feature is supported), |
2325 | * - SCEN bit in the USART_CR3 register (if Smartcard feature is supported), |
2345 | * - SCEN bit in the USART_CR3 register (if Smartcard feature is supported), |
2326 | * - IREN bit in the USART_CR3 register (if Irda feature is supported), |
2346 | * - IREN bit in the USART_CR3 register (if Irda feature is supported), |
2327 | * - HDSEL bit in the USART_CR3 register. |
2347 | * - HDSEL bit in the USART_CR3 register. |
2328 | * This function also sets the USART in Synchronous mode. |
2348 | * This function also sets the USART in Synchronous mode. |
2329 | * @note Macro @ref IS_USART_INSTANCE(USARTx) can be used to check whether or not |
2349 | * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not |
2330 | * Synchronous mode is supported by the USARTx instance. |
2350 | * Synchronous mode is supported by the USARTx instance. |
2331 | * @note Call of this function is equivalent to following function call sequence : |
2351 | * @note Call of this function is equivalent to following function call sequence : |
2332 | * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function (if LIN feature is supported) |
2352 | * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function (if LIN feature is supported) |
2333 | * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function (if Irda feature is supported) |
2353 | * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function (if Irda feature is supported) |
2334 | * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function (if Smartcard feature is supported) |
2354 | * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function (if Smartcard feature is supported) |
Line 2378... | Line 2398... | ||
2378 | * - STOP and CLKEN bits in the USART_CR2 register, |
2398 | * - STOP and CLKEN bits in the USART_CR2 register, |
2379 | * - SCEN bit in the USART_CR3 register (if Smartcard feature is supported), |
2399 | * - SCEN bit in the USART_CR3 register (if Smartcard feature is supported), |
2380 | * - IREN bit in the USART_CR3 register (if Irda feature is supported), |
2400 | * - IREN bit in the USART_CR3 register (if Irda feature is supported), |
2381 | * - HDSEL bit in the USART_CR3 register. |
2401 | * - HDSEL bit in the USART_CR3 register. |
2382 | * This function also set the UART/USART in LIN mode. |
2402 | * This function also set the UART/USART in LIN mode. |
2383 | * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
2403 | * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
2384 | * LIN feature is supported by the USARTx instance. |
2404 | * LIN feature is supported by the USARTx instance. |
2385 | * @note Call of this function is equivalent to following function call sequence : |
2405 | * @note Call of this function is equivalent to following function call sequence : |
2386 | * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function |
2406 | * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function |
2387 | * - Clear STOP in CR2 using @ref LL_USART_SetStopBitsLength() function |
2407 | * - Clear STOP in CR2 using @ref LL_USART_SetStopBitsLength() function |
2388 | * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function (if Smartcard feature is supported) |
2408 | * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function (if Smartcard feature is supported) |
Line 2432... | Line 2452... | ||
2432 | * - LINEN bit in the USART_CR2 register (if LIN feature is supported), |
2452 | * - LINEN bit in the USART_CR2 register (if LIN feature is supported), |
2433 | * - CLKEN bit in the USART_CR2 register, |
2453 | * - CLKEN bit in the USART_CR2 register, |
2434 | * - SCEN bit in the USART_CR3 register (if Smartcard feature is supported), |
2454 | * - SCEN bit in the USART_CR3 register (if Smartcard feature is supported), |
2435 | * - IREN bit in the USART_CR3 register (if Irda feature is supported), |
2455 | * - IREN bit in the USART_CR3 register (if Irda feature is supported), |
2436 | * This function also sets the UART/USART in Half Duplex mode. |
2456 | * This function also sets the UART/USART in Half Duplex mode. |
2437 | * @note Macro @ref IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not |
2457 | * @note Macro IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not |
2438 | * Half-Duplex mode is supported by the USARTx instance. |
2458 | * Half-Duplex mode is supported by the USARTx instance. |
2439 | * @note Call of this function is equivalent to following function call sequence : |
2459 | * @note Call of this function is equivalent to following function call sequence : |
2440 | * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function (if LIN feature is supported) |
2460 | * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function (if LIN feature is supported) |
2441 | * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function |
2461 | * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function |
2442 | * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function (if Smartcard feature is supported) |
2462 | * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function (if Smartcard feature is supported) |
Line 2487... | Line 2507... | ||
2487 | * - IREN bit in the USART_CR3 register (if Irda feature is supported), |
2507 | * - IREN bit in the USART_CR3 register (if Irda feature is supported), |
2488 | * - HDSEL bit in the USART_CR3 register. |
2508 | * - HDSEL bit in the USART_CR3 register. |
2489 | * This function also configures Stop bits to 1.5 bits and |
2509 | * This function also configures Stop bits to 1.5 bits and |
2490 | * sets the USART in Smartcard mode (SCEN bit). |
2510 | * sets the USART in Smartcard mode (SCEN bit). |
2491 | * Clock Output is also enabled (CLKEN). |
2511 | * Clock Output is also enabled (CLKEN). |
2492 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
2512 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
2493 | * Smartcard feature is supported by the USARTx instance. |
2513 | * Smartcard feature is supported by the USARTx instance. |
2494 | * @note Call of this function is equivalent to following function call sequence : |
2514 | * @note Call of this function is equivalent to following function call sequence : |
2495 | * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function (if LIN feature is supported) |
2515 | * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function (if LIN feature is supported) |
2496 | * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function (if Irda feature is supported) |
2516 | * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function (if Irda feature is supported) |
2497 | * - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function |
2517 | * - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function |
Line 2538... | Line 2558... | ||
2538 | * - LINEN bit in the USART_CR2 register (if LIN feature is supported), |
2558 | * - LINEN bit in the USART_CR2 register (if LIN feature is supported), |
2539 | * - STOP and CLKEN bits in the USART_CR2 register, |
2559 | * - STOP and CLKEN bits in the USART_CR2 register, |
2540 | * - SCEN bit in the USART_CR3 register (if Smartcard feature is supported), |
2560 | * - SCEN bit in the USART_CR3 register (if Smartcard feature is supported), |
2541 | * - HDSEL bit in the USART_CR3 register. |
2561 | * - HDSEL bit in the USART_CR3 register. |
2542 | * This function also sets the UART/USART in IRDA mode (IREN bit). |
2562 | * This function also sets the UART/USART in IRDA mode (IREN bit). |
2543 | * @note Macro @ref IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
2563 | * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not |
2544 | * IrDA feature is supported by the USARTx instance. |
2564 | * IrDA feature is supported by the USARTx instance. |
2545 | * @note Call of this function is equivalent to following function call sequence : |
2565 | * @note Call of this function is equivalent to following function call sequence : |
2546 | * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function (if LIN feature is supported) |
2566 | * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function (if LIN feature is supported) |
2547 | * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function |
2567 | * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function |
2548 | * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function (if Smartcard feature is supported) |
2568 | * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function (if Smartcard feature is supported) |
Line 2732... | Line 2752... | ||
2732 | } |
2752 | } |
2733 | 2753 | ||
2734 | #if defined(USART_LIN_SUPPORT) |
2754 | #if defined(USART_LIN_SUPPORT) |
2735 | /** |
2755 | /** |
2736 | * @brief Check if the USART LIN Break Detection Flag is set or not |
2756 | * @brief Check if the USART LIN Break Detection Flag is set or not |
2737 | * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
2757 | * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
2738 | * LIN feature is supported by the USARTx instance. |
2758 | * LIN feature is supported by the USARTx instance. |
2739 | * @rmtoll ISR LBDF LL_USART_IsActiveFlag_LBD |
2759 | * @rmtoll ISR LBDF LL_USART_IsActiveFlag_LBD |
2740 | * @param USARTx USART Instance |
2760 | * @param USARTx USART Instance |
2741 | * @retval State of bit (1 or 0). |
2761 | * @retval State of bit (1 or 0). |
2742 | */ |
2762 | */ |
Line 2746... | Line 2766... | ||
2746 | } |
2766 | } |
2747 | #endif /* USART_LIN_SUPPORT */ |
2767 | #endif /* USART_LIN_SUPPORT */ |
2748 | 2768 | ||
2749 | /** |
2769 | /** |
2750 | * @brief Check if the USART CTS interrupt Flag is set or not |
2770 | * @brief Check if the USART CTS interrupt Flag is set or not |
2751 | * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
2771 | * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
2752 | * Hardware Flow control feature is supported by the USARTx instance. |
2772 | * Hardware Flow control feature is supported by the USARTx instance. |
2753 | * @rmtoll ISR CTSIF LL_USART_IsActiveFlag_nCTS |
2773 | * @rmtoll ISR CTSIF LL_USART_IsActiveFlag_nCTS |
2754 | * @param USARTx USART Instance |
2774 | * @param USARTx USART Instance |
2755 | * @retval State of bit (1 or 0). |
2775 | * @retval State of bit (1 or 0). |
2756 | */ |
2776 | */ |
Line 2759... | Line 2779... | ||
2759 | return ((READ_BIT(USARTx->ISR, USART_ISR_CTSIF) == (USART_ISR_CTSIF)) ? 1UL : 0UL); |
2779 | return ((READ_BIT(USARTx->ISR, USART_ISR_CTSIF) == (USART_ISR_CTSIF)) ? 1UL : 0UL); |
2760 | } |
2780 | } |
2761 | 2781 | ||
2762 | /** |
2782 | /** |
2763 | * @brief Check if the USART CTS Flag is set or not |
2783 | * @brief Check if the USART CTS Flag is set or not |
2764 | * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
2784 | * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
2765 | * Hardware Flow control feature is supported by the USARTx instance. |
2785 | * Hardware Flow control feature is supported by the USARTx instance. |
2766 | * @rmtoll ISR CTS LL_USART_IsActiveFlag_CTS |
2786 | * @rmtoll ISR CTS LL_USART_IsActiveFlag_CTS |
2767 | * @param USARTx USART Instance |
2787 | * @param USARTx USART Instance |
2768 | * @retval State of bit (1 or 0). |
2788 | * @retval State of bit (1 or 0). |
2769 | */ |
2789 | */ |
Line 2784... | Line 2804... | ||
2784 | } |
2804 | } |
2785 | 2805 | ||
2786 | #if defined(USART_SMARTCARD_SUPPORT) |
2806 | #if defined(USART_SMARTCARD_SUPPORT) |
2787 | /** |
2807 | /** |
2788 | * @brief Check if the USART End Of Block Flag is set or not |
2808 | * @brief Check if the USART End Of Block Flag is set or not |
2789 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
2809 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
2790 | * Smartcard feature is supported by the USARTx instance. |
2810 | * Smartcard feature is supported by the USARTx instance. |
2791 | * @rmtoll ISR EOBF LL_USART_IsActiveFlag_EOB |
2811 | * @rmtoll ISR EOBF LL_USART_IsActiveFlag_EOB |
2792 | * @param USARTx USART Instance |
2812 | * @param USARTx USART Instance |
2793 | * @retval State of bit (1 or 0). |
2813 | * @retval State of bit (1 or 0). |
2794 | */ |
2814 | */ |
Line 2798... | Line 2818... | ||
2798 | } |
2818 | } |
2799 | #endif /* USART_SMARTCARD_SUPPORT */ |
2819 | #endif /* USART_SMARTCARD_SUPPORT */ |
2800 | 2820 | ||
2801 | /** |
2821 | /** |
2802 | * @brief Check if the USART Auto-Baud Rate Error Flag is set or not |
2822 | * @brief Check if the USART Auto-Baud Rate Error Flag is set or not |
2803 | * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
2823 | * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
2804 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
2824 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
2805 | * @rmtoll ISR ABRE LL_USART_IsActiveFlag_ABRE |
2825 | * @rmtoll ISR ABRE LL_USART_IsActiveFlag_ABRE |
2806 | * @param USARTx USART Instance |
2826 | * @param USARTx USART Instance |
2807 | * @retval State of bit (1 or 0). |
2827 | * @retval State of bit (1 or 0). |
2808 | */ |
2828 | */ |
Line 2811... | Line 2831... | ||
2811 | return ((READ_BIT(USARTx->ISR, USART_ISR_ABRE) == (USART_ISR_ABRE)) ? 1UL : 0UL); |
2831 | return ((READ_BIT(USARTx->ISR, USART_ISR_ABRE) == (USART_ISR_ABRE)) ? 1UL : 0UL); |
2812 | } |
2832 | } |
2813 | 2833 | ||
2814 | /** |
2834 | /** |
2815 | * @brief Check if the USART Auto-Baud Rate Flag is set or not |
2835 | * @brief Check if the USART Auto-Baud Rate Flag is set or not |
2816 | * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
2836 | * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
2817 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
2837 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
2818 | * @rmtoll ISR ABRF LL_USART_IsActiveFlag_ABR |
2838 | * @rmtoll ISR ABRF LL_USART_IsActiveFlag_ABR |
2819 | * @param USARTx USART Instance |
2839 | * @param USARTx USART Instance |
2820 | * @retval State of bit (1 or 0). |
2840 | * @retval State of bit (1 or 0). |
2821 | */ |
2841 | */ |
Line 2867... | Line 2887... | ||
2867 | { |
2887 | { |
2868 | return ((READ_BIT(USARTx->ISR, USART_ISR_RWU) == (USART_ISR_RWU)) ? 1UL : 0UL); |
2888 | return ((READ_BIT(USARTx->ISR, USART_ISR_RWU) == (USART_ISR_RWU)) ? 1UL : 0UL); |
2869 | } |
2889 | } |
2870 | 2890 | ||
2871 | #if defined(USART_CR1_UESM) |
2891 | #if defined(USART_CR1_UESM) |
- | 2892 | #if defined(USART_CR3_WUFIE) |
|
2872 | /** |
2893 | /** |
2873 | * @brief Check if the USART Wake Up from stop mode Flag is set or not |
2894 | * @brief Check if the USART Wake Up from stop mode Flag is set or not |
2874 | * @note Macro @ref IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
2895 | * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
2875 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
2896 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
2876 | * @rmtoll ISR WUF LL_USART_IsActiveFlag_WKUP |
2897 | * @rmtoll ISR WUF LL_USART_IsActiveFlag_WKUP |
2877 | * @param USARTx USART Instance |
2898 | * @param USARTx USART Instance |
2878 | * @retval State of bit (1 or 0). |
2899 | * @retval State of bit (1 or 0). |
2879 | */ |
2900 | */ |
2880 | __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_WKUP(USART_TypeDef *USARTx) |
2901 | __STATIC_INLINE uint32_t LL_USART_IsActiveFlag_WKUP(USART_TypeDef *USARTx) |
2881 | { |
2902 | { |
2882 | return ((READ_BIT(USARTx->ISR, USART_ISR_WUF) == (USART_ISR_WUF)) ? 1UL : 0UL); |
2903 | return ((READ_BIT(USARTx->ISR, USART_ISR_WUF) == (USART_ISR_WUF)) ? 1UL : 0UL); |
2883 | } |
2904 | } |
2884 | 2905 | ||
- | 2906 | #endif /* USART_CR3_WUFIE */ |
|
2885 | #endif /* USART_CR1_UESM */ |
2907 | #endif /* USART_CR1_UESM */ |
2886 | /** |
2908 | /** |
2887 | * @brief Check if the USART Transmit Enable Acknowledge Flag is set or not |
2909 | * @brief Check if the USART Transmit Enable Acknowledge Flag is set or not |
2888 | * @rmtoll ISR TEACK LL_USART_IsActiveFlag_TEACK |
2910 | * @rmtoll ISR TEACK LL_USART_IsActiveFlag_TEACK |
2889 | * @param USARTx USART Instance |
2911 | * @param USARTx USART Instance |
Line 2973... | Line 2995... | ||
2973 | 2995 | ||
2974 | 2996 | ||
2975 | #if defined(USART_LIN_SUPPORT) |
2997 | #if defined(USART_LIN_SUPPORT) |
2976 | /** |
2998 | /** |
2977 | * @brief Clear LIN Break Detection Flag |
2999 | * @brief Clear LIN Break Detection Flag |
2978 | * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
3000 | * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
2979 | * LIN feature is supported by the USARTx instance. |
3001 | * LIN feature is supported by the USARTx instance. |
2980 | * @rmtoll ICR LBDCF LL_USART_ClearFlag_LBD |
3002 | * @rmtoll ICR LBDCF LL_USART_ClearFlag_LBD |
2981 | * @param USARTx USART Instance |
3003 | * @param USARTx USART Instance |
2982 | * @retval None |
3004 | * @retval None |
2983 | */ |
3005 | */ |
Line 2987... | Line 3009... | ||
2987 | } |
3009 | } |
2988 | #endif /* USART_LIN_SUPPORT */ |
3010 | #endif /* USART_LIN_SUPPORT */ |
2989 | 3011 | ||
2990 | /** |
3012 | /** |
2991 | * @brief Clear CTS Interrupt Flag |
3013 | * @brief Clear CTS Interrupt Flag |
2992 | * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
3014 | * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
2993 | * Hardware Flow control feature is supported by the USARTx instance. |
3015 | * Hardware Flow control feature is supported by the USARTx instance. |
2994 | * @rmtoll ICR CTSCF LL_USART_ClearFlag_nCTS |
3016 | * @rmtoll ICR CTSCF LL_USART_ClearFlag_nCTS |
2995 | * @param USARTx USART Instance |
3017 | * @param USARTx USART Instance |
2996 | * @retval None |
3018 | * @retval None |
2997 | */ |
3019 | */ |
Line 3012... | Line 3034... | ||
3012 | } |
3034 | } |
3013 | 3035 | ||
3014 | #if defined(USART_SMARTCARD_SUPPORT) |
3036 | #if defined(USART_SMARTCARD_SUPPORT) |
3015 | /** |
3037 | /** |
3016 | * @brief Clear End Of Block Flag |
3038 | * @brief Clear End Of Block Flag |
3017 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
3039 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
3018 | * Smartcard feature is supported by the USARTx instance. |
3040 | * Smartcard feature is supported by the USARTx instance. |
3019 | * @rmtoll ICR EOBCF LL_USART_ClearFlag_EOB |
3041 | * @rmtoll ICR EOBCF LL_USART_ClearFlag_EOB |
3020 | * @param USARTx USART Instance |
3042 | * @param USARTx USART Instance |
3021 | * @retval None |
3043 | * @retval None |
3022 | */ |
3044 | */ |
Line 3036... | Line 3058... | ||
3036 | { |
3058 | { |
3037 | WRITE_REG(USARTx->ICR, USART_ICR_CMCF); |
3059 | WRITE_REG(USARTx->ICR, USART_ICR_CMCF); |
3038 | } |
3060 | } |
3039 | 3061 | ||
3040 | #if defined(USART_CR1_UESM) |
3062 | #if defined(USART_CR1_UESM) |
- | 3063 | #if defined(USART_CR3_WUFIE) |
|
3041 | /** |
3064 | /** |
3042 | * @brief Clear Wake Up from stop mode Flag |
3065 | * @brief Clear Wake Up from stop mode Flag |
3043 | * @note Macro @ref IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
3066 | * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
3044 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
3067 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
3045 | * @rmtoll ICR WUCF LL_USART_ClearFlag_WKUP |
3068 | * @rmtoll ICR WUCF LL_USART_ClearFlag_WKUP |
3046 | * @param USARTx USART Instance |
3069 | * @param USARTx USART Instance |
3047 | * @retval None |
3070 | * @retval None |
3048 | */ |
3071 | */ |
3049 | __STATIC_INLINE void LL_USART_ClearFlag_WKUP(USART_TypeDef *USARTx) |
3072 | __STATIC_INLINE void LL_USART_ClearFlag_WKUP(USART_TypeDef *USARTx) |
3050 | { |
3073 | { |
3051 | WRITE_REG(USARTx->ICR, USART_ICR_WUCF); |
3074 | WRITE_REG(USARTx->ICR, USART_ICR_WUCF); |
3052 | } |
3075 | } |
3053 | 3076 | ||
- | 3077 | #endif /* USART_CR3_WUFIE */ |
|
3054 | #endif /* USART_CR1_UESM */ |
3078 | #endif /* USART_CR1_UESM */ |
3055 | /** |
3079 | /** |
3056 | * @} |
3080 | * @} |
3057 | */ |
3081 | */ |
3058 | 3082 | ||
Line 3066... | Line 3090... | ||
3066 | * @param USARTx USART Instance |
3090 | * @param USARTx USART Instance |
3067 | * @retval None |
3091 | * @retval None |
3068 | */ |
3092 | */ |
3069 | __STATIC_INLINE void LL_USART_EnableIT_IDLE(USART_TypeDef *USARTx) |
3093 | __STATIC_INLINE void LL_USART_EnableIT_IDLE(USART_TypeDef *USARTx) |
3070 | { |
3094 | { |
3071 | SET_BIT(USARTx->CR1, USART_CR1_IDLEIE); |
3095 | ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_IDLEIE); |
3072 | } |
3096 | } |
3073 | 3097 | ||
3074 | /** |
3098 | /** |
3075 | * @brief Enable RX Not Empty Interrupt |
3099 | * @brief Enable RX Not Empty Interrupt |
3076 | * @rmtoll CR1 RXNEIE LL_USART_EnableIT_RXNE |
3100 | * @rmtoll CR1 RXNEIE LL_USART_EnableIT_RXNE |
3077 | * @param USARTx USART Instance |
3101 | * @param USARTx USART Instance |
3078 | * @retval None |
3102 | * @retval None |
3079 | */ |
3103 | */ |
3080 | __STATIC_INLINE void LL_USART_EnableIT_RXNE(USART_TypeDef *USARTx) |
3104 | __STATIC_INLINE void LL_USART_EnableIT_RXNE(USART_TypeDef *USARTx) |
3081 | { |
3105 | { |
3082 | SET_BIT(USARTx->CR1, USART_CR1_RXNEIE); |
3106 | ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_RXNEIE); |
3083 | } |
3107 | } |
3084 | 3108 | ||
3085 | /** |
3109 | /** |
3086 | * @brief Enable Transmission Complete Interrupt |
3110 | * @brief Enable Transmission Complete Interrupt |
3087 | * @rmtoll CR1 TCIE LL_USART_EnableIT_TC |
3111 | * @rmtoll CR1 TCIE LL_USART_EnableIT_TC |
3088 | * @param USARTx USART Instance |
3112 | * @param USARTx USART Instance |
3089 | * @retval None |
3113 | * @retval None |
3090 | */ |
3114 | */ |
3091 | __STATIC_INLINE void LL_USART_EnableIT_TC(USART_TypeDef *USARTx) |
3115 | __STATIC_INLINE void LL_USART_EnableIT_TC(USART_TypeDef *USARTx) |
3092 | { |
3116 | { |
3093 | SET_BIT(USARTx->CR1, USART_CR1_TCIE); |
3117 | ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_TCIE); |
3094 | } |
3118 | } |
3095 | 3119 | ||
3096 | /** |
3120 | /** |
3097 | * @brief Enable TX Empty Interrupt |
3121 | * @brief Enable TX Empty Interrupt |
3098 | * @rmtoll CR1 TXEIE LL_USART_EnableIT_TXE |
3122 | * @rmtoll CR1 TXEIE LL_USART_EnableIT_TXE |
3099 | * @param USARTx USART Instance |
3123 | * @param USARTx USART Instance |
3100 | * @retval None |
3124 | * @retval None |
3101 | */ |
3125 | */ |
3102 | __STATIC_INLINE void LL_USART_EnableIT_TXE(USART_TypeDef *USARTx) |
3126 | __STATIC_INLINE void LL_USART_EnableIT_TXE(USART_TypeDef *USARTx) |
3103 | { |
3127 | { |
3104 | SET_BIT(USARTx->CR1, USART_CR1_TXEIE); |
3128 | ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_TXEIE); |
3105 | } |
3129 | } |
3106 | 3130 | ||
3107 | /** |
3131 | /** |
3108 | * @brief Enable Parity Error Interrupt |
3132 | * @brief Enable Parity Error Interrupt |
3109 | * @rmtoll CR1 PEIE LL_USART_EnableIT_PE |
3133 | * @rmtoll CR1 PEIE LL_USART_EnableIT_PE |
3110 | * @param USARTx USART Instance |
3134 | * @param USARTx USART Instance |
3111 | * @retval None |
3135 | * @retval None |
3112 | */ |
3136 | */ |
3113 | __STATIC_INLINE void LL_USART_EnableIT_PE(USART_TypeDef *USARTx) |
3137 | __STATIC_INLINE void LL_USART_EnableIT_PE(USART_TypeDef *USARTx) |
3114 | { |
3138 | { |
3115 | SET_BIT(USARTx->CR1, USART_CR1_PEIE); |
3139 | ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_PEIE); |
3116 | } |
3140 | } |
3117 | 3141 | ||
3118 | /** |
3142 | /** |
3119 | * @brief Enable Character Match Interrupt |
3143 | * @brief Enable Character Match Interrupt |
3120 | * @rmtoll CR1 CMIE LL_USART_EnableIT_CM |
3144 | * @rmtoll CR1 CMIE LL_USART_EnableIT_CM |
3121 | * @param USARTx USART Instance |
3145 | * @param USARTx USART Instance |
3122 | * @retval None |
3146 | * @retval None |
3123 | */ |
3147 | */ |
3124 | __STATIC_INLINE void LL_USART_EnableIT_CM(USART_TypeDef *USARTx) |
3148 | __STATIC_INLINE void LL_USART_EnableIT_CM(USART_TypeDef *USARTx) |
3125 | { |
3149 | { |
3126 | SET_BIT(USARTx->CR1, USART_CR1_CMIE); |
3150 | ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_CMIE); |
3127 | } |
3151 | } |
3128 | 3152 | ||
3129 | /** |
3153 | /** |
3130 | * @brief Enable Receiver Timeout Interrupt |
3154 | * @brief Enable Receiver Timeout Interrupt |
3131 | * @rmtoll CR1 RTOIE LL_USART_EnableIT_RTO |
3155 | * @rmtoll CR1 RTOIE LL_USART_EnableIT_RTO |
3132 | * @param USARTx USART Instance |
3156 | * @param USARTx USART Instance |
3133 | * @retval None |
3157 | * @retval None |
3134 | */ |
3158 | */ |
3135 | __STATIC_INLINE void LL_USART_EnableIT_RTO(USART_TypeDef *USARTx) |
3159 | __STATIC_INLINE void LL_USART_EnableIT_RTO(USART_TypeDef *USARTx) |
3136 | { |
3160 | { |
3137 | SET_BIT(USARTx->CR1, USART_CR1_RTOIE); |
3161 | ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_RTOIE); |
3138 | } |
3162 | } |
3139 | 3163 | ||
3140 | #if defined(USART_SMARTCARD_SUPPORT) |
3164 | #if defined(USART_SMARTCARD_SUPPORT) |
3141 | /** |
3165 | /** |
3142 | * @brief Enable End Of Block Interrupt |
3166 | * @brief Enable End Of Block Interrupt |
3143 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
3167 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
3144 | * Smartcard feature is supported by the USARTx instance. |
3168 | * Smartcard feature is supported by the USARTx instance. |
3145 | * @rmtoll CR1 EOBIE LL_USART_EnableIT_EOB |
3169 | * @rmtoll CR1 EOBIE LL_USART_EnableIT_EOB |
3146 | * @param USARTx USART Instance |
3170 | * @param USARTx USART Instance |
3147 | * @retval None |
3171 | * @retval None |
3148 | */ |
3172 | */ |
3149 | __STATIC_INLINE void LL_USART_EnableIT_EOB(USART_TypeDef *USARTx) |
3173 | __STATIC_INLINE void LL_USART_EnableIT_EOB(USART_TypeDef *USARTx) |
3150 | { |
3174 | { |
3151 | SET_BIT(USARTx->CR1, USART_CR1_EOBIE); |
3175 | ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_EOBIE); |
3152 | } |
3176 | } |
3153 | #endif /* USART_SMARTCARD_SUPPORT */ |
3177 | #endif /* USART_SMARTCARD_SUPPORT */ |
3154 | 3178 | ||
3155 | #if defined(USART_LIN_SUPPORT) |
3179 | #if defined(USART_LIN_SUPPORT) |
3156 | /** |
3180 | /** |
3157 | * @brief Enable LIN Break Detection Interrupt |
3181 | * @brief Enable LIN Break Detection Interrupt |
3158 | * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
3182 | * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
3159 | * LIN feature is supported by the USARTx instance. |
3183 | * LIN feature is supported by the USARTx instance. |
3160 | * @rmtoll CR2 LBDIE LL_USART_EnableIT_LBD |
3184 | * @rmtoll CR2 LBDIE LL_USART_EnableIT_LBD |
3161 | * @param USARTx USART Instance |
3185 | * @param USARTx USART Instance |
3162 | * @retval None |
3186 | * @retval None |
3163 | */ |
3187 | */ |
Line 3177... | Line 3201... | ||
3177 | * @param USARTx USART Instance |
3201 | * @param USARTx USART Instance |
3178 | * @retval None |
3202 | * @retval None |
3179 | */ |
3203 | */ |
3180 | __STATIC_INLINE void LL_USART_EnableIT_ERROR(USART_TypeDef *USARTx) |
3204 | __STATIC_INLINE void LL_USART_EnableIT_ERROR(USART_TypeDef *USARTx) |
3181 | { |
3205 | { |
3182 | SET_BIT(USARTx->CR3, USART_CR3_EIE); |
3206 | ATOMIC_SET_BIT(USARTx->CR3, USART_CR3_EIE); |
3183 | } |
3207 | } |
3184 | 3208 | ||
3185 | /** |
3209 | /** |
3186 | * @brief Enable CTS Interrupt |
3210 | * @brief Enable CTS Interrupt |
3187 | * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
3211 | * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
3188 | * Hardware Flow control feature is supported by the USARTx instance. |
3212 | * Hardware Flow control feature is supported by the USARTx instance. |
3189 | * @rmtoll CR3 CTSIE LL_USART_EnableIT_CTS |
3213 | * @rmtoll CR3 CTSIE LL_USART_EnableIT_CTS |
3190 | * @param USARTx USART Instance |
3214 | * @param USARTx USART Instance |
3191 | * @retval None |
3215 | * @retval None |
3192 | */ |
3216 | */ |
3193 | __STATIC_INLINE void LL_USART_EnableIT_CTS(USART_TypeDef *USARTx) |
3217 | __STATIC_INLINE void LL_USART_EnableIT_CTS(USART_TypeDef *USARTx) |
3194 | { |
3218 | { |
3195 | SET_BIT(USARTx->CR3, USART_CR3_CTSIE); |
3219 | ATOMIC_SET_BIT(USARTx->CR3, USART_CR3_CTSIE); |
3196 | } |
3220 | } |
3197 | 3221 | ||
3198 | #if defined(USART_CR1_UESM) |
3222 | #if defined(USART_CR1_UESM) |
- | 3223 | #if defined(USART_CR3_WUFIE) |
|
3199 | /** |
3224 | /** |
3200 | * @brief Enable Wake Up from Stop Mode Interrupt |
3225 | * @brief Enable Wake Up from Stop Mode Interrupt |
3201 | * @note Macro @ref IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
3226 | * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
3202 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
3227 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
3203 | * @rmtoll CR3 WUFIE LL_USART_EnableIT_WKUP |
3228 | * @rmtoll CR3 WUFIE LL_USART_EnableIT_WKUP |
3204 | * @param USARTx USART Instance |
3229 | * @param USARTx USART Instance |
3205 | * @retval None |
3230 | * @retval None |
3206 | */ |
3231 | */ |
3207 | __STATIC_INLINE void LL_USART_EnableIT_WKUP(USART_TypeDef *USARTx) |
3232 | __STATIC_INLINE void LL_USART_EnableIT_WKUP(USART_TypeDef *USARTx) |
3208 | { |
3233 | { |
3209 | SET_BIT(USARTx->CR3, USART_CR3_WUFIE); |
3234 | ATOMIC_SET_BIT(USARTx->CR3, USART_CR3_WUFIE); |
3210 | } |
3235 | } |
3211 | 3236 | ||
- | 3237 | #endif /* USART_CR3_WUFIE */ |
|
3212 | #endif /* USART_CR1_UESM */ |
3238 | #endif /* USART_CR1_UESM */ |
3213 | 3239 | ||
3214 | /** |
3240 | /** |
3215 | * @brief Disable IDLE Interrupt |
3241 | * @brief Disable IDLE Interrupt |
3216 | * @rmtoll CR1 IDLEIE LL_USART_DisableIT_IDLE |
3242 | * @rmtoll CR1 IDLEIE LL_USART_DisableIT_IDLE |
3217 | * @param USARTx USART Instance |
3243 | * @param USARTx USART Instance |
3218 | * @retval None |
3244 | * @retval None |
3219 | */ |
3245 | */ |
3220 | __STATIC_INLINE void LL_USART_DisableIT_IDLE(USART_TypeDef *USARTx) |
3246 | __STATIC_INLINE void LL_USART_DisableIT_IDLE(USART_TypeDef *USARTx) |
3221 | { |
3247 | { |
3222 | CLEAR_BIT(USARTx->CR1, USART_CR1_IDLEIE); |
3248 | ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_IDLEIE); |
3223 | } |
3249 | } |
3224 | 3250 | ||
3225 | /** |
3251 | /** |
3226 | * @brief Disable RX Not Empty Interrupt |
3252 | * @brief Disable RX Not Empty Interrupt |
3227 | * @rmtoll CR1 RXNEIE LL_USART_DisableIT_RXNE |
3253 | * @rmtoll CR1 RXNEIE LL_USART_DisableIT_RXNE |
3228 | * @param USARTx USART Instance |
3254 | * @param USARTx USART Instance |
3229 | * @retval None |
3255 | * @retval None |
3230 | */ |
3256 | */ |
3231 | __STATIC_INLINE void LL_USART_DisableIT_RXNE(USART_TypeDef *USARTx) |
3257 | __STATIC_INLINE void LL_USART_DisableIT_RXNE(USART_TypeDef *USARTx) |
3232 | { |
3258 | { |
3233 | CLEAR_BIT(USARTx->CR1, USART_CR1_RXNEIE); |
3259 | ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_RXNEIE); |
3234 | } |
3260 | } |
3235 | 3261 | ||
3236 | /** |
3262 | /** |
3237 | * @brief Disable Transmission Complete Interrupt |
3263 | * @brief Disable Transmission Complete Interrupt |
3238 | * @rmtoll CR1 TCIE LL_USART_DisableIT_TC |
3264 | * @rmtoll CR1 TCIE LL_USART_DisableIT_TC |
3239 | * @param USARTx USART Instance |
3265 | * @param USARTx USART Instance |
3240 | * @retval None |
3266 | * @retval None |
3241 | */ |
3267 | */ |
3242 | __STATIC_INLINE void LL_USART_DisableIT_TC(USART_TypeDef *USARTx) |
3268 | __STATIC_INLINE void LL_USART_DisableIT_TC(USART_TypeDef *USARTx) |
3243 | { |
3269 | { |
3244 | CLEAR_BIT(USARTx->CR1, USART_CR1_TCIE); |
3270 | ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_TCIE); |
3245 | } |
3271 | } |
3246 | 3272 | ||
3247 | /** |
3273 | /** |
3248 | * @brief Disable TX Empty Interrupt |
3274 | * @brief Disable TX Empty Interrupt |
3249 | * @rmtoll CR1 TXEIE LL_USART_DisableIT_TXE |
3275 | * @rmtoll CR1 TXEIE LL_USART_DisableIT_TXE |
3250 | * @param USARTx USART Instance |
3276 | * @param USARTx USART Instance |
3251 | * @retval None |
3277 | * @retval None |
3252 | */ |
3278 | */ |
3253 | __STATIC_INLINE void LL_USART_DisableIT_TXE(USART_TypeDef *USARTx) |
3279 | __STATIC_INLINE void LL_USART_DisableIT_TXE(USART_TypeDef *USARTx) |
3254 | { |
3280 | { |
3255 | CLEAR_BIT(USARTx->CR1, USART_CR1_TXEIE); |
3281 | ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_TXEIE); |
3256 | } |
3282 | } |
3257 | 3283 | ||
3258 | /** |
3284 | /** |
3259 | * @brief Disable Parity Error Interrupt |
3285 | * @brief Disable Parity Error Interrupt |
3260 | * @rmtoll CR1 PEIE LL_USART_DisableIT_PE |
3286 | * @rmtoll CR1 PEIE LL_USART_DisableIT_PE |
3261 | * @param USARTx USART Instance |
3287 | * @param USARTx USART Instance |
3262 | * @retval None |
3288 | * @retval None |
3263 | */ |
3289 | */ |
3264 | __STATIC_INLINE void LL_USART_DisableIT_PE(USART_TypeDef *USARTx) |
3290 | __STATIC_INLINE void LL_USART_DisableIT_PE(USART_TypeDef *USARTx) |
3265 | { |
3291 | { |
3266 | CLEAR_BIT(USARTx->CR1, USART_CR1_PEIE); |
3292 | ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_PEIE); |
3267 | } |
3293 | } |
3268 | 3294 | ||
3269 | /** |
3295 | /** |
3270 | * @brief Disable Character Match Interrupt |
3296 | * @brief Disable Character Match Interrupt |
3271 | * @rmtoll CR1 CMIE LL_USART_DisableIT_CM |
3297 | * @rmtoll CR1 CMIE LL_USART_DisableIT_CM |
3272 | * @param USARTx USART Instance |
3298 | * @param USARTx USART Instance |
3273 | * @retval None |
3299 | * @retval None |
3274 | */ |
3300 | */ |
3275 | __STATIC_INLINE void LL_USART_DisableIT_CM(USART_TypeDef *USARTx) |
3301 | __STATIC_INLINE void LL_USART_DisableIT_CM(USART_TypeDef *USARTx) |
3276 | { |
3302 | { |
3277 | CLEAR_BIT(USARTx->CR1, USART_CR1_CMIE); |
3303 | ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_CMIE); |
3278 | } |
3304 | } |
3279 | 3305 | ||
3280 | /** |
3306 | /** |
3281 | * @brief Disable Receiver Timeout Interrupt |
3307 | * @brief Disable Receiver Timeout Interrupt |
3282 | * @rmtoll CR1 RTOIE LL_USART_DisableIT_RTO |
3308 | * @rmtoll CR1 RTOIE LL_USART_DisableIT_RTO |
3283 | * @param USARTx USART Instance |
3309 | * @param USARTx USART Instance |
3284 | * @retval None |
3310 | * @retval None |
3285 | */ |
3311 | */ |
3286 | __STATIC_INLINE void LL_USART_DisableIT_RTO(USART_TypeDef *USARTx) |
3312 | __STATIC_INLINE void LL_USART_DisableIT_RTO(USART_TypeDef *USARTx) |
3287 | { |
3313 | { |
3288 | CLEAR_BIT(USARTx->CR1, USART_CR1_RTOIE); |
3314 | ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_RTOIE); |
3289 | } |
3315 | } |
3290 | 3316 | ||
3291 | #if defined(USART_SMARTCARD_SUPPORT) |
3317 | #if defined(USART_SMARTCARD_SUPPORT) |
3292 | /** |
3318 | /** |
3293 | * @brief Disable End Of Block Interrupt |
3319 | * @brief Disable End Of Block Interrupt |
3294 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
3320 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
3295 | * Smartcard feature is supported by the USARTx instance. |
3321 | * Smartcard feature is supported by the USARTx instance. |
3296 | * @rmtoll CR1 EOBIE LL_USART_DisableIT_EOB |
3322 | * @rmtoll CR1 EOBIE LL_USART_DisableIT_EOB |
3297 | * @param USARTx USART Instance |
3323 | * @param USARTx USART Instance |
3298 | * @retval None |
3324 | * @retval None |
3299 | */ |
3325 | */ |
3300 | __STATIC_INLINE void LL_USART_DisableIT_EOB(USART_TypeDef *USARTx) |
3326 | __STATIC_INLINE void LL_USART_DisableIT_EOB(USART_TypeDef *USARTx) |
3301 | { |
3327 | { |
3302 | CLEAR_BIT(USARTx->CR1, USART_CR1_EOBIE); |
3328 | ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_EOBIE); |
3303 | } |
3329 | } |
3304 | #endif /* USART_SMARTCARD_SUPPORT */ |
3330 | #endif /* USART_SMARTCARD_SUPPORT */ |
3305 | 3331 | ||
3306 | #if defined(USART_LIN_SUPPORT) |
3332 | #if defined(USART_LIN_SUPPORT) |
3307 | /** |
3333 | /** |
3308 | * @brief Disable LIN Break Detection Interrupt |
3334 | * @brief Disable LIN Break Detection Interrupt |
3309 | * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
3335 | * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
3310 | * LIN feature is supported by the USARTx instance. |
3336 | * LIN feature is supported by the USARTx instance. |
3311 | * @rmtoll CR2 LBDIE LL_USART_DisableIT_LBD |
3337 | * @rmtoll CR2 LBDIE LL_USART_DisableIT_LBD |
3312 | * @param USARTx USART Instance |
3338 | * @param USARTx USART Instance |
3313 | * @retval None |
3339 | * @retval None |
3314 | */ |
3340 | */ |
Line 3328... | Line 3354... | ||
3328 | * @param USARTx USART Instance |
3354 | * @param USARTx USART Instance |
3329 | * @retval None |
3355 | * @retval None |
3330 | */ |
3356 | */ |
3331 | __STATIC_INLINE void LL_USART_DisableIT_ERROR(USART_TypeDef *USARTx) |
3357 | __STATIC_INLINE void LL_USART_DisableIT_ERROR(USART_TypeDef *USARTx) |
3332 | { |
3358 | { |
3333 | CLEAR_BIT(USARTx->CR3, USART_CR3_EIE); |
3359 | ATOMIC_CLEAR_BIT(USARTx->CR3, USART_CR3_EIE); |
3334 | } |
3360 | } |
3335 | 3361 | ||
3336 | /** |
3362 | /** |
3337 | * @brief Disable CTS Interrupt |
3363 | * @brief Disable CTS Interrupt |
3338 | * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
3364 | * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
3339 | * Hardware Flow control feature is supported by the USARTx instance. |
3365 | * Hardware Flow control feature is supported by the USARTx instance. |
3340 | * @rmtoll CR3 CTSIE LL_USART_DisableIT_CTS |
3366 | * @rmtoll CR3 CTSIE LL_USART_DisableIT_CTS |
3341 | * @param USARTx USART Instance |
3367 | * @param USARTx USART Instance |
3342 | * @retval None |
3368 | * @retval None |
3343 | */ |
3369 | */ |
3344 | __STATIC_INLINE void LL_USART_DisableIT_CTS(USART_TypeDef *USARTx) |
3370 | __STATIC_INLINE void LL_USART_DisableIT_CTS(USART_TypeDef *USARTx) |
3345 | { |
3371 | { |
3346 | CLEAR_BIT(USARTx->CR3, USART_CR3_CTSIE); |
3372 | ATOMIC_CLEAR_BIT(USARTx->CR3, USART_CR3_CTSIE); |
3347 | } |
3373 | } |
3348 | 3374 | ||
3349 | #if defined(USART_CR1_UESM) |
3375 | #if defined(USART_CR1_UESM) |
- | 3376 | #if defined(USART_CR3_WUFIE) |
|
3350 | /** |
3377 | /** |
3351 | * @brief Disable Wake Up from Stop Mode Interrupt |
3378 | * @brief Disable Wake Up from Stop Mode Interrupt |
3352 | * @note Macro @ref IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
3379 | * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
3353 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
3380 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
3354 | * @rmtoll CR3 WUFIE LL_USART_DisableIT_WKUP |
3381 | * @rmtoll CR3 WUFIE LL_USART_DisableIT_WKUP |
3355 | * @param USARTx USART Instance |
3382 | * @param USARTx USART Instance |
3356 | * @retval None |
3383 | * @retval None |
3357 | */ |
3384 | */ |
3358 | __STATIC_INLINE void LL_USART_DisableIT_WKUP(USART_TypeDef *USARTx) |
3385 | __STATIC_INLINE void LL_USART_DisableIT_WKUP(USART_TypeDef *USARTx) |
3359 | { |
3386 | { |
3360 | CLEAR_BIT(USARTx->CR3, USART_CR3_WUFIE); |
3387 | ATOMIC_CLEAR_BIT(USARTx->CR3, USART_CR3_WUFIE); |
3361 | } |
3388 | } |
3362 | 3389 | ||
- | 3390 | #endif /* USART_CR3_WUFIE */ |
|
3363 | #endif /* USART_CR1_UESM */ |
3391 | #endif /* USART_CR1_UESM */ |
3364 | 3392 | ||
3365 | /** |
3393 | /** |
3366 | * @brief Check if the USART IDLE Interrupt source is enabled or disabled. |
3394 | * @brief Check if the USART IDLE Interrupt source is enabled or disabled. |
3367 | * @rmtoll CR1 IDLEIE LL_USART_IsEnabledIT_IDLE |
3395 | * @rmtoll CR1 IDLEIE LL_USART_IsEnabledIT_IDLE |
Line 3440... | Line 3468... | ||
3440 | } |
3468 | } |
3441 | 3469 | ||
3442 | #if defined(USART_SMARTCARD_SUPPORT) |
3470 | #if defined(USART_SMARTCARD_SUPPORT) |
3443 | /** |
3471 | /** |
3444 | * @brief Check if the USART End Of Block Interrupt is enabled or disabled. |
3472 | * @brief Check if the USART End Of Block Interrupt is enabled or disabled. |
3445 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
3473 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
3446 | * Smartcard feature is supported by the USARTx instance. |
3474 | * Smartcard feature is supported by the USARTx instance. |
3447 | * @rmtoll CR1 EOBIE LL_USART_IsEnabledIT_EOB |
3475 | * @rmtoll CR1 EOBIE LL_USART_IsEnabledIT_EOB |
3448 | * @param USARTx USART Instance |
3476 | * @param USARTx USART Instance |
3449 | * @retval State of bit (1 or 0). |
3477 | * @retval State of bit (1 or 0). |
3450 | */ |
3478 | */ |
Line 3455... | Line 3483... | ||
3455 | 3483 | ||
3456 | #endif /* USART_SMARTCARD_SUPPORT */ |
3484 | #endif /* USART_SMARTCARD_SUPPORT */ |
3457 | #if defined(USART_LIN_SUPPORT) |
3485 | #if defined(USART_LIN_SUPPORT) |
3458 | /** |
3486 | /** |
3459 | * @brief Check if the USART LIN Break Detection Interrupt is enabled or disabled. |
3487 | * @brief Check if the USART LIN Break Detection Interrupt is enabled or disabled. |
3460 | * @note Macro @ref IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
3488 | * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not |
3461 | * LIN feature is supported by the USARTx instance. |
3489 | * LIN feature is supported by the USARTx instance. |
3462 | * @rmtoll CR2 LBDIE LL_USART_IsEnabledIT_LBD |
3490 | * @rmtoll CR2 LBDIE LL_USART_IsEnabledIT_LBD |
3463 | * @param USARTx USART Instance |
3491 | * @param USARTx USART Instance |
3464 | * @retval State of bit (1 or 0). |
3492 | * @retval State of bit (1 or 0). |
3465 | */ |
3493 | */ |
Line 3480... | Line 3508... | ||
3480 | return ((READ_BIT(USARTx->CR3, USART_CR3_EIE) == (USART_CR3_EIE)) ? 1UL : 0UL); |
3508 | return ((READ_BIT(USARTx->CR3, USART_CR3_EIE) == (USART_CR3_EIE)) ? 1UL : 0UL); |
3481 | } |
3509 | } |
3482 | 3510 | ||
3483 | /** |
3511 | /** |
3484 | * @brief Check if the USART CTS Interrupt is enabled or disabled. |
3512 | * @brief Check if the USART CTS Interrupt is enabled or disabled. |
3485 | * @note Macro @ref IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
3513 | * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not |
3486 | * Hardware Flow control feature is supported by the USARTx instance. |
3514 | * Hardware Flow control feature is supported by the USARTx instance. |
3487 | * @rmtoll CR3 CTSIE LL_USART_IsEnabledIT_CTS |
3515 | * @rmtoll CR3 CTSIE LL_USART_IsEnabledIT_CTS |
3488 | * @param USARTx USART Instance |
3516 | * @param USARTx USART Instance |
3489 | * @retval State of bit (1 or 0). |
3517 | * @retval State of bit (1 or 0). |
3490 | */ |
3518 | */ |
Line 3492... | Line 3520... | ||
3492 | { |
3520 | { |
3493 | return ((READ_BIT(USARTx->CR3, USART_CR3_CTSIE) == (USART_CR3_CTSIE)) ? 1UL : 0UL); |
3521 | return ((READ_BIT(USARTx->CR3, USART_CR3_CTSIE) == (USART_CR3_CTSIE)) ? 1UL : 0UL); |
3494 | } |
3522 | } |
3495 | 3523 | ||
3496 | #if defined(USART_CR1_UESM) |
3524 | #if defined(USART_CR1_UESM) |
- | 3525 | #if defined(USART_CR3_WUFIE) |
|
3497 | /** |
3526 | /** |
3498 | * @brief Check if the USART Wake Up from Stop Mode Interrupt is enabled or disabled. |
3527 | * @brief Check if the USART Wake Up from Stop Mode Interrupt is enabled or disabled. |
3499 | * @note Macro @ref IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
3528 | * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not |
3500 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
3529 | * Wake-up from Stop mode feature is supported by the USARTx instance. |
3501 | * @rmtoll CR3 WUFIE LL_USART_IsEnabledIT_WKUP |
3530 | * @rmtoll CR3 WUFIE LL_USART_IsEnabledIT_WKUP |
3502 | * @param USARTx USART Instance |
3531 | * @param USARTx USART Instance |
3503 | * @retval State of bit (1 or 0). |
3532 | * @retval State of bit (1 or 0). |
3504 | */ |
3533 | */ |
3505 | __STATIC_INLINE uint32_t LL_USART_IsEnabledIT_WKUP(USART_TypeDef *USARTx) |
3534 | __STATIC_INLINE uint32_t LL_USART_IsEnabledIT_WKUP(USART_TypeDef *USARTx) |
3506 | { |
3535 | { |
3507 | return ((READ_BIT(USARTx->CR3, USART_CR3_WUFIE) == (USART_CR3_WUFIE)) ? 1UL : 0UL); |
3536 | return ((READ_BIT(USARTx->CR3, USART_CR3_WUFIE) == (USART_CR3_WUFIE)) ? 1UL : 0UL); |
3508 | } |
3537 | } |
3509 | 3538 | ||
- | 3539 | #endif /* USART_CR3_WUFIE */ |
|
3510 | #endif /* USART_CR1_UESM */ |
3540 | #endif /* USART_CR1_UESM */ |
3511 | 3541 | ||
3512 | /** |
3542 | /** |
3513 | * @} |
3543 | * @} |
3514 | */ |
3544 | */ |
Line 3523... | Line 3553... | ||
3523 | * @param USARTx USART Instance |
3553 | * @param USARTx USART Instance |
3524 | * @retval None |
3554 | * @retval None |
3525 | */ |
3555 | */ |
3526 | __STATIC_INLINE void LL_USART_EnableDMAReq_RX(USART_TypeDef *USARTx) |
3556 | __STATIC_INLINE void LL_USART_EnableDMAReq_RX(USART_TypeDef *USARTx) |
3527 | { |
3557 | { |
3528 | SET_BIT(USARTx->CR3, USART_CR3_DMAR); |
3558 | ATOMIC_SET_BIT(USARTx->CR3, USART_CR3_DMAR); |
3529 | } |
3559 | } |
3530 | 3560 | ||
3531 | /** |
3561 | /** |
3532 | * @brief Disable DMA Mode for reception |
3562 | * @brief Disable DMA Mode for reception |
3533 | * @rmtoll CR3 DMAR LL_USART_DisableDMAReq_RX |
3563 | * @rmtoll CR3 DMAR LL_USART_DisableDMAReq_RX |
3534 | * @param USARTx USART Instance |
3564 | * @param USARTx USART Instance |
3535 | * @retval None |
3565 | * @retval None |
3536 | */ |
3566 | */ |
3537 | __STATIC_INLINE void LL_USART_DisableDMAReq_RX(USART_TypeDef *USARTx) |
3567 | __STATIC_INLINE void LL_USART_DisableDMAReq_RX(USART_TypeDef *USARTx) |
3538 | { |
3568 | { |
3539 | CLEAR_BIT(USARTx->CR3, USART_CR3_DMAR); |
3569 | ATOMIC_CLEAR_BIT(USARTx->CR3, USART_CR3_DMAR); |
3540 | } |
3570 | } |
3541 | 3571 | ||
3542 | /** |
3572 | /** |
3543 | * @brief Check if DMA Mode is enabled for reception |
3573 | * @brief Check if DMA Mode is enabled for reception |
3544 | * @rmtoll CR3 DMAR LL_USART_IsEnabledDMAReq_RX |
3574 | * @rmtoll CR3 DMAR LL_USART_IsEnabledDMAReq_RX |
Line 3556... | Line 3586... | ||
3556 | * @param USARTx USART Instance |
3586 | * @param USARTx USART Instance |
3557 | * @retval None |
3587 | * @retval None |
3558 | */ |
3588 | */ |
3559 | __STATIC_INLINE void LL_USART_EnableDMAReq_TX(USART_TypeDef *USARTx) |
3589 | __STATIC_INLINE void LL_USART_EnableDMAReq_TX(USART_TypeDef *USARTx) |
3560 | { |
3590 | { |
3561 | SET_BIT(USARTx->CR3, USART_CR3_DMAT); |
3591 | ATOMIC_SET_BIT(USARTx->CR3, USART_CR3_DMAT); |
3562 | } |
3592 | } |
3563 | 3593 | ||
3564 | /** |
3594 | /** |
3565 | * @brief Disable DMA Mode for transmission |
3595 | * @brief Disable DMA Mode for transmission |
3566 | * @rmtoll CR3 DMAT LL_USART_DisableDMAReq_TX |
3596 | * @rmtoll CR3 DMAT LL_USART_DisableDMAReq_TX |
3567 | * @param USARTx USART Instance |
3597 | * @param USARTx USART Instance |
3568 | * @retval None |
3598 | * @retval None |
3569 | */ |
3599 | */ |
3570 | __STATIC_INLINE void LL_USART_DisableDMAReq_TX(USART_TypeDef *USARTx) |
3600 | __STATIC_INLINE void LL_USART_DisableDMAReq_TX(USART_TypeDef *USARTx) |
3571 | { |
3601 | { |
3572 | CLEAR_BIT(USARTx->CR3, USART_CR3_DMAT); |
3602 | ATOMIC_CLEAR_BIT(USARTx->CR3, USART_CR3_DMAT); |
3573 | } |
3603 | } |
3574 | 3604 | ||
3575 | /** |
3605 | /** |
3576 | * @brief Check if DMA Mode is enabled for transmission |
3606 | * @brief Check if DMA Mode is enabled for transmission |
3577 | * @rmtoll CR3 DMAT LL_USART_IsEnabledDMAReq_TX |
3607 | * @rmtoll CR3 DMAT LL_USART_IsEnabledDMAReq_TX |
Line 3626... | Line 3656... | ||
3626 | * @arg @ref LL_USART_DMA_REG_DATA_RECEIVE |
3656 | * @arg @ref LL_USART_DMA_REG_DATA_RECEIVE |
3627 | * @retval Address of data register |
3657 | * @retval Address of data register |
3628 | */ |
3658 | */ |
3629 | __STATIC_INLINE uint32_t LL_USART_DMA_GetRegAddr(USART_TypeDef *USARTx, uint32_t Direction) |
3659 | __STATIC_INLINE uint32_t LL_USART_DMA_GetRegAddr(USART_TypeDef *USARTx, uint32_t Direction) |
3630 | { |
3660 | { |
3631 | register uint32_t data_reg_addr; |
3661 | uint32_t data_reg_addr; |
3632 | 3662 | ||
3633 | if (Direction == LL_USART_DMA_REG_DATA_TRANSMIT) |
3663 | if (Direction == LL_USART_DMA_REG_DATA_TRANSMIT) |
3634 | { |
3664 | { |
3635 | /* return address of TDR register */ |
3665 | /* return address of TDR register */ |
3636 | data_reg_addr = (uint32_t) &(USARTx->TDR); |
3666 | data_reg_addr = (uint32_t) &(USARTx->TDR); |
Line 3706... | Line 3736... | ||
3706 | * @{ |
3736 | * @{ |
3707 | */ |
3737 | */ |
3708 | 3738 | ||
3709 | /** |
3739 | /** |
3710 | * @brief Request an Automatic Baud Rate measurement on next received data frame |
3740 | * @brief Request an Automatic Baud Rate measurement on next received data frame |
3711 | * @note Macro @ref IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
3741 | * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not |
3712 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
3742 | * Auto Baud Rate detection feature is supported by the USARTx instance. |
3713 | * @rmtoll RQR ABRRQ LL_USART_RequestAutoBaudRate |
3743 | * @rmtoll RQR ABRRQ LL_USART_RequestAutoBaudRate |
3714 | * @param USARTx USART Instance |
3744 | * @param USARTx USART Instance |
3715 | * @retval None |
3745 | * @retval None |
3716 | */ |
3746 | */ |
Line 3755... | Line 3785... | ||
3755 | } |
3785 | } |
3756 | 3786 | ||
3757 | #if defined(USART_SMARTCARD_SUPPORT) |
3787 | #if defined(USART_SMARTCARD_SUPPORT) |
3758 | /** |
3788 | /** |
3759 | * @brief Request a Transmit data flush |
3789 | * @brief Request a Transmit data flush |
3760 | * @note Macro @ref IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
3790 | * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not |
3761 | * Smartcard feature is supported by the USARTx instance. |
3791 | * Smartcard feature is supported by the USARTx instance. |
3762 | * @rmtoll RQR TXFRQ LL_USART_RequestTxDataFlush |
3792 | * @rmtoll RQR TXFRQ LL_USART_RequestTxDataFlush |
3763 | * @param USARTx USART Instance |
3793 | * @param USARTx USART Instance |
3764 | * @retval None |
3794 | * @retval None |
3765 | */ |
3795 | */ |