RTEMS 6.1-rc2
Loading...
Searching...
No Matches
Macros
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.
 

Detailed Description

Macro Definition Documentation

◆ NXP_FLD2VAL [1/3]

#define NXP_FLD2VAL (   field,
  value 
)    (((value) & (field ## _MASK)) >> (field ## _SHIFT))

Mask and right-shift a register value to extract a bit field value.

Parameters
fieldName of the register bit field.
valueValue of the register.
Returns
Masked and shifted bit field value.

◆ NXP_FLD2VAL [2/3]

#define NXP_FLD2VAL (   field,
  value 
)    (((value) & (field ## _MASK)) >> (field ## _SHIFT))

Mask and right-shift a register value to extract a bit field value.

Parameters
fieldName of the register bit field.
valueValue of the register.
Returns
Masked and shifted bit field value.

◆ NXP_FLD2VAL [3/3]

#define NXP_FLD2VAL (   field,
  value 
)    (((value) & (field ## _MASK)) >> (field ## _SHIFT))

Mask and right-shift a register value to extract a bit field value.

Parameters
fieldName of the register bit field.
valueValue of the register.
Returns
Masked and shifted bit field value.

◆ NXP_VAL2FLD [1/3]

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

Parameters
fieldName of the register bit field.
valueValue of the bit field.
Returns
Masked and shifted value.

◆ NXP_VAL2FLD [2/3]

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

Parameters
fieldName of the register bit field.
valueValue of the bit field.
Returns
Masked and shifted value.

◆ NXP_VAL2FLD [3/3]

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

Parameters
fieldName of the register bit field.
valueValue of the bit field.
Returns
Masked and shifted value.