STM32L486xx HAL User Manual
Functions
Peripheral Control functions
UARTEx Exported Functions

Extended Peripheral Control functions. More...

Functions

HAL_StatusTypeDef HAL_UARTEx_EnableClockStopMode (UART_HandleTypeDef *huart)
 Keep UART Clock enabled when in Stop Mode.
HAL_StatusTypeDef HAL_UARTEx_DisableClockStopMode (UART_HandleTypeDef *huart)
 Disable UART Clock when in Stop Mode.
HAL_StatusTypeDef HAL_MultiProcessorEx_AddressLength_Set (UART_HandleTypeDef *huart, uint32_t AddressLength)
 By default in multiprocessor mode, when the wake up method is set to address mark, the UART handles only 4-bit long addresses detection; this API allows to enable longer addresses detection (6-, 7- or 8-bit long).
HAL_StatusTypeDef HAL_UARTEx_StopModeWakeUpSourceConfig (UART_HandleTypeDef *huart, UART_WakeUpTypeDef WakeUpSelection)
 Set Wakeup from Stop mode interrupt flag selection.
HAL_StatusTypeDef HAL_UARTEx_EnableStopMode (UART_HandleTypeDef *huart)
 Enable UART Stop Mode.
HAL_StatusTypeDef HAL_UARTEx_DisableStopMode (UART_HandleTypeDef *huart)
 Disable UART Stop Mode.

Detailed Description

Extended Peripheral Control functions.

 ===============================================================================
                      ##### Peripheral Control functions #####
 ===============================================================================
    [..] This section provides the following functions:
     (+) HAL_UARTEx_EnableClockStopMode() API enables the UART clock (HSI or LSE only) during stop mode
     (+) HAL_UARTEx_DisableClockStopMode() API disables the above functionality
     (+) HAL_MultiProcessorEx_AddressLength_Set() API optionally sets the UART node address
         detection length to more than 4 bits for multiprocessor address mark wake up.
     (+) HAL_UARTEx_StopModeWakeUpSourceConfig() API defines the wake-up from stop mode
         trigger: address match, Start Bit detection or RXNE bit status.
     (+) HAL_UARTEx_EnableStopMode() API enables the UART to wake up the MCU from stop mode
     (+) HAL_UARTEx_DisableStopMode() API disables the above functionality
     (+) HAL_UARTEx_WakeupCallback() called upon UART wakeup interrupt
     (+) HAL_UARTEx_EnableFifoMode() API enables the FIFO mode
     (+) HAL_UARTEx_DisableFifoMode() API disables the FIFO mode
     (+) HAL_UARTEx_SetTxFifoThreshold() API sets the TX FIFO threshold
     (+) HAL_UARTEx_SetRxFifoThreshold() API sets the RX FIFO threshold


Function Documentation

HAL_StatusTypeDef HAL_MultiProcessorEx_AddressLength_Set ( UART_HandleTypeDef huart,
uint32_t  AddressLength 
)

By default in multiprocessor mode, when the wake up method is set to address mark, the UART handles only 4-bit long addresses detection; this API allows to enable longer addresses detection (6-, 7- or 8-bit long).

Note:
Addresses detection lengths are: 6-bit address detection in 7-bit data mode, 7-bit address detection in 8-bit data mode, 8-bit address detection in 9-bit data mode.
Parameters:
huartUART handle.
AddressLengthThis parameter can be one of the following values:
Return values:
HALstatus

Definition at line 420 of file stm32l4xx_hal_uart_ex.c.

References __HAL_UART_DISABLE, __HAL_UART_ENABLE, assert_param, __UART_HandleTypeDef::gState, HAL_UART_STATE_BUSY, __UART_HandleTypeDef::Instance, IS_UART_ADDRESSLENGTH_DETECT, and UART_CheckIdleState().

HAL_StatusTypeDef HAL_UARTEx_DisableClockStopMode ( UART_HandleTypeDef huart)

Disable UART Clock when in Stop Mode.

Parameters:
huartUART handle.
Return values:
HALstatus

Definition at line 392 of file stm32l4xx_hal_uart_ex.c.

References __UART_HandleTypeDef::Instance.

HAL_StatusTypeDef HAL_UARTEx_DisableStopMode ( UART_HandleTypeDef huart)

Disable UART Stop Mode.

Parameters:
huartUART handle.
Return values:
HALstatus

Definition at line 534 of file stm32l4xx_hal_uart_ex.c.

References __UART_HandleTypeDef::Instance.

HAL_StatusTypeDef HAL_UARTEx_EnableClockStopMode ( UART_HandleTypeDef huart)

Keep UART Clock enabled when in Stop Mode.

Note:
When the USART clock source is configured to be LSE or HSI, it is possible to keep enabled this clock during STOP mode by setting the UCESM bit in USART_CR3 control register.
When LPUART is used to wakeup from stop with LSE is selected as LPUART clock source, and desired baud rate is 9600 baud, the bit UCESM bit in LPUART_CR3 control register must be set.
Parameters:
huartUART handle.
Return values:
HALstatus

Definition at line 373 of file stm32l4xx_hal_uart_ex.c.

References __UART_HandleTypeDef::Instance.

HAL_StatusTypeDef HAL_UARTEx_EnableStopMode ( UART_HandleTypeDef huart)

Enable UART Stop Mode.

Note:
The UART is able to wake up the MCU from Stop 1 mode as long as UART clock is HSI or LSE.
Parameters:
huartUART handle.
Return values:
HALstatus

Definition at line 515 of file stm32l4xx_hal_uart_ex.c.

References __UART_HandleTypeDef::Instance.

HAL_StatusTypeDef HAL_UARTEx_StopModeWakeUpSourceConfig ( UART_HandleTypeDef huart,
UART_WakeUpTypeDef  WakeUpSelection 
)

Set Wakeup from Stop mode interrupt flag selection.

Note:
It is the application responsibility to enable the interrupt used as usart_wkup interrupt source before entering low-power mode.
Parameters:
huartUART handle.
WakeUpSelectionAddress match, Start Bit detection or RXNE/RXFNE bit status. This parameter can be one of the following values:
Return values:
HALstatus

Definition at line 459 of file stm32l4xx_hal_uart_ex.c.

References __HAL_UART_DISABLE, __HAL_UART_ENABLE, assert_param, __UART_HandleTypeDef::gState, HAL_GetTick(), HAL_UART_STATE_BUSY, HAL_UART_STATE_READY, HAL_UART_TIMEOUT_VALUE, __UART_HandleTypeDef::Instance, IS_UART_WAKEUP_SELECTION, UART_WaitOnFlagUntilTimeout(), UART_WAKEUP_ON_ADDRESS, UARTEx_Wakeup_AddressConfig(), and UART_WakeUpTypeDef::WakeUpEvent.