Prusa MINI Firmware overview
UART Private Macros
Collaboration diagram for UART Private Macros:

Macros

#define IS_UART_WORD_LENGTH(LENGTH)
 
#define IS_UART_LIN_WORD_LENGTH(LENGTH)   (((LENGTH) == UART_WORDLENGTH_8B))
 
#define IS_UART_STOPBITS(STOPBITS)
 
#define IS_UART_PARITY(PARITY)
 
#define IS_UART_HARDWARE_FLOW_CONTROL(CONTROL)
 
#define IS_UART_MODE(MODE)   ((((MODE) & 0x0000FFF3U) == 0x00U) && ((MODE) != 0x00U))
 
#define IS_UART_STATE(STATE)
 
#define IS_UART_OVERSAMPLING(SAMPLING)
 
#define IS_UART_LIN_OVERSAMPLING(SAMPLING)   (((SAMPLING) == UART_OVERSAMPLING_16))
 
#define IS_UART_LIN_BREAK_DETECT_LENGTH(LENGTH)
 
#define IS_UART_WAKEUPMETHOD(WAKEUP)
 
#define IS_UART_BAUDRATE(BAUDRATE)   ((BAUDRATE) < 10500001U)
 
#define IS_UART_ADDRESS(ADDRESS)   ((ADDRESS) <= 0x0FU)
 
#define UART_DIV_SAMPLING16(_PCLK_, _BAUD_)   (((_PCLK_)*25U)/(4U*(_BAUD_)))
 
#define UART_DIVMANT_SAMPLING16(_PCLK_, _BAUD_)   (UART_DIV_SAMPLING16((_PCLK_), (_BAUD_))/100U)
 
#define UART_DIVFRAQ_SAMPLING16(_PCLK_, _BAUD_)   (((UART_DIV_SAMPLING16((_PCLK_), (_BAUD_)) - (UART_DIVMANT_SAMPLING16((_PCLK_), (_BAUD_)) * 100U)) * 16U + 50U) / 100U)
 
#define UART_BRR_SAMPLING16(_PCLK_, _BAUD_)
 
#define UART_DIV_SAMPLING8(_PCLK_, _BAUD_)   (((_PCLK_)*25U)/(2U*(_BAUD_)))
 
#define UART_DIVMANT_SAMPLING8(_PCLK_, _BAUD_)   (UART_DIV_SAMPLING8((_PCLK_), (_BAUD_))/100U)
 
#define UART_DIVFRAQ_SAMPLING8(_PCLK_, _BAUD_)   (((UART_DIV_SAMPLING8((_PCLK_), (_BAUD_)) - (UART_DIVMANT_SAMPLING8((_PCLK_), (_BAUD_)) * 100U)) * 8U + 50U) / 100U)
 
#define UART_BRR_SAMPLING8(_PCLK_, _BAUD_)
 

Detailed Description

Macro Definition Documentation

◆ IS_UART_WORD_LENGTH

#define IS_UART_WORD_LENGTH (   LENGTH)
Value:

◆ IS_UART_LIN_WORD_LENGTH

#define IS_UART_LIN_WORD_LENGTH (   LENGTH)    (((LENGTH) == UART_WORDLENGTH_8B))

◆ IS_UART_STOPBITS

#define IS_UART_STOPBITS (   STOPBITS)
Value:
(((STOPBITS) == UART_STOPBITS_1) || \
((STOPBITS) == UART_STOPBITS_2))

◆ IS_UART_PARITY

#define IS_UART_PARITY (   PARITY)
Value:
(((PARITY) == UART_PARITY_NONE) || \
((PARITY) == UART_PARITY_EVEN) || \
((PARITY) == UART_PARITY_ODD))

◆ IS_UART_HARDWARE_FLOW_CONTROL

