comparison libs/STM32F10x_StdPeriph_Lib_V3.5.0/Project/STM32F10x_StdPeriph_Examples/TIM/OCToggle/stm32f10x_it.c @ 0:c59513fd84fb

Initial commit of STM32 test code.
author Daniel O'Connor <darius@dons.net.au>
date Mon, 03 Oct 2011 21:19:15 +1030
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c59513fd84fb
1 /**
2 ******************************************************************************
3 * @file TIM/OCToggle/stm32f10x_it.c
4 * @author MCD Application Team
5 * @version V3.5.0
6 * @date 08-April-2011
7 * @brief Main Interrupt Service Routines.
8 * This file provides template for all exceptions handler and peripherals
9 * interrupt service routine.
10 ******************************************************************************
11 * @attention
12 *
13 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
14 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
15 * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
16 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
17 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
18 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
19 *
20 * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
21 ******************************************************************************
22 */
23
24 /* Includes ------------------------------------------------------------------*/
25 #include "stm32f10x_it.h"
26
27 /** @addtogroup STM32F10x_StdPeriph_Examples
28 * @{
29 */
30
31 /** @addtogroup TIM_OCToggle
32 * @{
33 */
34
35 /* Private typedef -----------------------------------------------------------*/
36 /* Private define ------------------------------------------------------------*/
37 /* Private macro -------------------------------------------------------------*/
38 /* Private variables ---------------------------------------------------------*/
39 uint16_t capture = 0;
40 extern __IO uint16_t CCR1_Val;
41 extern __IO uint16_t CCR2_Val;
42 extern __IO uint16_t CCR3_Val;
43 extern __IO uint16_t CCR4_Val;
44
45 /* Private function prototypes -----------------------------------------------*/
46 /* Private functions ---------------------------------------------------------*/
47
48 /******************************************************************************/
49 /* Cortex-M3 Processor Exceptions Handlers */
50 /******************************************************************************/
51
52 /**
53 * @brief This function handles NMI exception.
54 * @param None
55 * @retval None
56 */
57 void NMI_Handler(void)
58 {
59 }
60
61 /**
62 * @brief This function handles Hard Fault exception.
63 * @param None
64 * @retval None
65 */
66 void HardFault_Handler(void)
67 {
68 /* Go to infinite loop when Hard Fault exception occurs */
69 while (1)
70 {}
71 }
72
73 /**
74 * @brief This function handles Memory Manage exception.
75 * @param None
76 * @retval None
77 */
78 void MemManage_Handler(void)
79 {
80 /* Go to infinite loop when Memory Manage exception occurs */
81 while (1)
82 {}
83 }
84
85 /**
86 * @brief This function handles Bus Fault exception.
87 * @param None
88 * @retval None
89 */
90 void BusFault_Handler(void)
91 {
92 /* Go to infinite loop when Bus Fault exception occurs */
93 while (1)
94 {}
95 }
96
97 /**
98 * @brief This function handles Usage Fault exception.
99 * @param None
100 * @retval None
101 */
102 void UsageFault_Handler(void)
103 {
104 /* Go to infinite loop when Usage Fault exception occurs */
105 while (1)
106 {}
107 }
108
109 /**
110 * @brief This function handles Debug Monitor exception.
111 * @param None
112 * @retval None
113 */
114 void DebugMon_Handler(void)
115 {}
116
117 /**
118 * @brief This function handles SVCall exception.
119 * @param None
120 * @retval None
121 */
122 void SVC_Handler(void)
123 {}
124
125 /**
126 * @brief This function handles PendSV_Handler exception.
127 * @param None
128 * @retval None
129 */
130 void PendSV_Handler(void)
131 {}
132
133 /**
134 * @brief This function handles SysTick Handler.
135 * @param None
136 * @retval None
137 */
138 void SysTick_Handler(void)
139 {}
140
141 /******************************************************************************/
142 /* STM32F10x Peripherals Interrupt Handlers */
143 /******************************************************************************/
144
145 /**
146 * @brief This function handles TIM3 global interrupt request.
147 * @param None
148 * @retval None
149 */
150 void TIM3_IRQHandler(void)
151 {
152 /* TIM3_CH1 toggling with frequency = 183.1 Hz */
153 if (TIM_GetITStatus(TIM3, TIM_IT_CC1) != RESET)
154 {
155 TIM_ClearITPendingBit(TIM3, TIM_IT_CC1 );
156 capture = TIM_GetCapture1(TIM3);
157 TIM_SetCompare1(TIM3, capture + CCR1_Val );
158 }
159
160 /* TIM3_CH2 toggling with frequency = 366.2 Hz */
161 if (TIM_GetITStatus(TIM3, TIM_IT_CC2) != RESET)
162 {
163 TIM_ClearITPendingBit(TIM3, TIM_IT_CC2);
164 capture = TIM_GetCapture2(TIM3);
165 TIM_SetCompare2(TIM3, capture + CCR2_Val);
166 }
167
168 /* TIM3_CH3 toggling with frequency = 732.4 Hz */
169 if (TIM_GetITStatus(TIM3, TIM_IT_CC3) != RESET)
170 {
171 TIM_ClearITPendingBit(TIM3, TIM_IT_CC3);
172 capture = TIM_GetCapture3(TIM3);
173 TIM_SetCompare3(TIM3, capture + CCR3_Val);
174 }
175
176 /* TIM3_CH4 toggling with frequency = 1464.8 Hz */
177 if (TIM_GetITStatus(TIM3, TIM_IT_CC4) != RESET)
178 {
179 TIM_ClearITPendingBit(TIM3, TIM_IT_CC4);
180 capture = TIM_GetCapture4(TIM3);
181 TIM_SetCompare4(TIM3, capture + CCR4_Val);
182 }
183 }
184
185 /******************************************************************************/
186 /* STM32F10x Peripherals Interrupt Handlers */
187 /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
188 /* available peripheral interrupt handler's name please refer to the startup */
189 /* file (startup_stm32f10x_xx.s). */
190 /******************************************************************************/
191
192 /**
193 * @brief This function handles PPP interrupt request.
194 * @param None
195 * @retval None
196 */
197 /*void PPP_IRQHandler(void)
198 {
199 }*/
200
201 /**
202 * @}
203 */
204
205 /**
206 * @}
207 */
208
209 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/