Macros for use with bit field definitions (xxx_Pos, xxx_Msk).
More...
|
#define | _VAL2FLD(field, value) ((value << field ## _Pos) & field ## _Msk) |
| Mask and shift a bit field value for use in a register bit range. More...
|
|
#define | _FLD2VAL(field, value) ((value & field ## _Msk) >> field ## _Pos) |
| Mask and shift a register value to extract a bit filed value. More...
|
|
Macros for use with bit field definitions (xxx_Pos, xxx_Msk).
◆ _FLD2VAL
#define _FLD2VAL |
( |
|
field, |
|
|
|
value |
|
) |
| ((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. |
- Returns
- Masked and shifted bit field value.
◆ _VAL2FLD
#define _VAL2FLD |
( |
|
field, |
|
|
|
value |
|
) |
| ((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. |
- Returns
- Masked and shifted value.