mikroSDK Reference Manual

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

Topics

 Core Definitions
 Definitions for base addresses, unions, and structures.
 
#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.
 
#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.
 
#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.
 

Macro Definition Documentation

◆ _FLD2VAL [1/3]

#define _FLD2VAL ( field,
value )   (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
Parameters
[in]fieldName of the register bit field.
[in]valueValue of register. This parameter is interpreted as an uint32_t type.
Returns
Masked and shifted bit field value.

◆ _FLD2VAL [2/3]

#define _FLD2VAL ( field,
value )   (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
Parameters
[in]fieldName of the register bit field.
[in]valueValue of register. This parameter is interpreted as an uint32_t type.
Returns
Masked and shifted bit field value.

◆ _FLD2VAL [3/3]

#define _FLD2VAL ( field,
value )   (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
Parameters
[in]fieldName of the register bit field.
[in]valueValue of register. This parameter is interpreted as an uint32_t type.
Returns
Masked and shifted bit field value.

◆ _VAL2FLD [1/3]

#define _VAL2FLD ( field,
value )   (((uint32_t)(value) << field ## _Pos) & field ## _Msk)
Parameters
[in]fieldName of the register bit field.
[in]valueValue of the bit field. This parameter is interpreted as an uint32_t type.
Returns
Masked and shifted value.

◆ _VAL2FLD [2/3]

#define _VAL2FLD ( field,
value )   (((uint32_t)(value) << field ## _Pos) & field ## _Msk)
Parameters
[in]fieldName of the register bit field.
[in]valueValue of the bit field. This parameter is interpreted as an uint32_t type.
Returns
Masked and shifted value.

◆ _VAL2FLD [3/3]

#define _VAL2FLD ( field,
value )   (((uint32_t)(value) << field ## _Pos) & field ## _Msk)
Parameters
[in]fieldName of the register bit field.
[in]valueValue of the bit field. This parameter is interpreted as an uint32_t type.
Returns
Masked and shifted value.