STM32L4xx_HAL_Driver  1.14.0

Functions

__STATIC_INLINE void LL_LPUART_Enable (USART_TypeDef *LPUARTx)
 LPUART Enable CR1 UE LL_LPUART_Enable. More...
 
__STATIC_INLINE void LL_LPUART_Disable (USART_TypeDef *LPUARTx)
 LPUART Disable. More...
 
__STATIC_INLINE uint32_t LL_LPUART_IsEnabled (USART_TypeDef *LPUARTx)
 Indicate if LPUART is enabled CR1 UE LL_LPUART_IsEnabled. More...
 
__STATIC_INLINE void LL_LPUART_EnableFIFO (USART_TypeDef *LPUARTx)
 FIFO Mode Enable CR1 FIFOEN LL_LPUART_EnableFIFO. More...
 
__STATIC_INLINE void LL_LPUART_DisableFIFO (USART_TypeDef *LPUARTx)
 FIFO Mode Disable CR1 FIFOEN LL_LPUART_DisableFIFO. More...
 
__STATIC_INLINE uint32_t LL_LPUART_IsEnabledFIFO (USART_TypeDef *LPUARTx)
 Indicate if FIFO Mode is enabled CR1 FIFOEN LL_LPUART_IsEnabledFIFO. More...
 
__STATIC_INLINE void LL_LPUART_SetTXFIFOThreshold (USART_TypeDef *LPUARTx, uint32_t Threshold)
 Configure TX FIFO Threshold CR3 TXFTCFG LL_LPUART_SetTXFIFOThreshold. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetTXFIFOThreshold (USART_TypeDef *LPUARTx)
 Return TX FIFO Threshold Configuration CR3 TXFTCFG LL_LPUART_GetTXFIFOThreshold. More...
 
__STATIC_INLINE void LL_LPUART_SetRXFIFOThreshold (USART_TypeDef *LPUARTx, uint32_t Threshold)
 Configure RX FIFO Threshold CR3 RXFTCFG LL_LPUART_SetRXFIFOThreshold. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetRXFIFOThreshold (USART_TypeDef *LPUARTx)
 Return RX FIFO Threshold Configuration CR3 RXFTCFG LL_LPUART_GetRXFIFOThreshold. More...
 
__STATIC_INLINE void LL_LPUART_ConfigFIFOsThreshold (USART_TypeDef *LPUARTx, uint32_t TXThreshold, uint32_t RXThreshold)
 Configure TX and RX FIFOs Threshold CR3 TXFTCFG LL_LPUART_ConfigFIFOsThreshold
CR3 RXFTCFG LL_LPUART_ConfigFIFOsThreshold. More...
 
__STATIC_INLINE void LL_LPUART_EnableInStopMode (USART_TypeDef *LPUARTx)
 LPUART enabled in STOP Mode. More...
 
__STATIC_INLINE void LL_LPUART_DisableInStopMode (USART_TypeDef *LPUARTx)
 LPUART disabled in STOP Mode. More...
 
__STATIC_INLINE uint32_t LL_LPUART_IsEnabledInStopMode (USART_TypeDef *LPUARTx)
 Indicate if LPUART is enabled in STOP Mode (able to wake up MCU from Stop mode or not) CR1 UESM LL_LPUART_IsEnabledInStopMode. More...
 
__STATIC_INLINE void LL_LPUART_EnableClockInStopMode (USART_TypeDef *LPUARTx)
 LPUART Clock enabled in STOP Mode. More...
 
__STATIC_INLINE void LL_LPUART_DisableClockInStopMode (USART_TypeDef *LPUARTx)
 LPUART clock disabled in STOP Mode. More...
 
__STATIC_INLINE uint32_t LL_LPUART_IsClockEnabledInStopMode (USART_TypeDef *LPUARTx)
 Indicate if LPUART clock is enabled in STOP Mode CR3 UCESM LL_LPUART_IsClockEnabledInStopMode. More...
 
__STATIC_INLINE void LL_LPUART_EnableDirectionRx (USART_TypeDef *LPUARTx)
 Receiver Enable (Receiver is enabled and begins searching for a start bit) CR1 RE LL_LPUART_EnableDirectionRx. More...
 
__STATIC_INLINE void LL_LPUART_DisableDirectionRx (USART_TypeDef *LPUARTx)
 Receiver Disable CR1 RE LL_LPUART_DisableDirectionRx. More...
 
__STATIC_INLINE void LL_LPUART_EnableDirectionTx (USART_TypeDef *LPUARTx)
 Transmitter Enable CR1 TE LL_LPUART_EnableDirectionTx. More...
 
__STATIC_INLINE void LL_LPUART_DisableDirectionTx (USART_TypeDef *LPUARTx)
 Transmitter Disable CR1 TE LL_LPUART_DisableDirectionTx. More...
 
__STATIC_INLINE void LL_LPUART_SetTransferDirection (USART_TypeDef *LPUARTx, uint32_t TransferDirection)
 Configure simultaneously enabled/disabled states of Transmitter and Receiver CR1 RE LL_LPUART_SetTransferDirection
CR1 TE LL_LPUART_SetTransferDirection. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetTransferDirection (USART_TypeDef *LPUARTx)
 Return enabled/disabled states of Transmitter and Receiver CR1 RE LL_LPUART_GetTransferDirection
CR1 TE LL_LPUART_GetTransferDirection. More...
 
__STATIC_INLINE void LL_LPUART_SetParity (USART_TypeDef *LPUARTx, uint32_t Parity)
 Configure Parity (enabled/disabled and parity mode if enabled) More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetParity (USART_TypeDef *LPUARTx)
 Return Parity configuration (enabled/disabled and parity mode if enabled) CR1 PS LL_LPUART_GetParity
CR1 PCE LL_LPUART_GetParity. More...
 
__STATIC_INLINE void LL_LPUART_SetWakeUpMethod (USART_TypeDef *LPUARTx, uint32_t Method)
 Set Receiver Wake Up method from Mute mode. CR1 WAKE LL_LPUART_SetWakeUpMethod. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetWakeUpMethod (USART_TypeDef *LPUARTx)
 Return Receiver Wake Up method from Mute mode CR1 WAKE LL_LPUART_GetWakeUpMethod. More...
 
__STATIC_INLINE void LL_LPUART_SetDataWidth (USART_TypeDef *LPUARTx, uint32_t DataWidth)
 Set Word length (nb of data bits, excluding start and stop bits) CR1 M LL_LPUART_SetDataWidth. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetDataWidth (USART_TypeDef *LPUARTx)
 Return Word length (i.e. nb of data bits, excluding start and stop bits) CR1 M LL_LPUART_GetDataWidth. More...
 
__STATIC_INLINE void LL_LPUART_EnableMuteMode (USART_TypeDef *LPUARTx)
 Allow switch between Mute Mode and Active mode CR1 MME LL_LPUART_EnableMuteMode. More...
 
__STATIC_INLINE void LL_LPUART_DisableMuteMode (USART_TypeDef *LPUARTx)
 Prevent Mute Mode use. Set Receiver in active mode permanently. CR1 MME LL_LPUART_DisableMuteMode. More...
 
__STATIC_INLINE uint32_t LL_LPUART_IsEnabledMuteMode (USART_TypeDef *LPUARTx)
 Indicate if switch between Mute Mode and Active mode is allowed CR1 MME LL_LPUART_IsEnabledMuteMode. More...
 
