STM32F0xx Standard Peripherals Firmware Library
|
STM32F0xx_StdPeriph_Examples/RTC/RTC_Timer/stm32f0xx_it.c
Go to the documentation of this file.
00001 /** 00002 ****************************************************************************** 00003 * @file RTC/RTC_Timer/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>© 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 RTC_Timer 00038 * @{ 00039 */ 00040 00041 /* Private typedef -----------------------------------------------------------*/ 00042 /* Private define ------------------------------------------------------------*/ 00043 /* Private macro -------------------------------------------------------------*/ 00044 /* Private variables ---------------------------------------------------------*/ 00045 extern __IO uint8_t ALARM_Occured; 00046 00047 /* Private function prototypes -----------------------------------------------*/ 00048 /* Private functions ---------------------------------------------------------*/ 00049 00050 /******************************************************************************/ 00051 /* Cortex-M0 Processor Exceptions Handlers */ 00052 /******************************************************************************/ 00053 00054 /** 00055 * @brief This function handles NMI exception. 00056 * @param None 00057 * @retval None 00058 */ 00059 void NMI_Handler(void) 00060 { 00061 } 00062 00063 /** 00064 * @brief This function handles Hard Fault exception. 00065 * @param None 00066 * @retval None 00067 */ 00068 void HardFault_Handler(void) 00069 { 00070 /* Go to infinite loop when Hard Fault exception occurs */ 00071 while (1) 00072 { 00073 } 00074 } 00075 00076 /** 00077 * @brief This function handles Memory Manage exception. 00078 * @param None 00079 * @retval None 00080 */ 00081 void MemManage_Handler(void) 00082 { 00083 /* Go to infinite loop when Memory Manage exception occurs */ 00084 while (1) 00085 { 00086 } 00087 } 00088 00089 /** 00090 * @brief This function handles Bus Fault exception. 00091 * @param None 00092 * @retval None 00093 */ 00094 void BusFault_Handler(void) 00095 { 00096 /* Go to infinite loop when Bus Fault exception occurs */ 00097 while (1) 00098 { 00099 } 00100 } 00101 00102 /** 00103 * @brief This function handles Usage Fault exception. 00104 * @param None 00105 * @retval None 00106 */ 00107 void UsageFault_Handler(void) 00108 { 00109 /* Go to infinite loop when Usage Fault exception occurs */ 00110 while (1) 00111 { 00112 } 00113 } 00114 00115 /** 00116 * @brief This function handles SVCall exception. 00117 * @param None 00118 * @retval None 00119 */ 00120 void SVC_Handler(void) 00121 { 00122 } 00123 00124 /** 00125 * @brief This function handles Debug Monitor exception. 00126 * @param None 00127 * @retval None 00128 */ 00129 void DebugMon_Handler(void) 00130 { 00131 } 00132 00133 /** 00134 * @brief This function handles PendSVC exception. 00135 * @param None 00136 * @retval None 00137 */ 00138 void PendSV_Handler(void) 00139 { 00140 } 00141 00142 /** 00143 * @brief This function handles SysTick Handler. 00144 * @param None 00145 * @retval None 00146 */ 00147 void SysTick_Handler(void) 00148 { 00149 } 00150 00151 /******************************************************************************/ 00152 /* STM32F0xx Peripherals Interrupt Handlers */ 00153 /******************************************************************************/ 00154 /** 00155 * @brief This function handles External line 10 to 15 interrupts request. 00156 * @param None 00157 * @retval None 00158 */ 00159 void EXTI4_15_IRQHandler(void) 00160 { 00161 if((EXTI_GetITStatus(TAMPER_BUTTON_EXTI_LINE) != RESET)) 00162 { 00163 /* Disable the RTC Clock */ 00164 RCC_RTCCLKCmd(DISABLE); 00165 00166 /* Wait for RTC APB registers synchronisation */ 00167 RTC_WaitForSynchro(); 00168 00169 /* Clear the TAMPER EXTI pending bit */ 00170 EXTI_ClearITPendingBit(TAMPER_BUTTON_EXTI_LINE); 00171 } 00172 } 00173 00174 /** 00175 * @brief This function handles External line 0 interrupt request. 00176 * @param None 00177 * @retval None 00178 */ 00179 void EXTI0_1_IRQHandler(void) 00180 { 00181 if((EXTI_GetITStatus(SEL_BUTTON_EXTI_LINE) != RESET)) 00182 { 00183 /* Set the LCD Back Color */ 00184 LCD_SetBackColor(White); 00185 00186 /* Enable the RTC Clock */ 00187 RCC_RTCCLKCmd(ENABLE); 00188 00189 /* Wait for RTC APB registers synchronisation */ 00190 RTC_WaitForSynchro(); 00191 00192 /* Enable the alarmA */ 00193 RTC_AlarmCmd(RTC_Alarm_A, ENABLE); 00194 00195 /* Clear the WAKEUP EXTI pending bit */ 00196 EXTI_ClearITPendingBit(SEL_BUTTON_EXTI_LINE); 00197 } 00198 00199 } 00200 00201 /** 00202 * @brief This function handles RTC Alarm interrupt (A and B) request. 00203 * @param None 00204 * @retval None 00205 */ 00206 void RTC_IRQHandler(void) 00207 { 00208 /* Check on the AlarmA flag and on the number of interrupts per Second (60*8) */ 00209 if(RTC_GetITStatus(RTC_IT_ALRA) != RESET) 00210 { 00211 /* ALARM is enabled */ 00212 ALARM_Occured = 1; 00213 00214 /* Clear RTC AlarmA Flags */ 00215 RTC_ClearITPendingBit(RTC_IT_ALRA); 00216 } 00217 /* Clear the EXTIL line 17 */ 00218 EXTI_ClearITPendingBit(EXTI_Line17); 00219 00220 } 00221 00222 /** 00223 * @} 00224 */ 00225 00226 /** 00227 * @} 00228 */ 00229 00230 00231 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/