DIY Logging Volt/Ampmeter
CMSIS Core Register Access Functions
Defines and Type Definitions » Status and Control Registers » Nested Vectored Interrupt Controller (NVIC) » System Control Block (SCB)Defines and Type Definitions » Status and Control Registers » Nested Vectored Interrupt Controller (NVIC) » System Control Block (SCB) » | System Controls not in SCB (SCnSCB) » System Tick Timer (SysTick)Defines and Type Definitions » Status and Control Registers » Nested Vectored Interrupt Controller (NVIC) » System Control Block (SCB)Defines and Type Definitions » Status and Control Registers » Nested Vectored Interrupt Controller (NVIC) » System Control Block (SCB) » | System Controls not in SCB (SCnSCB) » System Tick Timer (SysTick) » | Instrumentation Trace Macrocell (ITM) » Data Watchpoint and Trace (DWT) » Trace Port Interface (TPI)Defines and Type Definitions » Status and Control Registers » Nested Vectored Interrupt Controller (NVIC) » System Control Block (SCB)Defines and Type Definitions » Status and Control Registers » Nested Vectored Interrupt Controller (NVIC) » System Control Block (SCB) » | System Controls not in SCB (SCnSCB) » System Tick Timer (SysTick)Defines and Type Definitions » Status and Control Registers » Nested Vectored Interrupt Controller (NVIC) » System Control Block (SCB)Defines and Type Definitions » Status and Control Registers » Nested Vectored Interrupt Controller (NVIC) » System Control Block (SCB) » | System Controls not in SCB (SCnSCB) » System Tick Timer (SysTick) » | Instrumentation Trace Macrocell (ITM) » Data Watchpoint and Trace (DWT) » Trace Port Interface (TPI) » | Floating Point Unit (FPU) » Core Debug Registers (CoreDebug) » Core register bit field macros » Core Definitions » Functions and Instructions Reference

Modules

 CMSIS Core Instruction Interface
 Access to dedicated instructions.
 

Macros

#define __get_FPSCR()   ((uint32_t)0U)
 Get FPSCR. More...
 
#define __set_FPSCR(x)   ((void)(x))
 Set FPSCR. More...
 

Functions

static __inline uint32_t __get_CONTROL (void)
 Enable IRQ Interrupts. More...
 
static __inline void __set_CONTROL (uint32_t control)
 Set Control Register. More...
 
static __inline uint32_t __get_IPSR (void)
 Get IPSR Register. More...
 
static __inline uint32_t __get_APSR (void)
 Get APSR Register. More...
 
static __inline uint32_t __get_xPSR (void)
 Get xPSR Register. More...
 
static __inline uint32_t __get_PSP (void)
 Get Process Stack Pointer. More...
 
static __inline void __set_PSP (uint32_t topOfProcStack)
 Set Process Stack Pointer. More...
 
static __inline uint32_t __get_MSP (void)
 Get Main Stack Pointer. More...
 
static __inline void __set_MSP (uint32_t topOfMainStack)
 Set Main Stack Pointer. More...
 
static __inline uint32_t __get_PRIMASK (void)
 Get Priority Mask. More...
 
static __inline void __set_PRIMASK (uint32_t priMask)
 Set Priority Mask. More...
 
static __inline uint32_t __get_FPSCR (void)
 Get FPSCR. More...
 
static __inline void __set_FPSCR (uint32_t fpscr)
 Set FPSCR. More...
 
 __attribute__ ((always_inline)) static __inline uint32_t __get_CONTROL(void)
 Enable IRQ Interrupts. More...
 

Detailed Description

Macro Definition Documentation

◆ __get_FPSCR

#define __get_FPSCR ( )    ((uint32_t)0U)

Get FPSCR.

Returns the current value of the Floating Point Status/Control register.

Returns
Floating Point Status/Control register value

Definition at line 754 of file cmsis_armclang.h.

◆ __set_FPSCR

#define __set_FPSCR (   x)    ((void)(x))

Set FPSCR.

Assigns the given value to the Floating Point Status/Control register.

Parameters
[in]fpscrFloating Point Status/Control value to set

