1 /** 2 * @file nvic_table.h 3 * @brief Interrupt vector table manipulation functions. 4 */ 5 6 /******************************************************************************* 7 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. 8 * 9 * Permission is hereby granted, free of charge, to any person obtaining a 10 * copy of this software and associated documentation files (the "Software"), 11 * to deal in the Software without restriction, including without limitation 12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 13 * and/or sell copies of the Software, and to permit persons to whom the 14 * Software is furnished to do so, subject to the following conditions: 15 * 16 * The above copyright notice and this permission notice shall be included 17 * in all copies or substantial portions of the Software. 18 * 19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES 23 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 * OTHER DEALINGS IN THE SOFTWARE. 26 * 27 * Except as contained in this notice, the name of Maxim Integrated 28 * Products, Inc. shall not be used except as stated in the Maxim Integrated 29 * Products, Inc. Branding Policy. 30 * 31 * The mere transfer of this software does not imply any licenses 32 * of trade secrets, proprietary technology, copyrights, patents, 33 * trademarks, maskwork rights, or any other form of intellectual 34 * property whatsoever. Maxim Integrated Products, Inc. retains all 35 * ownership rights. 36 * 37 * $Date: 2020-04-20 15:48:35 -0500 (Mon, 20 Apr 2020) $ 38 * $Revision: 53144 $ 39 * 40 ******************************************************************************/ 41 42 #ifndef _NVIC_TABLE_H 43 #define _NVIC_TABLE_H 44 45 #include "mxc_config.h" 46 47 #ifdef __cplusplus 48 extern "C" { 49 #endif 50 51 /** 52 * @ingroup syscfg 53 * @defgroup nvic NVIC Table 54 * @brief functions handling the nvic table. 55 * @{ 56 */ 57 /** 58 * @brief Set an IRQ hander callback function. If the IRQ table is in 59 * flash, this will copy it to RAM and set NVIC to RAM based table. 60 * 61 * @param irqn ARM external IRQ number 62 * @param irq_callback Function to be called at IRQ context 63 * 64 */ 65 void NVIC_SetVector(IRQn_Type irqn, void (*irq_callback)(void)); 66 67 /** 68 * @brief Copy NVIC vector table to RAM and set NVIC to RAM based table. 69 * 70 */ 71 void NVIC_SetRAM(void); 72 73 /** 74 * @brief Get Interrupt Vector 75 * @details Reads an interrupt vector from interrupt vector table. The 76 * interrupt number can be positive to specify a device specific 77 * interrupt, or negative to specify a processor exception. 78 * @param[in] IRQn Interrupt number. 79 * @return Address of interrupt handler function 80 */ 81 uint32_t NVIC_GetVector(IRQn_Type IRQn); 82 83 /**@} end of group nvic */ 84 85 #ifdef __cplusplus 86 } 87 #endif 88 89 #endif /* _NVIC_TABLE_H */ 90