STM32H735xx HAL User Manual
Defines
USART Private Macros
USART

Defines

#define USART_GET_DIV_FACTOR(__CLOCKPRESCALER__)
 Get USART clock division factor from clock prescaler value.
#define USART_DIV_SAMPLING8(__PCLK__, __BAUD__, __CLOCKPRESCALER__)
 BRR division operation to set BRR register in 8-bit oversampling mode.
#define USART_GETCLOCKSOURCE(__HANDLE__, __CLOCKSOURCE__)
 Report the USART clock source.
#define IS_USART_BAUDRATE(__BAUDRATE__)   ((__BAUDRATE__) <= 12500000U)
 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_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 IS_USART_PRESCALER(__CLOCKPRESCALER__)
 Ensure that USART Prescaler is valid.

Define Documentation

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

Check USART Baud rate.

Parameters:
__BAUDRATE__Baudrate specified by the user. The maximum Baud Rate is derived from the maximum clock on H7 (i.e. 100 MHz) divided by the smallest oversampling used on the USART (i.e. 8)
Return values:
SET(__BAUDRATE__ is valid) or RESET (__BAUDRATE__ is invalid)

Definition at line 993 of file stm32h7xx_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 1026 of file stm32h7xx_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 1048 of file stm32h7xx_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 1019 of file stm32h7xx_hal_usart.h.

Referenced by USART_SetConfig().

#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 1010 of file stm32h7xx_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 1041 of file stm32h7xx_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 1034 of file stm32h7xx_hal_usart.h.

Referenced by USART_SetConfig().

#define IS_USART_PRESCALER (   __CLOCKPRESCALER__)
Value:
(((__CLOCKPRESCALER__) == USART_PRESCALER_DIV1) || \
                                                ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV2) || \
                                                ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV4) || \
                                                ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV6) || \
                                                ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV8) || \
                                                ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV10) || \
                                                ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV12) || \
                                                ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV16) || \
                                                ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV32) || \
                                                ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV64) || \
                                                ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV128) || \
                                                ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV256))

Ensure that USART Prescaler is valid.

Parameters:
__CLOCKPRESCALER__USART Prescaler value.
Return values:
SET(__CLOCKPRESCALER__ is valid) or RESET (__CLOCKPRESCALER__ is invalid)

Definition at line 1064 of file stm32h7xx_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 1056 of file stm32h7xx_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 1000 of file stm32h7xx_hal_usart.h.

Referenced by USART_SetConfig().

#define USART_DIV_SAMPLING8 (   __PCLK__,
  __BAUD__,
  __CLOCKPRESCALER__ 
)
Value:
(((((__PCLK__)/USART_GET_DIV_FACTOR(__CLOCKPRESCALER__))*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.
__CLOCKPRESCALER__USART prescaler value.
Return values:
Divisionresult

Definition at line 718 of file stm32h7xx_hal_usart.h.

Referenced by USART_SetConfig().

#define USART_GET_DIV_FACTOR (   __CLOCKPRESCALER__)
Value:
(((__CLOCKPRESCALER__) == USART_PRESCALER_DIV1)   ? 1U :       \
   ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV2)   ? 2U :       \
   ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV4)   ? 4U :       \
   ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV6)   ? 6U :       \
   ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV8)   ? 8U :       \
   ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV10)  ? 10U :      \
   ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV12)  ? 12U :      \
   ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV16)  ? 16U :      \
   ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV32)  ? 32U :      \
   ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV64)  ? 64U :      \
   ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV128) ? 128U :     \
   ((__CLOCKPRESCALER__) == USART_PRESCALER_DIV256) ? 256U : 1U)

Get USART clock division factor from clock prescaler value.

Parameters:
__CLOCKPRESCALER__USART prescaler value.
Return values:
USARTclock division factor

Definition at line 698 of file stm32h7xx_hal_usart.h.

#define USART_GETCLOCKSOURCE (   __HANDLE__,
  __CLOCKSOURCE__ 
)

Report the USART clock source.

Parameters:
__HANDLE__specifies the USART Handle.
__CLOCKSOURCE__output variable.
Return values:
theUSART clocking source, written in __CLOCKSOURCE__.

Definition at line 728 of file stm32h7xx_hal_usart.h.

Referenced by USART_SetConfig().