Definition at line 766 of file cmsis_armclang.h.

Function Documentation

◆ __attribute__()

__attribute__ ( (always_inline)  )

Enable IRQ Interrupts.

Set FPSCR.

Get FPSCR.

Get Control Register.

Disable IRQ Interrupts.

Set Priority Mask.

Get Priority Mask.

Set Main Stack Pointer.

Get Main Stack Pointer.

Set Process Stack Pointer.

Get Process Stack Pointer.

Get xPSR Register.

Get APSR Register.

Get IPSR Register.

Set Control Register.

Enables IRQ interrupts by clearing the I-bit in the CPSR. Can only be executed in Privileged modes.

Disable IRQ Interrupts

Disables IRQ interrupts by setting the I-bit in the CPSR. Can only be executed in Privileged modes.

Get Control Register

Returns the content of the Control Register.

Returns
Control Register value

Writes the given value to the Control Register.

Parameters
[in]controlControl Register value to set

Returns the content of the IPSR Register.

Returns
IPSR Register value

Returns the content of the APSR Register.

Returns
APSR Register value

Returns the content of the xPSR Register.

Returns
xPSR Register value

Returns the current value of the Process Stack Pointer (PSP).

Returns
PSP Register value

Assigns the given value to the Process Stack Pointer (PSP).

Parameters
[in]topOfProcStackProcess Stack Pointer value to set

Returns the current value of the Main Stack Pointer (MSP).

Returns
MSP Register value

Assigns the given value to the Main Stack Pointer (MSP).

Parameters
[in]topOfMainStackMain Stack Pointer value to set

Returns the current state of the priority mask bit from the Priority Mask Register.

Returns
Priority Mask value

Assigns the given value to the Priority Mask Register.

Parameters
[in]priMaskPriority Mask

Enables IRQ interrupts by clearing the I-bit in the CPSR. Can only be executed in Privileged modes.

Disables IRQ interrupts by setting the I-bit in the CPSR. Can only be executed in Privileged modes.

Returns the content of the Control Register.

Returns
Control Register value

Returns the current value of the Floating Point Status/Control register.

Returns
Floating Point Status/Control register value

Assigns the given value to the Floating Point Status/Control register.

Parameters
[in]fpscrFloating Point Status/Control value to set

Definition at line 142 of file cmsis_armclang.h.

143 {
144  uint32_t result;
145 
146  __ASM volatile ("MRS %0, control" : "=r" (result) );
147  return(result);
148 }

◆ __get_APSR()

static __inline uint32_t __get_APSR ( void  )
static

Get APSR Register.

Returns the content of the APSR Register.

Returns
APSR Register value

Definition at line 166 of file cmsis_armcc.h.

167 {
168  register uint32_t __regAPSR __ASM("apsr");
169  return(__regAPSR);
170 }

◆ __get_CONTROL()

static __inline uint32_t __get_CONTROL ( void  )
static

Enable IRQ Interrupts.

Enables IRQ interrupts by clearing the I-bit in the CPSR. Can only be executed in Privileged modes.

Disable IRQ Interrupts

Disables IRQ interrupts by setting the I-bit in the CPSR. Can only be executed in Privileged modes.

Get Control Register

Returns the content of the Control Register.

Returns
Control Register value

Definition at line 130 of file cmsis_armcc.h.

131 {
132  register uint32_t __regControl __ASM("control");
133  return(__regControl);
134 }

◆ __get_FPSCR()

static __inline uint32_t __get_FPSCR ( void  )
static

Get FPSCR.

Returns the current value of the Floating Point Status/Control register.

Returns
Floating Point Status/Control register value

Definition at line 345 of file cmsis_armcc.h.

346 {
347 #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
348  (defined (__FPU_USED ) && (__FPU_USED == 1U)) )
349  register uint32_t __regfpscr __ASM("fpscr");
350  return(__regfpscr);
351 #else
352  return(0U);
353 #endif
354 }

◆ __get_IPSR()

static __inline uint32_t __get_IPSR ( void  )
static

Get IPSR Register.

Returns the content of the IPSR Register.

