gic.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * \file
  3. *
  4. * \section Purpose
  5. *
  6. * Methods and definitions for configuring interrupts.
  7. *
  8. * \section Usage
  9. * -# Enable or disable interrupt generation of a particular source with
  10. * IRQ_EnableIT and IRQ_DisableIT.
  11. * -# Start or stop the timer clock using TC_Start() and TC_Stop().
  12. */
  13. #ifndef GIC_H
  14. #define GIC_H
  15. /*------------------------------------------------------------------------------
  16. * Headers
  17. *------------------------------------------------------------------------------*/
  18. //#include "chip.h"
  19. #include <stdint.h>
  20. /*------------------------------------------------------------------------------
  21. * Global functions
  22. *------------------------------------------------------------------------------*/
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. enum {
  27. IRQ_TYPE_EDGE_BOTH,
  28. IRQ_TYPE_EDGE_RISING,
  29. IRQ_TYPE_EDGE_FALLING,
  30. IRQ_TYPE_LEVEL_HIGH,
  31. IRQ_TYPE_LEVEL_LOW,
  32. };
  33. typedef void (*ISRFunction_t)(void *param);
  34. void GIC_IrqHandler(void);
  35. void GIC_Initialize(void);
  36. int32_t request_irq(uint32_t irq_source, int32_t priority,ISRFunction_t func, void *param);
  37. int32_t free_irq(uint32_t irq_source);
  38. #ifdef __cplusplus
  39. }
  40. #endif
  41. #endif //#ifndef GIC_H