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 
23 #include "r_pdl_cmt.h"
24 #include "r_pdl_definitions.h"
25 #include "r_pdl_user_definitions.h"
26 
27 /*""FUNC COMMENT""***************************************************
28 * Module outline : Timer interrupt processing
29 *-------------------------------------------------------------------
30 * Declaration	: void Interrupt_CMTn(void)
31 *-------------------------------------------------------------------
32 * Function		: Interrupt processing function for CMT channel n
33 *-------------------------------------------------------------------
34 * Argument		: Nothing
35 *-------------------------------------------------------------------
36 * Return value	: Nothing
37 *-------------------------------------------------------------------
38 * Input			:
39 * Output		:
40 *-------------------------------------------------------------------
41 * Use function	: CMT_callback_func[n]
42 *-------------------------------------------------------------------
43 * Notes			:
44 *-------------------------------------------------------------------
45 * History		: 2011.04.08
46 *				: Ver 1.02
47 *				: CS-5 release.
48 *""FUNC COMMENT END""**********************************************/
49 #if 0
50 #if FAST_INTC_VECTOR == VECT_CMT0_CMI0
51 __fast_interrupt void Interrupt_CMT0(void)
52 #else
53 #pragma vector = VECT_CMT0_CMI0
54 __interrupt void Interrupt_CMT0(void)
55 #endif
56 {
57   if (rpdl_CMT_one_shot[0] != false)
58   {
59     /* Stop the channel 0 clock input */
60     CMT.CMSTR0.BIT.STR0 = 0;
61 
62     /* Clear the interrupt request flag (the timer may have set it again) */
63     ICU.IR[IR_CMT0_CMI0].BIT.IR = 0;
64   }
65 
66   /* Call the user function */
67   if (rpdl_CMT_callback_func[0] != PDL_NO_FUNC)
68   {
69     rpdl_CMT_callback_func[0]();
70   }
71 }
72 #endif
73 #if FAST_INTC_VECTOR == VECT_CMT1_CMI1
Interrupt_CMT1(void)74 __fast_interrupt void Interrupt_CMT1(void)
75 #else
76 #pragma vector = VECT_CMT1_CMI1
77 __interrupt void Interrupt_CMT1(void)
78 #endif
79 {
80   if (rpdl_CMT_one_shot[1] != false)
81   {
82     /* Stop the channel 0 clock input */
83     CMT.CMSTR0.BIT.STR1 = 0;
84 
85     /* Clear the interrupt request flag (the timer may have set it again) */
86     ICU.IR[IR_CMT1_CMI1].BIT.IR = 0;
87   }
88 
89   /* Call the user function */
90   if (rpdl_CMT_callback_func[1] != PDL_NO_FUNC)
91   {
92     rpdl_CMT_callback_func[1]();
93   }
94 }
95 
96 #if FAST_INTC_VECTOR == VECT_CMT2_CMI2
Interrupt_CMT2(void)97 __fast_interrupt void Interrupt_CMT2(void)
98 #else
99 #pragma vector = VECT_CMT2_CMI2
100 __interrupt void Interrupt_CMT2(void)
101 #endif
102 {
103   if (rpdl_CMT_one_shot[2] != false)
104   {
105     /* Stop the channel 0 clock input */
106     CMT.CMSTR1.BIT.STR2 = 0;
107 
108     /* Clear the interrupt request flag (the timer may have set it again) */
109     ICU.IR[IR_CMT2_CMI2].BIT.IR = 0;
110   }
111 
112   /* Call the user function */
113   if (rpdl_CMT_callback_func[2] != PDL_NO_FUNC)
114   {
115     rpdl_CMT_callback_func[2]();
116   }
117 }
118 
119 #if FAST_INTC_VECTOR == VECT_CMT3_CMI3
Interrupt_CMT3(void)120 __fast_interrupt void Interrupt_CMT3(void)
121 #else
122 #pragma vector = VECT_CMT3_CMI3
123 __interrupt void Interrupt_CMT3(void)
124 #endif
125 {
126   if (rpdl_CMT_one_shot[3] != false)
127   {
128     /* Stop the channel 0 clock input */
129     CMT.CMSTR1.BIT.STR3 = 0;
130 
131     /* Clear the interrupt request flag (the timer may have set it again) */
132     ICU.IR[IR_CMT3_CMI3].BIT.IR = 0;
133   }
134 
135   /* Call the user function */
136   if (rpdl_CMT_callback_func[3] != PDL_NO_FUNC)
137   {
138     rpdl_CMT_callback_func[3]();
139   }
140 }
141 /* End of file */
142