IntcInterrupts.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * FILE: IntcInterrupts.h
  3. *
  4. * DESCRIPTION: Contains defines for utilizing the Interrupt Controller in
  5. * the MCU.
  6. *
  7. * Note: We use "_p0" suffix on functions and section names to reference the
  8. * Core_0, "_p1" for functions and section names using the Core_1.
  9. *
  10. * VERSION: 1.2
  11. */
  12. #ifndef _INTCINTERRUPTS_H_
  13. #define _INTCINTERRUPTS_H_
  14. /*----------------------------------------------------------------------------*/
  15. /* Types */
  16. /*----------------------------------------------------------------------------*/
  17. /** All interrupt handlers should be of this type */
  18. typedef void(*INTCInterruptFn)(void);
  19. /*----------------------------------------------------------------------------*/
  20. /* Function declarations */
  21. /*----------------------------------------------------------------------------*/
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /**
  26. * This function will setup INTC for Software Vector Mode and
  27. * the Vector Table Base Address to INTCInterruptsHandlerTable.
  28. * This function can be used from user_init() (no stack frame, no memory access).
  29. */
  30. __asm void INTC_InitINTCInterrupts(void);
  31. /**
  32. * This function can be used to install an interrupt handler for a given
  33. * interrupt vector. It will also set the Priority Status Register for the
  34. * source to the one given.
  35. * parameter handlerFn: The function to call when the interrupt occurs.
  36. * parameter vectoryNum: The number of the INTC Interrupt Request Source we
  37. * wish to install the handler for.
  38. * parameter psrPriority: The priority to set in the Interrupt Controller
  39. * Priority Select Register.
  40. */
  41. void INTC_InstallINTCInterruptHandler(INTCInterruptFn handlerFn,
  42. unsigned short vectorNum,
  43. unsigned char psrPriority);
  44. #pragma section RX ".__exception_handlers_p0"
  45. /**
  46. * This function is used to Handle the interrupt source by jumping to the ISR
  47. * branch table (IACKR)
  48. */
  49. __declspec (section ".__exception_handlers_p0") void INTC_INTCInterruptHandler(void);
  50. #ifdef __cplusplus
  51. }
  52. #endif
  53. #endif