STM32F0xx Standard Peripherals Firmware Library: stm32f0xx_it.c Source File

STM32F0xx Standard Peripherals Library

STM32F0xx_StdPeriph_Examples/TIM/TIM_OCToggle/stm32f0xx_it.c
Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    TIM/TIM_OCToggle/stm32f0xx_it.c 
00004   * @author  MCD Application Team
00005   * @version V1.4.0
00006   * @date    24-July-2014
00007   * @brief   Main Interrupt Service Routines.
00008   *          This file provides template for all exceptions handler and 
00009   *          peripherals interrupt service routine.
00010   ******************************************************************************
00011   * @attention
00012   *
00013   * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
00014   *
00015   * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
00016   * You may not use this file except in compliance with the License.
00017   * You may obtain a copy of the License at:
00018   *
00019   *        http://www.st.com/software_license_agreement_liberty_v2
00020   *
00021   * Unless required by applicable law or agreed to in writing, software 
00022   * distributed under the License is distributed on an "AS IS" BASIS, 
00023   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00024   * See the License for the specific language governing permissions and
00025   * limitations under the License.
00026   *
00027   ******************************************************************************
00028   */
00029 
00030 /* Includes ------------------------------------------------------------------*/
00031 #include "stm32f0xx_it.h"
00032 
00033 /** @addtogroup STM32F0xx_StdPeriph_Examples
00034   * @{
00035   */
00036 
00037 /** @addtogroup TIM_OCToggle
00038   * @{
00039   */
00040 
00041 /* Private typedef -----------------------------------------------------------*/
00042 /* Private define ------------------------------------------------------------*/
00043 /* Private macro -------------------------------------------------------------*/
00044 /* Private variables ---------------------------------------------------------*/
00045 uint16_t capture = 0;
00046 extern __IO uint16_t CCR1_Val;
00047 extern __IO uint16_t CCR2_Val;
00048 extern __IO uint16_t CCR3_Val;
00049 extern __IO uint16_t CCR4_Val;
00050 
00051 /* Private function prototypes -----------------------------------------------*/
00052 /* Private functions ---------------------------------------------------------*/
00053 
00054 /******************************************************************************/
00055 /*            Cortex-M0 Processor Exceptions Handlers                         */
00056 /******************************************************************************/
00057 
00058 /**
00059   * @brief  This function handles NMI exception.
00060   * @param  None
00061   * @retval None
00062   */
00063 void NMI_Handler(void)
00064 {
00065 }
00066 
00067 /**
00068   * @brief  This function handles Hard Fault exception.
00069   * @param  None
00070   * @retval None
00071   */
00072 void HardFault_Handler(void)
00073 {
00074   /* Go to infinite loop when Hard Fault exception occurs */
00075   while (1)
00076   {
00077   }
00078 }
00079 
00080 /**
00081   * @brief  This function handles SVCall exception.
00082   * @param  None
00083   * @retval None
00084   */
00085 void SVC_Handler(void)
00086 {
00087 }
00088 
00089 /**
00090   * @brief  This function handles PendSVC exception.
00091   * @param  None
00092   * @retval None
00093   */
00094 void PendSV_Handler(void)
00095 {
00096 }
00097 
00098 /**
00099   * @brief  This function handles SysTick Handler.
00100   * @param  None
00101   * @retval None
00102   */
00103 void SysTick_Handler(void)
00104 {
00105 }
00106 
00107 /******************************************************************************/
00108 /*                 STM32F0xx Peripherals Interrupt Handlers                   */
00109 /*  Add here the Interrupt Handler for the used peripheral(s) (PPP), for the  */
00110 /*  available peripheral interrupt handler's name please refer to the startup */
00111 /*  file (startup_stm32f0xx.s).                                               */
00112 /******************************************************************************/
00113 /**
00114   * @brief  This function handles TIM3 global interrupt request.
00115   * @param  None
00116   * @retval None
00117   */
00118 void TIM3_IRQHandler(void)
00119 {
00120   /* TIM3_CH1 toggling with frequency = 585.9 Hz */
00121   if (TIM_GetITStatus(TIM3, TIM_IT_CC1) != RESET)
00122   {
00123     TIM_ClearITPendingBit(TIM3, TIM_IT_CC1 );
00124     capture = TIM_GetCapture1(TIM3);
00125     TIM_SetCompare1(TIM3, capture + CCR1_Val );
00126   }
00127 
00128   /* TIM3_CH2 toggling with frequency = 1171.8 Hz */
00129   if (TIM_GetITStatus(TIM3, TIM_IT_CC2) != RESET)
00130   {
00131     TIM_ClearITPendingBit(TIM3, TIM_IT_CC2);
00132     capture = TIM_GetCapture2(TIM3);
00133     TIM_SetCompare2(TIM3, capture + CCR2_Val);
00134   }
00135 
00136   /* TIM3_CH3 toggling with frequency = 2343.75 Hz */
00137   if (TIM_GetITStatus(TIM3, TIM_IT_CC3) != RESET)
00138   {
00139     TIM_ClearITPendingBit(TIM3, TIM_IT_CC3);
00140     capture = TIM_GetCapture3(TIM3);
00141     TIM_SetCompare3(TIM3, capture + CCR3_Val);
00142   }
00143 
00144   /* TIM3_CH4 toggling with frequency = 4687.5 Hz */
00145   if (TIM_GetITStatus(TIM3, TIM_IT_CC4) != RESET)
00146   {
00147     TIM_ClearITPendingBit(TIM3, TIM_IT_CC4);
00148     capture = TIM_GetCapture4(TIM3);
00149     TIM_SetCompare4(TIM3, capture + CCR4_Val);
00150   }
00151 }
00152 
00153 /**
00154   * @brief  This function handles PPP interrupt request.
00155   * @param  None
00156   * @retval None
00157   */
00158 /*void PPP_IRQHandler(void)
00159 {
00160 }*/
00161 
00162 /**
00163   * @}
00164   */
00165 
00166 /**
00167   * @}
00168   */
00169 
00170 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
STM32L1xx Standard Peripherals Library: Footer

 

 

 For complete documentation on STM32 Microcontrollers visit www.st.com/STM32