wm_irq.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /**
  2. * @file wm_irq.h
  3. *
  4. * @brief interupt driver module
  5. *
  6. * @author dave
  7. *
  8. * Copyright (c) 2015 Winner Microelectronics Co., Ltd.
  9. */
  10. #ifndef WM_IRQ_H
  11. #define WM_IRQ_H
  12. #include "wm_type_def.h"
  13. typedef void (*intr_handler_func) (void *);
  14. /**
  15. * @typedef struct tls_irq_handler
  16. */
  17. typedef struct tls_irq_handler
  18. {
  19. void (*handler) (void *);
  20. void *data;
  21. u32 counter;
  22. } tls_irq_handler_t;
  23. /**
  24. * @defgroup Driver_APIs Driver APIs
  25. * @brief Driver APIs
  26. */
  27. /**
  28. * @addtogroup Driver_APIs
  29. * @{
  30. */
  31. /**
  32. * @defgroup IRQ_Driver_APIs IRQ Driver APIs
  33. * @brief IRQ driver APIs
  34. */
  35. /**
  36. * @addtogroup IRQ_Driver_APIs
  37. * @{
  38. */
  39. /**
  40. * @brief This function is used to initial system interrupt.
  41. *
  42. * @param[in] None
  43. *
  44. * @return None
  45. *
  46. * @note None
  47. */
  48. void tls_irq_init(void);
  49. /**
  50. * @brief This function is used to register interrupt handler function.
  51. *
  52. * @param[in] vec_no interrupt NO
  53. * @param[in] handler
  54. * @param[in] *data
  55. *
  56. * @return None
  57. *
  58. * @note None
  59. */
  60. void tls_irq_register_handler(u8 vec_no, intr_handler_func handler, void *data);
  61. /**
  62. * @brief This function is used to enable interrupt.
  63. *
  64. * @param[in] vec_no interrupt NO
  65. *
  66. * @return None
  67. *
  68. * @note None
  69. */
  70. void tls_irq_enable(u8 vec_no);
  71. /**
  72. * @brief This function is used to disable interrupt.
  73. *
  74. * @param[in] vec_no interrupt NO
  75. *
  76. * @return None
  77. *
  78. * @note None
  79. */
  80. void tls_irq_disable(u8 vec_no);
  81. /**
  82. * @brief This function is used to get the isr count.
  83. *
  84. * @param[in] None
  85. *
  86. * @retval count
  87. *
  88. * @note None
  89. */
  90. u8 tls_get_isr_count(void);
  91. /**
  92. * @brief This function is used to enter interrupt.
  93. *
  94. * @param[in] None
  95. *
  96. * @return 0:success
  97. *
  98. * @note None
  99. */
  100. int csi_kernel_intrpt_enter(void);
  101. /**
  102. * @brief This function is used to exit from interrupt.
  103. *
  104. * @param[in] None
  105. *
  106. * @return 0:success
  107. *
  108. * @note None
  109. */
  110. int csi_kernel_intrpt_exit(void);
  111. void tls_irq_priority(u8 vec_no, u32 prio);
  112. /**
  113. * @}
  114. */
  115. /**
  116. * @}
  117. */
  118. #endif /* WM_IRQ_H */