STM8S/A Standard Peripherals Firmware Library
|
STM8S_StdPeriph_Examples/CAN/CAN_Networking/stm8s_it.c
Go to the documentation of this file.
00001 /** 00002 ****************************************************************************** 00003 * @file stm8s_it.c 00004 * @author MCD Application Team 00005 * @version V2.2.0 00006 * @date 30-September-2014 00007 * @brief Main Interrupt Service Routines. 00008 ****************************************************************************** 00009 * @attention 00010 * 00011 * <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2> 00012 * 00013 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 00014 * You may not use this file except in compliance with the License. 00015 * You may obtain a copy of the License at: 00016 * 00017 * http://www.st.com/software_license_agreement_liberty_v2 00018 * 00019 * Unless required by applicable law or agreed to in writing, software 00020 * distributed under the License is distributed on an "AS IS" BASIS, 00021 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00022 * See the License for the specific language governing permissions and 00023 * limitations under the License. 00024 * 00025 ****************************************************************************** 00026 */ 00027 00028 /* Includes ------------------------------------------------------------------*/ 00029 #include "stm8s_it.h" 00030 #include "main.h" 00031 00032 /* Private typedef -----------------------------------------------------------*/ 00033 /* Private define ------------------------------------------------------------*/ 00034 /* Private macro -------------------------------------------------------------*/ 00035 /* Private variables ---------------------------------------------------------*/ 00036 /* Private function prototypes -----------------------------------------------*/ 00037 /* Private functions ---------------------------------------------------------*/ 00038 extern uint8_t Key_Pressed_Number ; 00039 extern __IO uint8_t Key_status; 00040 00041 /* Public functions ----------------------------------------------------------*/ 00042 00043 /** @addtogroup IT_Functions 00044 * @{ 00045 */ 00046 #ifdef _COSMIC_ 00047 /** 00048 * @brief Dummy interrupt routine 00049 * @param None 00050 * @retval None 00051 */ 00052 INTERRUPT_HANDLER(NonHandledInterrupt, 25) 00053 { 00054 /* In order to detect unexpected events during development, 00055 it is recommended to set a breakpoint on the following instruction. 00056 */ 00057 } 00058 #endif /*_COSMIC_*/ 00059 00060 /** 00061 * @brief TRAP interrupt routine 00062 * @param None 00063 * @retval None 00064 */ 00065 INTERRUPT_HANDLER_TRAP(TRAP_IRQHandler) 00066 { 00067 /* In order to detect unexpected events during development, 00068 it is recommended to set a breakpoint on the following instruction. 00069 */ 00070 } 00071 /** 00072 * @brief Top Level Interrupt routine 00073 * @param None 00074 * @retval None 00075 */ 00076 INTERRUPT_HANDLER(TLI_IRQHandler, 0) 00077 { 00078 /* In order to detect unexpected events during development, 00079 it is recommended to set a breakpoint on the following instruction. 00080 */ 00081 } 00082 00083 /** 00084 * @brief Auto Wake Up Interrupt routine 00085 * @param None 00086 * @retval None 00087 */ 00088 INTERRUPT_HANDLER(AWU_IRQHandler, 1) 00089 { 00090 /* In order to detect unexpected events during development, 00091 it is recommended to set a breakpoint on the following instruction. 00092 */ 00093 } 00094 00095 /** 00096 * @brief Clock Controller Interrupt routine 00097 * @param None 00098 * @retval None 00099 */ 00100 INTERRUPT_HANDLER(CLK_IRQHandler, 2) 00101 { 00102 /* In order to detect unexpected events during development, 00103 it is recommended to set a breakpoint on the following instruction. 00104 */ 00105 } 00106 00107 /** 00108 * @brief External Interrupt PORTA Interrupt routine 00109 * @param None 00110 * @retval None 00111 */ 00112 INTERRUPT_HANDLER(EXTI_PORTA_IRQHandler, 3) 00113 { 00114 /* In order to detect unexpected events during development, 00115 it is recommended to set a breakpoint on the following instruction. 00116 */ 00117 } 00118 00119 /** 00120 * @brief External Interrupt PORTB Interrupt routine 00121 * @param None 00122 * @retval None 00123 */ 00124 INTERRUPT_HANDLER(EXTI_PORTB_IRQHandler, 4) 00125 { 00126 /* In order to detect unexpected events during development, 00127 it is recommended to set a breakpoint on the following instruction. 00128 */ 00129 } 00130 00131 /** 00132 * @brief External Interrupt PORTC Interrupt routine 00133 * @param None 00134 * @retval None 00135 */ 00136 INTERRUPT_HANDLER(EXTI_PORTC_IRQHandler, 5) 00137 { 00138 Key_status = Key_Pressed; 00139 } 00140 00141 /** 00142 * @brief External Interrupt PORTD Interrupt routine 00143 * @param None 00144 * @retval None 00145 */ 00146 INTERRUPT_HANDLER(EXTI_PORTD_IRQHandler, 6) 00147 { 00148 /* In order to detect unexpected events during development, 00149 it is recommended to set a breakpoint on the following instruction. 00150 */ 00151 } 00152 00153 /** 00154 * @brief External Interrupt PORTE Interrupt routine 00155 * @param None 00156 * @retval None 00157 */ 00158 INTERRUPT_HANDLER(EXTI_PORTE_IRQHandler, 7) 00159 { 00160 /* In order to detect unexpected events during development, 00161 it is recommended to set a breakpoint on the following instruction. 00162 */ 00163 } 00164 #ifdef STM8S903 00165 /** 00166 * @brief External Interrupt PORTF Interrupt routine 00167 * @param None 00168 * @retval None 00169 */ 00170 INTERRUPT_HANDLER(EXTI_PORTF_IRQHandler, 8) 00171 { 00172 /* In order to detect unexpected events during development, 00173 it is recommended to set a breakpoint on the following instruction. 00174 */ 00175 } 00176 #endif /*STM8S903*/ 00177 00178 #if defined (STM8S208) || defined (STM8AF52Ax) 00179 /** 00180 * @brief CAN RX Interrupt routine. 00181 * @param None 00182 * @retval None 00183 */ 00184 INTERRUPT_HANDLER(CAN_RX_IRQHandler, 8) 00185 { 00186 /* In order to detect unexpected events during development, 00187 it is recommended to set a breakpoint on the following instruction. 00188 */ 00189 /* Receiver Receives Frame */ 00190 CAN_Receive(); 00191 00192 LED_Display(CAN_GetReceivedData(0)); 00193 LCD_Display(CAN_GetReceivedData(0) + 4); 00194 Key_Pressed_Number = CAN_GetReceivedData(0); 00195 00196 } 00197 00198 /** 00199 * @brief CAN TX Interrupt routine 00200 * @param None 00201 * @retval None 00202 */ 00203 INTERRUPT_HANDLER(CAN_TX_IRQHandler, 9) 00204 { 00205 /* In order to detect unexpected events during development, 00206 it is recommended to set a breakpoint on the following instruction. 00207 */ 00208 } 00209 #endif /*STM8S208 || STM8AF52Ax */ 00210 00211 /** 00212 * @brief SPI Interrupt routine 00213 * @param None 00214 * @retval None 00215 */ 00216 INTERRUPT_HANDLER(SPI_IRQHandler, 10) 00217 { 00218 /* In order to detect unexpected events during development, 00219 it is recommended to set a breakpoint on the following instruction. 00220 */ 00221 } 00222 00223 /** 00224 * @brief Timer1 Update/Overflow/Trigger/Break Interrupt routine 00225 * @param None 00226 * @retval None 00227 */ 00228 INTERRUPT_HANDLER(TIM1_UPD_OVF_TRG_BRK_IRQHandler, 11) 00229 { 00230 /* In order to detect unexpected events during development, 00231 it is recommended to set a breakpoint on the following instruction. 00232 */ 00233 } 00234 00235 /** 00236 * @brief Timer1 Capture/Compare Interrupt routine 00237 * @param None 00238 * @retval None 00239 */ 00240 INTERRUPT_HANDLER(TIM1_CAP_COM_IRQHandler, 12) 00241 { 00242 /* In order to detect unexpected events during development, 00243 it is recommended to set a breakpoint on the following instruction. 00244 */ 00245 } 00246 00247 #ifdef STM8S903 00248 /** 00249 * @brief Timer5 Update/Overflow/Break/Trigger Interrupt routine 00250 * @param None 00251 * @retval None 00252 */ 00253 INTERRUPT_HANDLER(TIM5_UPD_OVF_BRK_TRG_IRQHandler, 13) 00254 { 00255 /* In order to detect unexpected events during development, 00256 it is recommended to set a breakpoint on the following instruction. 00257 */ 00258 } 00259 /** 00260 * @brief Timer5 Capture/Compare Interrupt routine 00261 * @param None 00262 * @retval None 00263 */ 00264 INTERRUPT_HANDLER(TIM5_CAP_COM_IRQHandler, 14) 00265 { 00266 /* In order to detect unexpected events during development, 00267 it is recommended to set a breakpoint on the following instruction. 00268 */ 00269 } 00270 00271 #else /*STM8S208, STM8S207, STM8S105 or STM8S103 or STM8AF62Ax or STM8AF52Ax or STM8AF626x */ 00272 /** 00273 * @brief Timer2 Update/Overflow/Break Interrupt routine 00274 * @param None 00275 * @retval None 00276 */ 00277 INTERRUPT_HANDLER(TIM2_UPD_OVF_BRK_IRQHandler, 13) 00278 { 00279 /* In order to detect unexpected events during development, 00280 it is recommended to set a breakpoint on the following instruction. 00281 */ 00282 } 00283 00284 /** 00285 * @brief Timer2 Capture/Compare Interrupt routine 00286 * @param None 00287 * @retval None 00288 */ 00289 INTERRUPT_HANDLER(TIM2_CAP_COM_IRQHandler, 14) 00290 { 00291 /* In order to detect unexpected events during development, 00292 it is recommended to set a breakpoint on the following instruction. 00293 */ 00294 } 00295 #endif /*STM8S903*/ 00296 00297 #if defined (STM8S208) || defined(STM8S207) || defined(STM8S007) || defined(STM8S105) || \ 00298 defined(STM8S005) || defined (STM8AF62Ax) || defined (STM8AF52Ax) || defined (STM8AF626x) 00299 /** 00300 * @brief Timer3 Update/Overflow/Break Interrupt routine. 00301 * @param None 00302 * @retval None 00303 */ 00304 INTERRUPT_HANDLER(TIM3_UPD_OVF_BRK_IRQHandler, 15) 00305 { 00306 /* In order to detect unexpected events during development, 00307 it is recommended to set a breakpoint on the following instruction. 00308 */ 00309 } 00310 00311 /** 00312 * @brief Timer3 Capture/Compare Interrupt routine 00313 * @param None 00314 * @retval None 00315 */ 00316 INTERRUPT_HANDLER(TIM3_CAP_COM_IRQHandler, 16) 00317 { 00318 /* In order to detect unexpected events during development, 00319 it is recommended to set a breakpoint on the following instruction. 00320 */ 00321 } 00322 #endif /*STM8S208, STM8S207 or STM8S105 or STM8AF62Ax or STM8AF52Ax or STM8AF626x */ 00323 00324 #if defined (STM8S208) || defined(STM8S207) || defined(STM8S007) || defined(STM8S103) || \ 00325 defined(STM8S003) || defined (STM8AF62Ax) || defined (STM8AF52Ax) || defined (STM8S903) 00326 /** 00327 * @brief UART1 TX Interrupt routine 00328 * @param None 00329 * @retval None 00330 */ 00331 INTERRUPT_HANDLER(UART1_TX_IRQHandler, 17) 00332 { 00333 /* In order to detect unexpected events during development, 00334 it is recommended to set a breakpoint on the following instruction. 00335 */ 00336 } 00337 00338 /** 00339 * @brief UART1 RX Interrupt routine 00340 * @param None 00341 * @retval None 00342 */ 00343 INTERRUPT_HANDLER(UART1_RX_IRQHandler, 18) 00344 { 00345 /* In order to detect unexpected events during development, 00346 it is recommended to set a breakpoint on the following instruction. 00347 */ 00348 } 00349 #endif /*STM8S105*/ 00350 00351 /** 00352 * @brief I2C Interrupt routine 00353 * @param None 00354 * @retval None 00355 */ 00356 INTERRUPT_HANDLER(I2C_IRQHandler, 19) 00357 { 00358 /* In order to detect unexpected events during development, 00359 it is recommended to set a breakpoint on the following instruction. 00360 */ 00361 } 00362 00363 #if defined(STM8S105) || defined(STM8S005) || defined (STM8AF626x) 00364 /** 00365 * @brief UART2 TX interrupt routine. 00366 * @param None 00367 * @retval None 00368 */ 00369 INTERRUPT_HANDLER(UART2_TX_IRQHandler, 20) 00370 { 00371 /* In order to detect unexpected events during development, 00372 it is recommended to set a breakpoint on the following instruction. 00373 */ 00374 } 00375 00376 /** 00377 * @brief UART2 RX interrupt routine. 00378 * @param None 00379 * @retval None 00380 */ 00381 INTERRUPT_HANDLER(UART2_RX_IRQHandler, 21) 00382 { 00383 /* In order to detect unexpected events during development, 00384 it is recommended to set a breakpoint on the following instruction. 00385 */ 00386 } 00387 #endif /* STM8S105*/ 00388 00389 #if defined(STM8S207) || defined(STM8S007) || defined(STM8S208) || defined (STM8AF52Ax) || defined (STM8AF62Ax) 00390 /** 00391 * @brief UART3 TX interrupt routine. 00392 * @param None 00393 * @retval None 00394 */ 00395 INTERRUPT_HANDLER(UART3_TX_IRQHandler, 20) 00396 { 00397 /* In order to detect unexpected events during development, 00398 it is recommended to set a breakpoint on the following instruction. 00399 */ 00400 } 00401 00402 /** 00403 * @brief UART3 RX interrupt routine. 00404 * @param None 00405 * @retval None 00406 */ 00407 INTERRUPT_HANDLER(UART3_RX_IRQHandler, 21) 00408 { 00409 /* In order to detect unexpected events during development, 00410 it is recommended to set a breakpoint on the following instruction. 00411 */ 00412 } 00413 #endif /*STM8S208 or STM8S207 or STM8AF52Ax or STM8AF62Ax */ 00414 00415 #if defined(STM8S207) || defined(STM8S007) || defined(STM8S208) || defined (STM8AF52Ax) || defined (STM8AF62Ax) 00416 /** 00417 * @brief ADC2 interrupt routine. 00418 * @param None 00419 * @retval None 00420 */ 00421 INTERRUPT_HANDLER(ADC2_IRQHandler, 22) 00422 { 00423 00424 /* In order to detect unexpected events during development, 00425 it is recommended to set a breakpoint on the following instruction. 00426 */ 00427 } 00428 #else /*STM8S105, STM8S103 or STM8S903 or STM8AF626x */ 00429 /** 00430 * @brief ADC1 interrupt routine. 00431 * @param None 00432 * @retval None 00433 */ 00434 INTERRUPT_HANDLER(ADC1_IRQHandler, 22) 00435 { 00436 00437 /* In order to detect unexpected events during development, 00438 it is recommended to set a breakpoint on the following instruction. 00439 */ 00440 } 00441 #endif /*STM8S208 or STM8S207 or STM8AF52Ax or STM8AF62Ax */ 00442 00443 #ifdef STM8S903 00444 /** 00445 * @brief Timer6 Update/Overflow/Trigger Interrupt routine 00446 * @param None 00447 * @retval None 00448 */ 00449 INTERRUPT_HANDLER(TIM6_UPD_OVF_TRG_IRQHandler, 23) 00450 { 00451 /* In order to detect unexpected events during development, 00452 it is recommended to set a breakpoint on the following instruction. 00453 */ 00454 } 00455 #else /*STM8S208, STM8S207, STM8S105 or STM8S103 or STM8AF62Ax or STM8AF52Ax or STM8AF626x */ 00456 /** 00457 * @brief Timer4 Update/Overflow Interrupt routine 00458 * @param None 00459 * @retval None 00460 */ 00461 INTERRUPT_HANDLER(TIM4_UPD_OVF_IRQHandler, 23) 00462 { 00463 /* In order to detect unexpected events during development, 00464 it is recommended to set a breakpoint on the following instruction. 00465 */ 00466 } 00467 #endif /*STM8S903*/ 00468 00469 /** 00470 * @brief Eeprom EEC Interrupt routine 00471 * @param None 00472 * @retval None 00473 */ 00474 INTERRUPT_HANDLER(EEPROM_EEC_IRQHandler, 24) 00475 { 00476 /* In order to detect unexpected events during development, 00477 it is recommended to set a breakpoint on the following instruction. 00478 */ 00479 } 00480 00481 /** 00482 * @} 00483 */ 00484 00485 00486 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/