STM32H735xx HAL User Manual
Defines
UART Exported Macros
UART

Defines

#define __HAL_UART_RESET_HANDLE_STATE(__HANDLE__)
 Reset UART handle states.
#define __HAL_UART_FLUSH_DRREGISTER(__HANDLE__)
 Flush the UART Data registers.
#define __HAL_UART_CLEAR_FLAG(__HANDLE__, __FLAG__)   ((__HANDLE__)->Instance->ICR = (__FLAG__))
 Clear the specified UART pending flag.
#define __HAL_UART_CLEAR_PEFLAG(__HANDLE__)   __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_PEF)
 Clear the UART PE pending flag.
#define __HAL_UART_CLEAR_FEFLAG(__HANDLE__)   __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_FEF)
 Clear the UART FE pending flag.
#define __HAL_UART_CLEAR_NEFLAG(__HANDLE__)   __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_NEF)
 Clear the UART NE pending flag.
#define __HAL_UART_CLEAR_OREFLAG(__HANDLE__)   __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_OREF)
 Clear the UART ORE pending flag.
#define __HAL_UART_CLEAR_IDLEFLAG(__HANDLE__)   __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_IDLEF)
 Clear the UART IDLE pending flag.
#define __HAL_UART_CLEAR_TXFECF(__HANDLE__)   __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_TXFECF)
 Clear the UART TX FIFO empty clear flag.
#define __HAL_UART_GET_FLAG(__HANDLE__, __FLAG__)   (((__HANDLE__)->Instance->ISR & (__FLAG__)) == (__FLAG__))
 Check whether the specified UART flag is set or not.
#define __HAL_UART_ENABLE_IT(__HANDLE__, __INTERRUPT__)
 Enable the specified UART interrupt.
#define __HAL_UART_DISABLE_IT(__HANDLE__, __INTERRUPT__)
 Disable the specified UART interrupt.
#define __HAL_UART_GET_IT(__HANDLE__, __INTERRUPT__)
 Check whether the specified UART interrupt has occurred or not.
#define __HAL_UART_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)
 Check whether the specified UART interrupt source is enabled or not.
#define __HAL_UART_CLEAR_IT(__HANDLE__, __IT_CLEAR__)   ((__HANDLE__)->Instance->ICR = (uint32_t)(__IT_CLEAR__))
 Clear the specified UART ISR flag, in setting the proper ICR register flag.
#define __HAL_UART_SEND_REQ(__HANDLE__, __REQ__)   ((__HANDLE__)->Instance->RQR |= (uint16_t)(__REQ__))
 Set a specific UART request flag.
#define __HAL_UART_ONE_BIT_SAMPLE_ENABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR3|= USART_CR3_ONEBIT)
 Enable the UART one bit sample method.
#define __HAL_UART_ONE_BIT_SAMPLE_DISABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR3 &= ~USART_CR3_ONEBIT)
 Disable the UART one bit sample method.
#define __HAL_UART_ENABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE)
 Enable UART.
#define __HAL_UART_DISABLE(__HANDLE__)   ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE)
 Disable UART.
#define __HAL_UART_HWCONTROL_CTS_ENABLE(__HANDLE__)
 Enable CTS flow control.
#define __HAL_UART_HWCONTROL_CTS_DISABLE(__HANDLE__)
 Disable CTS flow control.
#define __HAL_UART_HWCONTROL_RTS_ENABLE(__HANDLE__)
 Enable RTS flow control.
#define __HAL_UART_HWCONTROL_RTS_DISABLE(__HANDLE__)
 Disable RTS flow control.

Define Documentation

#define __HAL_UART_CLEAR_FEFLAG (   __HANDLE__)    __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_FEF)

Clear the UART FE pending flag.

Parameters:
__HANDLE__specifies the UART Handle.
Return values:
None

Definition at line 889 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_CLEAR_FLAG (   __HANDLE__,
  __FLAG__ 
)    ((__HANDLE__)->Instance->ICR = (__FLAG__))

Clear the specified UART pending flag.

Parameters:
__HANDLE__specifies the UART Handle.
__FLAG__specifies the flag to check. This parameter can be any combination of the following values:
Return values:
None

Definition at line 877 of file stm32h7xx_hal_uart.h.

