exception.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef _HARDWARE_EXCEPTION_H
8 #define _HARDWARE_EXCEPTION_H
9 
10 #include "pico.h"
12 #include "hardware/regs/m0plus.h"
13 
27 // PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_EXCEPTION, Enable/disable assertions in the exception module, type=bool, default=0, group=hardware_exception
28 #ifndef PARAM_ASSERTIONS_ENABLED_EXCEPTION
29 #define PARAM_ASSERTIONS_ENABLED_EXCEPTION 0
30 #endif
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
52  NMI_EXCEPTION = -14, /* Non Maskable Interrupt */
53  HARDFAULT_EXCEPTION = -13, /* HardFault Interrupt */
54  SVCALL_EXCEPTION = -5, /* SV Call Interrupt */
55  PENDSV_EXCEPTION = -2, /* Pend SV Interrupt */
56  SYSTICK_EXCEPTION = -1, /* System Tick Interrupt */
57 };
58 
64 typedef void (*exception_handler_t)(void);
65 
80 
92 void exception_restore_handler(enum exception_number num, exception_handler_t original_handler);
93 
102 #ifdef __cplusplus
103 }
104 #endif
105 
106 #endif
void exception_restore_handler(enum exception_number num, exception_handler_t original_handler)
Restore the original exception handler for an exception on this coreThis method may be used to restor...
Definition: exception.c:55
void(* exception_handler_t)(void)
Exception handler function typeAll exception handlers should be of this type, and follow normal ARM E...
Definition: exception.h:64
exception_handler_t exception_get_vtable_handler(enum exception_number num)
Get the current exception handler for the specified exception from the currently installed vector tab...
Definition: exception.c:37
exception_number
Exception number definitions.
Definition: exception.h:51
exception_handler_t exception_set_exclusive_handler(enum exception_number num, exception_handler_t handler)
Set the exception handler for an exception on the executing core.This method will assert if an except...
Definition: exception.c:42