My Project
Loading...
Searching...
No Matches
UARTEx Private Macros

Macros

#define UART_GETCLOCKSOURCE(__HANDLE__, __CLOCKSOURCE__)
 Report the UART clock source.
 
#define UART_MASK_COMPUTATION(__HANDLE__)
 Report the UART mask to apply to retrieve the received data according to the word length and to the parity bits activation.
 
#define IS_UART_WORD_LENGTH(__LENGTH__)
 Ensure that UART frame length is valid.
 
#define IS_UART_ADDRESSLENGTH_DETECT(__ADDRESS__)
 Ensure that UART wake-up address length is valid.
 

Detailed Description

Macro Definition Documentation

◆ IS_UART_ADDRESSLENGTH_DETECT

#define IS_UART_ADDRESSLENGTH_DETECT (   __ADDRESS__)
Value:
(((__ADDRESS__) == UART_ADDRESS_DETECT_4B) || \
((__ADDRESS__) == UART_ADDRESS_DETECT_7B))
#define UART_ADDRESS_DETECT_7B
Definition: stm32f3xx_hal_uart_ex.h:88
#define UART_ADDRESS_DETECT_4B
Definition: stm32f3xx_hal_uart_ex.h:87

Ensure that UART wake-up address length is valid.

Parameters
__ADDRESS__UART wake-up address length.
Return values
SET(ADDRESS is valid) or RESET (ADDRESS is invalid)

◆ IS_UART_WORD_LENGTH

#define IS_UART_WORD_LENGTH (   __LENGTH__)
Value:
(((__LENGTH__) == UART_WORDLENGTH_8B) || \
((__LENGTH__) == UART_WORDLENGTH_9B))
#define UART_WORDLENGTH_8B
Definition: stm32f3xx_hal_uart_ex.h:74
#define UART_WORDLENGTH_9B
Definition: stm32f3xx_hal_uart_ex.h:78

Ensure that UART frame length is valid.

Parameters
__LENGTH__UART frame length.
Return values
SET(LENGTH is valid) or RESET (LENGTH is invalid)

◆ UART_GETCLOCKSOURCE

#define UART_GETCLOCKSOURCE (   __HANDLE__,
  __CLOCKSOURCE__ 
)

Report the UART clock source.

Parameters
__HANDLE__specifies the UART Handle.
__CLOCKSOURCE__output variable.
Return values
UARTclocking source, written in CLOCKSOURCE.

◆ UART_MASK_COMPUTATION

#define UART_MASK_COMPUTATION (   __HANDLE__)
Value:
do { \
if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_9B) \
{ \
if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \
{ \
(__HANDLE__)->Mask = 0x01FFU ; \
} \
else \
{ \
(__HANDLE__)->Mask = 0x00FFU ; \
} \
} \
else if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_8B) \
{ \
if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \
{ \
(__HANDLE__)->Mask = 0x00FFU ; \
} \
else \
{ \
(__HANDLE__)->Mask = 0x007FU ; \
} \
} \
else \
{ \
(__HANDLE__)->Mask = 0x0000U; \
} \
} while(0U)
#define UART_PARITY_NONE
Definition: stm32f3xx_hal_uart.h:369

Report the UART mask to apply to retrieve the received data according to the word length and to the parity bits activation.

Note
If PCE = 1, the parity bit is not included in the data extracted by the reception API(). This masking operation is not carried out in the case of DMA transfers.
Parameters
__HANDLE__specifies the UART Handle.
Return values
None,themask to apply to UART RDR register is stored in (HANDLE)->Mask field.