nvic_table.h 3.0 KB

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