STM32F103xB HAL User Manual
Defines
USART Private Macros
USART

Defines

#define IS_USART_NACK_STATE(NACK)
#define IS_USART_LASTBIT(LASTBIT)
#define IS_USART_PHASE(CPHA)
#define IS_USART_POLARITY(CPOL)
#define IS_USART_CLOCK(CLOCK)
#define IS_USART_WORD_LENGTH(LENGTH)
#define IS_USART_STOPBITS(STOPBITS)
#define IS_USART_PARITY(PARITY)
#define IS_USART_MODE(MODE)   ((((MODE) & (~((uint32_t)USART_MODE_TX_RX))) == 0x00U) && ((MODE) != 0x00U))
#define IS_USART_BAUDRATE(BAUDRATE)   ((BAUDRATE) <= 4500000U)
#define USART_DIV(_PCLK_, _BAUD_)   (((_PCLK_)*25U)/(4U*(_BAUD_)))
#define USART_DIVMANT(_PCLK_, _BAUD_)   (USART_DIV((_PCLK_), (_BAUD_))/100U)
#define USART_DIVFRAQ(_PCLK_, _BAUD_)   ((((USART_DIV((_PCLK_), (_BAUD_)) - (USART_DIVMANT((_PCLK_), (_BAUD_)) * 100U)) * 16U) + 50U) / 100U)
#define USART_BRR(_PCLK_, _BAUD_)

Define Documentation

#define IS_USART_BAUDRATE (   BAUDRATE)    ((BAUDRATE) <= 4500000U)

Definition at line 604 of file stm32f1xx_hal_usart.h.

Referenced by USART_SetConfig().

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

Definition at line 587 of file stm32f1xx_hal_usart.h.

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

Definition at line 578 of file stm32f1xx_hal_usart.h.

Referenced by USART_SetConfig().

#define IS_USART_MODE (   MODE)    ((((MODE) & (~((uint32_t)USART_MODE_TX_RX))) == 0x00U) && ((MODE) != 0x00U))

Definition at line 602 of file stm32f1xx_hal_usart.h.

Referenced by USART_SetConfig().

#define IS_USART_NACK_STATE (   NACK)
Value:
(((NACK) == USART_NACK_ENABLE) || \
                                      ((NACK) == USART_NACK_DISABLE))

Definition at line 575 of file stm32f1xx_hal_usart.h.

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

Definition at line 598 of file stm32f1xx_hal_usart.h.

Referenced by USART_SetConfig().

#define IS_USART_PHASE (   CPHA)
Value:
(((CPHA) == USART_PHASE_1EDGE) || \
                                      ((CPHA) == USART_PHASE_2EDGE))

Definition at line 581 of file stm32f1xx_hal_usart.h.

Referenced by USART_SetConfig().

#define IS_USART_POLARITY (   CPOL)
Value:
(((CPOL) == USART_POLARITY_LOW) || \
                                      ((CPOL) == USART_POLARITY_HIGH))

Definition at line 584 of file stm32f1xx_hal_usart.h.

Referenced by USART_SetConfig().

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

Definition at line 593 of file stm32f1xx_hal_usart.h.

Referenced by USART_SetConfig().

#define IS_USART_WORD_LENGTH (   LENGTH)
Value:
(((LENGTH) == USART_WORDLENGTH_8B) || \
                                      ((LENGTH) == USART_WORDLENGTH_9B))

Definition at line 590 of file stm32f1xx_hal_usart.h.

Referenced by USART_SetConfig().

#define USART_BRR (   _PCLK_,
  _BAUD_ 
)
Value:
(((USART_DIVMANT((_PCLK_), (_BAUD_)) << 4U) + \
                                        ((USART_DIVFRAQ((_PCLK_), (_BAUD_)) & 0xF0U) << 1U)) + \
                                         (USART_DIVFRAQ((_PCLK_), (_BAUD_)) & 0x0FU))

Definition at line 615 of file stm32f1xx_hal_usart.h.

Referenced by USART_SetConfig().

#define USART_DIV (   _PCLK_,
  _BAUD_ 
)    (((_PCLK_)*25U)/(4U*(_BAUD_)))

Definition at line 606 of file stm32f1xx_hal_usart.h.

#define USART_DIVFRAQ (   _PCLK_,
  _BAUD_ 
)    ((((USART_DIV((_PCLK_), (_BAUD_)) - (USART_DIVMANT((_PCLK_), (_BAUD_)) * 100U)) * 16U) + 50U) / 100U)

Definition at line 610 of file stm32f1xx_hal_usart.h.

#define USART_DIVMANT (   _PCLK_,
  _BAUD_ 
)    (USART_DIV((_PCLK_), (_BAUD_))/100U)

Definition at line 608 of file stm32f1xx_hal_usart.h.