summaryrefslogtreecommitdiff
path: root/bsp/rx/RPDL/interrupt_cmt.c
blob: 700ebf301a6ccbb62b8aa61bce83c3ebb5e5b865 (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
/*""FILE COMMENT""*******************************************************
* System Name	: Interrupt program for RX62Nxx
* File Name		: Interrupt_CMT.c
* Version		: 1.02
* Contents		: Interrupt handlers for the CMT channels
* 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_cmt.h"
#include "r_pdl_definitions.h"
#include "r_pdl_user_definitions.h"

/*""FUNC COMMENT""***************************************************
* Module outline : Timer interrupt processing
*-------------------------------------------------------------------
* Declaration	: void Interrupt_CMTn(void)
*-------------------------------------------------------------------
* Function		: Interrupt processing function for CMT channel n
*-------------------------------------------------------------------
* Argument		: Nothing
*-------------------------------------------------------------------
* Return value	: Nothing
*-------------------------------------------------------------------
* Input			:
* Output		: 
*-------------------------------------------------------------------
* Use function	: CMT_callback_func[n]
*-------------------------------------------------------------------
* Notes			:
*-------------------------------------------------------------------
* History		: 2011.04.08
*				: Ver 1.02
*				: CS-5 release.
*""FUNC COMMENT END""**********************************************/
#if 0
#if FAST_INTC_VECTOR == VECT_CMT0_CMI0
__fast_interrupt void Interrupt_CMT0(void)
#else
#pragma vector = VECT_CMT0_CMI0
__interrupt void Interrupt_CMT0(void)
#endif
{
  if (rpdl_CMT_one_shot[0] != false)
  {
    /* Stop the channel 0 clock input */
    CMT.CMSTR0.BIT.STR0 = 0;

    /* Clear the interrupt request flag (the timer may have set it again) */
    ICU.IR[IR_CMT0_CMI0].BIT.IR = 0;
  }

  /* Call the user function */
  if (rpdl_CMT_callback_func[0] != PDL_NO_FUNC)
  {
    rpdl_CMT_callback_func[0]();
  }
}
#endif
#if FAST_INTC_VECTOR == VECT_CMT1_CMI1
__fast_interrupt void Interrupt_CMT1(void)
#else
#pragma vector = VECT_CMT1_CMI1
__interrupt void Interrupt_CMT1(void)
#endif
{
  if (rpdl_CMT_one_shot[1] != false)
  {
    /* Stop the channel 0 clock input */
    CMT.CMSTR0.BIT.STR1 = 0;

    /* Clear the interrupt request flag (the timer may have set it again) */
    ICU.IR[IR_CMT1_CMI1].BIT.IR = 0;
  }

  /* Call the user function */
  if (rpdl_CMT_callback_func[1] != PDL_NO_FUNC)
  {
    rpdl_CMT_callback_func[1]();
  }
}

#if FAST_INTC_VECTOR == VECT_CMT2_CMI2
__fast_interrupt void Interrupt_CMT2(void)
#else
#pragma vector = VECT_CMT2_CMI2
__interrupt void Interrupt_CMT2(void)
#endif
{
  if (rpdl_CMT_one_shot[2] != false)
  {
    /* Stop the channel 0 clock input */
    CMT.CMSTR1.BIT.STR2 = 0;

    /* Clear the interrupt request flag (the timer may have set it again) */
    ICU.IR[IR_CMT2_CMI2].BIT.IR = 0;
  }

  /* Call the user function */
  if (rpdl_CMT_callback_func[2] != PDL_NO_FUNC)
  {
    rpdl_CMT_callback_func[2]();
  }
}

#if FAST_INTC_VECTOR == VECT_CMT3_CMI3
__fast_interrupt void Interrupt_CMT3(void)
#else
#pragma vector = VECT_CMT3_CMI3
__interrupt void Interrupt_CMT3(void)
#endif
{
  if (rpdl_CMT_one_shot[3] != false)
  {
    /* Stop the channel 0 clock input */
    CMT.CMSTR1.BIT.STR3 = 0;

    /* Clear the interrupt request flag (the timer may have set it again) */
    ICU.IR[IR_CMT3_CMI3].BIT.IR = 0;
  }

  /* Call the user function */
  if (rpdl_CMT_callback_func[3] != PDL_NO_FUNC)
  {
    rpdl_CMT_callback_func[3]();
  }
}
/* End of file */