RTEMS 6.1-rc5
Loading...
Searching...
No Matches
Macros

Macros

#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.
 

Detailed Description

Macro Definition Documentation

◆ IS_USART_BAUDRATE

#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)

◆ IS_USART_CLOCK

#define IS_USART_CLOCK (   __CLOCK__)
Value:
(((__CLOCK__) == USART_CLOCK_DISABLE) || \
((__CLOCK__) == USART_CLOCK_ENABLE))
#define USART_CLOCK_DISABLE
Definition: stm32h7xx_hal_usart.h:280
#define USART_CLOCK_ENABLE
Definition: stm32h7xx_hal_usart.h:281

Ensure that USART clock state is valid.

Parameters
__CLOCK__USART clock state.
Return values
SET(CLOCK is valid) or RESET (CLOCK is invalid)

◆ IS_USART_LASTBIT

#define IS_USART_LASTBIT (   __LASTBIT__)
Value:
(((__LASTBIT__) == USART_LASTBIT_DISABLE) || \
((__LASTBIT__) == USART_LASTBIT_ENABLE))
#define USART_LASTBIT_DISABLE
Definition: stm32h7xx_hal_usart.h:310
#define USART_LASTBIT_ENABLE
Definition: stm32h7xx_hal_usart.h:311

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)

◆ IS_USART_MODE

#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)

◆ IS_USART_PARITY

#define IS_USART_PARITY (   __PARITY__)
Value:
(((__PARITY__) == USART_PARITY_NONE) || \
((__PARITY__) == USART_PARITY_EVEN) || \
((__PARITY__) == USART_PARITY_ODD))
#define USART_PARITY_ODD
Definition: stm32h7xx_hal_usart.h:260
#define USART_PARITY_NONE
Definition: stm32h7xx_hal_usart.h:258
#define USART_PARITY_EVEN
Definition: stm32h7xx_hal_usart.h:259

Ensure that USART frame parity is valid.

Parameters
__PARITY__USART frame parity.
Return values
SET(PARITY is valid) or RESET (PARITY is invalid)

◆ IS_USART_PHASE

#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)

◆ IS_USART_POLARITY

#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)

◆ IS_USART_PRESCALER

#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))
#define USART_PRESCALER_DIV10
Definition: stm32h7xx_hal_usart.h:325
#define USART_PRESCALER_DIV128
Definition: stm32h7xx_hal_usart.h:330
#define USART_PRESCALER_DIV12
Definition: stm32h7xx_hal_usart.h:326
#define USART_PRESCALER_DIV1
Definition: stm32h7xx_hal_usart.h:320
#define USART_PRESCALER_DIV2
Definition: stm32h7xx_hal_usart.h:321
#define USART_PRESCALER_DIV64
Definition: stm32h7xx_hal_usart.h:329
#define USART_PRESCALER_DIV32
Definition: stm32h7xx_hal_usart.h:328
#define USART_PRESCALER_DIV256
Definition: stm32h7xx_hal_usart.h:331
#define USART_PRESCALER_DIV4
Definition: stm32h7xx_hal_usart.h:322
#define USART_PRESCALER_DIV8
Definition: stm32h7xx_hal_usart.h:324
#define USART_PRESCALER_DIV6
Definition: stm32h7xx_hal_usart.h:323
#define USART_PRESCALER_DIV16
Definition: stm32h7xx_hal_usart.h:327

Ensure that USART Prescaler is valid.

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

◆ IS_USART_REQUEST_PARAMETER

#define IS_USART_REQUEST_PARAMETER (   __PARAM__)
Value:
(((__PARAM__) == USART_RXDATA_FLUSH_REQUEST) || \
((__PARAM__) == USART_TXDATA_FLUSH_REQUEST))
#define USART_RXDATA_FLUSH_REQUEST
Definition: stm32h7xx_hal_usart.h:341
#define USART_TXDATA_FLUSH_REQUEST
Definition: stm32h7xx_hal_usart.h:342

Ensure that USART request parameter is valid.

Parameters
__PARAM__USART request parameter.
Return values
SET(PARAM is valid) or RESET (PARAM is invalid)

◆ IS_USART_STOPBITS

#define IS_USART_STOPBITS (   __STOPBITS__)
Value:
(((__STOPBITS__) == USART_STOPBITS_0_5) || \
((__STOPBITS__) == USART_STOPBITS_1) || \
((__STOPBITS__) == USART_STOPBITS_1_5) || \
((__STOPBITS__) == USART_STOPBITS_2))
#define USART_STOPBITS_1_5
Definition: stm32h7xx_hal_usart.h:248
#define USART_STOPBITS_1
Definition: stm32h7xx_hal_usart.h:247
#define USART_STOPBITS_0_5
Definition: stm32h7xx_hal_usart.h:246
#define USART_STOPBITS_2
Definition: stm32h7xx_hal_usart.h:249

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)

◆ USART_DIV_SAMPLING8

#define USART_DIV_SAMPLING8 (   __PCLK__,
  __BAUD__,
  __CLOCKPRESCALER__ 
)
Value:
(((((__PCLK__)/USART_GET_DIV_FACTOR(__CLOCKPRESCALER__))*2U)\
+ ((__BAUD__)/2U)) / (__BAUD__))
#define USART_GET_DIV_FACTOR(__CLOCKPRESCALER__)
Get USART clock division factor from clock prescaler value.
Definition: stm32h7xx_hal_usart.h:716

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

◆ USART_GET_DIV_FACTOR

#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

◆ USART_GETCLOCKSOURCE

#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.