interrupt.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //*****************************************************************************
  2. //
  3. // interrupt.h - Prototypes for the NVIC Interrupt Controller Driver.
  4. //
  5. // Copyright (c) 2005-2009 Luminary Micro, Inc. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Luminary Micro, Inc. (LMI) is supplying this software for use solely and
  9. // exclusively on LMI's microcontroller products.
  10. //
  11. // The software is owned by LMI and/or its suppliers, and is protected under
  12. // applicable copyright laws. All rights are reserved. You may not combine
  13. // this software with "viral" open-source software in order to form a larger
  14. // program. Any use in violation of the foregoing restrictions may subject
  15. // the user to criminal sanctions under applicable laws, as well as to civil
  16. // liability for the breach of the terms and conditions of this license.
  17. //
  18. // THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
  19. // OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
  20. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
  21. // LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
  22. // CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
  23. //
  24. // This is part of revision 4694 of the Stellaris Peripheral Driver Library.
  25. //
  26. //*****************************************************************************
  27. #ifndef __INTERRUPT_H__
  28. #define __INTERRUPT_H__
  29. //*****************************************************************************
  30. //
  31. // If building with a C++ compiler, make all of the definitions in this header
  32. // have a C binding.
  33. //
  34. //*****************************************************************************
  35. #ifdef __cplusplus
  36. extern "C"
  37. {
  38. #endif
  39. //*****************************************************************************
  40. //
  41. // Macro to generate an interrupt priority mask based on the number of bits
  42. // of priority supported by the hardware.
  43. //
  44. //*****************************************************************************
  45. #define INT_PRIORITY_MASK ((0xFF << (8 - NUM_PRIORITY_BITS)) & 0xFF)
  46. //*****************************************************************************
  47. //
  48. // Prototypes for the APIs.
  49. //
  50. //*****************************************************************************
  51. extern tBoolean IntMasterEnable(void);
  52. extern tBoolean IntMasterDisable(void);
  53. extern void IntRegister(unsigned long ulInterrupt, void (*pfnHandler)(void));
  54. extern void IntUnregister(unsigned long ulInterrupt);
  55. extern void IntPriorityGroupingSet(unsigned long ulBits);
  56. extern unsigned long IntPriorityGroupingGet(void);
  57. extern void IntPrioritySet(unsigned long ulInterrupt,
  58. unsigned char ucPriority);
  59. extern long IntPriorityGet(unsigned long ulInterrupt);
  60. extern void IntEnable(unsigned long ulInterrupt);
  61. extern void IntDisable(unsigned long ulInterrupt);
  62. //*****************************************************************************
  63. //
  64. // Mark the end of the C bindings section for C++ compilers.
  65. //
  66. //*****************************************************************************
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif // __INTERRUPT_H__