interrupt_cmt.c 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /*""FILE COMMENT""*******************************************************
  2. * System Name : Interrupt program for RX62Nxx
  3. * File Name : Interrupt_CMT.c
  4. * Version : 1.02
  5. * Contents : Interrupt handlers for the CMT channels
  6. * Customer :
  7. * Model :
  8. * Order :
  9. * CPU : RX
  10. * Compiler : RXC
  11. * OS : Nothing
  12. * Programmer :
  13. * Note :
  14. ************************************************************************
  15. * Copyright, 2011. Renesas Electronics Corporation
  16. * and Renesas Solutions Corporation
  17. ************************************************************************
  18. * History : 2011.04.08
  19. * : Ver 1.02
  20. * : CS-5 release.
  21. *""FILE COMMENT END""**************************************************/
  22. #include "r_pdl_cmt.h"
  23. #include "r_pdl_definitions.h"
  24. #include "r_pdl_user_definitions.h"
  25. /*""FUNC COMMENT""***************************************************
  26. * Module outline : Timer interrupt processing
  27. *-------------------------------------------------------------------
  28. * Declaration : void Interrupt_CMTn(void)
  29. *-------------------------------------------------------------------
  30. * Function : Interrupt processing function for CMT channel n
  31. *-------------------------------------------------------------------
  32. * Argument : Nothing
  33. *-------------------------------------------------------------------
  34. * Return value : Nothing
  35. *-------------------------------------------------------------------
  36. * Input :
  37. * Output :
  38. *-------------------------------------------------------------------
  39. * Use function : CMT_callback_func[n]
  40. *-------------------------------------------------------------------
  41. * Notes :
  42. *-------------------------------------------------------------------
  43. * History : 2011.04.08
  44. * : Ver 1.02
  45. * : CS-5 release.
  46. *""FUNC COMMENT END""**********************************************/
  47. #if 0
  48. #if FAST_INTC_VECTOR == VECT_CMT0_CMI0
  49. __fast_interrupt void Interrupt_CMT0(void)
  50. #else
  51. #pragma vector = VECT_CMT0_CMI0
  52. __interrupt void Interrupt_CMT0(void)
  53. #endif
  54. {
  55. if (rpdl_CMT_one_shot[0] != false)
  56. {
  57. /* Stop the channel 0 clock input */
  58. CMT.CMSTR0.BIT.STR0 = 0;
  59. /* Clear the interrupt request flag (the timer may have set it again) */
  60. ICU.IR[IR_CMT0_CMI0].BIT.IR = 0;
  61. }
  62. /* Call the user function */
  63. if (rpdl_CMT_callback_func[0] != PDL_NO_FUNC)
  64. {
  65. rpdl_CMT_callback_func[0]();
  66. }
  67. }
  68. #endif
  69. #if FAST_INTC_VECTOR == VECT_CMT1_CMI1
  70. __fast_interrupt void Interrupt_CMT1(void)
  71. #else
  72. #pragma vector = VECT_CMT1_CMI1
  73. __interrupt void Interrupt_CMT1(void)
  74. #endif
  75. {
  76. if (rpdl_CMT_one_shot[1] != false)
  77. {
  78. /* Stop the channel 0 clock input */
  79. CMT.CMSTR0.BIT.STR1 = 0;
  80. /* Clear the interrupt request flag (the timer may have set it again) */
  81. ICU.IR[IR_CMT1_CMI1].BIT.IR = 0;
  82. }
  83. /* Call the user function */
  84. if (rpdl_CMT_callback_func[1] != PDL_NO_FUNC)
  85. {
  86. rpdl_CMT_callback_func[1]();
  87. }
  88. }
  89. #if FAST_INTC_VECTOR == VECT_CMT2_CMI2
  90. __fast_interrupt void Interrupt_CMT2(void)
  91. #else
  92. #pragma vector = VECT_CMT2_CMI2
  93. __interrupt void Interrupt_CMT2(void)
  94. #endif
  95. {
  96. if (rpdl_CMT_one_shot[2] != false)
  97. {
  98. /* Stop the channel 0 clock input */
  99. CMT.CMSTR1.BIT.STR2 = 0;
  100. /* Clear the interrupt request flag (the timer may have set it again) */
  101. ICU.IR[IR_CMT2_CMI2].BIT.IR = 0;
  102. }
  103. /* Call the user function */
  104. if (rpdl_CMT_callback_func[2] != PDL_NO_FUNC)
  105. {
  106. rpdl_CMT_callback_func[2]();
  107. }
  108. }
  109. #if FAST_INTC_VECTOR == VECT_CMT3_CMI3
  110. __fast_interrupt void Interrupt_CMT3(void)
  111. #else
  112. #pragma vector = VECT_CMT3_CMI3
  113. __interrupt void Interrupt_CMT3(void)
  114. #endif
  115. {
  116. if (rpdl_CMT_one_shot[3] != false)
  117. {
  118. /* Stop the channel 0 clock input */
  119. CMT.CMSTR1.BIT.STR3 = 0;
  120. /* Clear the interrupt request flag (the timer may have set it again) */
  121. ICU.IR[IR_CMT3_CMI3].BIT.IR = 0;
  122. }
  123. /* Call the user function */
  124. if (rpdl_CMT_callback_func[3] != PDL_NO_FUNC)
  125. {
  126. rpdl_CMT_callback_func[3]();
  127. }
  128. }
  129. /* End of file */