NMSIS-Core  Version 1.0.0-HummingBird
NMSIS-Core support for HummingBird RISC-V processor-based devices
Peripheral Access

Naming conventions and optional features for accessing peripherals. More...

Macros

#define __I   volatile const
 Defines 'read only' permissions. More...
 
#define __O   volatile
 Defines 'write only' permissions. More...
 
#define __IO   volatile
 Defines 'read / write' permissions. More...
 
#define __IM   volatile const
 Defines 'read only' structure member permissions. More...
 
#define __OM   volatile
 Defines 'write only' structure member permissions. More...
 
#define __IOM   volatile
 Defines 'read/write' structure member permissions. More...
 
#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. More...
 
#define _FLD2VAL(field, value)   (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
 Mask and shift a register value to extract a bit filed value. More...
 

Detailed Description

Naming conventions and optional features for accessing peripherals.

The section below describes the naming conventions, requirements, and optional features for accessing device specific peripherals. Most of the rules also apply to the core peripherals.

The Device Header File <device.h> contains typically these definition and also includes the core specific header files.

Macro Definition Documentation

◆ __I

#define __I   volatile const

Defines 'read only' permissions.

Definition at line 214 of file nmsis_gcc.h.

◆ __IM

#define __IM   volatile const

Defines 'read only' structure member permissions.

Definition at line 223 of file nmsis_gcc.h.

◆ __IO

#define __IO   volatile

Defines 'read / write' permissions.

Definition at line 219 of file nmsis_gcc.h.

◆ __IOM

#define __IOM   volatile

Defines 'read/write' structure member permissions.

Definition at line 227 of file nmsis_gcc.h.

◆ __O

#define __O   volatile

Defines 'write only' permissions.

Definition at line 217 of file nmsis_gcc.h.

◆ __OM

#define __OM   volatile

Defines 'write only' structure member permissions.

Definition at line 225 of file nmsis_gcc.h.

◆ _FLD2VAL

#define _FLD2VAL (   field,
  value 
)    (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)

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

The macro _FLD2VAL uses the #define's _Pos and _Msk of the related bit field to extract the value of a bit field from a register.

Example:

nlbits = _FLD2VAL(CLIC_CLICCFG_NLBIT, PLIC->CFG);
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.

Definition at line 257 of file nmsis_gcc.h.

◆ _VAL2FLD

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

The macro _VAL2FLD uses the #define's _Pos and _Msk of the related bit field to shift bit-field values for assigning to a register.

Example:

PLIC->CFG = _VAL2FLD(CLIC_CLICCFG_NLBIT, 3);
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.

Definition at line 242 of file nmsis_gcc.h.

_FLD2VAL
#define _FLD2VAL(field, value)
Mask and shift a register value to extract a bit filed value.
Definition: nmsis_gcc.h:257
_VAL2FLD
#define _VAL2FLD(field, value)
Mask and shift a bit field value for use in a register bit range.
Definition: nmsis_gcc.h:242