WB32L003 Standard Peripherals Firmware Library

Macros
Core register bit field macros
Defines and Type Definitions

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

## Macros
#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. More...
#define | _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
| Mask and shift a register value to extract a bit filed value. More...

## Detailed Description

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

## Macro Definition Documentation

## ◆ _FLD2VAL

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

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

Parameters

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

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

Parameters

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

Returns
  Masked and shifted value.