interrupt.h 3.1 KB

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