STM32L486xx HAL User Manual
Defines
USART Private Macros
USART

Defines

#define USART_DIV_SAMPLING8(__PCLK__, __BAUD__)   ((((__PCLK__)*2U) + ((__BAUD__)/2U)) / (__BAUD__))
 BRR division operation to set BRR register in 8-bit oversampling mode.
#define IS_USART_BAUDRATE(__BAUDRATE__)   ((__BAUDRATE__) <= 10000000U)
 Check USART Baud rate.
#define IS_USART_STOPBITS(__STOPBITS__)
 Ensure that USART frame number of stop bits is valid.
#define IS_USART_PARITY(__PARITY__)
 Ensure that USART frame parity is valid.
#define IS_USART_MODE(__MODE__)   ((((__MODE__) & 0xFFFFFFF3U) == 0x00U) && ((__MODE__) != 0x00U))
 Ensure that USART communication mode is valid.
#define IS_USART_OVERSAMPLING(__SAMPLING__)
 Ensure that USART oversampling is valid.
#define IS_USART_CLOCK(__CLOCK__)
 Ensure that USART clock state is valid.
#define IS_USART_POLARITY(__CPOL__)   (((__CPOL__) == USART_POLARITY_LOW) || ((__CPOL__) == USART_POLARITY_HIGH))
 Ensure that USART frame polarity is valid.
#define IS_USART_PHASE(__CPHA__)   (((__CPHA__) == USART_PHASE_1EDGE) || ((__CPHA__) == USART_PHASE_2EDGE))
 Ensure that USART frame phase is valid.
#define IS_USART_LASTBIT(__LASTBIT__)
 Ensure that USART frame last bit clock pulse setting is valid.
#define IS_USART_REQUEST_PARAMETER(__PARAM__)
 Ensure that USART request parameter is valid.

Define Documentation

#define IS_USART_BAUDRATE (   __BAUDRATE__)    ((__BAUDRATE__) <= 10000000U)

Check USART Baud rate.

Parameters:
__BAUDRATE__Baudrate specified by the user. The maximum Baud Rate is derived from the maximum clock on L4 divided by the smallest oversampling used on the USART (i.e. 8) (i.e. 120 MHz on STM32L4Rx/L4Sx, 80 Mhz otherwise)
Return values:
SET(__BAUDRATE__ is valid) or RESET (__BAUDRATE__ is invalid)

Definition at line 782 of file stm32l4xx_hal_usart.h.

Referenced by USART_SetConfig().

#define IS_USART_CLOCK (   __CLOCK__)
Value:
(((__CLOCK__) == USART_CLOCK_DISABLE) || \
                                   ((__CLOCK__) == USART_CLOCK_ENABLE))

Ensure that USART clock state is valid.

Parameters:
__CLOCK__USART clock state.
Return values:
SET(__CLOCK__ is valid) or RESET (__CLOCK__ is invalid)

Definition at line 824 of file stm32l4xx_hal_usart.h.

#define IS_USART_LASTBIT (   __LASTBIT__)
Value:
(((__LASTBIT__) == USART_LASTBIT_DISABLE) || \
                                       ((__LASTBIT__) == USART_LASTBIT_ENABLE))

Ensure that USART frame last bit clock pulse setting is valid.

Parameters:
__LASTBIT__USART frame last bit clock pulse setting.
Return values:
SET(__LASTBIT__ is valid) or RESET (__LASTBIT__ is invalid)

Definition at line 846 of file stm32l4xx_hal_usart.h.

Referenced by USART_SetConfig().

#define IS_USART_MODE (   __MODE__)    ((((__MODE__) & 0xFFFFFFF3U) == 0x00U) && ((__MODE__) != 0x00U))

Ensure that USART communication mode is valid.

Parameters:
__MODE__USART communication mode.
Return values:
SET(__MODE__ is valid) or RESET (__MODE__ is invalid)

Definition at line 809 of file stm32l4xx_hal_usart.h.

Referenced by USART_SetConfig().

#define IS_USART_OVERSAMPLING (   __SAMPLING__)
Value:
(((__SAMPLING__) == USART_OVERSAMPLING_16) || \
                                             ((__SAMPLING__) == USART_OVERSAMPLING_8))

Ensure that USART oversampling is valid.

Parameters:
__SAMPLING__USART oversampling.
Return values:
SET(__SAMPLING__ is valid) or RESET (__SAMPLING__ is invalid)

Definition at line 816 of file stm32l4xx_hal_usart.h.

#define IS_USART_PARITY (   __PARITY__)
Value:
(((__PARITY__) == USART_PARITY_NONE) || \
                                     ((__PARITY__) == USART_PARITY_EVEN) || \
                                     ((__PARITY__) == USART_PARITY_ODD))

Ensure that USART frame parity is valid.

Parameters:
__PARITY__USART frame parity.
Return values:
SET(__PARITY__ is valid) or RESET (__PARITY__ is invalid)

Definition at line 800 of file stm32l4xx_hal_usart.h.

Referenced by USART_SetConfig().

#define IS_USART_PHASE (   __CPHA__)    (((__CPHA__) == USART_PHASE_1EDGE) || ((__CPHA__) == USART_PHASE_2EDGE))

Ensure that USART frame phase is valid.

Parameters:
__CPHA__USART frame phase.
Return values:
SET(__CPHA__ is valid) or RESET (__CPHA__ is invalid)

Definition at line 839 of file stm32l4xx_hal_usart.h.

Referenced by USART_SetConfig().

#define IS_USART_POLARITY (   __CPOL__)    (((__CPOL__) == USART_POLARITY_LOW) || ((__CPOL__) == USART_POLARITY_HIGH))

Ensure that USART frame polarity is valid.

Parameters:
__CPOL__USART frame polarity.
Return values:
SET(__CPOL__ is valid) or RESET (__CPOL__ is invalid)

Definition at line 832 of file stm32l4xx_hal_usart.h.

Referenced by USART_SetConfig().

#define IS_USART_REQUEST_PARAMETER (   __PARAM__)
Value:
(((__PARAM__) == USART_RXDATA_FLUSH_REQUEST) || \
                                               ((__PARAM__) == USART_TXDATA_FLUSH_REQUEST))

Ensure that USART request parameter is valid.

Parameters:
__PARAM__USART request parameter.
Return values:
SET(__PARAM__ is valid) or RESET (__PARAM__ is invalid)

Definition at line 854 of file stm32l4xx_hal_usart.h.

#define IS_USART_STOPBITS (   __STOPBITS__)
Value:
(((__STOPBITS__) == USART_STOPBITS_0_5) || \
                                         ((__STOPBITS__) == USART_STOPBITS_1)   || \
                                         ((__STOPBITS__) == USART_STOPBITS_1_5) || \
                                         ((__STOPBITS__) == USART_STOPBITS_2))

Ensure that USART frame number of stop bits is valid.

Parameters:
__STOPBITS__USART frame number of stop bits.
Return values:
SET(__STOPBITS__ is valid) or RESET (__STOPBITS__ is invalid)

Definition at line 790 of file stm32l4xx_hal_usart.h.

Referenced by USART_SetConfig().

#define USART_DIV_SAMPLING8 (   __PCLK__,
  __BAUD__ 
)    ((((__PCLK__)*2U) + ((__BAUD__)/2U)) / (__BAUD__))

BRR division operation to set BRR register in 8-bit oversampling mode.

Parameters:
__PCLK__USART clock.
__BAUD__Baud rate set by the user.
Return values:
Divisionresult

Definition at line 769 of file stm32l4xx_hal_usart.h.

Referenced by USART_SetConfig().