TUKS MCU Introductory course / TUKS-COURSE-THERMOMETER

Fork of TUKS-COURSE-TIMER by TUKS MCU Introductory course

Embed: (wiki syntax)

« Back to documentation index

Configuration functions

Configuration functions
[USART Exported Functions]

Functions

__STATIC_INLINE void LL_USART_Enable (USART_TypeDef *USARTx)
 USART Enable CR1 UE LL_USART_Enable.
__STATIC_INLINE void LL_USART_Disable (USART_TypeDef *USARTx)
 USART Disable (all USART prescalers and outputs are disabled)
__STATIC_INLINE uint32_t LL_USART_IsEnabled (USART_TypeDef *USARTx)
 Indicate if USART is enabled CR1 UE LL_USART_IsEnabled.
__STATIC_INLINE void LL_USART_EnableInStopMode (USART_TypeDef *USARTx)
 USART enabled in STOP Mode.
__STATIC_INLINE void LL_USART_DisableInStopMode (USART_TypeDef *USARTx)
 USART disabled in STOP Mode.
__STATIC_INLINE uint32_t LL_USART_IsEnabledInStopMode (USART_TypeDef *USARTx)
 Indicate if USART is enabled in STOP Mode (able to wake up MCU from Stop mode or not)
__STATIC_INLINE void LL_USART_EnableDirectionRx (USART_TypeDef *USARTx)
 Receiver Enable (Receiver is enabled and begins searching for a start bit) CR1 RE LL_USART_EnableDirectionRx.
__STATIC_INLINE void LL_USART_DisableDirectionRx (USART_TypeDef *USARTx)
 Receiver Disable CR1 RE LL_USART_DisableDirectionRx.
__STATIC_INLINE void LL_USART_EnableDirectionTx (USART_TypeDef *USARTx)
 Transmitter Enable CR1 TE LL_USART_EnableDirectionTx.
__STATIC_INLINE void LL_USART_DisableDirectionTx (USART_TypeDef *USARTx)
 Transmitter Disable CR1 TE LL_USART_DisableDirectionTx.
__STATIC_INLINE void LL_USART_SetTransferDirection (USART_TypeDef *USARTx, uint32_t TransferDirection)
 Configure simultaneously enabled/disabled states of Transmitter and Receiver CR1 RE LL_USART_SetTransferDirection
CR1 TE LL_USART_SetTransferDirection.
__STATIC_INLINE uint32_t LL_USART_GetTransferDirection (USART_TypeDef *USARTx)
 Return enabled/disabled states of Transmitter and Receiver CR1 RE LL_USART_GetTransferDirection
CR1 TE LL_USART_GetTransferDirection.
__STATIC_INLINE void LL_USART_SetParity (USART_TypeDef *USARTx, uint32_t Parity)
 Configure Parity (enabled/disabled and parity mode if enabled).
__STATIC_INLINE uint32_t LL_USART_GetParity (USART_TypeDef *USARTx)
 Return Parity configuration (enabled/disabled and parity mode if enabled) CR1 PS LL_USART_GetParity
CR1 PCE LL_USART_GetParity.
__STATIC_INLINE void LL_USART_SetWakeUpMethod (USART_TypeDef *USARTx, uint32_t Method)
 Set Receiver Wake Up method from Mute mode.
__STATIC_INLINE uint32_t LL_USART_GetWakeUpMethod (USART_TypeDef *USARTx)
 Return Receiver Wake Up method from Mute mode CR1 WAKE LL_USART_GetWakeUpMethod.