__STATIC_INLINE void LL_LPUART_SetPrescaler (USART_TypeDef *LPUARTx, uint32_t PrescalerValue)
 Configure Clock source prescaler for baudrate generator and oversampling PRESC PRESCALER LL_LPUART_SetPrescaler. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetPrescaler (USART_TypeDef *LPUARTx)
 Retrieve the Clock source prescaler for baudrate generator and oversampling PRESC PRESCALER LL_LPUART_GetPrescaler. More...
 
__STATIC_INLINE void LL_LPUART_SetStopBitsLength (USART_TypeDef *LPUARTx, uint32_t StopBits)
 Set the length of the stop bits CR2 STOP LL_LPUART_SetStopBitsLength. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetStopBitsLength (USART_TypeDef *LPUARTx)
 Retrieve the length of the stop bits CR2 STOP LL_LPUART_GetStopBitsLength. More...
 
__STATIC_INLINE void LL_LPUART_ConfigCharacter (USART_TypeDef *LPUARTx, uint32_t DataWidth, uint32_t Parity, uint32_t StopBits)
 Configure Character frame format (Datawidth, Parity control, Stop Bits) More...
 
__STATIC_INLINE void LL_LPUART_SetTXRXSwap (USART_TypeDef *LPUARTx, uint32_t SwapConfig)
 Configure TX/RX pins swapping setting. CR2 SWAP LL_LPUART_SetTXRXSwap. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetTXRXSwap (USART_TypeDef *LPUARTx)
 Retrieve TX/RX pins swapping configuration. CR2 SWAP LL_LPUART_GetTXRXSwap. More...
 
__STATIC_INLINE void LL_LPUART_SetRXPinLevel (USART_TypeDef *LPUARTx, uint32_t PinInvMethod)
 Configure RX pin active level logic CR2 RXINV LL_LPUART_SetRXPinLevel. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetRXPinLevel (USART_TypeDef *LPUARTx)
 Retrieve RX pin active level logic configuration CR2 RXINV LL_LPUART_GetRXPinLevel. More...
 
__STATIC_INLINE void LL_LPUART_SetTXPinLevel (USART_TypeDef *LPUARTx, uint32_t PinInvMethod)
 Configure TX pin active level logic CR2 TXINV LL_LPUART_SetTXPinLevel. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetTXPinLevel (USART_TypeDef *LPUARTx)
 Retrieve TX pin active level logic configuration CR2 TXINV LL_LPUART_GetTXPinLevel. More...
 
__STATIC_INLINE void LL_LPUART_SetBinaryDataLogic (USART_TypeDef *LPUARTx, uint32_t DataLogic)
 Configure Binary data logic. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetBinaryDataLogic (USART_TypeDef *LPUARTx)
 Retrieve Binary data configuration CR2 DATAINV LL_LPUART_GetBinaryDataLogic. More...
 
__STATIC_INLINE void LL_LPUART_SetTransferBitOrder (USART_TypeDef *LPUARTx, uint32_t BitOrder)
 Configure transfer bit order (either Less or Most Significant Bit First) More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetTransferBitOrder (USART_TypeDef *LPUARTx)
 Return transfer bit order (either Less or Most Significant Bit First) More...
 
__STATIC_INLINE void LL_LPUART_ConfigNodeAddress (USART_TypeDef *LPUARTx, uint32_t AddressLen, uint32_t NodeAddress)
 Set Address of the LPUART node. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetNodeAddress (USART_TypeDef *LPUARTx)
 Return 8 bit Address of the LPUART node as set in ADD field of CR2. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetNodeAddressLen (USART_TypeDef *LPUARTx)
 Return Length of Node Address used in Address Detection mode (7-bit or 4-bit) CR2 ADDM7 LL_LPUART_GetNodeAddressLen. More...
 
__STATIC_INLINE void LL_LPUART_EnableRTSHWFlowCtrl (USART_TypeDef *LPUARTx)
 Enable RTS HW Flow Control CR3 RTSE LL_LPUART_EnableRTSHWFlowCtrl. More...
 
__STATIC_INLINE void LL_LPUART_DisableRTSHWFlowCtrl (USART_TypeDef *LPUARTx)
 Disable RTS HW Flow Control CR3 RTSE LL_LPUART_DisableRTSHWFlowCtrl. More...
 
__STATIC_INLINE void LL_LPUART_EnableCTSHWFlowCtrl (USART_TypeDef *LPUARTx)
 Enable CTS HW Flow Control CR3 CTSE LL_LPUART_EnableCTSHWFlowCtrl. More...
 
__STATIC_INLINE void LL_LPUART_DisableCTSHWFlowCtrl (USART_TypeDef *LPUARTx)
 Disable CTS HW Flow Control CR3 CTSE LL_LPUART_DisableCTSHWFlowCtrl. More...
 
__STATIC_INLINE void LL_LPUART_SetHWFlowCtrl (USART_TypeDef *LPUARTx, uint32_t HardwareFlowControl)
 Configure HW Flow Control mode (both CTS and RTS) CR3 RTSE LL_LPUART_SetHWFlowCtrl
CR3 CTSE LL_LPUART_SetHWFlowCtrl. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetHWFlowCtrl (USART_TypeDef *LPUARTx)
 Return HW Flow Control configuration (both CTS and RTS) CR3 RTSE LL_LPUART_GetHWFlowCtrl
CR3 CTSE LL_LPUART_GetHWFlowCtrl. More...
 
__STATIC_INLINE void LL_LPUART_EnableOverrunDetect (USART_TypeDef *LPUARTx)
 Enable Overrun detection CR3 OVRDIS LL_LPUART_EnableOverrunDetect. More...
 
__STATIC_INLINE void LL_LPUART_DisableOverrunDetect (USART_TypeDef *LPUARTx)
 Disable Overrun detection CR3 OVRDIS LL_LPUART_DisableOverrunDetect. More...
 
__STATIC_INLINE uint32_t LL_LPUART_IsEnabledOverrunDetect (USART_TypeDef *LPUARTx)
 Indicate if Overrun detection is enabled CR3 OVRDIS LL_LPUART_IsEnabledOverrunDetect. More...
 
__STATIC_INLINE void LL_LPUART_SetWKUPType (USART_TypeDef *LPUARTx, uint32_t Type)
 Select event type for Wake UP Interrupt Flag (WUS[1:0] bits) CR3 WUS LL_LPUART_SetWKUPType. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetWKUPType (USART_TypeDef *LPUARTx)
 Return event type for Wake UP Interrupt Flag (WUS[1:0] bits) CR3 WUS LL_LPUART_GetWKUPType. More...
 
