]> begriffs open source - cmsis/blob - CMSIS/DoxyGen/Core/src/Ref_CoreRegister.txt
Reworked CMSIS-Core(M) and Core(A) docs for CMSIS 6. (#47)
[cmsis] / CMSIS / DoxyGen / Core / src / Ref_CoreRegister.txt
1 /**************************************************************************************************/
2 /** \defgroup Core_Register_gr Core Register Access
3 \brief Functions to access the Cortex-M core registers.
4 \details
5   The following functions provide access to Cortex-M core registers. 
6
7   @{ 
8 */
9
10
11 /**************************************************************************************************/
12 /** \brief  Read the CONTROL register
13     \details
14     The function reads the CONTROL register value using the instruction \b MRS. 
15     \n\n
16     The CONTROL register controls the stack used and the privilege level for software execution
17     when the processor is in thread mode and, if implemented, indicates whether the FPU state is
18     active. This register uses the following bits:
19     \n
20     - \b CONTROL[2] [only Cortex-M4 and Cortex-M7]
21         - =0 FPU not active
22         - =1 FPU active
23         \n\n
24     - \b CONTROL[1] 
25         - =0 In handler mode - MSP is selected. No alternate stack possible for handler mode.
26         - =0 In thread mode - Default stack pointer MSP is used.
27         - =1 In thread mode - Alternate stack pointer PSP is used.
28         \n\n
29     - \b CONTROL[0] [not Cortex-M0]
30         - =0 In thread mode and privileged state.
31         - =1 In thread mode and user state.
32      
33     \returns    CONTROL register value
34     
35     \remarks    
36             - The processor can be in user state or privileged state when running in thread mode.
37             - Exception handlers always run in privileged state.
38             - On reset, the processor is in thread mode with privileged access  rights.
39     
40     \sa     
41             - \ref __set_CONTROL; CONTROL_Type 
42             - \ref ref_man_sec
43  */
44 uint32_t __get_CONTROL(void);
45
46
47 /**************************************************************************************************/
48 /** \brief  Set the CONTROL Register
49     \details 
50     The function sets the CONTROL register value using the instruction \b MSR. 
51     \n\n
52     The CONTROL register controls the stack used and the privilege level for software execution
53     when the processor is in thread mode and, if implemented, indicates whether the FPU state is
54     active. This register uses the following bits:
55     \n
56     - \b CONTROL[2] [only Cortex-M4 and Cortex-M7]
57         - =0 FPU not active
58         - =1 FPU active
59         \n\n
60     - \b CONTROL[1] 
61         - Writeable only when the processor is in thread mode and privileged state (CONTROL[0]=0).
62         - =0 In handler mode - MSP is selected. No alternate stack pointer possible for handler mode.
63         - =0 In thread mode - Default stack pointer MSP is used.
64         - =1 In thread mode - Alternate stack pointer PSP is used.
65         \n\n
66     - \b CONTROL[0] [not writeable for Cortex-M0]
67         - Writeable only when the processor is in privileged state.
68         - Can be used to switch the processor to user state (thread mode).
69         - Once in user state, trigger an interrupt and change the state to privileged in the 
70         exception handler (the only way).
71         - =0 In thread mode and privileged state.
72         - =1 In thread mode and user state.
73
74      
75     \param [in] control  CONTROL register value to set    
76     
77     \remarks    
78             - The processor can be in user state or privileged state when running in thread mode.
79             - Exception handlers always run in privileged state.
80             - On reset, the processor is in thread mode with privileged access  rights.
81
82     \sa     
83             - \ref __get_CONTROL; __set_PSP; __set_MSP; CONTROL_Type 
84             - \ref ref_man_sec
85 */
86 void __set_CONTROL(uint32_t control);
87
88
89 /**************************************************************************************************/
90 /** \brief  Read the IPSR register
91     \details 
92     The function reads the Interrupt Program Status Register (IPSR) using the instruction \b MRS. 
93     \n\n
94     The ISPR contains the exception type number of the current Interrupt Service Routine (ISR). 
95     Each exception has an associated unique IRQn number. The following bits are used:
96     
97     - \b ISR_NUMBER (IPSR[8:0])
98         - = 0 Thread mode
99         - = 1 Reserved
100         - = 2 NMI
101         - = 3 HardFault
102         - = 4 MemManage
103         - = 5 BusFault
104         - = 6 UsageFault
105         - = 7 SecureFault
106         - = 8-10  Reserved
107         - = 11 SVC
108         - = 12 Reserved for Debug
109         - = 13 Reserved
110         - = 14 PendSV
111         - = 15 SysTick
112         - = 16 IRQ0
113         - ...
114         - = n+15 IRQ(n-1)
115
116     \returns    ISPR register value
117
118     \remarks    
119             - This register is read-only.
120
121     \sa     
122             - \ref __get_xPSR; IPSR_Type
123             - \ref NVIC_gr
124             - \ref ref_man_sec
125 */
126 uint32_t __get_IPSR(void);
127
128
129 /**************************************************************************************************/
130 /** \brief  Read the APSR register
131     \details
132     The function reads the Application Program Status Register (APSR) using the instruction \b MRS.
133     \n\n
134     The APSR contains the current state of the condition flags from instructions executed previously.
135     The APSR is essential for controlling conditional branches. The following flags are used:
136     
137     - \b N (APSR[31]) (Negative flag)
138         - =1 The instruction result has a negative value (when interpreted as signed integer).
139         - =0 The instruction result has a positive value or equal zero.
140     \n\n
141     - \b Z (APSR[30]) (Zero flag)
142         - =1 The instruction result is zero. Or, after a compare instruction, when the two values
143             are the same.
144     \n\n
145     - \b C (APSR[29]) (Carry or borrow flag)
146         - =1 For unsigned additions, if an unsigned overflow occurred.
147         - =<i>inverse of borrow output status</i> For unsigned subtract operations.
148     \n\n
149     - \b V (APSR[28]) (Overflow flag)
150         - =1 A signed overflow occurred (for signed additions or subtractions).
151     \n\n
152     - \b Q (APSR[27]) (DSP overflow or saturation flag) [not Cortex-M0]
153         - This flag is a \em sticky flag. Saturating and certain multiplying instructions can set the
154         flag, but cannot clear it. 
155         - =1 When saturation or an overflow occurred.
156     \n\n
157     - \b GE (APSR[19:16]) (Greater than or Equal flags) [not Cortex-M0]
158         - Can be set by the parallel add and subtract instructions.
159         - Are used by the <kbd>SEL</kbd> instruction to perform byte-based selection from two registers.
160     
161     
162     \returns    APSR register value
163
164     \remarks    
165             - Some instructions update all flags; some instructions update a subset of the flags. 
166             - If a flag is not updated, the original value is preserved. 
167             - Conditional instructions that are not executed have no effect on the flags.
168             - The CMSIS does not provide a function to update this register.
169
170     \sa     
171             - \ref __get_xPSR; APSR_Type 
172             - \ref ref_man_sec
173
174  */
175 uint32_t __get_APSR(void);
176
177
178 /**************************************************************************************************/
179 /** \brief  Read the xPSR register 
180     \details 
181     The function reads the combined Program Status Register (xPSR) using the instruction \b MRS. 
182     \n\n
183     xPSR provides information about program execution and the APSR flags. It consists of the 
184     following PSRs:
185     \li Application Program Status Register (APSR)
186     \li Interrupt Program Status Register (IPSR)
187     \li Execution Program Status Register (EPSR)
188     
189     In addition to the flags described in \ref __get_APSR and \ref __get_IPSR, the register provides 
190     the following flags:
191     - \b IT (xPSR[26:25]) (If-Then condition instruction)
192         - Contains up to four instructions following an IT instruction. 
193         - Each instruction in the block is conditional. 
194         - The conditions for the instructions are either all the same, or some can be the inverse 
195         of others.
196     \n\n
197     - \b T (xPSR[24]) (Thumb bit) 
198         - =1 Indicates that that the processor is in Thumb state. 
199         - =0 Attempting to execute instructions when the T bit is 0 results in a fault or lockup. 
200         - The conditions for the instructions are either all the same, or some can be the inverse 
201         of others.
202     
203     \returns    xPSR register value 
204     
205     \remarks
206         - The CMSIS does not provide functions that access EPSR.
207
208     \sa     
209             - \ref __get_APSR; __get_IPSR; xPSR_Type
210             - \ref ref_man_sec
211     
212  */
213 uint32_t __get_xPSR(void);
214
215
216 /**************************************************************************************************/
217 /** \brief  Read the PSP register
218     \details 
219     The function reads the Process Stack Pointer (PSP) value using the instruction \b MRS.
220     \n\n
221     Physically two different stack pointers (SP) exist: 
222     - The Main Stack Pointer (MSP) is the default stack pointer after reset. It is also used when 
223     running exception handlers (handler mode).
224     - The Process Stack Pointer (PSP), which can be used only in thread mode. 
225     
226     Register R13 banks the SP. The SP selection is determined by the bit[1] of the CONTROL register: 
227     - =0 MSP is the current stack pointer. This is also the default SP. The initial value is loaded 
228     from the first 32-bit word of the vector table from the program memory.
229     - =1 PSP is the current stack pointer. The initial value is undefined. 
230   
231     \returns    PSP register value
232         
233     \remarks
234         - Only one of the two SPs is visible at a time.
235         - For many applications, the system can completely rely on the MSP.
236         - The PSP is normally used in designs with an OS where the stack memory for OS Kernel must 
237         be separated from the application code.  
238
239     \sa 
240         - \ref __set_PSP; __get_MSP; __get_CONTROL
241         - \ref ref_man_sec
242
243     
244  */
245 uint32_t __get_PSP(void);
246
247
248 /**************************************************************************************************/
249 /** \brief  Set the PSP register
250     \details
251     The function sets the Process Stack Pointer (PSP) value using the instruction \b MSR.
252     \n\n
253     Physically two different stack pointers (SP) exist: 
254     - The Main Stack Pointer (MSP) is the default stack pointer after reset. It is also used when 
255     running exception handlers (handler mode).
256     - The Process Stack Pointer (PSP), which can be used only in thread mode. 
257     
258     Register R13 banks the SP. The SP selection is determined by the bit[1] of the CONTROL register: 
259     - =0 MSP is the current stack pointer. This is also the default SP. The initial value is loaded 
260     from the first 32-bit word of the vector table from the program memory.
261     - =1 PSP is the current stack pointer. The initial value is undefined. 
262     
263     \param [in]    topOfProcStack  PSP value to set
264         
265     \remarks
266         - Only one of the two SPs is visible at a time.
267         - For many applications, the system can completely rely on the MSP.
268         - The PSP is normally used in designs with an OS where the stack memory for OS Kernel must 
269         be separated from the application code.  
270         
271     \sa 
272         - \ref __get_PSP; __set_MSP; __set_CONTROL
273         - \ref ref_man_sec
274  */
275 void __set_PSP(uint32_t topOfProcStack);
276
277
278 /**************************************************************************************************/
279 /** \brief  Read the MSP register
280     \details 
281     The function reads the Main Stack Pointer (MSP) value using the instruction \b MRS.
282     \n\n
283     Physically two different stack pointers (SP) exist: 
284     - The Main Stack Pointer (MSP) is the default stack pointer after reset. It is also used when 
285     running exception handlers (handler mode).
286     - The Process Stack Pointer (PSP), which can be used only in thread mode. 
287     
288     Register R13 banks the SP. The SP selection is determined by the bit[1] of the CONTROL register: 
289     - =0 MSP is the current stack pointer. This is also the default SP. The initial value is loaded 
290     from the first 32-bit word of the vector table from the program memory.
291     - =1 PSP is the current stack pointer. The initial value is undefined. 
292     
293     \returns    MSP Register value 
294
295     \remarks
296         - Only one of the two SPs is visible at a time.
297         - For many applications, the system can completely rely on the MSP.
298         - The PSP is normally used in designs with an OS where the stack memory for OS Kernel must 
299         be separated from the application code.  
300         
301     \sa 
302         - \ref __set_MSP; __get_PSP; __get_CONTROL
303         - \ref ref_man_sec
304
305  */
306 uint32_t __get_MSP(void);
307
308
309 /**************************************************************************************************/
310 /** \brief  Set the MSP register
311     \details 
312     The function sets the Main Stack Pointer (MSP) value using the instruction \b MSR.
313     \n\n
314     Physically two different stack pointers (SP) exist: 
315     - The Main Stack Pointer (MSP) is the default stack pointer after reset. It is also used when 
316     running exception handlers (handler mode).
317     - The Process Stack Pointer (PSP), which can be used only in thread mode. 
318     
319     Register R13 banks the SP. The SP selection is determined by the bit[1] of the CONTROL register: 
320     - =0 MSP is the current stack pointer. This is also the default SP. The initial value is loaded 
321     from the first 32-bit word of the vector table from the program memory.
322     - =1 PSP is the current stack pointer. The initial value is undefined. 
323     
324     \param [in]    topOfMainStack  MSP value to set
325
326     \remarks
327         - Only one of the two SPs is visible at a time.
328         - For many applications, the system can completely rely on the MSP.
329         - The PSP is normally used in designs with an OS where the stack memory for OS Kernel must 
330         be separated from the application code.  
331         
332     \sa 
333         - \ref __get_MSP; __set_PSP; __set_CONTROL
334         - \ref ref_man_sec
335
336  */
337 void __set_MSP(uint32_t topOfMainStack);
338
339
340 /**************************************************************************************************/
341 /** \brief  Read the PRIMASK register bit 
342     \details 
343     The function reads the Priority Mask register (PRIMASK) value using the instruction \b MRS. 
344     \n\n
345     PRIMASK is a 1-bit-wide interrupt mask register. When set,
346     it blocks all interrupts apart from the non-maskable interrupt (NMI) and the hard fault exception.
347     The PRIMASK prevents activation of all exceptions with configurable priority.
348
349     \returns    PRIMASK register value
350                 - =0 no effect
351                 - =1 prevents the activation of all exceptions with configurable priority
352            
353     \sa 
354         - \ref __set_PRIMASK; __get_BASEPRI; __get_FAULTMASK
355         - \ref ref_man_sec                    
356                     
357  */
358 uint32_t __get_PRIMASK(void);
359
360
361 /**************************************************************************************************/
362 /** \brief  Set the Priority Mask bit
363     \details 
364     The function sets the Priority Mask register (PRIMASK) value using the instruction \b MSR. 
365     \n\n
366     PRIMASK is a 1-bit-wide interrupt mask register. When set,
367     it blocks all interrupts apart from the non-maskable interrupt (NMI) and the hard fault exception.
368     The PRIMASK prevents activation of all exceptions with configurable priority.
369
370     \param [in]    priMask  Priority Mask
371                     - =0 no effect
372                     - =1 prevents the activation of all exceptions with configurable priority
373
374     \remarks
375         - When set, PRIMASK effectively changes the current priority level to 0. 
376         This is the highest programmable level.
377         - When set and a fault occurs, the hard fault handler will be executed.
378         - Useful for temporarily disabling all interrupts for timing critical tasks. 
379         - Does not have the ability to mask BusFault or bypass MPU.
380
381     \sa 
382         - \ref __get_PRIMASK; __set_BASEPRI; __set_FAULTMASK
383         - \ref ref_man_sec                    
384
385  */
386 void __set_PRIMASK(uint32_t priMask);
387  
388
389 /**************************************************************************************************/
390 /** \brief  Read the BASEPRI register [not for Cortex-M0, Cortex-M0+, or SC000]
391     \details 
392     The function returns the Base Priority Mask register (BASEPRI) using the instruction \b MRS. 
393     \n\n
394     BASEPRI defines the minimum priority for exception processing. When BASEPRI is set to a non-zero 
395     value, it prevents the activation of all exceptions with the same or lower priority level as 
396     the BASEPRI value.
397     
398     \returns    BASEPRI register value
399
400     \remarks    
401         - Not for Cortex-M0, Cortex-M0+, or SC000.
402                     
403     \sa 
404         - \ref __set_BASEPRI;  __set_BASEPRI_MAX; __get_FAULTMASK; __get_PRIMASK
405         - \ref ref_man_sec
406
407     */
408 uint32_t __get_BASEPRI(void);
409
410
411 /**************************************************************************************************/
412 /** \brief  Set the BASEPRI register [not for Cortex-M0, Cortex-M0+, or SC000]
413     \details 
414     The function sets the Base Priority Mask register (BASEPRI) value using the instruction \b MSR.
415     \n\n
416     BASEPRI defines the minimum priority for exception processing. 
417     When BASEPRI is set to a non-zero value, it prevents the activation of all exceptions with the 
418     same or lower priority level as the BASEPRI value.
419     
420     \param [in]    basePri  BASEPRI value to set
421
422     \remarks    
423         - Not for Cortex-M0, Cortex-M0+, or SC000.
424         - Cannot be set in user state.
425         - Useful for changing the masking level or disabling the masking.
426
427     \sa 
428         - \ref __get_BASEPRI;  __set_BASEPRI_MAX; __set_FAULTMASK; __set_PRIMASK
429         - \ref ref_man_sec
430     
431  */
432 void __set_BASEPRI(uint32_t basePri); 
433  
434  
435 /**************************************************************************************************/
436 /** \brief  Increase the BASEPRI register [not for Cortex-M0, Cortex-M0+, or SC000]
437     \details 
438     The function only increases the Base Priority Mask register (BASEPRI) value using the instruction \b MSR.
439         The value is set only if BASEPRI masking is disabled, or the new value increases the BASEPRI priority level.
440     \n\n
441     BASEPRI defines the minimum priority for exception processing. 
442         
443     \param [in]    basePri  BASEPRI value to set
444
445     \remarks    
446         - Not for Cortex-M0, Cortex-M0+, or SC000.
447         - Cannot be set in user state.
448         - Useful for increasing the masking level.
449         - Has no effect when \em basePri is lower than the current value of BASEPRI.
450         - Use \ref __set_BASEPRI to lower the Base Priority Mask register.
451
452     \sa 
453         - \ref __set_BASEPRI; __get_BASEPRI; __set_FAULTMASK; __set_PRIMASK
454         - \ref ref_man_sec
455     
456  */
457 void __set_BASEPRI_MAX(uint32_t basePri); 
458
459
460 /**************************************************************************************************/
461 /** \brief  Read the FAULTMASK register [not for Cortex-M0, Cortex-M0+, or SC000]
462     \details 
463     The function reads the Fault Mask register (FAULTMASK) value using the instruction \b MRS. 
464     \n\n
465     FAULTMASK prevents activation of all exceptions except for the Non-Maskable Interrupt (NMI).
466
467     \returns    FAULTMASK register value
468
469     \remarks    
470         - not for Cortex-M0, Cortex-M0+, or SC000.
471         - Is cleared automatically upon exiting the exception handler, except when returning 
472         from the NMI handler.
473
474     \sa 
475         - \ref __set_FAULTMASK; __get_BASEPRI; __get_PRIMASK 
476         - \ref ref_man_sec
477  */
478 uint32_t __get_FAULTMASK(void);
479
480
481 /**************************************************************************************************/
482 /** \brief  Set the FAULTMASK register [not for Cortex-M0, Cortex-M0+, or SC000]
483     \details 
484     The function sets the Fault Mask register (FAULTMASK) value using the instruction \b MSR.
485     \n\n
486     FAULTMASK prevents activation of all exceptions except for Non-Maskable Interrupt (NMI).
487     FAULTMASK can be used to escalate a configurable fault handler (BusFault, usage fault, or 
488     memory management fault) to hard fault level without invoking a hard fault. This allows the 
489     fault handler to pretend to be the hard fault handler, with the ability to:
490     -# <b>Mask BusFault</b> by setting the BFHFNMIGN in the Configuration Control register.
491     It can be used to test the bus system without causing a lockup. 
492     -# <b>Bypass the MPU</b>, allowing accessing the MPU protected memory location without 
493     reprogramming the MPU to just carry out a few transfers for fixing faults.
494
495     \param [in]    faultMask  FAULTMASK register value to set 
496
497     \remarks    
498         - not for Cortex-M0, Cortex-M0+, or SC000.
499         - Is cleared automatically upon exiting the exception handler, except when returning 
500         from the NMI handler.
501         - When set, it changes the effective current priority level to -1, so that even the hard
502         fault handler is blocked.
503         - Can be used by fault handlers to change their priority to -1 to have access to some 
504         features for hard fault exceptions (see above).
505         - When set, lockups can still be caused by incorrect or undefined instructions, or by using
506         SVC in the wrong priority level.
507
508     \sa 
509         - \ref __get_FAULTMASK; __set_BASEPRI; __set_PRIMASK 
510         - \ref ref_man_sec
511  */
512 void __set_FAULTMASK(uint32_t faultMask);
513
514
515 /**************************************************************************************************/
516 /** \brief  Read the FPSCR register [only Cortex-M4 and Cortex-M7]
517     \details 
518     The function reads the Floating-Point Status Control Register (FPSCR) value. 
519     \n\n
520     FPSCR provides all necessary User level controls of the floating-point system. 
521         
522     \returns    
523             - FPSCR register value, when __FPU_PRESENT=1
524             - =0, when __FPU_PRESENT=0
525
526     \remarks
527             - Only for Cortex-M4 and Cortex-M7.
528                 
529     \sa 
530             - \ref __set_FPSCR
531             - \ref ref_man_sec
532                     
533  */
534 uint32_t __get_FPSCR(void);
535
536
537 /**************************************************************************************************/
538 /** \brief  Set the FPSC register [only for Cortex-M4 and Cortex-M7]
539     \details 
540     The function sets the Floating-Point Status Control Register (FPSCR) value. 
541     \n\n
542     FPSCR provides all necessary User level control of the floating-point system. 
543     \n
544     - \b N (FPSC[31]) (Negative flag)
545         - =1 The instruction result has a negative value (when interpreted as signed integer).
546         - =0 The instruction result has a positive value or equal zero.
547     \n\n
548     - \b Z (FPSC[30]) (Zero flag)
549         - =1 The instruction result is zero. Or, after a compare instruction, when the two values
550             are the same.
551     \n\n
552     - \b C (FPSC[29]) (Carry or borrow flag)
553         - =1 For unsigned additions, if an unsigned overflow occurred.
554         - =<i>inverse of borrow output status</i> For unsigned subtract operations.
555     \n\n
556     - \b V (FPSC[28]) (Overflow flag)
557         - =1 A signed overflow occurred (for signed additions or subtractions).
558     \n\n
559     - \b AHP (FPSC[26]) (Alternative half-precision flag)
560         - =1 Alternative half-precision format selected.
561         - =0 IEEE half-precision format selected.
562     \n\n
563     - \b DN (FPSC[25]) (Default NaN mode control flag)
564         - =1 Any operation involving one or more NaNs returns the Default NaN.
565         - =0 NaN operands propagate through to the output of a floating-point operation.
566     \n\n
567     - \b FZ (FPSC[24]) (Flush-to-zero mode control flag)
568         - =1 Flush-to-zero mode enabled.
569         - =0 Flush-to-zero mode disabled. Behavior of the floating-point system is fully 
570         compliant with the IEEE 754 standard.
571     \n\n
572     - \b RMode (FPSC[23:22]) (Rounding Mode control flags)
573         - =0b00 Round to Nearest (RN) mode.
574         - =0b01 Round towards Plus Infinity (RP) mode.
575         - =0b10 Round towards Minus Infinity (RM) mode.
576         - =0b11 Round towards Zero (RZ) mode.
577         - The specified rounding mode is used by almost all floating-point instructions.
578     \n\n
579     - \b IDC (FPSC[7]) (Input Denormal cumulative exception flags)
580         - See Cumulative exception bits (FPSC[4:0]).
581     \n\n
582     - \b IXC (FPSC[4]) (Inexact cumulative exception flag)
583         - =1 Exception occurred. 
584         - =0 Value has to be set explicitly. 
585         - Flag is not cleared automatically.
586     \n\n
587     - \b UFC (FPSC[3]) (Underflow cumulative exception flag)
588         - =1 Exception occurred. 
589         - =0 Value has to be set explicitly. 
590         - Flag is not cleared automatically.
591     \n\n
592     - \b OFC (FPSC[2]) (Overflow cumulative exception flag)
593         - =1 Exception occurred. 
594         - =0 Value has to be set explicitly. 
595         - Flag is not cleared automatically.
596     \n\n
597     - \b DZC (FPSC[1]) (Division by Zero cumulative exception flag)
598         - =1 Exception occurred. 
599         - =0 Value has to be set explicitly. 
600         - Flag is not cleared automatically.
601     \n\n
602     - \b IOC (FPSC[0]) (Invalid Operation cumulative exception flag)
603         - =1 Exception occurred. 
604         - =0 Value has to be set explicitly. 
605         - Flag is not cleared automatically.
606         
607     \param [in]    fpscr  FPSCR value to set
608
609     \remarks
610             - Only for Cortex-M4 and Cortex-M7.
611             - The variable \b __FPU_PRESENT has to be set to 1.
612     
613     \sa 
614             - \ref __get_FPSCR
615             - \ref ref_man_sec
616  */
617 void __set_FPSCR(uint32_t fpscr);
618
619
620 /**************************************************************************************************/
621 /** \brief  Globally enables interrupts and configurable fault handlers
622     \details
623     The function enables interrupts and all configurable fault handlers by clearing PRIMASK.
624     The function uses the instruction <b>CPSIE i</b>.
625
626     \remarks
627             - Can be executed in privileged mode only. 
628             
629     \sa 
630         - \ref __disable_irq; __set_BASEPRI; __set_CONTROL; __set_PRIMASK
631  */
632 void __enable_irq(void);
633
634
635 /**************************************************************************************************/
636 /** \brief  Globally disables interrupts and configurable fault handlers
637     \details 
638     The function disables interrupts and all configurable fault handlers by setting PRIMASK. 
639     The function uses the instruction <b>CPSID i</b>.
640
641     \remarks
642         - Can be executed in privileged mode only. 
643         - An interrupt can enter pending state even if it is disabled. Disabling an interrupt 
644         only prevents the processor from taking that interrupt.
645
646     \sa 
647         - \ref __enable_irq;  __set_BASEPRI; __set_CONTROL; __set_PRIMASK
648  */
649 void __disable_irq(void);
650
651
652 /**************************************************************************************************/
653 /** \brief  Enables interrupts and all fault handlers [not for Cortex-M0, Cortex-M0+, or SC000]
654     \details 
655     The function enables interrupts and all fault handlers by clearing FAULTMASK.
656     The function uses the instruction <b>CPSIE f</b>.
657
658     \remarks
659             - not for Cortex-M0, Cortex-M0+, or SC000.
660             - Can be executed in privileged mode only. 
661     
662     \sa 
663         - \ref __disable_fault_irq; __set_BASEPRI; __set_CONTROL; __set_FAULTMASK
664  */
665  void __enable_fault_irq(void);
666
667
668 /**************************************************************************************************/
669 /** \brief  Disables interrupts and all fault handlers [not for Cortex-M0, Cortex-M0+, or SC000]
670     \details 
671     The function disables interrupts and all fault handlers by setting FAULTMASK.
672     The function uses the instruction <b>CPSID f</b>.
673
674     \remarks
675         - not for Cortex-M0, Cortex-M0+, or SC000.
676         - Can be executed in privileged mode only. 
677         - An interrupt can enter pending state even if it is disabled. Disabling an interrupt 
678         only prevents the processor from taking that interrupt.
679
680     \sa 
681         - \ref __enable_fault_irq; __set_BASEPRI; __set_CONTROL; __set_FAULTMASK
682  */
683 void __disable_fault_irq(void);
684
685 /**
686 \cond (ARMv8M)
687 */
688
689 /**
690   \brief   Get Process Stack Pointer Limit
691   Devices without Armv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
692   Stack Pointer Limit register hence zero is returned always in non-secure
693   mode.
694
695   \details Returns the current value of the Process Stack Pointer Limit (PSPLIM).
696   \return               PSPLIM Register value
697   \note    Only available for Armv8-M Architecture. 
698  */
699 uint32_t __get_PSPLIM(void);
700
701 /**
702   \brief   Set Process Stack Pointer Limit
703   Devices without Armv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
704   Stack Pointer Limit register hence the write is silently ignored in non-secure
705   mode.
706
707   \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM).
708   \param [in]    ProcStackPtrLimit  Process Stack Pointer Limit value to set
709   \note    Only available for Armv8-M Architecture. 
710  */
711 void __set_PSPLIM(uint32_t ProcStackPtrLimit);
712
713 /**
714   \brief   Get Main Stack Pointer Limit
715   Devices without Armv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
716   Stack Pointer Limit register hence zero is returned always in non-secure
717   mode.
718
719   \details Returns the current value of the Main Stack Pointer Limit (MSPLIM).
720   \return               MSPLIM Register value
721   \note    Only available for Armv8-M Architecture. 
722  */
723 uint32_t __get_MSPLIM(void);
724
725 /**
726   \brief   Set Main Stack Pointer Limit
727   Devices without Armv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure
728   Stack Pointer Limit register hence the write is silently ignored in non-secure
729   mode.
730
731   \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM).
732   \param [in]    MainStackPtrLimit  Main Stack Pointer Limit value to set
733   \note    Only available for Armv8-M Architecture. 
734  */
735 __set_MSPLIM(uint32_t MainStackPtrLimit);
736
737 /**
738 \endcond
739 */
740
741 /** @} */ /** end of Core_Register_gr **/