Basic Native CMSIS Register Access Documentation 1.0
The Common Microcontroller Software Interface Standard (CMSIS) simplifies microcontroller software development, providing a consistent and efficient interface for developers working with Cortex-M and entry-level Cortex-A processors. It promotes code reuse, portability, and interoperability, enabling developers to focus on application-level logic rather than dealing with low-level hardware details.
Loading...
Searching...
No Matches

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

Collaboration diagram for Core register bit field macros:

Modules

 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.
 

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)

#include <core_cm7.h>

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

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

#define _VAL2FLD (   field,
  value 
)    (((uint32_t)(value) << field ## _Pos) & field ## _Msk)

#include <core_cm7.h>

Mask and shift a bit field value for use in a register bit range.

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.