Referenced by HAL_UART_Abort(), HAL_UART_Abort_IT(), HAL_UART_AbortReceive(), HAL_UART_AbortReceive_IT(), HAL_UART_DMAResume(), HAL_UART_IRQHandler(), HAL_UART_Transmit_DMA(), HAL_UARTEx_ReceiveToIdle(), HAL_UARTEx_ReceiveToIdle_DMA(), HAL_UARTEx_ReceiveToIdle_IT(), UART_DMARxAbortCallback(), UART_DMARxOnlyAbortCallback(), UART_DMATxAbortCallback(), UART_RxISR_16BIT(), UART_RxISR_16BIT_FIFOEN(), UART_RxISR_8BIT(), UART_RxISR_8BIT_FIFOEN(), and UART_WaitOnFlagUntilTimeout().

#define __HAL_UART_CLEAR_IDLEFLAG (   __HANDLE__)    __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_IDLEF)

Clear the UART IDLE pending flag.

Parameters:
__HANDLE__specifies the UART Handle.
Return values:
None

Definition at line 907 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_CLEAR_IT (   __HANDLE__,
  __IT_CLEAR__ 
)    ((__HANDLE__)->Instance->ICR = (uint32_t)(__IT_CLEAR__))

Clear the specified UART ISR flag, in setting the proper ICR register flag.

Parameters:
__HANDLE__specifies the UART Handle.
__IT_CLEAR__specifies the interrupt clear register flag that needs to be set to clear the corresponding interrupt This parameter can be one of the following values:
Return values:
None

Definition at line 1091 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_CLEAR_NEFLAG (   __HANDLE__)    __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_NEF)

Clear the UART NE pending flag.

Parameters:
__HANDLE__specifies the UART Handle.
Return values:
None

Definition at line 895 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_CLEAR_OREFLAG (   __HANDLE__)    __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_OREF)

Clear the UART ORE pending flag.

Parameters:
__HANDLE__specifies the UART Handle.
Return values:
None

Definition at line 901 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_CLEAR_PEFLAG (   __HANDLE__)    __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_PEF)

Clear the UART PE pending flag.

Parameters:
__HANDLE__specifies the UART Handle.
Return values:
None

Definition at line 883 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_CLEAR_TXFECF (   __HANDLE__)    __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_TXFECF)

Clear the UART TX FIFO empty clear flag.

Parameters:
__HANDLE__specifies the UART Handle.
Return values:
None

Definition at line 913 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_DISABLE (   __HANDLE__)    ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE)
#define __HAL_UART_DISABLE_IT (   __HANDLE__,
  __INTERRUPT__ 
)
Value:
(\
                                                           ((((uint8_t)(__INTERRUPT__)) >> 5U) == 1U)?\
                                                           ((__HANDLE__)->Instance->CR1 &= ~ (1U <<\
                                                               ((__INTERRUPT__) & UART_IT_MASK))): \
                                                           ((((uint8_t)(__INTERRUPT__)) >> 5U) == 2U)?\
                                                           ((__HANDLE__)->Instance->CR2 &= ~ (1U <<\
                                                               ((__INTERRUPT__) & UART_IT_MASK))): \
                                                           ((__HANDLE__)->Instance->CR3 &= ~ (1U <<\
                                                               ((__INTERRUPT__) & UART_IT_MASK))))

Disable the specified UART interrupt.

Parameters:
__HANDLE__specifies the UART Handle.
__INTERRUPT__specifies the UART interrupt source to disable. This parameter can be one of the following values:
Return values:
None

Definition at line 1005 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_ENABLE (   __HANDLE__)    ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE)

Enable UART.

Parameters:
__HANDLE__specifies the UART Handle.
Return values:
None

Definition at line 1122 of file stm32h7xx_hal_uart.h.

Referenced by HAL_HalfDuplex_Init(), HAL_LIN_Init(), HAL_MultiProcessor_Init(), HAL_MultiProcessorEx_AddressLength_Set(), HAL_RS485Ex_Init(), HAL_UART_Init(), and HAL_UARTEx_StopModeWakeUpSourceConfig().

#define __HAL_UART_ENABLE_IT (   __HANDLE__,
  __INTERRUPT__ 
)
Value:
(\
                                                           ((((uint8_t)(__INTERRUPT__)) >> 5U) == 1U)?\
                                                           ((__HANDLE__)->Instance->CR1 |= (1U <<\
                                                               ((__INTERRUPT__) & UART_IT_MASK))): \
                                                           ((((uint8_t)(__INTERRUPT__)) >> 5U) == 2U)?\
                                                           ((__HANDLE__)->Instance->CR2 |= (1U <<\
                                                               ((__INTERRUPT__) & UART_IT_MASK))): \
                                                           ((__HANDLE__)->Instance->CR3 |= (1U <<\
                                                               ((__INTERRUPT__) & UART_IT_MASK))))