#define IS_UART_HARDWARE_FLOW_CONTROL (   CONTROL)
Value:
(((CONTROL) == UART_HWCONTROL_NONE) || \
((CONTROL) == UART_HWCONTROL_RTS) || \
((CONTROL) == UART_HWCONTROL_CTS) || \
((CONTROL) == UART_HWCONTROL_RTS_CTS))

◆ IS_UART_MODE

#define IS_UART_MODE (   MODE)    ((((MODE) & 0x0000FFF3U) == 0x00U) && ((MODE) != 0x00U))

◆ IS_UART_STATE

#define IS_UART_STATE (   STATE)
Value:
(((STATE) == UART_STATE_DISABLE) || \
((STATE) == UART_STATE_ENABLE))

◆ IS_UART_OVERSAMPLING

#define IS_UART_OVERSAMPLING (   SAMPLING)
Value:
(((SAMPLING) == UART_OVERSAMPLING_16) || \
((SAMPLING) == UART_OVERSAMPLING_8))

◆ IS_UART_LIN_OVERSAMPLING

#define IS_UART_LIN_OVERSAMPLING (   SAMPLING)    (((SAMPLING) == UART_OVERSAMPLING_16))

◆ IS_UART_LIN_BREAK_DETECT_LENGTH

#define IS_UART_LIN_BREAK_DETECT_LENGTH (   LENGTH)

◆ IS_UART_WAKEUPMETHOD

#define IS_UART_WAKEUPMETHOD (   WAKEUP)
Value:
(((WAKEUP) == UART_WAKEUPMETHOD_IDLELINE) || \

◆ IS_UART_BAUDRATE

#define IS_UART_BAUDRATE (   BAUDRATE)    ((BAUDRATE) < 10500001U)

◆ IS_UART_ADDRESS

#define IS_UART_ADDRESS (   ADDRESS)    ((ADDRESS) <= 0x0FU)

◆ UART_DIV_SAMPLING16

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

◆ UART_DIVMANT_SAMPLING16

#define UART_DIVMANT_SAMPLING16 (   _PCLK_,
  _BAUD_ 
)    (UART_DIV_SAMPLING16((_PCLK_), (_BAUD_))/100U)

◆ UART_DIVFRAQ_SAMPLING16

#define UART_DIVFRAQ_SAMPLING16 (   _PCLK_,
  _BAUD_ 
)    (((UART_DIV_SAMPLING16((_PCLK_), (_BAUD_)) - (UART_DIVMANT_SAMPLING16((_PCLK_), (_BAUD_)) * 100U)) * 16U + 50U) / 100U)

◆ UART_BRR_SAMPLING16

#define UART_BRR_SAMPLING16 (   _PCLK_,
  _BAUD_ 
)
Value:
(((UART_DIVMANT_SAMPLING16((_PCLK_), (_BAUD_)) << 4U) + \
(UART_DIVFRAQ_SAMPLING16((_PCLK_), (_BAUD_)) & 0xF0U)) + \
(UART_DIVFRAQ_SAMPLING16((_PCLK_), (_BAUD_)) & 0x0FU))

◆ UART_DIV_SAMPLING8

#define UART_DIV_SAMPLING8 (   _PCLK_,
  _BAUD_ 
)    (((_PCLK_)*25U)/(2U*(_BAUD_)))

◆ UART_DIVMANT_SAMPLING8

#define UART_DIVMANT_SAMPLING8 (   _PCLK_,
  _BAUD_ 
)    (UART_DIV_SAMPLING8((_PCLK_), (_BAUD_))/100U)

◆ UART_DIVFRAQ_SAMPLING8

#define UART_DIVFRAQ_SAMPLING8 (   _PCLK_,
  _BAUD_ 
)    (((UART_DIV_SAMPLING8((_PCLK_), (_BAUD_)) - (UART_DIVMANT_SAMPLING8((_PCLK_), (_BAUD_)) * 100U)) * 8U + 50U) / 100U)

◆ UART_BRR_SAMPLING8

