mikroSDK Reference Manual
Macros for use with bit field definitions (xxx_SHIFT, xxx_MASK).

Macros

#define NXP_VAL2FLD(field, value)   (((value) << (field ## _SHIFT)) & (field ## _MASK))
 Mask and left-shift a bit field value for use in a register bit range.
 
#define NXP_FLD2VAL(field, value)   (((value) & (field ## _MASK)) >> (field ## _SHIFT))
 Mask and right-shift a register value to extract a bit field value.
 
#define NXP_VAL2FLD(field, value)   (((value) << (field ## _SHIFT)) & (field ## _MASK))
 Mask and left-shift a bit field value for use in a register bit range.
 
#define NXP_FLD2VAL(field, value)   (((value) & (field ## _MASK)) >> (field ## _SHIFT))
 Mask and right-shift a register value to extract a bit field value.
 
#define NXP_VAL2FLD(field, value)   (((value) << (field ## _SHIFT)) & (field ## _MASK))
 Mask and left-shift a bit field value for use in a register bit range.
 
#define NXP_FLD2VAL(field, value)   (((value) & (field ## _MASK)) >> (field ## _SHIFT))
 Mask and right-shift a register value to extract a bit field value.
 
#define NXP_VAL2FLD(field, value)   (((value) << (field ## _SHIFT)) & (field ## _MASK))
 Mask and left-shift a bit field value for use in a register bit range.
 
#define NXP_FLD2VAL(field, value)   (((value) & (field ## _MASK)) >> (field ## _SHIFT))
 Mask and right-shift a register value to extract a bit field value.
 
#define NXP_VAL2FLD(field, value)   (((value) << (field ## _SHIFT)) & (field ## _MASK))
 Mask and left-shift a bit field value for use in a register bit range.
 
#define NXP_FLD2VAL(field, value)   (((value) & (field ## _MASK)) >> (field ## _SHIFT))
 Mask and right-shift a register value to extract a bit field value.
 

Macro Definition Documentation

◆ NXP_FLD2VAL [1/5]

#define NXP_FLD2VAL ( field,
value )   (((value) & (field ## _MASK)) >> (field ## _SHIFT))
Parameters
fieldName of the register bit field.
valueValue of the register.
Returns
Masked and shifted bit field value.

◆ NXP_FLD2VAL [2/5]

#define NXP_FLD2VAL ( field,
value )   (((value) & (field ## _MASK)) >> (field ## _SHIFT))
Parameters
fieldName of the register bit field.
valueValue of the register.
Returns
Masked and shifted bit field value.

◆ NXP_FLD2VAL [3/5]

#define NXP_FLD2VAL ( field,
value )   (((value) & (field ## _MASK)) >> (field ## _SHIFT))
Parameters
fieldName of the register bit field.
valueValue of the register.
Returns
Masked and shifted bit field value.

◆ NXP_FLD2VAL [4/5]

#define NXP_FLD2VAL ( field,
value )   (((value) & (field ## _MASK)) >> (field ## _SHIFT))
Parameters
fieldName of the register bit field.
valueValue of the register.
Returns
Masked and shifted bit field value.

◆ NXP_FLD2VAL [5/5]

#define NXP_FLD2VAL ( field,
value )   (((value) & (field ## _MASK)) >> (field ## _SHIFT))
Parameters
fieldName of the register bit field.
valueValue of the register.
Returns
Masked and shifted bit field value.

◆ NXP_VAL2FLD [1/5]

#define NXP_VAL2FLD ( field,
value )   (((value) << (field ## _SHIFT)) & (field ## _MASK))
Parameters
fieldName of the register bit field.
valueValue of the bit field.
Returns
Masked and shifted value.

◆ NXP_VAL2FLD [2/5]

#define NXP_VAL2FLD ( field,
value )   (((value) << (field ## _SHIFT)) & (field ## _MASK))
Parameters
fieldName of the register bit field.
valueValue of the bit field.
Returns
Masked and shifted value.

◆ NXP_VAL2FLD [3/5]

#define NXP_VAL2FLD ( field,
value )   (((value) << (field ## _SHIFT)) & (field ## _MASK))
Parameters
fieldName of the register bit field.
valueValue of the bit field.
Returns
Masked and shifted value.

◆ NXP_VAL2FLD [4/5]

#define NXP_VAL2FLD ( field,
value )   (((value) << (field ## _SHIFT)) & (field ## _MASK))
Parameters
fieldName of the register bit field.
valueValue of the bit field.
Returns
Masked and shifted value.

◆ NXP_VAL2FLD [5/5]

#define NXP_VAL2FLD ( field,
value )   (((value) << (field ## _SHIFT)) & (field ## _MASK))
Parameters
fieldName of the register bit field.
valueValue of the bit field.
Returns
Masked and shifted value.