Enable the specified UART interrupt.

Parameters:
__HANDLE__specifies the UART Handle.
__INTERRUPT__specifies the UART interrupt source to enable. This parameter can be one of the following values:
Return values:
None

Definition at line 972 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_FLUSH_DRREGISTER (   __HANDLE__)
Value:
do{                \
    SET_BIT((__HANDLE__)->Instance->RQR, UART_RXDATA_FLUSH_REQUEST); \
    SET_BIT((__HANDLE__)->Instance->RQR, UART_TXDATA_FLUSH_REQUEST); \
  }  while(0U)

Flush the UART Data registers.

Parameters:
__HANDLE__specifies the UART Handle.
Return values:
None

Definition at line 853 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_GET_FLAG (   __HANDLE__,
  __FLAG__ 
)    (((__HANDLE__)->Instance->ISR & (__FLAG__)) == (__FLAG__))

Check whether the specified UART flag is set or not.

Parameters:
__HANDLE__specifies the UART Handle.
__FLAG__specifies the flag to check. This parameter can be one of the following values:
Return values:
Thenew state of __FLAG__ (TRUE or FALSE).

Definition at line 947 of file stm32h7xx_hal_uart.h.

Referenced by HAL_UARTEx_ReceiveToIdle(), UART_RxISR_16BIT(), UART_RxISR_16BIT_FIFOEN(), UART_RxISR_8BIT(), UART_RxISR_8BIT_FIFOEN(), and UART_WaitOnFlagUntilTimeout().

#define __HAL_UART_GET_IT (   __HANDLE__,
  __INTERRUPT__ 
)
Value:
((((__HANDLE__)->Instance->ISR\
                                                        & (1U << ((__INTERRUPT__)>> 8U))) != RESET) ? SET : RESET)

Check whether the specified UART interrupt has occurred or not.

Parameters:
__HANDLE__specifies the UART Handle.
__INTERRUPT__specifies the UART interrupt to check. This parameter can be one of the following values:
Return values:
Thenew state of __INTERRUPT__ (SET or RESET).

Definition at line 1038 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_GET_IT_SOURCE (   __HANDLE__,
  __INTERRUPT__ 
)
Value:
((((((((uint8_t)(__INTERRUPT__)) >> 5U) == 1U) ?\
                                                                (__HANDLE__)->Instance->CR1 : \
                                                                (((((uint8_t)(__INTERRUPT__)) >> 5U) == 2U) ?\
                                                                 (__HANDLE__)->Instance->CR2 : \
                                                                 (__HANDLE__)->Instance->CR3)) & (1U <<\
                                                                     (((uint16_t)(__INTERRUPT__)) &\
                                                                      UART_IT_MASK)))  != RESET) ? SET : RESET)

Check whether the specified UART interrupt source is enabled or not.

Parameters:
__HANDLE__specifies the UART Handle.
__INTERRUPT__specifies the UART interrupt source to check. This parameter can be one of the following values:
Return values:
Thenew state of __INTERRUPT__ (SET or RESET).

Definition at line 1064 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_HWCONTROL_CTS_DISABLE (   __HANDLE__)
Value:
do{                                                              \
    ATOMIC_CLEAR_BIT((__HANDLE__)->Instance->CR3, USART_CR3_CTSE); \
    (__HANDLE__)->Init.HwFlowCtl &= ~(USART_CR3_CTSE);             \
  } while(0U)

Disable CTS flow control.

Note:
This macro allows to disable CTS hardware flow control for a given UART instance, without need to call HAL_UART_Init() function. As involving direct access to UART registers, usage of this macro should be fully endorsed by user.
As macro is expected to be used for modifying CTS Hw flow control feature activation, without need for USART instance Deinit/Init, following conditions for macro call should be fulfilled :
Parameters:
__HANDLE__specifies the UART Handle.
Return values:
None

Definition at line 1162 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_HWCONTROL_CTS_ENABLE (   __HANDLE__)
Value:
do{                                                             \
    ATOMIC_SET_BIT((__HANDLE__)->Instance->CR3, USART_CR3_CTSE);  \
    (__HANDLE__)->Init.HwFlowCtl |= USART_CR3_CTSE;               \
  } while(0U)

