STM32F10x_StdPeriph_Examples/TIM/TIM9_OCToggle/stm32f10x_it.c

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    TIM/TIM9_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 TIM9_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 CCR1Val;
00040 extern __IO uint16_t CCR2Val;
00041 
00042 /* Private function prototypes -----------------------------------------------*/
00043 /* Private functions ---------------------------------------------------------*/
00044 
00045 /******************************************************************************/
00046 /*            Cortex-M3 Processor Exceptions Handlers                         */
00047 /******************************************************************************/
00048 
00049 /**
00050   * @brief  This function handles NMI exception.
00051   * @param  None
00052   * @retval None
00053   */
00054 void NMI_Handler(void)
00055 {
00056 }
00057 
00058 /**
00059   * @brief  This function handles Hard Fault exception.
00060   * @param  None
00061   * @retval None
00062   */
00063 void HardFault_Handler(void)
00064 {
00065   /* Go to infinite loop when Hard Fault exception occurs */
00066   while (1)
00067   {}
00068 }
00069 
00070 /**
00071   * @brief  This function handles Memory Manage exception.
00072   * @param  None
00073   * @retval None
00074   */
00075 void MemManage_Handler(void)
00076 {
00077   /* Go to infinite loop when Memory Manage exception occurs */
00078   while (1)
00079   {}
00080 }
00081 
00082 /**
00083   * @brief  This function handles Bus Fault exception.
00084   * @param  None
00085   * @retval None
00086   */
00087 void BusFault_Handler(void)
00088 {
00089   /* Go to infinite loop when Bus Fault exception occurs */
00090   while (1)
00091   {}
00092 }
00093 
00094 /**
00095   * @brief  This function handles Usage Fault exception.
00096   * @param  None
00097   * @retval None
00098   */
00099 void UsageFault_Handler(void)
00100 {
00101   /* Go to infinite loop when Usage Fault exception occurs */
00102   while (1)
00103   {}
00104 }
00105 
00106 /**
00107   * @brief  This function handles Debug Monitor exception.
00108   * @param  None
00109   * @retval None
00110   */
00111 void DebugMon_Handler(void)
00112 {}
00113 
00114 /**
00115   * @brief  This function handles SVCall exception.
00116   * @param  None
00117   * @retval None
00118   */
00119 void SVC_Handler(void)
00120 {}
00121 
00122 /**
00123   * @brief  This function handles PendSV_Handler exception.
00124   * @param  None
00125   * @retval None
00126   */
00127 void PendSV_Handler(void)
00128 {}
00129 
00130 /**
00131   * @brief  This function handles SysTick Handler.
00132   * @param  None
00133   * @retval None
00134   */
00135 void SysTick_Handler(void)
00136 {}
00137 
00138 /******************************************************************************/
00139 /*            STM32F10x Peripherals Interrupt Handlers                        */
00140 /******************************************************************************/
00141 
00142 /**
00143   * @brief  This function handles TIM1 Break and TIM9 interrupts request.
00144   * @param  None
00145   * @retval None
00146   */
00147 void TIM1_BRK_TIM9_IRQHandler(void)
00148 {
00149   /* TIM9_CH1 toggling with frequency = 366.2 Hz */
00150   if (TIM_GetITStatus(TIM9, TIM_IT_CC1) != RESET)
00151   {
00152     TIM_ClearITPendingBit(TIM9, TIM_IT_CC1 );
00153     capture = TIM_GetCapture1(TIM9);
00154     TIM_SetCompare1(TIM9, capture + CCR1Val );
00155   }
00156 
00157   /* TIM9_CH2 toggling with frequency = 732.4 Hz */
00158   if (TIM_GetITStatus(TIM9, TIM_IT_CC2) != RESET)
00159   {
00160     TIM_ClearITPendingBit(TIM9, TIM_IT_CC2);
00161     capture = TIM_GetCapture2(TIM9);
00162     TIM_SetCompare2(TIM9, capture + CCR2Val);
00163   }
00164 }
00165 
00166 /******************************************************************************/
00167 /*                 STM32F10x Peripherals Interrupt Handlers                   */
00168 /*  Add here the Interrupt Handler for the used peripheral(s) (PPP), for the  */
00169 /*  available peripheral interrupt handler's name please refer to the startup */
00170 /*  file (startup_stm32f10x_xx.s).                                            */
00171 /******************************************************************************/
00172 
00173 /**
00174   * @brief  This function handles PPP interrupt request.
00175   * @param  None
00176   * @retval None
00177   */
00178 /*void PPP_IRQHandler(void)
00179 {
00180 }*/
00181 
00182 /**
00183   * @}
00184   */ 
00185 
00186 /**
00187   * @}
00188   */ 
00189 
00190 /******************* (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