MG32L003 Standard Peripherals Firmware Library

宏定义
Core register bit field macros
Defines and Type Definitions

Macros for use with bit field definitions (xxx_Pos, xxx_Msk). 更多...

## 宏定义
#define | _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk)
| Mask and shift a bit field value for use in a register bit range. 更多...
#define | _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
| Mask and shift a register value to extract a bit filed value. 更多...

## 详细描述

Macros for use with bit field definitions (xxx_Pos, xxx_Msk).

## 宏定义说明

## ◆ _FLD2VAL

#define _FLD2VAL | ( |  | field,
|  |  | value
| ) |  | (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)

Mask and shift a register value to extract a bit filed value.

参数

  [in] | field | Name of the register bit field.
  [in] | value | Value of register. This parameter is interpreted as an uint32_t type.

返回
  Masked and shifted bit field value.

## ◆ _VAL2FLD

#define _VAL2FLD | ( |  | field,
|  |  | value
| ) |  | (((uint32_t)(value) << field ## _Pos) & field ## _Msk)

Mask and shift a bit field value for use in a register bit range.

参数

  [in] | field | Name of the register bit field.
  [in] | value | Value of the bit field. This parameter is interpreted as an uint32_t type.

返回
  Masked and shifted value.