#define UART_BRR_SAMPLING8 (   _PCLK_,
  _BAUD_ 
)
Value:
(((UART_DIVMANT_SAMPLING8((_PCLK_), (_BAUD_)) << 4U) + \
((UART_DIVFRAQ_SAMPLING8((_PCLK_), (_BAUD_)) & 0xF8U) << 1U)) + \
(UART_DIVFRAQ_SAMPLING8((_PCLK_), (_BAUD_)) & 0x07U))
UART_OVERSAMPLING_16
#define UART_OVERSAMPLING_16
Definition: stm32f4xx_hal_uart.h:276
UART_DIVFRAQ_SAMPLING8
#define UART_DIVFRAQ_SAMPLING8(_PCLK_, _BAUD_)
Definition: stm32f4xx_hal_uart.h:758
UART_HWCONTROL_NONE
#define UART_HWCONTROL_NONE
Definition: stm32f4xx_hal_uart.h:246
UART_DIVMANT_SAMPLING16
#define UART_DIVMANT_SAMPLING16(_PCLK_, _BAUD_)
Definition: stm32f4xx_hal_uart.h:748
UART_WORDLENGTH_9B
#define UART_WORDLENGTH_9B
Definition: stm32f4xx_hal_uart.h:219
UART_LINBREAKDETECTLENGTH_10B
#define UART_LINBREAKDETECTLENGTH_10B
Definition: stm32f4xx_hal_uart.h:285
UART_HWCONTROL_CTS
#define UART_HWCONTROL_CTS
Definition: stm32f4xx_hal_uart.h:248
UART_STATE_DISABLE
#define UART_STATE_DISABLE
Definition: stm32f4xx_hal_uart.h:267
UART_DIVMANT_SAMPLING8
#define UART_DIVMANT_SAMPLING8(_PCLK_, _BAUD_)
Definition: stm32f4xx_hal_uart.h:757
UART_WAKEUPMETHOD_ADDRESSMARK
#define UART_WAKEUPMETHOD_ADDRESSMARK
Definition: stm32f4xx_hal_uart.h:295
UART_PARITY_NONE
#define UART_PARITY_NONE
Definition: stm32f4xx_hal_uart.h:236
UART_HWCONTROL_RTS
#define UART_HWCONTROL_RTS
Definition: stm32f4xx_hal_uart.h:247
LENGTH
Definition: inflate.h:48
UART_DIVFRAQ_SAMPLING16
#define UART_DIVFRAQ_SAMPLING16(_PCLK_, _BAUD_)
Definition: stm32f4xx_hal_uart.h:749
UART_WAKEUPMETHOD_IDLELINE
#define UART_WAKEUPMETHOD_IDLELINE
Definition: stm32f4xx_hal_uart.h:294
UART_HWCONTROL_RTS_CTS
#define UART_HWCONTROL_RTS_CTS
Definition: stm32f4xx_hal_uart.h:249
UART_PARITY_EVEN
#define UART_PARITY_EVEN
Definition: stm32f4xx_hal_uart.h:237
UART_LINBREAKDETECTLENGTH_11B
#define UART_LINBREAKDETECTLENGTH_11B
Definition: stm32f4xx_hal_uart.h:286
UART_STOPBITS_1
#define UART_STOPBITS_1
Definition: stm32f4xx_hal_uart.h:227
UART_STOPBITS_2
#define UART_STOPBITS_2
Definition: stm32f4xx_hal_uart.h:228
UART_WORDLENGTH_8B
#define UART_WORDLENGTH_8B
Definition: stm32f4xx_hal_uart.h:218
UART_PARITY_ODD
#define UART_PARITY_ODD
Definition: stm32f4xx_hal_uart.h:238
UART_OVERSAMPLING_8
#define UART_OVERSAMPLING_8
Definition: stm32f4xx_hal_uart.h:277
UART_STATE_ENABLE
#define UART_STATE_ENABLE
Definition: stm32f4xx_hal_uart.h:268