Enable CTS flow control.

Note:
This macro allows to enable CTS hardware flow control for a given UART instance, without need to call HAL_UART_Init() function. As involving direct access to UART registers, usage of this macro should be fully endorsed by user.
As macro is expected to be used for modifying CTS Hw flow control feature activation, without need for USART instance Deinit/Init, following conditions for macro call should be fulfilled :
Parameters:
__HANDLE__specifies the UART Handle.
Return values:
None

Definition at line 1143 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_HWCONTROL_RTS_DISABLE (   __HANDLE__)
Value:
do{                                                             \
    ATOMIC_CLEAR_BIT((__HANDLE__)->Instance->CR3, USART_CR3_RTSE);\
    (__HANDLE__)->Init.HwFlowCtl &= ~(USART_CR3_RTSE);            \
  } while(0U)

Disable RTS flow control.

Note:
This macro allows to disable RTS hardware flow control for a given UART instance, without need to call HAL_UART_Init() function. As involving direct access to UART registers, usage of this macro should be fully endorsed by user.
As macro is expected to be used for modifying RTS Hw flow control feature activation, without need for USART instance Deinit/Init, following conditions for macro call should be fulfilled :
Parameters:
__HANDLE__specifies the UART Handle.
Return values:
None

Definition at line 1200 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_HWCONTROL_RTS_ENABLE (   __HANDLE__)
Value:
do{                                                            \
    ATOMIC_SET_BIT((__HANDLE__)->Instance->CR3, USART_CR3_RTSE); \
    (__HANDLE__)->Init.HwFlowCtl |= USART_CR3_RTSE;              \
  } while(0U)

Enable RTS flow control.

Note:
This macro allows to enable RTS hardware flow control for a given UART instance, without need to call HAL_UART_Init() function. As involving direct access to UART registers, usage of this macro should be fully endorsed by user.
As macro is expected to be used for modifying RTS Hw flow control feature activation, without need for USART instance Deinit/Init, following conditions for macro call should be fulfilled :
Parameters:
__HANDLE__specifies the UART Handle.
Return values:
None

Definition at line 1181 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_ONE_BIT_SAMPLE_DISABLE (   __HANDLE__)    ((__HANDLE__)->Instance->CR3 &= ~USART_CR3_ONEBIT)

Disable the UART one bit sample method.

Parameters:
__HANDLE__specifies the UART Handle.
Return values:
None

Definition at line 1116 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_ONE_BIT_SAMPLE_ENABLE (   __HANDLE__)    ((__HANDLE__)->Instance->CR3|= USART_CR3_ONEBIT)

Enable the UART one bit sample method.

Parameters:
__HANDLE__specifies the UART Handle.
Return values:
None

Definition at line 1110 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_RESET_HANDLE_STATE (   __HANDLE__)
Value:
do{                                                   \
                                                       (__HANDLE__)->gState = HAL_UART_STATE_RESET;      \
                                                       (__HANDLE__)->RxState = HAL_UART_STATE_RESET;     \
                                                       (__HANDLE__)->MspInitCallback = NULL;             \
                                                       (__HANDLE__)->MspDeInitCallback = NULL;           \
                                                     } while(0U)

Reset UART handle states.

Parameters:
__HANDLE__UART handle.
Return values:
None

Definition at line 836 of file stm32h7xx_hal_uart.h.

#define __HAL_UART_SEND_REQ (   __HANDLE__,
  __REQ__ 
)    ((__HANDLE__)->Instance->RQR |= (uint16_t)(__REQ__))

Set a specific UART request flag.

Parameters:
__HANDLE__specifies the UART Handle.
__REQ__specifies the request flag to set This parameter can be one of the following values:
Return values:
None

Definition at line 1104 of file stm32h7xx_hal_uart.h.

Referenced by HAL_LIN_SendBreak(), HAL_MultiProcessor_EnterMuteMode(), HAL_UART_Abort(), HAL_UART_Abort_IT(), HAL_UART_AbortReceive(), HAL_UART_AbortReceive_IT(), HAL_UART_AbortTransmit(), HAL_UART_AbortTransmit_IT(), UART_DMARxAbortCallback(), UART_DMARxOnlyAbortCallback(), UART_DMATxAbortCallback(), UART_DMATxOnlyAbortCallback(), UART_RxISR_16BIT(), UART_RxISR_16BIT_FIFOEN(), UART_RxISR_8BIT(), and UART_RxISR_8BIT_FIFOEN().