__STATIC_INLINE void LL_USART_SetDataWidth (USART_TypeDef *USARTx, uint32_t DataWidth)
 Set Word length (i.e.
__STATIC_INLINE uint32_t LL_USART_GetDataWidth (USART_TypeDef *USARTx)
 Return Word length (i.e.
__STATIC_INLINE void LL_USART_EnableMuteMode (USART_TypeDef *USARTx)
 Allow switch between Mute Mode and Active mode CR1 MME LL_USART_EnableMuteMode.
__STATIC_INLINE void LL_USART_DisableMuteMode (USART_TypeDef *USARTx)
 Prevent Mute Mode use.
__STATIC_INLINE uint32_t LL_USART_IsEnabledMuteMode (USART_TypeDef *USARTx)
 Indicate if switch between Mute Mode and Active mode is allowed CR1 MME LL_USART_IsEnabledMuteMode.
__STATIC_INLINE void LL_USART_SetOverSampling (USART_TypeDef *USARTx, uint32_t OverSampling)
 Set Oversampling to 8-bit or 16-bit mode CR1 OVER8 LL_USART_SetOverSampling.
__STATIC_INLINE uint32_t LL_USART_GetOverSampling (USART_TypeDef *USARTx)
 Return Oversampling mode CR1 OVER8 LL_USART_GetOverSampling.
__STATIC_INLINE void LL_USART_SetLastClkPulseOutput (USART_TypeDef *USARTx, uint32_t LastBitClockPulse)
 Configure if Clock pulse of the last data bit is output to the SCLK pin or not.
__STATIC_INLINE uint32_t LL_USART_GetLastClkPulseOutput (USART_TypeDef *USARTx)
 Retrieve Clock pulse of the last data bit output configuration (Last bit Clock pulse output to the SCLK pin or not)
__STATIC_INLINE void LL_USART_SetClockPhase (USART_TypeDef *USARTx, uint32_t ClockPhase)
 Select the phase of the clock output on the SCLK pin in synchronous mode.
__STATIC_INLINE uint32_t LL_USART_GetClockPhase (USART_TypeDef *USARTx)
 Return phase of the clock output on the SCLK pin in synchronous mode.
__STATIC_INLINE void LL_USART_SetClockPolarity (USART_TypeDef *USARTx, uint32_t ClockPolarity)
 Select the polarity of the clock output on the SCLK pin in synchronous mode.
__STATIC_INLINE uint32_t LL_USART_GetClockPolarity (USART_TypeDef *USARTx)
 Return polarity of the clock output on the SCLK pin in synchronous mode.
__STATIC_INLINE void LL_USART_ConfigClock (USART_TypeDef *USARTx, uint32_t Phase, uint32_t Polarity, uint32_t LBCPOutput)
 Configure Clock signal format (Phase Polarity and choice about output of last bit clock pulse)
__STATIC_INLINE void LL_USART_EnableSCLKOutput (USART_TypeDef *USARTx)
 Enable Clock output on SCLK pin.
__STATIC_INLINE void LL_USART_DisableSCLKOutput (USART_TypeDef *USARTx)
 Disable Clock output on SCLK pin.
__STATIC_INLINE uint32_t LL_USART_IsEnabledSCLKOutput (USART_TypeDef *USARTx)
 Indicate if Clock output on SCLK pin is enabled.
__STATIC_INLINE void LL_USART_SetStopBitsLength (USART_TypeDef *USARTx, uint32_t StopBits)
 Set the length of the stop bits CR2 STOP LL_USART_SetStopBitsLength.
__STATIC_INLINE uint32_t LL_USART_GetStopBitsLength (USART_TypeDef *USARTx)
 Retrieve the length of the stop bits CR2 STOP LL_USART_GetStopBitsLength.
__STATIC_INLINE void LL_USART_ConfigCharacter (USART_TypeDef *USARTx, uint32_t DataWidth, uint32_t Parity, uint32_t StopBits)
 Configure Character frame format (Datawidth, Parity control, Stop Bits)
__STATIC_INLINE void LL_USART_SetTXRXSwap (USART_TypeDef *USARTx, uint32_t SwapConfig)
 Configure TX/RX pins swapping setting.
__STATIC_INLINE uint32_t LL_USART_GetTXRXSwap (USART_TypeDef *USARTx)
 Retrieve TX/RX pins swapping configuration.
__STATIC_INLINE void LL_USART_SetRXPinLevel (USART_TypeDef *USARTx, uint32_t PinInvMethod)
 Configure RX pin active level logic CR2 RXINV LL_USART_SetRXPinLevel.
__STATIC_INLINE uint32_t LL_USART_GetRXPinLevel (USART_TypeDef *USARTx)
 Retrieve RX pin active level logic configuration CR2 RXINV LL_USART_GetRXPinLevel.
__STATIC_INLINE void LL_USART_SetTXPinLevel (USART_TypeDef *USARTx, uint32_t PinInvMethod)
 Configure TX pin active level logic CR2 TXINV LL_USART_SetTXPinLevel.
__STATIC_INLINE uint32_t LL_USART_GetTXPinLevel (USART_TypeDef *USARTx)
 Retrieve TX pin active level logic configuration CR2 TXINV LL_USART_GetTXPinLevel.
__STATIC_INLINE void LL_USART_SetBinaryDataLogic (USART_TypeDef *USARTx, uint32_t DataLogic)
 Configure Binary data logic.
__STATIC_INLINE uint32_t LL_USART_GetBinaryDataLogic (USART_TypeDef *USARTx)
 Retrieve Binary data configuration CR2 DATAINV LL_USART_GetBinaryDataLogic.
__STATIC_INLINE void LL_USART_SetTransferBitOrder (USART_TypeDef *USARTx, uint32_t BitOrder)
 Configure transfer bit order (either Less or Most Significant Bit First)
__STATIC_INLINE uint32_t LL_USART_GetTransferBitOrder (USART_TypeDef *USARTx)
 Return transfer bit order (either Less or Most Significant Bit First)
__STATIC_INLINE void LL_USART_EnableAutoBaudRate (USART_TypeDef *USARTx)
 Enable Auto Baud-Rate Detection.
__STATIC_INLINE void LL_USART_DisableAutoBaudRate (USART_TypeDef *USARTx)
 Disable Auto Baud-Rate Detection.
__STATIC_INLINE uint32_t LL_USART_IsEnabledAutoBaud (USART_TypeDef *USARTx)
 Indicate if Auto Baud-Rate Detection mechanism is enabled.
__STATIC_INLINE void LL_USART_SetAutoBaudRateMode (USART_TypeDef *USARTx, uint32_t AutoBaudRateMode)
 Set Auto Baud-Rate mode bits.
__STATIC_INLINE uint32_t LL_USART_GetAutoBaudRateMode (USART_TypeDef *USARTx)
 Return Auto Baud-Rate mode.
__STATIC_INLINE void LL_USART_EnableRxTimeout (USART_TypeDef *USARTx)
 Enable Receiver Timeout CR2 RTOEN LL_USART_EnableRxTimeout.
__STATIC_INLINE void LL_USART_DisableRxTimeout (USART_TypeDef *USARTx)
 Disable Receiver Timeout CR2 RTOEN LL_USART_DisableRxTimeout.
__STATIC_INLINE uint32_t LL_USART_IsEnabledRxTimeout (USART_TypeDef *USARTx)
 Indicate if Receiver Timeout feature is enabled CR2 RTOEN LL_USART_IsEnabledRxTimeout.
__STATIC_INLINE void LL_USART_ConfigNodeAddress (USART_TypeDef *USARTx, uint32_t AddressLen, uint32_t NodeAddress)
 Set Address of the USART node.
__STATIC_INLINE uint32_t LL_USART_GetNodeAddress (USART_TypeDef *USARTx)
 Return 8 bit Address of the USART node as set in ADD field of CR2.
__STATIC_INLINE uint32_t LL_USART_GetNodeAddressLen (USART_TypeDef *USARTx)
 Return Length of Node Address used in Address Detection mode (7-bit or 4-bit) CR2 ADDM7 LL_USART_GetNodeAddressLen.
__STATIC_INLINE void LL_USART_EnableRTSHWFlowCtrl (USART_TypeDef *USARTx)
 Enable RTS HW Flow Control.
__STATIC_INLINE void LL_USART_DisableRTSHWFlowCtrl (USART_TypeDef *USARTx)
 Disable RTS HW Flow Control.
__STATIC_INLINE void LL_USART_EnableCTSHWFlowCtrl (USART_TypeDef *USARTx)
 Enable CTS HW Flow Control.
__STATIC_INLINE void LL_USART_DisableCTSHWFlowCtrl (USART_TypeDef *USARTx)
 Disable CTS HW Flow Control.
__STATIC_INLINE void LL_USART_SetHWFlowCtrl (USART_TypeDef *USARTx, uint32_t HardwareFlowControl)
 Configure HW Flow Control mode (both CTS and RTS)
__STATIC_INLINE uint32_t LL_USART_GetHWFlowCtrl (USART_TypeDef *USARTx)
 Return HW Flow Control configuration (both CTS and RTS)
__STATIC_INLINE void LL_USART_EnableOneBitSamp (USART_TypeDef *USARTx)
 Enable One bit sampling method CR3 ONEBIT LL_USART_EnableOneBitSamp.
__STATIC_INLINE void LL_USART_DisableOneBitSamp (USART_TypeDef *USARTx)
 Disable One bit sampling method CR3 ONEBIT LL_USART_DisableOneBitSamp.
__STATIC_INLINE uint32_t LL_USART_IsEnabledOneBitSamp (USART_TypeDef *USARTx)
 Indicate if One bit sampling method is enabled CR3 ONEBIT LL_USART_IsEnabledOneBitSamp.
__STATIC_INLINE void LL_USART_EnableOverrunDetect (USART_TypeDef *USARTx)
 Enable Overrun detection CR3 OVRDIS LL_USART_EnableOverrunDetect.
__STATIC_INLINE void LL_USART_DisableOverrunDetect (USART_TypeDef *USARTx)
 Disable Overrun detection CR3 OVRDIS LL_USART_DisableOverrunDetect.
__STATIC_INLINE uint32_t LL_USART_IsEnabledOverrunDetect (USART_TypeDef *USARTx)
 Indicate if Overrun detection is enabled CR3 OVRDIS LL_USART_IsEnabledOverrunDetect.
__STATIC_INLINE void LL_USART_SetWKUPType (USART_TypeDef *USARTx, uint32_t Type)
 Select event type for Wake UP Interrupt Flag (WUS[1:0] bits)
__STATIC_INLINE uint32_t LL_USART_GetWKUPType (USART_TypeDef *USARTx)
 Return event type for Wake UP Interrupt Flag (WUS[1:0] bits)
__STATIC_INLINE void LL_USART_SetBaudRate (USART_TypeDef *USARTx, uint32_t PeriphClk, uint32_t OverSampling, uint32_t BaudRate)
 Configure USART BRR register for achieving expected Baud Rate value.
__STATIC_INLINE uint32_t LL_USART_GetBaudRate (USART_TypeDef *USARTx, uint32_t PeriphClk, uint32_t OverSampling)
 Return current Baud Rate value, according to USARTDIV present in BRR register (full BRR content), and to used Peripheral Clock and Oversampling mode values.
__STATIC_INLINE void LL_USART_SetRxTimeout (USART_TypeDef *USARTx, uint32_t Timeout)
 Set Receiver Time Out Value (expressed in nb of bits duration) RTOR RTO LL_USART_SetRxTimeout.
__STATIC_INLINE uint32_t LL_USART_GetRxTimeout (USART_TypeDef *USARTx)
 Get Receiver Time Out Value (expressed in nb of bits duration) RTOR RTO LL_USART_GetRxTimeout.
__STATIC_INLINE void LL_USART_SetBlockLength (USART_TypeDef *USARTx, uint32_t BlockLength)
 Set Block Length value in reception RTOR BLEN LL_USART_SetBlockLength.
__STATIC_INLINE uint32_t LL_USART_GetBlockLength (USART_TypeDef *USARTx)
 Get Block Length value in reception RTOR BLEN LL_USART_GetBlockLength.

Function Documentation

__STATIC_INLINE void LL_USART_ConfigCharacter ( USART_TypeDef *  USARTx,
uint32_t  DataWidth,
uint32_t  Parity,
uint32_t  StopBits 
)

Configure Character frame format (Datawidth, Parity control, Stop Bits)

Note:
Call of this function is equivalent to following function call sequence :
  • Data Width configuration using LL_USART_SetDataWidth() function
  • Parity Control and mode configuration using LL_USART_SetParity() function
  • Stop bits configuration using LL_USART_SetStopBitsLength() function CR1 PS LL_USART_ConfigCharacter
    CR1 PCE LL_USART_ConfigCharacter
    CR1 M0 LL_USART_ConfigCharacter
    CR1 M1 LL_USART_ConfigCharacter
    CR2 STOP LL_USART_ConfigCharacter
Parameters:
USARTxUSART Instance
DataWidthThis parameter can be one of the following values:

  • LL_USART_DATAWIDTH_7B
  • LL_USART_DATAWIDTH_8B
  • LL_USART_DATAWIDTH_9B
ParityThis parameter can be one of the following values:

  • LL_USART_PARITY_NONE
  • LL_USART_PARITY_EVEN
  • LL_USART_PARITY_ODD
StopBitsThis parameter can be one of the following values:

  • LL_USART_STOPBITS_0_5
  • LL_USART_STOPBITS_1
  • LL_USART_STOPBITS_1_5
  • LL_USART_STOPBITS_2
Return values:
None

Definition at line 1078 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_ConfigClock ( USART_TypeDef *  USARTx,
uint32_t  Phase,
uint32_t  Polarity,
uint32_t  LBCPOutput 
)

Configure Clock signal format (Phase Polarity and choice about output of last bit clock pulse)

Note:
Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not Synchronous mode is supported by the USARTx instance.
Call of this function is equivalent to following function call sequence :
Parameters:
USARTxUSART Instance
PhaseThis parameter can be one of the following values:

  • LL_USART_PHASE_1EDGE
  • LL_USART_PHASE_2EDGE
PolarityThis parameter can be one of the following values:

  • LL_USART_POLARITY_LOW
  • LL_USART_POLARITY_HIGH
LBCPOutputThis parameter can be one of the following values:

  • LL_USART_LASTCLKPULSE_NO_OUTPUT
  • LL_USART_LASTCLKPULSE_OUTPUT
Return values:
None

Definition at line 976 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_ConfigNodeAddress ( USART_TypeDef *  USARTx,
uint32_t  AddressLen,
uint32_t  NodeAddress 
)

Set Address of the USART node.

Note:
This is used in multiprocessor communication during Mute mode or Stop mode, for wake up with address mark detection.
4bits address node is used when 4-bit Address Detection is selected in ADDM7. (b7-b4 should be set to 0) 8bits address node is used when 7-bit Address Detection is selected in ADDM7. (This is used in multiprocessor communication during Mute mode or Stop mode, for wake up with 7-bit address mark detection. The MSB of the character sent by the transmitter should be equal to 1. It may also be used for character detection during normal reception, Mute mode inactive (for example, end of block detection in ModBus protocol). In this case, the whole received character (8-bit) is compared to the ADD[7:0] value and CMF flag is set on match) CR2 ADD LL_USART_ConfigNodeAddress
CR2 ADDM7 LL_USART_ConfigNodeAddress
Parameters:
USARTxUSART Instance
AddressLenThis parameter can be one of the following values:

  • LL_USART_ADDRESS_DETECT_4B
  • LL_USART_ADDRESS_DETECT_7B
NodeAddress4 or 7 bit Address of the USART node.
Return values:
None

Definition at line 1356 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_Disable ( USART_TypeDef *  USARTx )

USART Disable (all USART prescalers and outputs are disabled)

Note:
When USART is disabled, USART prescalers and outputs are stopped immediately, and current operations are discarded. The configuration of the USART is kept, but all the status flags, in the USARTx_ISR are set to their default values. CR1 UE LL_USART_Disable
Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 571 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_DisableAutoBaudRate ( USART_TypeDef *  USARTx )

Disable Auto Baud-Rate Detection.

Note:
Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not Auto Baud Rate detection feature is supported by the USARTx instance. CR2 ABREN LL_USART_DisableAutoBaudRate
Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 1247 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_DisableCTSHWFlowCtrl ( USART_TypeDef *  USARTx )

Disable CTS HW Flow Control.

Note:
Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not Hardware Flow control feature is supported by the USARTx instance. CR3 CTSE LL_USART_DisableCTSHWFlowCtrl
Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 1437 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_DisableDirectionRx ( USART_TypeDef *  USARTx )

Receiver Disable CR1 RE LL_USART_DisableDirectionRx.

Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 646 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_DisableDirectionTx ( USART_TypeDef *  USARTx )

Transmitter Disable CR1 TE LL_USART_DisableDirectionTx.

Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 668 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_DisableInStopMode ( USART_TypeDef *  USARTx )

USART disabled in STOP Mode.

Note:
When this function is disabled, USART is not able to wake up the MCU from Stop mode
Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not Wake-up from Stop mode feature is supported by the USARTx instance. CR1 UESM LL_USART_DisableInStopMode
Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 611 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_DisableMuteMode ( USART_TypeDef *  USARTx )

Prevent Mute Mode use.

Set Receiver in active mode permanently. CR1 MME LL_USART_DisableMuteMode

Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 816 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_DisableOneBitSamp ( USART_TypeDef *  USARTx )

Disable One bit sampling method CR3 ONEBIT LL_USART_DisableOneBitSamp.

Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 1496 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_DisableOverrunDetect ( USART_TypeDef *  USARTx )

Disable Overrun detection CR3 OVRDIS LL_USART_DisableOverrunDetect.

Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 1529 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_DisableRTSHWFlowCtrl ( USART_TypeDef *  USARTx )

Disable RTS HW Flow Control.

Note:
Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not Hardware Flow control feature is supported by the USARTx instance. CR3 RTSE LL_USART_DisableRTSHWFlowCtrl
Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 1411 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_DisableRxTimeout ( USART_TypeDef *  USARTx )

Disable Receiver Timeout CR2 RTOEN LL_USART_DisableRxTimeout.

Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 1317 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_DisableSCLKOutput ( USART_TypeDef *  USARTx )

Disable Clock output on SCLK pin.

Note:
Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not Synchronous mode is supported by the USARTx instance. CR2 CLKEN LL_USART_DisableSCLKOutput
Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 1002 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_Enable ( USART_TypeDef *  USARTx )

USART Enable CR1 UE LL_USART_Enable.

Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 557 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_EnableAutoBaudRate ( USART_TypeDef *  USARTx )

Enable Auto Baud-Rate Detection.

Note:
Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not Auto Baud Rate detection feature is supported by the USARTx instance. CR2 ABREN LL_USART_EnableAutoBaudRate
Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 1234 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_EnableCTSHWFlowCtrl ( USART_TypeDef *  USARTx )

Enable CTS HW Flow Control.

Note:
Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not Hardware Flow control feature is supported by the USARTx instance. CR3 CTSE LL_USART_EnableCTSHWFlowCtrl
Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 1424 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_EnableDirectionRx ( USART_TypeDef *  USARTx )

Receiver Enable (Receiver is enabled and begins searching for a start bit) CR1 RE LL_USART_EnableDirectionRx.

Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 635 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_EnableDirectionTx ( USART_TypeDef *  USARTx )

Transmitter Enable CR1 TE LL_USART_EnableDirectionTx.

Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 657 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_EnableInStopMode ( USART_TypeDef *  USARTx )

USART enabled in STOP Mode.

Note:
When this function is enabled, USART is able to wake up the MCU from Stop mode, provided that USART clock selection is HSI or LSE in RCC.
Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not Wake-up from Stop mode feature is supported by the USARTx instance. CR1 UESM LL_USART_EnableInStopMode
Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 597 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_EnableMuteMode ( USART_TypeDef *  USARTx )

Allow switch between Mute Mode and Active mode CR1 MME LL_USART_EnableMuteMode.

Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 805 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_EnableOneBitSamp ( USART_TypeDef *  USARTx )

Enable One bit sampling method CR3 ONEBIT LL_USART_EnableOneBitSamp.

Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 1485 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_EnableOverrunDetect ( USART_TypeDef *  USARTx )

Enable Overrun detection CR3 OVRDIS LL_USART_EnableOverrunDetect.

Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 1518 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_EnableRTSHWFlowCtrl ( USART_TypeDef *  USARTx )

Enable RTS HW Flow Control.

Note:
Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not Hardware Flow control feature is supported by the USARTx instance. CR3 RTSE LL_USART_EnableRTSHWFlowCtrl
Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 1398 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_EnableRxTimeout ( USART_TypeDef *  USARTx )

Enable Receiver Timeout CR2 RTOEN LL_USART_EnableRxTimeout.

Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 1306 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_EnableSCLKOutput ( USART_TypeDef *  USARTx )

Enable Clock output on SCLK pin.

Note:
Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not Synchronous mode is supported by the USARTx instance. CR2 CLKEN LL_USART_EnableSCLKOutput
Parameters:
USARTxUSART Instance
Return values:
None

Definition at line 989 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetAutoBaudRateMode ( USART_TypeDef *  USARTx )

Return Auto Baud-Rate mode.

Note:
Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not Auto Baud Rate detection feature is supported by the USARTx instance. CR2 ABRMODE LL_USART_GetAutoBaudRateMode
Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_AUTOBAUD_DETECT_ON_STARTBIT
  • LL_USART_AUTOBAUD_DETECT_ON_FALLINGEDGE
  • LL_USART_AUTOBAUD_DETECT_ON_7F_FRAME
  • LL_USART_AUTOBAUD_DETECT_ON_55_FRAME

Definition at line 1295 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetBaudRate ( USART_TypeDef *  USARTx,
uint32_t  PeriphClk,
uint32_t  OverSampling 
)

Return current Baud Rate value, according to USARTDIV present in BRR register (full BRR content), and to used Peripheral Clock and Oversampling mode values.

Note:
In case of non-initialized or invalid value stored in BRR register, value 0 will be returned. BRR BRR LL_USART_GetBaudRate
Parameters:
USARTxUSART Instance
PeriphClkPeripheral Clock
OverSamplingThis parameter can be one of the following values:

  • LL_USART_OVERSAMPLING_16
  • LL_USART_OVERSAMPLING_8
Return values:
BaudRate

Definition at line 1624 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetBinaryDataLogic ( USART_TypeDef *  USARTx )

Retrieve Binary data configuration CR2 DATAINV LL_USART_GetBinaryDataLogic.

Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_BINARY_LOGIC_POSITIVE
  • LL_USART_BINARY_LOGIC_NEGATIVE

Definition at line 1190 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetBlockLength ( USART_TypeDef *  USARTx )

Get Block Length value in reception RTOR BLEN LL_USART_GetBlockLength.

Parameters:
USARTxUSART Instance
Return values:
Valuebetween Min_Data=0x00 and Max_Data=0xFF

Definition at line 1690 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetClockPhase ( USART_TypeDef *  USARTx )

Return phase of the clock output on the SCLK pin in synchronous mode.

Note:
Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not Synchronous mode is supported by the USARTx instance. CR2 CPHA LL_USART_GetClockPhase
Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_PHASE_1EDGE
  • LL_USART_PHASE_2EDGE

Definition at line 917 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetClockPolarity ( USART_TypeDef *  USARTx )

Return polarity of the clock output on the SCLK pin in synchronous mode.

Note:
Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not Synchronous mode is supported by the USARTx instance. CR2 CPOL LL_USART_GetClockPolarity
Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_POLARITY_LOW
  • LL_USART_POLARITY_HIGH

Definition at line 948 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetDataWidth ( USART_TypeDef *  USARTx )

Return Word length (i.e.

nb of data bits, excluding start and stop bits) CR1 M0 LL_USART_GetDataWidth
CR1 M1 LL_USART_GetDataWidth

Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_DATAWIDTH_7B
  • LL_USART_DATAWIDTH_8B
  • LL_USART_DATAWIDTH_9B

Definition at line 794 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetHWFlowCtrl ( USART_TypeDef *  USARTx )

Return HW Flow Control configuration (both CTS and RTS)

Note:
Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not Hardware Flow control feature is supported by the USARTx instance. CR3 RTSE LL_USART_GetHWFlowCtrl
CR3 CTSE LL_USART_GetHWFlowCtrl
Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_HWCONTROL_NONE
  • LL_USART_HWCONTROL_RTS
  • LL_USART_HWCONTROL_CTS
  • LL_USART_HWCONTROL_RTS_CTS

Definition at line 1474 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetLastClkPulseOutput ( USART_TypeDef *  USARTx )

Retrieve Clock pulse of the last data bit output configuration (Last bit Clock pulse output to the SCLK pin or not)

Note:
Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not Synchronous mode is supported by the USARTx instance. CR2 LBCL LL_USART_GetLastClkPulseOutput
Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_LASTCLKPULSE_NO_OUTPUT
  • LL_USART_LASTCLKPULSE_OUTPUT

Definition at line 886 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetNodeAddress ( USART_TypeDef *  USARTx )

Return 8 bit Address of the USART node as set in ADD field of CR2.

Note:
If 4-bit Address Detection is selected in ADDM7, only 4bits (b3-b0) of returned value are relevant (b31-b4 are not relevant) If 7-bit Address Detection is selected in ADDM7, only 8bits (b7-b0) of returned value are relevant (b31-b8 are not relevant) CR2 ADD LL_USART_GetNodeAddress
Parameters:
USARTxUSART Instance
Return values:
Addressof the USART node (Value between Min_Data=0 and Max_Data=255)

Definition at line 1372 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetNodeAddressLen ( USART_TypeDef *  USARTx )

Return Length of Node Address used in Address Detection mode (7-bit or 4-bit) CR2 ADDM7 LL_USART_GetNodeAddressLen.

Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_ADDRESS_DETECT_4B
  • LL_USART_ADDRESS_DETECT_7B

Definition at line 1385 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetOverSampling ( USART_TypeDef *  USARTx )

Return Oversampling mode CR1 OVER8 LL_USART_GetOverSampling.

Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_OVERSAMPLING_16
  • LL_USART_OVERSAMPLING_8

Definition at line 854 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetParity ( USART_TypeDef *  USARTx )

Return Parity configuration (enabled/disabled and parity mode if enabled) CR1 PS LL_USART_GetParity
CR1 PCE LL_USART_GetParity.

Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_PARITY_NONE
  • LL_USART_PARITY_EVEN
  • LL_USART_PARITY_ODD

Definition at line 736 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetRXPinLevel ( USART_TypeDef *  USARTx )

Retrieve RX pin active level logic configuration CR2 RXINV LL_USART_GetRXPinLevel.

Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_RXPIN_LEVEL_STANDARD
  • LL_USART_RXPIN_LEVEL_INVERTED

Definition at line 1134 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetRxTimeout ( USART_TypeDef *  USARTx )

Get Receiver Time Out Value (expressed in nb of bits duration) RTOR RTO LL_USART_GetRxTimeout.

Parameters:
USARTxUSART Instance
Return values:
Valuebetween Min_Data=0x00 and Max_Data=0x00FFFFFF

Definition at line 1667 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetStopBitsLength ( USART_TypeDef *  USARTx )

Retrieve the length of the stop bits CR2 STOP LL_USART_GetStopBitsLength.

Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_STOPBITS_0_5
  • LL_USART_STOPBITS_1
  • LL_USART_STOPBITS_1_5
  • LL_USART_STOPBITS_2

Definition at line 1046 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetTransferBitOrder ( USART_TypeDef *  USARTx )

Return transfer bit order (either Less or Most Significant Bit First)

Note:
MSB First means data is transmitted/received with the MSB first, following the start bit. LSB First means data is transmitted/received with data bit 0 first, following the start bit. CR2 MSBFIRST LL_USART_GetTransferBitOrder
Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_BITORDER_LSBFIRST
  • LL_USART_BITORDER_MSBFIRST

Definition at line 1221 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetTransferDirection ( USART_TypeDef *  USARTx )

Return enabled/disabled states of Transmitter and Receiver CR1 RE LL_USART_GetTransferDirection
CR1 TE LL_USART_GetTransferDirection.

Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_DIRECTION_NONE
  • LL_USART_DIRECTION_RX
  • LL_USART_DIRECTION_TX
  • LL_USART_DIRECTION_TX_RX

Definition at line 702 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetTXPinLevel ( USART_TypeDef *  USARTx )

Retrieve TX pin active level logic configuration CR2 TXINV LL_USART_GetTXPinLevel.

Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_TXPIN_LEVEL_STANDARD
  • LL_USART_TXPIN_LEVEL_INVERTED

Definition at line 1161 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetTXRXSwap ( USART_TypeDef *  USARTx )

Retrieve TX/RX pins swapping configuration.

CR2 SWAP LL_USART_GetTXRXSwap

Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_TXRX_STANDARD
  • LL_USART_TXRX_SWAPPED

Definition at line 1107 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetWakeUpMethod ( USART_TypeDef *  USARTx )

Return Receiver Wake Up method from Mute mode CR1 WAKE LL_USART_GetWakeUpMethod.

Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_WAKEUP_IDLELINE
  • LL_USART_WAKEUP_ADDRESSMARK

Definition at line 763 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_GetWKUPType ( USART_TypeDef *  USARTx )

Return event type for Wake UP Interrupt Flag (WUS[1:0] bits)

Note:
Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not Wake-up from Stop mode feature is supported by the USARTx instance. CR3 WUS LL_USART_GetWKUPType
Parameters:
USARTxUSART Instance
Return values:
Returnedvalue can be one of the following values:

  • LL_USART_WAKEUP_ON_ADDRESS
  • LL_USART_WAKEUP_ON_STARTBIT
  • LL_USART_WAKEUP_ON_RXNE

Definition at line 1573 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_IsEnabled ( USART_TypeDef *  USARTx )

Indicate if USART is enabled CR1 UE LL_USART_IsEnabled.

Parameters:
USARTxUSART Instance
Return values:
Stateof bit (1 or 0).

Definition at line 582 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_IsEnabledAutoBaud ( USART_TypeDef *  USARTx )

Indicate if Auto Baud-Rate Detection mechanism is enabled.

Note:
Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not Auto Baud Rate detection feature is supported by the USARTx instance. CR2 ABREN LL_USART_IsEnabledAutoBaud
Parameters:
USARTxUSART Instance
Return values:
Stateof bit (1 or 0).

Definition at line 1260 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_IsEnabledInStopMode ( USART_TypeDef *  USARTx )

Indicate if USART is enabled in STOP Mode (able to wake up MCU from Stop mode or not)

Note:
Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not Wake-up from Stop mode feature is supported by the USARTx instance. CR1 UESM LL_USART_IsEnabledInStopMode
Parameters:
USARTxUSART Instance
Return values:
Stateof bit (1 or 0).

Definition at line 624 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_IsEnabledMuteMode ( USART_TypeDef *  USARTx )

Indicate if switch between Mute Mode and Active mode is allowed CR1 MME LL_USART_IsEnabledMuteMode.

Parameters:
USARTxUSART Instance
Return values:
Stateof bit (1 or 0).

Definition at line 827 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_IsEnabledOneBitSamp ( USART_TypeDef *  USARTx )

Indicate if One bit sampling method is enabled CR3 ONEBIT LL_USART_IsEnabledOneBitSamp.

Parameters:
USARTxUSART Instance
Return values:
Stateof bit (1 or 0).

Definition at line 1507 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_IsEnabledOverrunDetect ( USART_TypeDef *  USARTx )

Indicate if Overrun detection is enabled CR3 OVRDIS LL_USART_IsEnabledOverrunDetect.

Parameters:
USARTxUSART Instance
Return values:
Stateof bit (1 or 0).

Definition at line 1540 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_IsEnabledRxTimeout ( USART_TypeDef *  USARTx )

Indicate if Receiver Timeout feature is enabled CR2 RTOEN LL_USART_IsEnabledRxTimeout.

Parameters:
USARTxUSART Instance
Return values:
Stateof bit (1 or 0).

Definition at line 1328 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE uint32_t LL_USART_IsEnabledSCLKOutput ( USART_TypeDef *  USARTx )

Indicate if Clock output on SCLK pin is enabled.

Note:
Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not Synchronous mode is supported by the USARTx instance. CR2 CLKEN LL_USART_IsEnabledSCLKOutput
Parameters:
USARTxUSART Instance
Return values:
Stateof bit (1 or 0).

Definition at line 1015 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetAutoBaudRateMode ( USART_TypeDef *  USARTx,
uint32_t  AutoBaudRateMode 
)

Set Auto Baud-Rate mode bits.

Note:
Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not Auto Baud Rate detection feature is supported by the USARTx instance. CR2 ABRMODE LL_USART_SetAutoBaudRateMode
Parameters:
USARTxUSART Instance
AutoBaudRateModeThis parameter can be one of the following values:

  • LL_USART_AUTOBAUD_DETECT_ON_STARTBIT
  • LL_USART_AUTOBAUD_DETECT_ON_FALLINGEDGE
  • LL_USART_AUTOBAUD_DETECT_ON_7F_FRAME
  • LL_USART_AUTOBAUD_DETECT_ON_55_FRAME
Return values:
None

Definition at line 1278 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetBaudRate ( USART_TypeDef *  USARTx,
uint32_t  PeriphClk,
uint32_t  OverSampling,
uint32_t  BaudRate 
)

Configure USART BRR register for achieving expected Baud Rate value.

Note:
Compute and set USARTDIV value in BRR Register (full BRR content) according to used Peripheral Clock, Oversampling mode, and expected Baud Rate values
Peripheral clock and Baud rate values provided as function parameters should be valid (Baud rate value != 0) BRR BRR LL_USART_SetBaudRate
Parameters:
USARTxUSART Instance
PeriphClkPeripheral Clock
OverSamplingThis parameter can be one of the following values:

  • LL_USART_OVERSAMPLING_16
  • LL_USART_OVERSAMPLING_8
BaudRateBaud Rate
Return values:
None

Definition at line 1593 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetBinaryDataLogic ( USART_TypeDef *  USARTx,
uint32_t  DataLogic 
)

Configure Binary data logic.

Note:
Allow to define how Logical data from the data register are send/received : either in positive/direct logic (1=H, 0=L) or in negative/inverse logic (1=L, 0=H) CR2 DATAINV LL_USART_SetBinaryDataLogic
Parameters:
USARTxUSART Instance
DataLogicThis parameter can be one of the following values:

  • LL_USART_BINARY_LOGIC_POSITIVE
  • LL_USART_BINARY_LOGIC_NEGATIVE
Return values:
None

Definition at line 1177 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetBlockLength ( USART_TypeDef *  USARTx,
uint32_t  BlockLength 
)

Set Block Length value in reception RTOR BLEN LL_USART_SetBlockLength.

Parameters:
USARTxUSART Instance
BlockLengthValue between Min_Data=0x00 and Max_Data=0xFF
Return values:
None

Definition at line 1679 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetClockPhase ( USART_TypeDef *  USARTx,
uint32_t  ClockPhase 
)

Select the phase of the clock output on the SCLK pin in synchronous mode.

Note:
Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not Synchronous mode is supported by the USARTx instance. CR2 CPHA LL_USART_SetClockPhase
Parameters:
USARTxUSART Instance
ClockPhaseThis parameter can be one of the following values:

  • LL_USART_PHASE_1EDGE
  • LL_USART_PHASE_2EDGE
Return values:
None

Definition at line 902 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetClockPolarity ( USART_TypeDef *  USARTx,
uint32_t  ClockPolarity 
)

Select the polarity of the clock output on the SCLK pin in synchronous mode.

Note:
Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not Synchronous mode is supported by the USARTx instance. CR2 CPOL LL_USART_SetClockPolarity
Parameters:
USARTxUSART Instance
ClockPolarityThis parameter can be one of the following values:

  • LL_USART_POLARITY_LOW
  • LL_USART_POLARITY_HIGH
Return values:
None

Definition at line 933 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetDataWidth ( USART_TypeDef *  USARTx,
uint32_t  DataWidth 
)

Set Word length (i.e.

nb of data bits, excluding start and stop bits) CR1 M0 LL_USART_SetDataWidth
CR1 M1 LL_USART_SetDataWidth

Parameters:
USARTxUSART Instance
DataWidthThis parameter can be one of the following values:

  • LL_USART_DATAWIDTH_7B
  • LL_USART_DATAWIDTH_8B
  • LL_USART_DATAWIDTH_9B
Return values:
None

Definition at line 779 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetHWFlowCtrl ( USART_TypeDef *  USARTx,
uint32_t  HardwareFlowControl 
)

Configure HW Flow Control mode (both CTS and RTS)

Note:
Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not Hardware Flow control feature is supported by the USARTx instance. CR3 RTSE LL_USART_SetHWFlowCtrl
CR3 CTSE LL_USART_SetHWFlowCtrl
Parameters:
USARTxUSART Instance
HardwareFlowControlThis parameter can be one of the following values:

  • LL_USART_HWCONTROL_NONE
  • LL_USART_HWCONTROL_RTS
  • LL_USART_HWCONTROL_CTS
  • LL_USART_HWCONTROL_RTS_CTS
Return values:
None

Definition at line 1456 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetLastClkPulseOutput ( USART_TypeDef *  USARTx,
uint32_t  LastBitClockPulse 
)

Configure if Clock pulse of the last data bit is output to the SCLK pin or not.

Note:
Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not Synchronous mode is supported by the USARTx instance. CR2 LBCL LL_USART_SetLastClkPulseOutput
Parameters:
USARTxUSART Instance
LastBitClockPulseThis parameter can be one of the following values:

  • LL_USART_LASTCLKPULSE_NO_OUTPUT
  • LL_USART_LASTCLKPULSE_OUTPUT
Return values:
None

Definition at line 870 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetOverSampling ( USART_TypeDef *  USARTx,
uint32_t  OverSampling 
)

Set Oversampling to 8-bit or 16-bit mode CR1 OVER8 LL_USART_SetOverSampling.

Parameters:
USARTxUSART Instance
OverSamplingThis parameter can be one of the following values:

  • LL_USART_OVERSAMPLING_16
  • LL_USART_OVERSAMPLING_8
Return values:
None

Definition at line 841 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetParity ( USART_TypeDef *  USARTx,
uint32_t  Parity 
)

Configure Parity (enabled/disabled and parity mode if enabled).

Note:
This function selects if hardware parity control (generation and detection) is enabled or disabled. When the parity control is enabled (Odd or Even), computed parity bit is inserted at the MSB position (9th or 8th bit depending on data width) and parity is checked on the received data. CR1 PS LL_USART_SetParity
CR1 PCE LL_USART_SetParity
Parameters:
USARTxUSART Instance
ParityThis parameter can be one of the following values:

  • LL_USART_PARITY_NONE
  • LL_USART_PARITY_EVEN
  • LL_USART_PARITY_ODD
Return values:
None

Definition at line 721 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetRXPinLevel ( USART_TypeDef *  USARTx,
uint32_t  PinInvMethod 
)

Configure RX pin active level logic CR2 RXINV LL_USART_SetRXPinLevel.

Parameters:
USARTxUSART Instance
PinInvMethodThis parameter can be one of the following values:

  • LL_USART_RXPIN_LEVEL_STANDARD
  • LL_USART_RXPIN_LEVEL_INVERTED
Return values:
None

Definition at line 1121 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetRxTimeout ( USART_TypeDef *  USARTx,
uint32_t  Timeout 
)

Set Receiver Time Out Value (expressed in nb of bits duration) RTOR RTO LL_USART_SetRxTimeout.

Parameters:
USARTxUSART Instance
TimeoutValue between Min_Data=0x00 and Max_Data=0x00FFFFFF
Return values:
None

Definition at line 1656 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetStopBitsLength ( USART_TypeDef *  USARTx,
uint32_t  StopBits 
)

Set the length of the stop bits CR2 STOP LL_USART_SetStopBitsLength.

Parameters:
USARTxUSART Instance
StopBitsThis parameter can be one of the following values:

  • LL_USART_STOPBITS_0_5
  • LL_USART_STOPBITS_1
  • LL_USART_STOPBITS_1_5
  • LL_USART_STOPBITS_2
Return values:
None

Definition at line 1031 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetTransferBitOrder ( USART_TypeDef *  USARTx,
uint32_t  BitOrder 
)

Configure transfer bit order (either Less or Most Significant Bit First)

Note:
MSB First means data is transmitted/received with the MSB first, following the start bit. LSB First means data is transmitted/received with data bit 0 first, following the start bit. CR2 MSBFIRST LL_USART_SetTransferBitOrder
Parameters:
USARTxUSART Instance
BitOrderThis parameter can be one of the following values:

  • LL_USART_BITORDER_LSBFIRST
  • LL_USART_BITORDER_MSBFIRST
Return values:
None

Definition at line 1206 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetTransferDirection ( USART_TypeDef *  USARTx,
uint32_t  TransferDirection 
)

Configure simultaneously enabled/disabled states of Transmitter and Receiver CR1 RE LL_USART_SetTransferDirection
CR1 TE LL_USART_SetTransferDirection.

Parameters:
USARTxUSART Instance
TransferDirectionThis parameter can be one of the following values:

  • LL_USART_DIRECTION_NONE
  • LL_USART_DIRECTION_RX
  • LL_USART_DIRECTION_TX
  • LL_USART_DIRECTION_TX_RX
Return values:
None

Definition at line 686 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetTXPinLevel ( USART_TypeDef *  USARTx,
uint32_t  PinInvMethod 
)

Configure TX pin active level logic CR2 TXINV LL_USART_SetTXPinLevel.

Parameters:
USARTxUSART Instance
PinInvMethodThis parameter can be one of the following values:

  • LL_USART_TXPIN_LEVEL_STANDARD
  • LL_USART_TXPIN_LEVEL_INVERTED
Return values:
None

Definition at line 1148 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetTXRXSwap ( USART_TypeDef *  USARTx,
uint32_t  SwapConfig 
)

Configure TX/RX pins swapping setting.

CR2 SWAP LL_USART_SetTXRXSwap

Parameters:
USARTxUSART Instance
SwapConfigThis parameter can be one of the following values:

  • LL_USART_TXRX_STANDARD
  • LL_USART_TXRX_SWAPPED
Return values:
None

Definition at line 1094 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetWakeUpMethod ( USART_TypeDef *  USARTx,
uint32_t  Method 
)

Set Receiver Wake Up method from Mute mode.

CR1 WAKE LL_USART_SetWakeUpMethod

Parameters:
USARTxUSART Instance
MethodThis parameter can be one of the following values:

  • LL_USART_WAKEUP_IDLELINE
  • LL_USART_WAKEUP_ADDRESSMARK
Return values:
None

Definition at line 750 of file stm32l4xx_ll_usart.h.

__STATIC_INLINE void LL_USART_SetWKUPType ( USART_TypeDef *  USARTx,
uint32_t  Type 
)

Select event type for Wake UP Interrupt Flag (WUS[1:0] bits)

Note:
Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not Wake-up from Stop mode feature is supported by the USARTx instance. CR3 WUS LL_USART_SetWKUPType
Parameters:
USARTxUSART Instance
TypeThis parameter can be one of the following values:

  • LL_USART_WAKEUP_ON_ADDRESS
  • LL_USART_WAKEUP_ON_STARTBIT
  • LL_USART_WAKEUP_ON_RXNE
Return values:
None

Definition at line 1557 of file stm32l4xx_ll_usart.h.