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
26// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_EXCEPTION, Enable/disable assertions in the exception module, type=bool, default=0, group=hardware_exception
27#ifndef PARAM_ASSERTIONS_ENABLED_EXCEPTION
28#define PARAM_ASSERTIONS_ENABLED_EXCEPTION 0
29#endif
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
51 NMI_EXCEPTION = -14, /* Non Maskable Interrupt */
52 HARDFAULT_EXCEPTION = -13, /* HardFault Interrupt */
53 SVCALL_EXCEPTION = -5, /* SV Call Interrupt */
54 PENDSV_EXCEPTION = -2, /* Pend SV Interrupt */
55 SYSTICK_EXCEPTION = -1, /* System Tick Interrupt */
56};
57
63typedef void (*exception_handler_t)(void);
64
79
92
101#ifdef __cplusplus
102}
103#endif
104
105#endif
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.
Definition: exception.c:42
void(* exception_handler_t)(void)
Exception handler function type.
Definition: exception.h:63
exception_number
Exception number definitions.
Definition: exception.h:50
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
void exception_restore_handler(enum exception_number num, exception_handler_t original_handler)
Restore the original exception handler for an exception on this core.
Definition: exception.c:55