STM32F10x_StdPeriph_Examples/TIM/OCToggle/stm32f10x_it.c

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    TIM/OCToggle/stm32f10x_it.c 
00004   * @author  MCD Application Team
00005   * @version V3.4.0
00006   * @date    10/15/2010
00007   * @brief   Main Interrupt Service Routines.
00008   *          This file provides template for all exceptions handler and peripherals
00009   *          interrupt service routine.
00010   ******************************************************************************
00011   * @copy
00012   *
00013   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00014   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
00015   * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
00016   * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
00017   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
00018   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00019   *
00020   * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>
00021   */ 
00022 
00023 /* Includes ------------------------------------------------------------------*/
00024 #include "stm32f10x_it.h"
00025 
00026 /** @addtogroup STM32F10x_StdPeriph_Examples
00027   * @{
00028   */
00029 
00030 /** @addtogroup TIM_OCToggle
00031   * @{
00032   */ 
00033 
00034 /* Private typedef -----------------------------------------------------------*/
00035 /* Private define ------------------------------------------------------------*/
00036 /* Private macro -------------------------------------------------------------*/
00037 /* Private variables ---------------------------------------------------------*/
00038 uint16_t capture = 0;
00039 extern __IO uint16_t CCR1_Val;
00040 extern __IO uint16_t CCR2_Val;
00041 extern __IO uint16_t CCR3_Val;
00042 extern __IO uint16_t CCR4_Val;
00043 
00044 /* Private function prototypes -----------------------------------------------*/
00045 /* Private functions ---------------------------------------------------------*/
00046 
00047 /******************************************************************************/
00048 /*            Cortex-M3 Processor Exceptions Handlers                         */
00049 /******************************************************************************/
00050 
00051 /**
00052   * @brief  This function handles NMI exception.
00053   * @param  None
00054   * @retval None
00055   */
00056 void NMI_Handler(void)
00057 {
00058 }
00059 
00060 /**
00061   * @brief  This function handles Hard Fault exception.
00062   * @param  None
00063   * @retval None
00064   */
00065 void HardFault_Handler(void)
00066 {
00067   /* Go to infinite loop when Hard Fault exception occurs */
00068   while (1)
00069   {}
00070 }
00071 
00072 /**
00073   * @brief  This function handles Memory Manage exception.
00074   * @param  None
00075   * @retval None
00076   */
00077 void MemManage_Handler(void)
00078 {
00079   /* Go to infinite loop when Memory Manage exception occurs */
00080   while (1)
00081   {}
00082 }
00083 
00084 /**
00085   * @brief  This function handles Bus Fault exception.
00086   * @param  None
00087   * @retval None
00088   */
00089 void BusFault_Handler(void)
00090 {
00091   /* Go to infinite loop when Bus Fault exception occurs */
00092   while (1)
00093   {}
00094 }
00095 
00096 /**
00097   * @brief  This function handles Usage Fault exception.
00098   * @param  None
00099   * @retval None
00100   */
00101 void UsageFault_Handler(void)
00102 {
00103   /* Go to infinite loop when Usage Fault exception occurs */
00104   while (1)
00105   {}
00106 }
00107 
00108 /**
00109   * @brief  This function handles Debug Monitor exception.
00110   * @param  None
00111   * @retval None
00112   */
00113 void DebugMon_Handler(void)
00114 {}
00115 
00116 /**
00117   * @brief  This function handles SVCall exception.
00118   * @param  None
00119   * @retval None
00120   */
00121 void SVC_Handler(void)
00122 {}
00123 
00124 /**
00125   * @brief  This function handles PendSV_Handler exception.
00126   * @param  None
00127   * @retval None
00128   */
00129 void PendSV_Handler(void)
00130 {}
00131 
00132 /**
00133   * @brief  This function handles SysTick Handler.
00134   * @param  None
00135   * @retval None
00136   */
00137 void SysTick_Handler(void)
00138 {}
00139 
00140 /******************************************************************************/
00141 /*            STM32F10x Peripherals Interrupt Handlers                        */
00142 /******************************************************************************/
00143 
00144 /**
00145   * @brief  This function handles TIM3 global interrupt request.
00146   * @param  None
00147   * @retval None
00148   */
00149 void TIM3_IRQHandler(void)
00150 {
00151   /* TIM3_CH1 toggling with frequency = 183.1 Hz */
00152   if (TIM_GetITStatus(TIM3, TIM_IT_CC1) != RESET)
00153   {
00154     TIM_ClearITPendingBit(TIM3, TIM_IT_CC1 );
00155     capture = TIM_GetCapture1(TIM3);
00156     TIM_SetCompare1(TIM3, capture + CCR1_Val );
00157   }
00158 
00159   /* TIM3_CH2 toggling with frequency = 366.2 Hz */
00160   if (TIM_GetITStatus(TIM3, TIM_IT_CC2) != RESET)
00161   {
00162     TIM_ClearITPendingBit(TIM3, TIM_IT_CC2);
00163     capture = TIM_GetCapture2(TIM3);
00164     TIM_SetCompare2(TIM3, capture + CCR2_Val);
00165   }
00166 
00167   /* TIM3_CH3 toggling with frequency = 732.4 Hz */
00168   if (TIM_GetITStatus(TIM3, TIM_IT_CC3) != RESET)
00169   {
00170     TIM_ClearITPendingBit(TIM3, TIM_IT_CC3);
00171     capture = TIM_GetCapture3(TIM3);
00172     TIM_SetCompare3(TIM3, capture + CCR3_Val);
00173   }
00174 
00175   /* TIM3_CH4 toggling with frequency = 1464.8 Hz */
00176   if (TIM_GetITStatus(TIM3, TIM_IT_CC4) != RESET)
00177   {
00178     TIM_ClearITPendingBit(TIM3, TIM_IT_CC4);
00179     capture = TIM_GetCapture4(TIM3);
00180     TIM_SetCompare4(TIM3, capture + CCR4_Val);
00181   }
00182 }
00183 
00184 /******************************************************************************/
00185 /*                 STM32F10x Peripherals Interrupt Handlers                   */
00186 /*  Add here the Interrupt Handler for the used peripheral(s) (PPP), for the  */
00187 /*  available peripheral interrupt handler's name please refer to the startup */
00188 /*  file (startup_stm32f10x_xx.s).                                            */
00189 /******************************************************************************/
00190 
00191 /**
00192   * @brief  This function handles PPP interrupt request.
00193   * @param  None
00194   * @retval None
00195   */
00196 /*void PPP_IRQHandler(void)
00197 {
00198 }*/
00199 
00200 /**
00201   * @}
00202   */ 
00203 
00204 /**
00205   * @}
00206   */ 
00207 
00208 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32