Returns
IPSR Register value

Definition at line 154 of file cmsis_armcc.h.

155 {
156  register uint32_t __regIPSR __ASM("ipsr");
157  return(__regIPSR);
158 }

◆ __get_MSP()

static __inline uint32_t __get_MSP ( void  )
static

Get Main Stack Pointer.

Returns the current value of the Main Stack Pointer (MSP).

Returns
MSP Register value

Definition at line 214 of file cmsis_armcc.h.

215 {
216  register uint32_t __regMainStackPointer __ASM("msp");
217  return(__regMainStackPointer);
218 }

◆ __get_PRIMASK()

static __inline uint32_t __get_PRIMASK ( void  )
static

Get Priority Mask.

Returns the current state of the priority mask bit from the Priority Mask Register.

Returns
Priority Mask value

Definition at line 238 of file cmsis_armcc.h.

239 {
240  register uint32_t __regPriMask __ASM("primask");
241  return(__regPriMask);
242 }

◆ __get_PSP()

static __inline uint32_t __get_PSP ( void  )
static

Get Process Stack Pointer.

Returns the current value of the Process Stack Pointer (PSP).

Returns
PSP Register value

Definition at line 190 of file cmsis_armcc.h.

191 {
192  register uint32_t __regProcessStackPointer __ASM("psp");
193  return(__regProcessStackPointer);
194 }

◆ __get_xPSR()

static __inline uint32_t __get_xPSR ( void  )
static

Get xPSR Register.

Returns the content of the xPSR Register.

Returns
xPSR Register value

Definition at line 178 of file cmsis_armcc.h.

179 {
180  register uint32_t __regXPSR __ASM("xpsr");
181  return(__regXPSR);
182 }

◆ __set_CONTROL()

static __inline void __set_CONTROL ( uint32_t  control)
static

Set Control Register.

Writes the given value to the Control Register.

Parameters
[in]controlControl Register value to set

Definition at line 142 of file cmsis_armcc.h.

143 {
144  register uint32_t __regControl __ASM("control");
145  __regControl = control;
146 }

◆ __set_FPSCR()

static __inline void __set_FPSCR ( uint32_t  fpscr)
static

Set FPSCR.

Assigns the given value to the Floating Point Status/Control register.

Parameters
[in]fpscrFloating Point Status/Control value to set

Definition at line 362 of file cmsis_armcc.h.

363 {
364 #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
365  (defined (__FPU_USED ) && (__FPU_USED == 1U)) )
366  register uint32_t __regfpscr __ASM("fpscr");
367  __regfpscr = (fpscr);
368 #else
369  (void)fpscr;
370 #endif
371 }

◆ __set_MSP()

static __inline void __set_MSP ( uint32_t  topOfMainStack)
static

Set Main Stack Pointer.

Assigns the given value to the Main Stack Pointer (MSP).

Parameters
[in]topOfMainStackMain Stack Pointer value to set

Definition at line 226 of file cmsis_armcc.h.

227 {
228  register uint32_t __regMainStackPointer __ASM("msp");
229  __regMainStackPointer = topOfMainStack;
230 }

◆ __set_PRIMASK()

static __inline void __set_PRIMASK ( uint32_t  priMask)
static

Set Priority Mask.

Assigns the given value to the Priority Mask Register.

Parameters
[in]priMaskPriority Mask

Definition at line 250 of file cmsis_armcc.h.

251 {
252  register uint32_t __regPriMask __ASM("primask");
253  __regPriMask = (priMask);
254 }

◆ __set_PSP()

static __inline void __set_PSP ( uint32_t  topOfProcStack)
static

Set Process Stack Pointer.

Assigns the given value to the Process Stack Pointer (PSP).

Parameters
[in]topOfProcStackProcess Stack Pointer value to set

Definition at line 202 of file cmsis_armcc.h.

203 {
204  register uint32_t __regProcessStackPointer __ASM("psp");
205  __regProcessStackPointer = topOfProcStack;
206 }
__ASM
#define __ASM
Definition: cmsis_armcc.h:53
__ASM
#define __ASM
Definition: cmsis_armclang.h:38