blob: e8a8652b33a5cfabe45caa6c483a85ba226dca68 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
|
/*""FILE COMMENT""*******************************************************
* System Name : Interrupt program for RX62Nxx
* File Name : Interrupt_TMR.c
* Version : 1.02
* Contents : Interrupt handlers for the Timer units
* Customer :
* Model :
* Order :
* CPU : RX
* Compiler : RXC
* OS : Nothing
* Programmer :
* Note :
************************************************************************
* Copyright, 2011. Renesas Electronics Corporation
* and Renesas Solutions Corporation
************************************************************************
* History : 2011.04.08
* : Ver 1.02
* : CS-5 release.
*""FILE COMMENT END""**************************************************/
#include "r_pdl_tmr.h"
#include "r_pdl_definitions.h"
#include "r_pdl_user_definitions.h"
/*""FUNC COMMENT""***************************************************
* Module outline : Timer interrupt processing
*-------------------------------------------------------------------
* Declaration : void Interrupt_TMRn_XXX(void)
*-------------------------------------------------------------------
* Function : Interrupt processing function for Timer TMR channel n
*-------------------------------------------------------------------
* Argument : Nothing
*-------------------------------------------------------------------
* Return value : Nothing
*-------------------------------------------------------------------
* Input :
* Output :
*-------------------------------------------------------------------
* Use function : R_TmrOverflowFunc[n](), R_TmrCMAFunc[n]() or
* : R_TmrCMBFunc[n]() as appropriate.
*-------------------------------------------------------------------
* Notes :
*-------------------------------------------------------------------
* History : 2011.04.08
* : Ver 1.02
* : CS-5 release.
*""FUNC COMMENT END""**********************************************/
#if FAST_INTC_VECTOR == VECT_TMR0_CMIA0
__fast_interrupt void Interrupt_TMR0_CMA(void)
#else
#pragma vector = VECT_TMR0_CMIA0
__interrupt void Interrupt_TMR0_CMA(void)
#endif
{
/* Call the user function? */
if (rpdl_TMR_CMA_callback_func[0] != PDL_NO_FUNC)
{
/* Call the user function */
rpdl_TMR_CMA_callback_func[0]();
}
}
#if FAST_INTC_VECTOR == VECT_TMR0_CMIB0
__fast_interrupt void Interrupt_TMR0_CMB(void)
#else
#pragma vector = VECT_TMR0_CMIB0
__interrupt void Interrupt_TMR0_CMB(void)
#endif
{
if (rpdl_TMR_one_shot[0] != false)
{
/* Channel mode? */
if (rpdl_TMR_one_shot[0] == CHANNEL_MODE)
{
/* Stop the channel 0 clock input */
TMR0.TCCR.BYTE = 0x00u;
}
/* Unit mode? */
else
{
/* Stop the channel 1 clock input */
TMR1.TCCR.BYTE = 0x00u;
}
rpdl_TMR_one_shot[0] = false;
/* Clear the interrupt request flag (the timer may have set it again) */
ICU.IR[VECT_TMR0_CMIB0].BIT.IR = 0;
}
/* Call the user function? */
if (rpdl_TMR_CMB_callback_func[0] != PDL_NO_FUNC)
{
rpdl_TMR_CMB_callback_func[0]();
}
}
#if FAST_INTC_VECTOR == VECT_TMR0_OVI0
__fast_interrupt void Interrupt_TMR0_OV(void)
#else
#pragma vector = VECT_TMR0_OVI0
__interrupt void Interrupt_TMR0_OV(void)
#endif
{
/* Call the user function */
if (rpdl_TMR_Overflow_callback_func[0] != PDL_NO_FUNC)
{
rpdl_TMR_Overflow_callback_func[0]();
}
}
#if FAST_INTC_VECTOR == VECT_TMR1_CMIA1
__fast_interrupt void Interrupt_TMR1_CMA(void)
#else
#pragma vector = VECT_TMR1_CMIA1
__interrupt void Interrupt_TMR1_CMA(void)
#endif
{
/* Call the user function? */
if (rpdl_TMR_CMA_callback_func[1] != PDL_NO_FUNC)
{
/* Call the user function */
rpdl_TMR_CMA_callback_func[1]();
}
}
#if FAST_INTC_VECTOR == VECT_TMR1_CMIB1
__fast_interrupt void Interrupt_TMR1_CMB(void)
#else
#pragma vector = VECT_TMR1_CMIB1
__interrupt void Interrupt_TMR1_CMB(void)
#endif
{
if (rpdl_TMR_one_shot[1] != false)
{
/* Stop the channel 1 clock input */
TMR1.TCCR.BYTE = 0x00u;
rpdl_TMR_one_shot[1] = false;
/* Clear the interrupt request flag (the timer may have set it again) */
ICU.IR[VECT_TMR1_CMIB1].BIT.IR = 0u;
}
/* Call the user function? */
if (rpdl_TMR_CMB_callback_func[1] != PDL_NO_FUNC)
{
rpdl_TMR_CMB_callback_func[1]();
}
}
#if FAST_INTC_VECTOR == VECT_TMR1_OVI1
__fast_interrupt void Interrupt_TMR1_OV(void)
#else
#pragma vector = VECT_TMR1_OVI1
__interrupt void Interrupt_TMR1_OV(void)
#endif
{
/* Call the user function */
if (rpdl_TMR_Overflow_callback_func[1] != PDL_NO_FUNC)
{
rpdl_TMR_Overflow_callback_func[1]();
}
}
#if FAST_INTC_VECTOR == VECT_TMR2_CMIA2
__fast_interrupt void Interrupt_TMR2_CMA(void)
#else
#pragma vector = VECT_TMR2_CMIA2
__interrupt void Interrupt_TMR2_CMA(void)
#endif
{
/* Call the user function? */
if (rpdl_TMR_CMA_callback_func[2] != PDL_NO_FUNC)
{
/* Call the user function */
rpdl_TMR_CMA_callback_func[2]();
}
}
#if FAST_INTC_VECTOR == VECT_TMR2_CMIB2
__fast_interrupt void Interrupt_TMR2_CMB(void)
#else
#pragma vector = VECT_TMR2_CMIB2
__interrupt void Interrupt_TMR2_CMB(void)
#endif
{
if (rpdl_TMR_one_shot[2] != false)
{
/* Channel mode? */
if (rpdl_TMR_one_shot[2] == CHANNEL_MODE)
{
/* Stop the channel 2 clock input */
TMR2.TCCR.BYTE = 0x00u;
}
/* Unit mode? */
else
{
/* Stop the channel 3 clock input */
TMR3.TCCR.BYTE = 0x00u;
}
rpdl_TMR_one_shot[2] = false;
/* Clear the interrupt request flag (the timer may have set it again) */
ICU.IR[VECT_TMR2_CMIB2].BIT.IR = 0;
}
/* Call the user function? */
if (rpdl_TMR_CMB_callback_func[2] != PDL_NO_FUNC)
{
rpdl_TMR_CMB_callback_func[2]();
}
}
#if FAST_INTC_VECTOR == VECT_TMR2_OVI2
__fast_interrupt void Interrupt_TMR2_OV(void)
#else
#pragma vector = VECT_TMR2_OVI2
__interrupt void Interrupt_TMR2_OV(void)
#endif
{
/* Call the user function */
if (rpdl_TMR_Overflow_callback_func[2] != PDL_NO_FUNC)
{
rpdl_TMR_Overflow_callback_func[2]();
}
}
#if FAST_INTC_VECTOR == VECT_TMR3_CMIA3
__fast_interrupt void Interrupt_TMR3_CMA(void)
#else
#pragma vector = VECT_TMR3_CMIA3
__interrupt void Interrupt_TMR3_CMA(void)
#endif
{
/* Call the user function? */
if (rpdl_TMR_CMA_callback_func[3] != PDL_NO_FUNC)
{
/* Call the user function */
rpdl_TMR_CMA_callback_func[3]();
}
}
#if FAST_INTC_VECTOR == VECT_TMR3_CMIB3
__fast_interrupt void Interrupt_TMR3_CMB(void)
#else
#pragma vector = VECT_TMR3_CMIB3
__interrupt void Interrupt_TMR3_CMB(void)
#endif
{
if (rpdl_TMR_one_shot[3] != false)
{
/* Stop the channel 3 clock input */
TMR3.TCCR.BYTE = 0x00u;
rpdl_TMR_one_shot[3] = false;
/* Clear the interrupt request flag (the timer may have set it again) */
ICU.IR[VECT_TMR3_CMIB3].BIT.IR = 0;
}
/* Call the user function? */
if (rpdl_TMR_CMB_callback_func[3] != PDL_NO_FUNC)
{
rpdl_TMR_CMB_callback_func[3]();
}
}
#if FAST_INTC_VECTOR == VECT_TMR3_OVI3
__fast_interrupt void Interrupt_TMR3_OV(void)
#else
#pragma vector = VECT_TMR3_OVI3
__interrupt void Interrupt_TMR3_OV(void)
#endif
{
/* Call the user function */
if (rpdl_TMR_Overflow_callback_func[3] != PDL_NO_FUNC)
{
rpdl_TMR_Overflow_callback_func[3]();
}
}
/* End of file */
|