__STATIC_INLINE void LL_LPUART_SetBaudRate (USART_TypeDef *LPUARTx, uint32_t PeriphClk, uint32_t PrescalerValue, uint32_t BaudRate) __STATIC_INLINE void LL_LPUART_SetBaudRate(USART_TypeDef *LPUARTx
 Configure LPUART BRR register for achieving expected Baud Rate value. More...
 
__STATIC_INLINE uint32_t LL_LPUART_GetBaudRate (USART_TypeDef *LPUARTx, uint32_t PeriphClk, uint32_t PrescalerValue) __STATIC_INLINE uint32_t LL_LPUART_GetBaudRate(USART_TypeDef *LPUARTx
 Return current Baud Rate value, according to LPUARTDIV present in BRR register (full BRR content), and to used Peripheral Clock values. More...
 
 if (lpuartdiv >=LPUART_BRR_MIN_VALUE)
 
 return (brrresult)
 

Variables

__STATIC_INLINE void uint32_t PeriphClk
 
__STATIC_INLINE void uint32_t uint32_t BaudRate
 
LPUARTx BRR = __LL_LPUART_DIV(PeriphClk, BaudRate)
 
register uint32_t brrresult
 
register uint32_t periphclkpresc = (uint32_t)(PeriphClk / (LPUART_PRESCALER_TAB[(uint16_t)PrescalerValue]))
 
 lpuartdiv = LPUARTx->BRR & LPUART_BRR_MASK
 
 else
 

Detailed Description

Function Documentation

◆ if()

if ( lpuartdiv >=  LPUART_BRR_MIN_VALUE)

Definition at line 1479 of file stm32l4xx_ll_lpuart.h.

1480  {
1481 #if defined(USART_PRESC_PRESCALER)
1482  brrresult = (uint32_t)(((uint64_t)(periphclkpresc) * LPUART_LPUARTDIV_FREQ_MUL) / lpuartdiv);
1483 #else
1484  brrresult = (uint32_t)(((uint64_t)(PeriphClk) * LPUART_LPUARTDIV_FREQ_MUL) / lpuartdiv);
1485 #endif /* USART_PRESC_PRESCALER */
1486  }
__STATIC_INLINE void uint32_t PeriphClk
register uint32_t periphclkpresc
register uint32_t brrresult

◆ LL_LPUART_ConfigCharacter()

__STATIC_INLINE void LL_LPUART_ConfigCharacter ( USART_TypeDef *  LPUARTx,
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 :
Parameters
LPUARTxLPUART Instance
DataWidthThis parameter can be one of the following values:
  • LL_LPUART_DATAWIDTH_7B
  • LL_LPUART_DATAWIDTH_8B
  • LL_LPUART_DATAWIDTH_9B
ParityThis parameter can be one of the following values:
  • LL_LPUART_PARITY_NONE
  • LL_LPUART_PARITY_EVEN
  • LL_LPUART_PARITY_ODD
StopBitsThis parameter can be one of the following values:
  • LL_LPUART_STOPBITS_1
  • LL_LPUART_STOPBITS_2
Return values
None

Definition at line 1051 of file stm32l4xx_ll_lpuart.h.

1053 {
1054  MODIFY_REG(LPUARTx->CR1, USART_CR1_PS | USART_CR1_PCE | USART_CR1_M, Parity | DataWidth);
1055  MODIFY_REG(LPUARTx->CR2, USART_CR2_STOP, StopBits);
1056 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_ConfigFIFOsThreshold()

__STATIC_INLINE void LL_LPUART_ConfigFIFOsThreshold ( USART_TypeDef *  LPUARTx,
uint32_t  TXThreshold,
uint32_t  RXThreshold 
)

Configure TX and RX FIFOs Threshold CR3 TXFTCFG LL_LPUART_ConfigFIFOsThreshold
CR3 RXFTCFG LL_LPUART_ConfigFIFOsThreshold.

Parameters
LPUARTxLPUART Instance
TXThresholdThis parameter can be one of the following values:
  • LL_LPUART_FIFOTHRESHOLD_1_8
  • LL_LPUART_FIFOTHRESHOLD_1_4
  • LL_LPUART_FIFOTHRESHOLD_1_2
  • LL_LPUART_FIFOTHRESHOLD_3_4
  • LL_LPUART_FIFOTHRESHOLD_7_8
  • LL_LPUART_FIFOTHRESHOLD_8_8
RXThresholdThis parameter can be one of the following values:
  • LL_LPUART_FIFOTHRESHOLD_1_8
  • LL_LPUART_FIFOTHRESHOLD_1_4
  • LL_LPUART_FIFOTHRESHOLD_1_2
  • LL_LPUART_FIFOTHRESHOLD_3_4
  • LL_LPUART_FIFOTHRESHOLD_7_8
  • LL_LPUART_FIFOTHRESHOLD_8_8
Return values
None

Definition at line 670 of file stm32l4xx_ll_lpuart.h.

671 {
672  MODIFY_REG(LPUARTx->CR3, USART_CR3_TXFTCFG | USART_CR3_RXFTCFG, (TXThreshold << USART_CR3_TXFTCFG_Pos) | (RXThreshold << USART_CR3_RXFTCFG_Pos));
673 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_ConfigNodeAddress()

__STATIC_INLINE void LL_LPUART_ConfigNodeAddress ( USART_TypeDef *  LPUARTx,
uint32_t  AddressLen,
uint32_t  NodeAddress 
)

Set Address of the LPUART 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_LPUART_ConfigNodeAddress
CR2 ADDM7 LL_LPUART_ConfigNodeAddress
Parameters
LPUARTxLPUART Instance
AddressLenThis parameter can be one of the following values:
  • LL_LPUART_ADDRESS_DETECT_4B
  • LL_LPUART_ADDRESS_DETECT_7B
NodeAddress4 or 7 bit Address of the LPUART node.
Return values
None

Definition at line 1223 of file stm32l4xx_ll_lpuart.h.

1224 {
1225  MODIFY_REG(LPUARTx->CR2, USART_CR2_ADD | USART_CR2_ADDM7,
1226  (uint32_t)(AddressLen | (NodeAddress << USART_CR2_ADD_Pos)));
1227 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_Disable()

__STATIC_INLINE void LL_LPUART_Disable ( USART_TypeDef *  LPUARTx)

LPUART Disable.

Note
When LPUART is disabled, LPUART prescalers and outputs are stopped immediately, and current operations are discarded. The configuration of the LPUART is kept, but all the status flags, in the LPUARTx_ISR are set to their default values.
In order to go into low-power mode without generating errors on the line, the TE bit must be reset before and the software must wait for the TC bit in the LPUART_ISR to be set before resetting the UE bit. The DMA requests are also reset when UE = 0 so the DMA channel must be disabled before resetting the UE bit. CR1 UE LL_LPUART_Disable
Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 529 of file stm32l4xx_ll_lpuart.h.

530 {
531  CLEAR_BIT(LPUARTx->CR1, USART_CR1_UE);
532 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_LPUART_DisableClockInStopMode()

__STATIC_INLINE void LL_LPUART_DisableClockInStopMode ( USART_TypeDef *  LPUARTx)

LPUART clock disabled in STOP Mode.

Note
When this function is called, LPUART Clock is disabled while in STOP mode CR3 UCESM LL_LPUART_DisableClockInStopMode
Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 733 of file stm32l4xx_ll_lpuart.h.

734 {
735  CLEAR_BIT(LPUARTx->CR3, USART_CR3_UCESM);
736 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_LPUART_DisableCTSHWFlowCtrl()

__STATIC_INLINE void LL_LPUART_DisableCTSHWFlowCtrl ( USART_TypeDef *  LPUARTx)

Disable CTS HW Flow Control CR3 CTSE LL_LPUART_DisableCTSHWFlowCtrl.

Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 1296 of file stm32l4xx_ll_lpuart.h.

1297 {
1298  CLEAR_BIT(LPUARTx->CR3, USART_CR3_CTSE);
1299 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_LPUART_DisableDirectionRx()

__STATIC_INLINE void LL_LPUART_DisableDirectionRx ( USART_TypeDef *  LPUARTx)

Receiver Disable CR1 RE LL_LPUART_DisableDirectionRx.

Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 767 of file stm32l4xx_ll_lpuart.h.

768 {
769  CLEAR_BIT(LPUARTx->CR1, USART_CR1_RE);
770 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_LPUART_DisableDirectionTx()

__STATIC_INLINE void LL_LPUART_DisableDirectionTx ( USART_TypeDef *  LPUARTx)

Transmitter Disable CR1 TE LL_LPUART_DisableDirectionTx.

Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 789 of file stm32l4xx_ll_lpuart.h.

790 {
791  CLEAR_BIT(LPUARTx->CR1, USART_CR1_TE);
792 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_LPUART_DisableFIFO()

__STATIC_INLINE void LL_LPUART_DisableFIFO ( USART_TypeDef *  LPUARTx)

FIFO Mode Disable CR1 FIFOEN LL_LPUART_DisableFIFO.

Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 563 of file stm32l4xx_ll_lpuart.h.

564 {
565  CLEAR_BIT(LPUARTx->CR1, USART_CR1_FIFOEN);
566 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_LPUART_DisableInStopMode()

__STATIC_INLINE void LL_LPUART_DisableInStopMode ( USART_TypeDef *  LPUARTx)

LPUART disabled in STOP Mode.

Note
When this function is disabled, LPUART is not able to wake up the MCU from Stop mode CR1 UESM LL_LPUART_DisableInStopMode
Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 696 of file stm32l4xx_ll_lpuart.h.

697 {
698  CLEAR_BIT(LPUARTx->CR1, USART_CR1_UESM);
699 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_LPUART_DisableMuteMode()

__STATIC_INLINE void LL_LPUART_DisableMuteMode ( USART_TypeDef *  LPUARTx)

Prevent Mute Mode use. Set Receiver in active mode permanently. CR1 MME LL_LPUART_DisableMuteMode.

Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 935 of file stm32l4xx_ll_lpuart.h.

936 {
937  CLEAR_BIT(LPUARTx->CR1, USART_CR1_MME);
938 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_LPUART_DisableOverrunDetect()

__STATIC_INLINE void LL_LPUART_DisableOverrunDetect ( USART_TypeDef *  LPUARTx)

Disable Overrun detection CR3 OVRDIS LL_LPUART_DisableOverrunDetect.

Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 1351 of file stm32l4xx_ll_lpuart.h.

1352 {
1353  SET_BIT(LPUARTx->CR3, USART_CR3_OVRDIS);
1354 }

◆ LL_LPUART_DisableRTSHWFlowCtrl()

__STATIC_INLINE void LL_LPUART_DisableRTSHWFlowCtrl ( USART_TypeDef *  LPUARTx)

Disable RTS HW Flow Control CR3 RTSE LL_LPUART_DisableRTSHWFlowCtrl.

Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 1274 of file stm32l4xx_ll_lpuart.h.

1275 {
1276  CLEAR_BIT(LPUARTx->CR3, USART_CR3_RTSE);
1277 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_LPUART_Enable()

__STATIC_INLINE void LL_LPUART_Enable ( USART_TypeDef *  LPUARTx)

LPUART Enable CR1 UE LL_LPUART_Enable.

Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 510 of file stm32l4xx_ll_lpuart.h.

511 {
512  SET_BIT(LPUARTx->CR1, USART_CR1_UE);
513 }

◆ LL_LPUART_EnableClockInStopMode()

__STATIC_INLINE void LL_LPUART_EnableClockInStopMode ( USART_TypeDef *  LPUARTx)

LPUART Clock enabled in STOP Mode.

Note
When this function is called, LPUART Clock is enabled while in STOP mode CR3 UCESM LL_LPUART_EnableClockInStopMode
Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 721 of file stm32l4xx_ll_lpuart.h.

722 {
723  SET_BIT(LPUARTx->CR3, USART_CR3_UCESM);
724 }

◆ LL_LPUART_EnableCTSHWFlowCtrl()

__STATIC_INLINE void LL_LPUART_EnableCTSHWFlowCtrl ( USART_TypeDef *  LPUARTx)

Enable CTS HW Flow Control CR3 CTSE LL_LPUART_EnableCTSHWFlowCtrl.

Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 1285 of file stm32l4xx_ll_lpuart.h.

1286 {
1287  SET_BIT(LPUARTx->CR3, USART_CR3_CTSE);
1288 }

◆ LL_LPUART_EnableDirectionRx()

__STATIC_INLINE void LL_LPUART_EnableDirectionRx ( USART_TypeDef *  LPUARTx)

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

Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 756 of file stm32l4xx_ll_lpuart.h.

757 {
758  SET_BIT(LPUARTx->CR1, USART_CR1_RE);
759 }

◆ LL_LPUART_EnableDirectionTx()

__STATIC_INLINE void LL_LPUART_EnableDirectionTx ( USART_TypeDef *  LPUARTx)

Transmitter Enable CR1 TE LL_LPUART_EnableDirectionTx.

Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 778 of file stm32l4xx_ll_lpuart.h.

779 {
780  SET_BIT(LPUARTx->CR1, USART_CR1_TE);
781 }

◆ LL_LPUART_EnableFIFO()

__STATIC_INLINE void LL_LPUART_EnableFIFO ( USART_TypeDef *  LPUARTx)

FIFO Mode Enable CR1 FIFOEN LL_LPUART_EnableFIFO.

Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 552 of file stm32l4xx_ll_lpuart.h.

553 {
554  SET_BIT(LPUARTx->CR1, USART_CR1_FIFOEN);
555 }

◆ LL_LPUART_EnableInStopMode()

__STATIC_INLINE void LL_LPUART_EnableInStopMode ( USART_TypeDef *  LPUARTx)

LPUART enabled in STOP Mode.

Note
When this function is enabled, LPUART is able to wake up the MCU from Stop mode, provided that LPUART clock selection is HSI or LSE in RCC. CR1 UESM LL_LPUART_EnableInStopMode
Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 684 of file stm32l4xx_ll_lpuart.h.

685 {
686  SET_BIT(LPUARTx->CR1, USART_CR1_UESM);
687 }

◆ LL_LPUART_EnableMuteMode()

__STATIC_INLINE void LL_LPUART_EnableMuteMode ( USART_TypeDef *  LPUARTx)

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

Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 924 of file stm32l4xx_ll_lpuart.h.

925 {
926  SET_BIT(LPUARTx->CR1, USART_CR1_MME);
927 }

◆ LL_LPUART_EnableOverrunDetect()

__STATIC_INLINE void LL_LPUART_EnableOverrunDetect ( USART_TypeDef *  LPUARTx)

Enable Overrun detection CR3 OVRDIS LL_LPUART_EnableOverrunDetect.

Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 1340 of file stm32l4xx_ll_lpuart.h.

1341 {
1342  CLEAR_BIT(LPUARTx->CR3, USART_CR3_OVRDIS);
1343 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_LPUART_EnableRTSHWFlowCtrl()

__STATIC_INLINE void LL_LPUART_EnableRTSHWFlowCtrl ( USART_TypeDef *  LPUARTx)

Enable RTS HW Flow Control CR3 RTSE LL_LPUART_EnableRTSHWFlowCtrl.

Parameters
LPUARTxLPUART Instance
Return values
None

Definition at line 1263 of file stm32l4xx_ll_lpuart.h.

1264 {
1265  SET_BIT(LPUARTx->CR3, USART_CR3_RTSE);
1266 }

◆ LL_LPUART_GetBaudRate()

__STATIC_INLINE uint32_t LL_LPUART_GetBaudRate ( USART_TypeDef *  LPUARTx,
uint32_t  PeriphClk,
uint32_t  PrescalerValue 
)

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

Note
In case of non-initialized or invalid value stored in BRR register, value 0 will be returned. BRR BRR LL_LPUART_GetBaudRate
Parameters
LPUARTxLPUART Instance
PeriphClkPeripheral Clock
Return values
BaudRate

◆ LL_LPUART_GetBinaryDataLogic()

__STATIC_INLINE uint32_t LL_LPUART_GetBinaryDataLogic ( USART_TypeDef *  LPUARTx)

Retrieve Binary data configuration CR2 DATAINV LL_LPUART_GetBinaryDataLogic.

Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_BINARY_LOGIC_POSITIVE
  • LL_LPUART_BINARY_LOGIC_NEGATIVE

Definition at line 1164 of file stm32l4xx_ll_lpuart.h.

1165 {
1166  return (uint32_t)(READ_BIT(LPUARTx->CR2, USART_CR2_DATAINV));
1167 }

◆ LL_LPUART_GetDataWidth()

__STATIC_INLINE uint32_t LL_LPUART_GetDataWidth ( USART_TypeDef *  LPUARTx)

Return Word length (i.e. nb of data bits, excluding start and stop bits) CR1 M LL_LPUART_GetDataWidth.

Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_DATAWIDTH_7B
  • LL_LPUART_DATAWIDTH_8B
  • LL_LPUART_DATAWIDTH_9B

Definition at line 913 of file stm32l4xx_ll_lpuart.h.

914 {
915  return (uint32_t)(READ_BIT(LPUARTx->CR1, USART_CR1_M));
916 }

◆ LL_LPUART_GetHWFlowCtrl()

__STATIC_INLINE uint32_t LL_LPUART_GetHWFlowCtrl ( USART_TypeDef *  LPUARTx)

Return HW Flow Control configuration (both CTS and RTS) CR3 RTSE LL_LPUART_GetHWFlowCtrl
CR3 CTSE LL_LPUART_GetHWFlowCtrl.

Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_HWCONTROL_NONE
  • LL_LPUART_HWCONTROL_RTS
  • LL_LPUART_HWCONTROL_CTS
  • LL_LPUART_HWCONTROL_RTS_CTS

Definition at line 1329 of file stm32l4xx_ll_lpuart.h.

1330 {
1331  return (uint32_t)(READ_BIT(LPUARTx->CR3, USART_CR3_RTSE | USART_CR3_CTSE));
1332 }

◆ LL_LPUART_GetNodeAddress()

__STATIC_INLINE uint32_t LL_LPUART_GetNodeAddress ( USART_TypeDef *  LPUARTx)

Return 8 bit Address of the LPUART 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_LPUART_GetNodeAddress
Parameters
LPUARTxLPUART Instance
Return values
Addressof the LPUART node (Value between Min_Data=0 and Max_Data=255)

Definition at line 1239 of file stm32l4xx_ll_lpuart.h.

1240 {
1241  return (uint32_t)(READ_BIT(LPUARTx->CR2, USART_CR2_ADD) >> USART_CR2_ADD_Pos);
1242 }

◆ LL_LPUART_GetNodeAddressLen()

__STATIC_INLINE uint32_t LL_LPUART_GetNodeAddressLen ( USART_TypeDef *  LPUARTx)

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

Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_ADDRESS_DETECT_4B
  • LL_LPUART_ADDRESS_DETECT_7B

Definition at line 1252 of file stm32l4xx_ll_lpuart.h.

1253 {
1254  return (uint32_t)(READ_BIT(LPUARTx->CR2, USART_CR2_ADDM7));
1255 }

◆ LL_LPUART_GetParity()

__STATIC_INLINE uint32_t LL_LPUART_GetParity ( USART_TypeDef *  LPUARTx)

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

Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_PARITY_NONE
  • LL_LPUART_PARITY_EVEN
  • LL_LPUART_PARITY_ODD

Definition at line 857 of file stm32l4xx_ll_lpuart.h.

858 {
859  return (uint32_t)(READ_BIT(LPUARTx->CR1, USART_CR1_PS | USART_CR1_PCE));
860 }

◆ LL_LPUART_GetPrescaler()

__STATIC_INLINE uint32_t LL_LPUART_GetPrescaler ( USART_TypeDef *  LPUARTx)

Retrieve the Clock source prescaler for baudrate generator and oversampling PRESC PRESCALER LL_LPUART_GetPrescaler.

Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_PRESCALER_DIV1
  • LL_LPUART_PRESCALER_DIV2
  • LL_LPUART_PRESCALER_DIV4
  • LL_LPUART_PRESCALER_DIV6
  • LL_LPUART_PRESCALER_DIV8
  • LL_LPUART_PRESCALER_DIV10
  • LL_LPUART_PRESCALER_DIV12
  • LL_LPUART_PRESCALER_DIV16
  • LL_LPUART_PRESCALER_DIV32
  • LL_LPUART_PRESCALER_DIV64
  • LL_LPUART_PRESCALER_DIV128
  • LL_LPUART_PRESCALER_DIV256

Definition at line 994 of file stm32l4xx_ll_lpuart.h.

995 {
996  return (uint32_t)(READ_BIT(LPUARTx->PRESC, USART_PRESC_PRESCALER));
997 }

◆ LL_LPUART_GetRXFIFOThreshold()

__STATIC_INLINE uint32_t LL_LPUART_GetRXFIFOThreshold ( USART_TypeDef *  LPUARTx)

Return RX FIFO Threshold Configuration CR3 RXFTCFG LL_LPUART_GetRXFIFOThreshold.

Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_FIFOTHRESHOLD_1_8
  • LL_LPUART_FIFOTHRESHOLD_1_4
  • LL_LPUART_FIFOTHRESHOLD_1_2
  • LL_LPUART_FIFOTHRESHOLD_3_4
  • LL_LPUART_FIFOTHRESHOLD_7_8
  • LL_LPUART_FIFOTHRESHOLD_8_8

Definition at line 644 of file stm32l4xx_ll_lpuart.h.

645 {
646  return (uint32_t)(READ_BIT(LPUARTx->CR3, USART_CR3_RXFTCFG) >> USART_CR3_RXFTCFG_Pos);
647 }

◆ LL_LPUART_GetRXPinLevel()

__STATIC_INLINE uint32_t LL_LPUART_GetRXPinLevel ( USART_TypeDef *  LPUARTx)

Retrieve RX pin active level logic configuration CR2 RXINV LL_LPUART_GetRXPinLevel.

Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_RXPIN_LEVEL_STANDARD
  • LL_LPUART_RXPIN_LEVEL_INVERTED

Definition at line 1107 of file stm32l4xx_ll_lpuart.h.

1108 {
1109  return (uint32_t)(READ_BIT(LPUARTx->CR2, USART_CR2_RXINV));
1110 }

◆ LL_LPUART_GetStopBitsLength()

__STATIC_INLINE uint32_t LL_LPUART_GetStopBitsLength ( USART_TypeDef *  LPUARTx)

Retrieve the length of the stop bits CR2 STOP LL_LPUART_GetStopBitsLength.

Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_STOPBITS_1
  • LL_LPUART_STOPBITS_2

Definition at line 1022 of file stm32l4xx_ll_lpuart.h.

1023 {
1024  return (uint32_t)(READ_BIT(LPUARTx->CR2, USART_CR2_STOP));
1025 }

◆ LL_LPUART_GetTransferBitOrder()

__STATIC_INLINE uint32_t LL_LPUART_GetTransferBitOrder ( USART_TypeDef *  LPUARTx)

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_LPUART_GetTransferBitOrder
Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_BITORDER_LSBFIRST
  • LL_LPUART_BITORDER_MSBFIRST

Definition at line 1195 of file stm32l4xx_ll_lpuart.h.

1196 {
1197  return (uint32_t)(READ_BIT(LPUARTx->CR2, USART_CR2_MSBFIRST));
1198 }

◆ LL_LPUART_GetTransferDirection()

__STATIC_INLINE uint32_t LL_LPUART_GetTransferDirection ( USART_TypeDef *  LPUARTx)

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

Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_DIRECTION_NONE
  • LL_LPUART_DIRECTION_RX
  • LL_LPUART_DIRECTION_TX
  • LL_LPUART_DIRECTION_TX_RX

Definition at line 823 of file stm32l4xx_ll_lpuart.h.

824 {
825  return (uint32_t)(READ_BIT(LPUARTx->CR1, USART_CR1_RE | USART_CR1_TE));
826 }

◆ LL_LPUART_GetTXFIFOThreshold()

__STATIC_INLINE uint32_t LL_LPUART_GetTXFIFOThreshold ( USART_TypeDef *  LPUARTx)

Return TX FIFO Threshold Configuration CR3 TXFTCFG LL_LPUART_GetTXFIFOThreshold.

Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_FIFOTHRESHOLD_1_8
  • LL_LPUART_FIFOTHRESHOLD_1_4
  • LL_LPUART_FIFOTHRESHOLD_1_2
  • LL_LPUART_FIFOTHRESHOLD_3_4
  • LL_LPUART_FIFOTHRESHOLD_7_8
  • LL_LPUART_FIFOTHRESHOLD_8_8

Definition at line 609 of file stm32l4xx_ll_lpuart.h.

610 {
611  return (uint32_t)(READ_BIT(LPUARTx->CR3, USART_CR3_TXFTCFG) >> USART_CR3_TXFTCFG_Pos);
612 }

◆ LL_LPUART_GetTXPinLevel()

__STATIC_INLINE uint32_t LL_LPUART_GetTXPinLevel ( USART_TypeDef *  LPUARTx)

Retrieve TX pin active level logic configuration CR2 TXINV LL_LPUART_GetTXPinLevel.

Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_TXPIN_LEVEL_STANDARD
  • LL_LPUART_TXPIN_LEVEL_INVERTED

Definition at line 1134 of file stm32l4xx_ll_lpuart.h.

1135 {
1136  return (uint32_t)(READ_BIT(LPUARTx->CR2, USART_CR2_TXINV));
1137 }

◆ LL_LPUART_GetTXRXSwap()

__STATIC_INLINE uint32_t LL_LPUART_GetTXRXSwap ( USART_TypeDef *  LPUARTx)

Retrieve TX/RX pins swapping configuration. CR2 SWAP LL_LPUART_GetTXRXSwap.

Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_TXRX_STANDARD
  • LL_LPUART_TXRX_SWAPPED

Definition at line 1080 of file stm32l4xx_ll_lpuart.h.

1081 {
1082  return (uint32_t)(READ_BIT(LPUARTx->CR2, USART_CR2_SWAP));
1083 }

◆ LL_LPUART_GetWakeUpMethod()

__STATIC_INLINE uint32_t LL_LPUART_GetWakeUpMethod ( USART_TypeDef *  LPUARTx)

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

Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_WAKEUP_IDLELINE
  • LL_LPUART_WAKEUP_ADDRESSMARK

Definition at line 884 of file stm32l4xx_ll_lpuart.h.

885 {
886  return (uint32_t)(READ_BIT(LPUARTx->CR1, USART_CR1_WAKE));
887 }

◆ LL_LPUART_GetWKUPType()

__STATIC_INLINE uint32_t LL_LPUART_GetWKUPType ( USART_TypeDef *  LPUARTx)

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

Parameters
LPUARTxLPUART Instance
Return values
Returnedvalue can be one of the following values:
  • LL_LPUART_WAKEUP_ON_ADDRESS
  • LL_LPUART_WAKEUP_ON_STARTBIT
  • LL_LPUART_WAKEUP_ON_RXNE

Definition at line 1391 of file stm32l4xx_ll_lpuart.h.

1392 {
1393  return (uint32_t)(READ_BIT(LPUARTx->CR3, USART_CR3_WUS));
1394 }

◆ LL_LPUART_IsClockEnabledInStopMode()

__STATIC_INLINE uint32_t LL_LPUART_IsClockEnabledInStopMode ( USART_TypeDef *  LPUARTx)

Indicate if LPUART clock is enabled in STOP Mode CR3 UCESM LL_LPUART_IsClockEnabledInStopMode.

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

Definition at line 744 of file stm32l4xx_ll_lpuart.h.

745 {
746  return ((READ_BIT(LPUARTx->CR3, USART_CR3_UCESM) == (USART_CR3_UCESM)) ? 1UL : 0UL);
747 }

◆ LL_LPUART_IsEnabled()

__STATIC_INLINE uint32_t LL_LPUART_IsEnabled ( USART_TypeDef *  LPUARTx)

Indicate if LPUART is enabled CR1 UE LL_LPUART_IsEnabled.

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

Definition at line 540 of file stm32l4xx_ll_lpuart.h.

541 {
542  return ((READ_BIT(LPUARTx->CR1, USART_CR1_UE) == (USART_CR1_UE)) ? 1UL : 0UL);
543 }

◆ LL_LPUART_IsEnabledFIFO()

__STATIC_INLINE uint32_t LL_LPUART_IsEnabledFIFO ( USART_TypeDef *  LPUARTx)

Indicate if FIFO Mode is enabled CR1 FIFOEN LL_LPUART_IsEnabledFIFO.

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

Definition at line 574 of file stm32l4xx_ll_lpuart.h.

575 {
576  return ((READ_BIT(LPUARTx->CR1, USART_CR1_FIFOEN) == (USART_CR1_FIFOEN)) ? 1UL : 0UL);
577 }

◆ LL_LPUART_IsEnabledInStopMode()

__STATIC_INLINE uint32_t LL_LPUART_IsEnabledInStopMode ( USART_TypeDef *  LPUARTx)

Indicate if LPUART is enabled in STOP Mode (able to wake up MCU from Stop mode or not) CR1 UESM LL_LPUART_IsEnabledInStopMode.

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

Definition at line 708 of file stm32l4xx_ll_lpuart.h.

709 {
710  return ((READ_BIT(LPUARTx->CR1, USART_CR1_UESM) == (USART_CR1_UESM)) ? 1UL : 0UL);
711 }

◆ LL_LPUART_IsEnabledMuteMode()

__STATIC_INLINE uint32_t LL_LPUART_IsEnabledMuteMode ( USART_TypeDef *  LPUARTx)

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

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

Definition at line 946 of file stm32l4xx_ll_lpuart.h.

947 {
948  return ((READ_BIT(LPUARTx->CR1, USART_CR1_MME) == (USART_CR1_MME)) ? 1UL : 0UL);
949 }

◆ LL_LPUART_IsEnabledOverrunDetect()

__STATIC_INLINE uint32_t LL_LPUART_IsEnabledOverrunDetect ( USART_TypeDef *  LPUARTx)

Indicate if Overrun detection is enabled CR3 OVRDIS LL_LPUART_IsEnabledOverrunDetect.

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

Definition at line 1362 of file stm32l4xx_ll_lpuart.h.

1363 {
1364  return ((READ_BIT(LPUARTx->CR3, USART_CR3_OVRDIS) != USART_CR3_OVRDIS) ? 1UL : 0UL);
1365 }

◆ LL_LPUART_SetBaudRate()

__STATIC_INLINE void LL_LPUART_SetBaudRate ( USART_TypeDef *  LPUARTx,
uint32_t  PeriphClk,
uint32_t  PrescalerValue,
uint32_t  BaudRate 
)

Configure LPUART BRR register for achieving expected Baud Rate value.

Note
Compute and set LPUARTDIV value in BRR Register (full BRR content) according to used Peripheral Clock and expected Baud Rate values
Peripheral clock and Baud Rate values provided as function parameters should be valid (Baud rate value != 0).
Provided that LPUARTx_BRR must be > = 0x300 and LPUART_BRR is 20-bit, a care should be taken when generating high baud rates using high PeriphClk values. PeriphClk must be in the range [3 x BaudRate, 4096 x BaudRate]. BRR BRR LL_LPUART_SetBaudRate
Parameters
LPUARTxLPUART Instance
PeriphClkPeripheral Clock
BaudRateBaud Rate
Return values
None

◆ LL_LPUART_SetBinaryDataLogic()

__STATIC_INLINE void LL_LPUART_SetBinaryDataLogic ( USART_TypeDef *  LPUARTx,
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_LPUART_SetBinaryDataLogic
Parameters
LPUARTxLPUART Instance
DataLogicThis parameter can be one of the following values:
  • LL_LPUART_BINARY_LOGIC_POSITIVE
  • LL_LPUART_BINARY_LOGIC_NEGATIVE
Return values
None

Definition at line 1151 of file stm32l4xx_ll_lpuart.h.

1152 {
1153  MODIFY_REG(LPUARTx->CR2, USART_CR2_DATAINV, DataLogic);
1154 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_SetDataWidth()

__STATIC_INLINE void LL_LPUART_SetDataWidth ( USART_TypeDef *  LPUARTx,
uint32_t  DataWidth 
)

Set Word length (nb of data bits, excluding start and stop bits) CR1 M LL_LPUART_SetDataWidth.

Parameters
LPUARTxLPUART Instance
DataWidthThis parameter can be one of the following values:
  • LL_LPUART_DATAWIDTH_7B
  • LL_LPUART_DATAWIDTH_8B
  • LL_LPUART_DATAWIDTH_9B
Return values
None

Definition at line 899 of file stm32l4xx_ll_lpuart.h.

900 {
901  MODIFY_REG(LPUARTx->CR1, USART_CR1_M, DataWidth);
902 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_SetHWFlowCtrl()

__STATIC_INLINE void LL_LPUART_SetHWFlowCtrl ( USART_TypeDef *  LPUARTx,
uint32_t  HardwareFlowControl 
)

Configure HW Flow Control mode (both CTS and RTS) CR3 RTSE LL_LPUART_SetHWFlowCtrl
CR3 CTSE LL_LPUART_SetHWFlowCtrl.

Parameters
LPUARTxLPUART Instance
HardwareFlowControlThis parameter can be one of the following values:
  • LL_LPUART_HWCONTROL_NONE
  • LL_LPUART_HWCONTROL_RTS
  • LL_LPUART_HWCONTROL_CTS
  • LL_LPUART_HWCONTROL_RTS_CTS
Return values
None

Definition at line 1313 of file stm32l4xx_ll_lpuart.h.

1314 {
1315  MODIFY_REG(LPUARTx->CR3, USART_CR3_RTSE | USART_CR3_CTSE, HardwareFlowControl);
1316 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_SetParity()

__STATIC_INLINE void LL_LPUART_SetParity ( USART_TypeDef *  LPUARTx,
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 (depending on data width) and parity is checked on the received data. CR1 PS LL_LPUART_SetParity
CR1 PCE LL_LPUART_SetParity
Parameters
LPUARTxLPUART Instance
ParityThis parameter can be one of the following values:
  • LL_LPUART_PARITY_NONE
  • LL_LPUART_PARITY_EVEN
  • LL_LPUART_PARITY_ODD
Return values
None

Definition at line 842 of file stm32l4xx_ll_lpuart.h.

843 {
844  MODIFY_REG(LPUARTx->CR1, USART_CR1_PS | USART_CR1_PCE, Parity);
845 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_SetPrescaler()

__STATIC_INLINE void LL_LPUART_SetPrescaler ( USART_TypeDef *  LPUARTx,
uint32_t  PrescalerValue 
)

Configure Clock source prescaler for baudrate generator and oversampling PRESC PRESCALER LL_LPUART_SetPrescaler.

Parameters
LPUARTxLPUART Instance
PrescalerValueThis parameter can be one of the following values:
  • LL_LPUART_PRESCALER_DIV1
  • LL_LPUART_PRESCALER_DIV2
  • LL_LPUART_PRESCALER_DIV4
  • LL_LPUART_PRESCALER_DIV6
  • LL_LPUART_PRESCALER_DIV8
  • LL_LPUART_PRESCALER_DIV10
  • LL_LPUART_PRESCALER_DIV12
  • LL_LPUART_PRESCALER_DIV16
  • LL_LPUART_PRESCALER_DIV32
  • LL_LPUART_PRESCALER_DIV64
  • LL_LPUART_PRESCALER_DIV128
  • LL_LPUART_PRESCALER_DIV256
Return values
None

Definition at line 971 of file stm32l4xx_ll_lpuart.h.

972 {
973  MODIFY_REG(LPUARTx->PRESC, USART_PRESC_PRESCALER, (uint16_t)PrescalerValue);
974 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_SetRXFIFOThreshold()

__STATIC_INLINE void LL_LPUART_SetRXFIFOThreshold ( USART_TypeDef *  LPUARTx,
uint32_t  Threshold 
)

Configure RX FIFO Threshold CR3 RXFTCFG LL_LPUART_SetRXFIFOThreshold.

Parameters
LPUARTxLPUART Instance
ThresholdThis parameter can be one of the following values:
  • LL_LPUART_FIFOTHRESHOLD_1_8
  • LL_LPUART_FIFOTHRESHOLD_1_4
  • LL_LPUART_FIFOTHRESHOLD_1_2
  • LL_LPUART_FIFOTHRESHOLD_3_4
  • LL_LPUART_FIFOTHRESHOLD_7_8
  • LL_LPUART_FIFOTHRESHOLD_8_8
Return values
None

Definition at line 627 of file stm32l4xx_ll_lpuart.h.

628 {
629  MODIFY_REG(LPUARTx->CR3, USART_CR3_RXFTCFG, Threshold << USART_CR3_RXFTCFG_Pos);
630 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_SetRXPinLevel()

__STATIC_INLINE void LL_LPUART_SetRXPinLevel ( USART_TypeDef *  LPUARTx,
uint32_t  PinInvMethod 
)

Configure RX pin active level logic CR2 RXINV LL_LPUART_SetRXPinLevel.

Parameters
LPUARTxLPUART Instance
PinInvMethodThis parameter can be one of the following values:
  • LL_LPUART_RXPIN_LEVEL_STANDARD
  • LL_LPUART_RXPIN_LEVEL_INVERTED
Return values
None

Definition at line 1094 of file stm32l4xx_ll_lpuart.h.

1095 {
1096  MODIFY_REG(LPUARTx->CR2, USART_CR2_RXINV, PinInvMethod);
1097 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_SetStopBitsLength()

__STATIC_INLINE void LL_LPUART_SetStopBitsLength ( USART_TypeDef *  LPUARTx,
uint32_t  StopBits 
)

Set the length of the stop bits CR2 STOP LL_LPUART_SetStopBitsLength.

Parameters
LPUARTxLPUART Instance
StopBitsThis parameter can be one of the following values:
  • LL_LPUART_STOPBITS_1
  • LL_LPUART_STOPBITS_2
Return values
None

Definition at line 1009 of file stm32l4xx_ll_lpuart.h.

1010 {
1011  MODIFY_REG(LPUARTx->CR2, USART_CR2_STOP, StopBits);
1012 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_SetTransferBitOrder()

__STATIC_INLINE void LL_LPUART_SetTransferBitOrder ( USART_TypeDef *  LPUARTx,
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_LPUART_SetTransferBitOrder
Parameters
LPUARTxLPUART Instance
BitOrderThis parameter can be one of the following values:
  • LL_LPUART_BITORDER_LSBFIRST
  • LL_LPUART_BITORDER_MSBFIRST
Return values
None

Definition at line 1180 of file stm32l4xx_ll_lpuart.h.

1181 {
1182  MODIFY_REG(LPUARTx->CR2, USART_CR2_MSBFIRST, BitOrder);
1183 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_SetTransferDirection()

__STATIC_INLINE void LL_LPUART_SetTransferDirection ( USART_TypeDef *  LPUARTx,
uint32_t  TransferDirection 
)

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

Parameters
LPUARTxLPUART Instance
TransferDirectionThis parameter can be one of the following values:
  • LL_LPUART_DIRECTION_NONE
  • LL_LPUART_DIRECTION_RX
  • LL_LPUART_DIRECTION_TX
  • LL_LPUART_DIRECTION_TX_RX
Return values
None

Definition at line 807 of file stm32l4xx_ll_lpuart.h.

808 {
809  MODIFY_REG(LPUARTx->CR1, USART_CR1_RE | USART_CR1_TE, TransferDirection);
810 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_SetTXFIFOThreshold()

__STATIC_INLINE void LL_LPUART_SetTXFIFOThreshold ( USART_TypeDef *  LPUARTx,
uint32_t  Threshold 
)

Configure TX FIFO Threshold CR3 TXFTCFG LL_LPUART_SetTXFIFOThreshold.

Parameters
LPUARTxLPUART Instance
ThresholdThis parameter can be one of the following values:
  • LL_LPUART_FIFOTHRESHOLD_1_8
  • LL_LPUART_FIFOTHRESHOLD_1_4
  • LL_LPUART_FIFOTHRESHOLD_1_2
  • LL_LPUART_FIFOTHRESHOLD_3_4
  • LL_LPUART_FIFOTHRESHOLD_7_8
  • LL_LPUART_FIFOTHRESHOLD_8_8
Return values
None

Definition at line 592 of file stm32l4xx_ll_lpuart.h.

593 {
594  MODIFY_REG(LPUARTx->CR3, USART_CR3_TXFTCFG, Threshold << USART_CR3_TXFTCFG_Pos);
595 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_SetTXPinLevel()

__STATIC_INLINE void LL_LPUART_SetTXPinLevel ( USART_TypeDef *  LPUARTx,
uint32_t  PinInvMethod 
)

Configure TX pin active level logic CR2 TXINV LL_LPUART_SetTXPinLevel.

Parameters
LPUARTxLPUART Instance
PinInvMethodThis parameter can be one of the following values:
  • LL_LPUART_TXPIN_LEVEL_STANDARD
  • LL_LPUART_TXPIN_LEVEL_INVERTED
Return values
None

Definition at line 1121 of file stm32l4xx_ll_lpuart.h.

1122 {
1123  MODIFY_REG(LPUARTx->CR2, USART_CR2_TXINV, PinInvMethod);
1124 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_SetTXRXSwap()

__STATIC_INLINE void LL_LPUART_SetTXRXSwap ( USART_TypeDef *  LPUARTx,
uint32_t  SwapConfig 
)

Configure TX/RX pins swapping setting. CR2 SWAP LL_LPUART_SetTXRXSwap.

Parameters
LPUARTxLPUART Instance
SwapConfigThis parameter can be one of the following values:
  • LL_LPUART_TXRX_STANDARD
  • LL_LPUART_TXRX_SWAPPED
Return values
None

Definition at line 1067 of file stm32l4xx_ll_lpuart.h.

1068 {
1069  MODIFY_REG(LPUARTx->CR2, USART_CR2_SWAP, SwapConfig);
1070 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_SetWakeUpMethod()

__STATIC_INLINE void LL_LPUART_SetWakeUpMethod ( USART_TypeDef *  LPUARTx,
uint32_t  Method 
)

Set Receiver Wake Up method from Mute mode. CR1 WAKE LL_LPUART_SetWakeUpMethod.

Parameters
LPUARTxLPUART Instance
MethodThis parameter can be one of the following values:
  • LL_LPUART_WAKEUP_IDLELINE
  • LL_LPUART_WAKEUP_ADDRESSMARK
Return values
None

Definition at line 871 of file stm32l4xx_ll_lpuart.h.

872 {
873  MODIFY_REG(LPUARTx->CR1, USART_CR1_WAKE, Method);
874 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_LPUART_SetWKUPType()

__STATIC_INLINE void LL_LPUART_SetWKUPType ( USART_TypeDef *  LPUARTx,
uint32_t  Type 
)

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

Parameters
LPUARTxLPUART Instance
TypeThis parameter can be one of the following values:
  • LL_LPUART_WAKEUP_ON_ADDRESS
  • LL_LPUART_WAKEUP_ON_STARTBIT
  • LL_LPUART_WAKEUP_ON_RXNE
Return values
None

Definition at line 1377 of file stm32l4xx_ll_lpuart.h.

1378 {
1379  MODIFY_REG(LPUARTx->CR3, USART_CR3_WUS, Type);
1380 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ return()

return ( brrresult  )

Variable Documentation

◆ BaudRate

__STATIC_INLINE void uint32_t uint32_t BaudRate
Initial value:
{
#if defined(USART_PRESC_PRESCALER)
LPUARTx->BRR = __LL_LPUART_DIV(PeriphClk, PrescalerValue, BaudRate)

Definition at line 1433 of file stm32l4xx_ll_lpuart.h.

◆ BRR

LPUARTx BRR = __LL_LPUART_DIV(PeriphClk, BaudRate)

Definition at line 1437 of file stm32l4xx_ll_lpuart.h.

◆ brrresult

register uint32_t brrresult

Definition at line 1472 of file stm32l4xx_ll_lpuart.h.

◆ else

else
Initial value:
{
brrresult = 0x0UL
register uint32_t brrresult

Definition at line 1488 of file stm32l4xx_ll_lpuart.h.

◆ lpuartdiv

lpuartdiv = LPUARTx->BRR & LPUART_BRR_MASK

Definition at line 1477 of file stm32l4xx_ll_lpuart.h.

◆ PeriphClk

__STATIC_INLINE uint32_t uint32_t PeriphClk
Initial value:
{
register uint32_t lpuartdiv

Definition at line 1431 of file stm32l4xx_ll_lpuart.h.

◆ periphclkpresc

register uint32_t periphclkpresc = (uint32_t)(PeriphClk / (LPUART_PRESCALER_TAB[(uint16_t)PrescalerValue]))

Definition at line 1474 of file stm32l4xx_ll_lpuart.h.