MAX32680 Peripheral Driver API
Peripheral Driver API for the MAX32680
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules
nvic_table.h
1
6/******************************************************************************
7 *
8 * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
9 * Analog Devices, Inc.),
10 * Copyright (C) 2023-2024 Analog Devices, Inc.
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 *
24 ******************************************************************************/
25
26#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32680_NVIC_TABLE_H_
27#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32680_NVIC_TABLE_H_
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
41void MXC_NVIC_SetVector(IRQn_Type irqn, void (*irq_callback)(void));
42
43#if defined(__GNUC__)
44#if __CM4_CMSIS_VERSION_MAIN == 0x03
45// NVIC_SetVector was custom-implemented in the PeriphDrivers library for
46// CMSIS version 3. Newer versions of CMSIS provide an implementation of
47// NVIC_SetVector with different functionality, so the Maxim implementation
48// has been moved to MXC_NVIC_SetVector (above).
49
50// The MSDK will move to CMSIS version 5 in the future.
51
52// For CMSIS version 3, use MXC_NVIC_SetVector instead.
53// For CMSIS version 5, you have the choice of using either. However, only
54// MXC_NVIC_SetVector will work with legacy code.
55inline __attribute__((
56 deprecated("Use MXC_NVIC_SetVector instead. See nvic_table.h for more details."))) void
57NVIC_SetVector(IRQn_Type irqn, void (*irq_callback)(void))
58{
59 MXC_NVIC_SetVector(irqn, irq_callback);
60}
61#endif
62#endif
63
68void NVIC_SetRAM(void);
69
78uint32_t MXC_NVIC_GetVector(IRQn_Type IRQn);
79
80#if defined(__GNUC__)
81#if __CM4_CMSIS_VERSION_MAIN == 0x03
82// NVIC_GetVector was custom-implemented in the PeriphDrivers library for
83// CMSIS version 3. Newer versions of CMSIS provide an implementation of
84// NVIC_GetVector with different functionality, so the Maxim implementation
85// has been moved to MXC_NVIC_GetVector (above).
86
87// The MSDK will move to CMSIS version 5 in the future.
88
89// For CMSIS version 3, use MXC_NVIC_SetVector instead.
90// For CMSIS version 5, you have the choice of using either. However, only
91// MXC_NVIC_GetVector will work with legacy code.
92inline __attribute__((
93 deprecated("Use MXC_NVIC_GetVector instead. See nvic_table.h for more details."))) void
94NVIC_GetVector(IRQn_Type irqn)
95{
96 MXC_NVIC_GetVector(irqn);
97}
98#endif
99#endif
100
101#ifdef __cplusplus
102}
103#endif
104
105#endif // LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32680_NVIC_TABLE_H_